query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
sequencelengths 0
30
| negative_scores
sequencelengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
Sets whether to show the color code. | public function showColorCode($showColorCode)
{
if(is_bool($showColorCode))
{
$this->showColorCode = $showColorCode;
} else {
$this->type_error(__FUNCTION__, 'boolean');
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setShowColor($boolean)\r\n\t{\r\n\t\tif ( is_bool($boolean) ) $this->showColor = $boolean;\r\n\t}",
"public function setColorMode($mode){\r\n $this->colorMode = $mode;\r\n }",
"function Color($color = 0){\n if($this -> handle == false) return false;\n if($this -> pcp_color != true) return false;\n \n switch($color){\n case 1:\n $select = kbyte(49);\n break;\n \n default:\n $select = kbyte(48);\n }\n \n return $this -> Append(kbyte(27) . \"r\" . $select);\n }",
"public function setShowColorPicker($value)\n\t{\n\t\t$this->setViewState('ShowColorPicker',TPropertyValue::ensureBoolean($value),true);\n\t}",
"public function isColoredMode()\n\t{\n\t\treturn $this->colorSet ? true : false;\n\t}",
"function set_color($color)\r\n {\r\n $this->color = $color;\r\n }",
"public function setColor ($color) {}",
"function cp_set_options()\n {\n update_option('cp_is_displayed_debug_info', false);\n }",
"function show()\n {\n if($this->color === false) {\n parent::show(); // use text class show function\n }else {\n echo\"<font color=\".$this->color.\">\".$this->str.\"</font><br/>\";\n }\n\n }",
"public function setHighlight($flag) {}",
"public\tfunction\tsetColor($color)\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$this->color\t=\t$color;\n\t\t\t\t\t\t\t\t}",
"public function color($color)\n {\n $this->color = $color;\n }",
"public function color($color)\n {\n $this->color = $color;\n }",
"public function enableDebugBar() {\n\t\t$this->debug = true;\n\t}",
"function beforeDraw()\n {\n echo \"<div style='color:{$this->color}';>\";\n\n }",
"public function keyboardColor()\n {\n }",
"public function setDebug($on = true)\n\t{\n\t\t$this->debug = (bool) $on;\n\t}",
"public function colorCheckCommand()\n {\n // $char= '❤';\n // $ret = ProcessUtil::run('echo ❤');\n // var_dump($ret, trim($ret[1]), $char === trim($ret[1]));\n //\n // die;\n\n $this->output->aList([\n 'basic color output?' => Cli::isSupportColor() ? '<info>Y</info>' : 'N',\n 'ansi char output?' => Cli::isAnsiSupport() ? 'Y' : 'N',\n '256 color output?' => Cli::isSupport256Color() ? 'Y' : 'N',\n 'font symbol output?' => Cli::isSupport256Color() ? 'Y' : 'N',\n ], 'color support check');\n }",
"public function setJSDebug($value = false){\n $this->javascript_debug = $value;\n }",
"function debugOn()\n {\n $this->isDebugOn = true;\n }",
"public function setColor($color){\r\n $this->color = $color;\r\n }",
"function setColor($value) {\n\t\treturn $this->setColumnValue('color', $value, Model::COLUMN_TYPE_VARCHAR);\n\t}",
"function set_debug($value){\n\t\t$this->debug_on = $value;\n\t}",
"public function isCOD()\n {\n $this->cod = true;\n }",
"public function setColor($color);",
"public function setColor($color);",
"private function setTextColor()\n {\n $this->tcpdf->SetTextColor(\n Color::TEXT_COLOR_DARK_RED,\n Color::TEXT_COLOR_DARK_GREEN,\n Color::TEXT_COLOR_DARK_BLUE\n );\n }",
"public function setShowDebugInfo($flag) {}",
"public function setColor($color)\n {\n $this->color = hexdec(ltrim($color, \"#\"));\n }",
"protected function set_sections() \n\t{\n\t\t$this->color_sections = 255 / $this->color_depth;\n\n\t\techo 'Color sections: '. $this->color_sections .\"\\n\";\n\t}"
] | [
"0.65637934",
"0.57972187",
"0.5723748",
"0.569442",
"0.5681963",
"0.56085217",
"0.5584516",
"0.55796766",
"0.5516408",
"0.54780406",
"0.5448088",
"0.5395123",
"0.5395123",
"0.53774846",
"0.5326336",
"0.5317391",
"0.52539814",
"0.52313405",
"0.5171337",
"0.51610225",
"0.51607424",
"0.5133885",
"0.5132683",
"0.5104137",
"0.51034623",
"0.51034623",
"0.50995666",
"0.5096238",
"0.5054193",
"0.5037742"
] | 0.58287126 | 1 |
Internal ID of the series | public function getSeriesId()
{
return $this->seriesId;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSeriesId() {\n\t\t return $this->getData('seriesId');\n\t}",
"public function getSerieId()\n {\n return $this->serieId;\n }",
"public function id() {\n return $this->keyPrefix . $this->_sId;\n }",
"protected function getUniqueId()\n {\n return spl_object_hash($this);\n }",
"public function getId()\n {\n if ($this->id === null) {\n $this->id = spl_object_hash($this);\n }\n return $this->id;\n }",
"public function getSeriesTvdbId()\n {\n return $this->seriesTvdbId;\n }",
"function id() {\n\t\tif ( empty( $this->_id ) ) {\n\t\t\t$this->_id = uniqid();\n\t\t}\n\n\t\treturn $this->_id;\n\t}",
"public function getUniqueId(): string;",
"abstract public function get_data_id();",
"public function getUniqueId();",
"public function getUniqueId();",
"public function getID () {\n\t\treturn $this->idLog;\n\t}",
"public function getID()\n {\n return $this->iD;\n }",
"public function getID()\n {\n return $this->iD;\n }",
"public function getID()\n {\n return $this->iD;\n }",
"public function getID()\n {\n return $this->iD;\n }",
"public function getID()\n {\n return $this->iD;\n }",
"public function getID()\n {\n return $this->iD;\n }",
"public function getID()\n {\n return $this->iD;\n }",
"public function getID()\n {\n return $this->iD;\n }",
"protected static function id() {\n static $id= 1;\n\n if (++$id > 65535) $id= 1;\n return $id;\n }",
"public function getID () {\n\t\treturn $this->log_id;\n\t}",
"public function getId(){\n $type = strtolower( $this->getType() );\n return $type.'.'.$this->getHandle();\n }",
"function _createUniqueDatasetID() {\r\n\r\n $maxDatasetID =& $this->dbConn->GetOne('SELECT MAX(datasetId) FROM datasets');\r\n return ++$maxDatasetID;\r\n }",
"public function getID() {\n\t\treturn \\Anemo\\ID::getInstance();\n\t}",
"public function getIdentifier()\n {\n return $this->getId();\n }",
"function id()\n {\n return null;\n }",
"public function ID(): string;",
"public function getIdentifier()\r\n {\r\n return $this->id;\r\n }",
"public function getStringId()\n\t{\n\t\treturn self::getMonthString($this->month). \"-\" . $this->getYear();\n\t}"
] | [
"0.81312275",
"0.7196356",
"0.673181",
"0.66101223",
"0.65808165",
"0.6553597",
"0.6550133",
"0.65489256",
"0.6519453",
"0.64946026",
"0.64946026",
"0.6478606",
"0.64697033",
"0.64697033",
"0.64697033",
"0.64697033",
"0.64697033",
"0.64697033",
"0.64697033",
"0.64697033",
"0.6422686",
"0.64099514",
"0.6403901",
"0.64005804",
"0.63829446",
"0.6374642",
"0.6361645",
"0.6358381",
"0.6356597",
"0.6351121"
] | 0.81590515 | 0 |
Title of the series | public function getSeriesTitle()
{
return $this->seriesTitle;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSeriesTitle() {\n\t\t return $this->getData('seriesTitle');\n\t}",
"function getTitle()\n {\n }",
"private function get_title( $title = 'Data chart' ): string {\n return '<title>' . $title . '</title>';\n }",
"public function getTitle()\n {\n return 'Zahlungserinnerung';\n }",
"function setSeriesTitle($title) {\n\t\t $this->setData('seriesTitle', $title);\n\t}",
"function title() {\n // Empty title for entities\n }",
"public function title()\n {\n return 'Mitglieder mit identischem Nachnamen und PLZ ';\n }",
"public function getTitle() {\n echo $this->getSelfName();\n echo \"<br>\";\n echo $this->getStaticName();\n }",
"public function getTitle()\r\n {\r\n return \"<title>{$this->title}</title>\\n\";\r\n }",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();"
] | [
"0.83001286",
"0.73072517",
"0.7259283",
"0.71841806",
"0.7174357",
"0.70790666",
"0.7036388",
"0.7028413",
"0.7018846",
"0.69937366",
"0.69937366",
"0.69937366",
"0.69937366",
"0.69937366",
"0.69937366",
"0.69937366",
"0.69937366",
"0.69937366",
"0.69937366",
"0.69937366",
"0.69937366",
"0.69937366",
"0.69937366",
"0.69937366",
"0.69937366",
"0.69937366",
"0.69937366",
"0.69937366",
"0.69937366",
"0.69937366"
] | 0.82528186 | 1 |
TVDB ID for the series | public function getSeriesTvdbId()
{
return $this->seriesTvdbId;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSeriesId() {\n\t\t return $this->getData('seriesId');\n\t}",
"public function getSeriesId()\n {\n return $this->seriesId;\n }",
"public function getVatID();",
"function get_series_tmdb_id ($title, $year) {\n global $tmdb_api_key;\n $_title = urlencode($title);\n $url = \"https://api.themoviedb.org/3/search/tv?api_key={$tmdb_api_key}&query={$_title}&first_air_date_year={$year}\";\n $results = curl_http_get($url);\n if (isset($results['results'])) {\n foreach ($results['results'] as $series) {\n if ((isset($series['name']) && strcasecmp($title, $series['name']) === 0) || (isset($series['original_name']) && strcasecmp($title, $series['original_name']) === 0)) {\n return $series['id'];\n }\n }\n return (count($results['results']) > 0 && isset($results['results'][0]) && isset($results['results'][0]['id'])) ? $results['results'][0]['id'] : '';\n }\n return '';\n}",
"public function getSeriesTvmazeId()\n {\n return $this->seriesTvmazeId;\n }",
"function getTrackId() {\n\t\treturn $this->getData('trackId');\n\t}",
"public function getSerieId()\n {\n return $this->serieId;\n }",
"protected function getStorageSequentialIdField()\n\t{\n\t\treturn 'driverId';\n\t}",
"private static function get_tid() {\n return Config::get('analytics.id');\n }",
"public function getID()\n {\n return $this->timeslot_item_id;\n }",
"public function id() {\n return $this->rtid;\n }",
"abstract public function get_data_id();",
"protected function generateId()\n {\n return $this->stringToId( $this->getViewName() );\n }",
"public function getElasticaDocumentId();",
"public function id() {\n return $this->keyPrefix . $this->_sId;\n }",
"public function getTimeseriesId($tstr) {\n $log = $this->logger();\n\n $soap = $this->getSoap();\n\n $log->debug(\"Get timeseries ID for: \" . $tstr);\n $res = $soap->GetTimeSeriesID( array('identifier' => $tstr ) );\n if ( $res === false ) {\n $log->error(\"Error retrieving the time series id for \" . $tstr);\n return -1;\n }\n\n $tid = $res->GetTimeSeriesIDResult;\n if ( $tid <= 0 ) {\n $log->debug(\"Could not find a timeseries for \" . $tstr);\n }\n\n $log->debug(\"Timeseries id for \" . $tstr . \" is \" . $tid);\n return $tid;\n }",
"public function getIdentifier(){\n\t\treturn $this->getPluginKey().\"-\".$this->getThingId().\"-\".$this->getThingVariationId();\n\t}",
"public function getID(): string {\n return $this->schema['id'] ?? '';\n }",
"public function get_mongo_id(){\n\t\treturn $this->v_mongo_id;\n\t}",
"public function get_mongo_id(){\n\t\treturn $this->v_mongo_id;\n\t}",
"public static function traceId(): string\n {\n return str_replace('-', '', Uuid::uuid4());\n }",
"public function getStringId()\n\t{\n\t\treturn self::getMonthString($this->month). \"-\" . $this->getYear();\n\t}",
"public function ID(): string;",
"public function getID();",
"public function getID();",
"public function getID();",
"public function getID();",
"public function getID();",
"static function data_id(): string { return 'updates'; }",
"protected function instance_id() {\n\t\treturn sanitize_title( implode( '_', array_filter( array(\n\t\t\t$this->module(),\n\t\t\t$this->unique(),\n\t\t\t$this->get_id(),\n\t\t) ) ) );\n\t}"
] | [
"0.6970236",
"0.6763021",
"0.63652414",
"0.6285386",
"0.6062504",
"0.5937912",
"0.59093595",
"0.5905068",
"0.58729154",
"0.5851551",
"0.5824788",
"0.58223313",
"0.57704645",
"0.5754226",
"0.5740805",
"0.5714039",
"0.56942725",
"0.5682555",
"0.5651859",
"0.5651859",
"0.5595486",
"0.55861163",
"0.5581099",
"0.5576156",
"0.5576156",
"0.5576156",
"0.5576156",
"0.5576156",
"0.5574339",
"0.5565404"
] | 0.8174283 | 0 |
TVMaze ID for the series | public function getSeriesTvmazeId()
{
return $this->seriesTvmazeId;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSeriesId() {\n\t\t return $this->getData('seriesId');\n\t}",
"public function getSeriesTvdbId()\n {\n return $this->seriesTvdbId;\n }",
"public function getSeriesId()\n {\n return $this->seriesId;\n }",
"public function getVatID();",
"public function getSerieId()\n {\n return $this->serieId;\n }",
"public function getVatId()\n {\n return $this->vatId['vatId'];\n }",
"public function getVatId() {\n\n return $this->vatId['vatId'];\n }",
"public function getVatId()\n {\n return $this->vatId;\n }",
"public function getVatId()\n {\n return $this->vatId;\n }",
"public function temoignage_id()\n {\n return $this->_temoignage_id;\n }",
"public function getId_vet()\n {\n return $this->id_vet;\n }",
"public function getIdTempoSemanal( ) {\n return $this->idTempoSemanal;\n }",
"public function getID()\n {\n return $this->timeslot_item_id;\n }",
"public function getIdTurma( ) {\n return $this->idTurma;\n }",
"public function id() {\n return $this->rtid;\n }",
"public function getTsId()\n {\n return $this->_sTsId;\n }",
"public function getMetricaEvotranspiracion_idmetricaEvotranspiracion(){\n return $this->metricaEvotranspiracion_idmetricaEvotranspiracion;\n }",
"public function getCurrentTavlingId() {\n return $this->currenttavlingsid;\n }",
"public function getTimeseriesId($tstr) {\n $log = $this->logger();\n\n $soap = $this->getSoap();\n\n $log->debug(\"Get timeseries ID for: \" . $tstr);\n $res = $soap->GetTimeSeriesID( array('identifier' => $tstr ) );\n if ( $res === false ) {\n $log->error(\"Error retrieving the time series id for \" . $tstr);\n return -1;\n }\n\n $tid = $res->GetTimeSeriesIDResult;\n if ( $tid <= 0 ) {\n $log->debug(\"Could not find a timeseries for \" . $tstr);\n }\n\n $log->debug(\"Timeseries id for \" . $tstr . \" is \" . $tid);\n return $tid;\n }",
"function setSeriesId($id) {\n\t\t $this->setData('seriesId', $id);\n\t}",
"function getVatTypeId() {\r\r\n\t\treturn $this->vat_type_id;\r\r\n\t}",
"private static function get_tid() {\n return Config::get('analytics.id');\n }",
"public function getIdTeatro()\n {\n return $this->idTeatro;\n }",
"protected function generateId()\n {\n return $this->stringToId( $this->getViewName() );\n }",
"function getTrackId() {\n\t\treturn $this->getData('trackId');\n\t}",
"function get_series_tmdb_id ($title, $year) {\n global $tmdb_api_key;\n $_title = urlencode($title);\n $url = \"https://api.themoviedb.org/3/search/tv?api_key={$tmdb_api_key}&query={$_title}&first_air_date_year={$year}\";\n $results = curl_http_get($url);\n if (isset($results['results'])) {\n foreach ($results['results'] as $series) {\n if ((isset($series['name']) && strcasecmp($title, $series['name']) === 0) || (isset($series['original_name']) && strcasecmp($title, $series['original_name']) === 0)) {\n return $series['id'];\n }\n }\n return (count($results['results']) > 0 && isset($results['results'][0]) && isset($results['results'][0]['id'])) ? $results['results'][0]['id'] : '';\n }\n return '';\n}",
"public function getVmId()\n {\n return $this->vm_id;\n }",
"function hb_series_get_post_id()\n{\n\t$post_id = 0;\n\t\n\tif ( in_the_loop() )\n\t\t$post_id = get_the_ID();\n\t\n\telse if ( is_singular() ) $post_id = get_queried_object_id();\n\t\n\treturn $post_id;\n}",
"public function getIdVin()\n {\n return $this->idVin;\n }",
"public static function traceId(): string\n {\n return str_replace('-', '', Uuid::uuid4());\n }"
] | [
"0.6938904",
"0.6890846",
"0.6875155",
"0.6520893",
"0.64466536",
"0.60419554",
"0.5937925",
"0.5891608",
"0.5891608",
"0.5811799",
"0.5775584",
"0.5722061",
"0.5701081",
"0.56719095",
"0.5665219",
"0.5665205",
"0.56535643",
"0.55933464",
"0.5554492",
"0.55515593",
"0.5522863",
"0.55123526",
"0.54918194",
"0.54880136",
"0.5461342",
"0.5460908",
"0.54556656",
"0.544912",
"0.5425624",
"0.5419355"
] | 0.74976426 | 0 |
Type of the series, Anime, Daily or Standard | public function getSeriesType()
{
return $this->seriesType;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPeriodType();",
"public function getMachineTypeSeries()\n {\n return $this->machine_type_series;\n }",
"public function type() : DataType\n {\n return DataType::continuous();\n }",
"public function SeriesBlueprintType()\n{\n$com['seq'][0]=[];\n$com['seq'][0]['ele'][0]=['minOccurs'=>'0','ref'=>'Documentation'];\n$com['seq'][0]['ele'][1]=['minOccurs'=>'0','maxOccurs'=>'unbounded','ref'=>'Quantity'];\n$com['seq'][0]['ele'][2]=['minOccurs'=>'0','maxOccurs'=>'unbounded','ref'=>'AllowedValue'];\n// Name the Series shall have.\n$com['att'][0]=['name'=>'name','type'=>'ShortTokenType','use'=>'required'];\n// Data type this Series shall have.\n$com['att'][1]=['name'=>'seriesType','type'=>'SeriesTypeType','use'=>'required'];\n// Is the Series optional or required?\n$com['att'][2]=['default'=>'required','name'=>'modality','type'=>'ModalityType','use'=>'optional'];\n$com['att'][3]=['default'=>'linear','name'=>'plotScale','type'=>'PlotScaleType','use'=>'optional'];\n$com['att'][4]=['name'=>'dependency','type'=>'DependencyType','use'=>'required'];\n// Maximum number of occurences of the Series. If > 1, the index attribute must be used in the AnIML document.\n$com['att'][5]=['default'=>'1','name'=>'maxOccurs','type'=>'MaxOccursType','use'=>'optional'];\nreturn $com;\n}",
"function getType() {\r\n\t\t\tif (is_bool($this->Value) ||\r\n\t\t\t is_int($this->Value)) {\r\n\t\t\t\treturn 'i';\r\n\t\t\t}\r\n\r\n\t\t\tif (is_float($this->Value) || \r\n\t\t\t is_numeric($this->Value)) {\r\n\t\t\t\treturn 'd';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// for anything else use string\r\n\t\t\treturn 's';\r\n\t\t}",
"public function get_data_type()\n {\n return $this->get_argument( 'format' );\n }",
"public function get_period_type() {\n return get_post_meta( $this->get_id(), '_dokan_subscription_period', true );\n }",
"protected function set_type() {\n\t\t$this->type = 'kirki-date';\n\t}",
"abstract public function type();",
"abstract public function type();",
"public function scoreForType($type) {\n\t\tif (Strings::compare($type, 'date') || Strings::compare($type, 'DateTime') || Strings::compare($type, 'Nette\\Utils\\DateTime')) {\n\t\t\treturn 1;\n\t\t}\n\t}",
"private static function durabilityType() {\n\t\t$result = array(\n\t\t\t'minutes' => __( 'Minutes', WPXSMARTSHOP_TEXTDOMAIN ),\n\t\t\t'days' => __( 'Days', WPXSMARTSHOP_TEXTDOMAIN ),\n\t\t\t'months' => __( 'Months', WPXSMARTSHOP_TEXTDOMAIN ),\n\t\t\t'years' => __( 'Years', WPXSMARTSHOP_TEXTDOMAIN ),\n\t\t);\n\t\treturn $result;\n\t}",
"public static function statType()\n {\n return\n [\n Statistics::TYPE_BY_CATEGORY=>Yii::t('app', 'By category')\n ];\n }",
"public function dataType($type = null);",
"public function type() {}",
"abstract protected function getVariationType();",
"public function get_stock_type()\n {\n $types = $this->stock_model->get_stock_type();\n if(isset($types)){\n echo json_encode($types);\n }\n }",
"public function getMetatype() {\n return $this->metatype;\n }",
"public function type();",
"public function type();",
"public function type();",
"abstract public function getType();",
"abstract public function getType();",
"abstract public function getType();",
"abstract public function getType();",
"abstract public function getType();",
"abstract public function getType();",
"abstract public function getType();",
"public function hasSeries();",
"function activitytype()\n{\n}"
] | [
"0.6110471",
"0.5898266",
"0.5699804",
"0.5677496",
"0.55268675",
"0.54961354",
"0.54935193",
"0.54610837",
"0.53982174",
"0.53982174",
"0.5377392",
"0.53703564",
"0.52769816",
"0.52308285",
"0.52270967",
"0.5223413",
"0.5188912",
"0.51853216",
"0.5168368",
"0.5168368",
"0.5168368",
"0.5145569",
"0.5145569",
"0.5145569",
"0.5145569",
"0.5145569",
"0.5145569",
"0.5145569",
"0.51296806",
"0.5125538"
] | 0.6639763 | 0 |
Number of episodes in the release | public function getReleaseEpisodeCount()
{
return $this->releaseEpisodeCount;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNbEpisodes()\n {\n\t\t$nbEpisodes = 0;\n\t\tfor($i = 1 ; $i <= $this->getNbSeasons() ; $i++)\n\t\t{\n\t\t\t$nbEpisodes += $this->getNbEpisodesInSeason($i);\n\t\t}\n return $nbEpisodes;\n }",
"public function getNumberOfEpisodes() {\n\t\treturn $this->numberOfEpisodes;\n\t}",
"public function getNbSeasons()\n {\n\t\t$today = new \\DateTime('now');\n\t\t$maxNbSeason = 0;\n\t\tforeach($this->episodes as $key => $episode)\n\t\t{\n\t\t\tif($episode->getSeasonNumber() > $maxNbSeason AND $episode->getFirstAired() < $today)\n\t\t\t{\n\t\t\t\t$maxNbSeason = $episode->getSeasonNumber();\n\t\t\t}\n\t\t}\n return $maxNbSeason;\n }",
"public function getReleaseEpisodeNumbers()\n {\n return $this->releaseEpisodeNumbers;\n }",
"public function count () {\n\t\treturn 7;\n\t}",
"public function count(): int\n {\n return count($this->events);\n }",
"function get_object_count()\r\n {\r\n return $this->get_browser()->count_announcement_distributions($this->get_condition());\r\n }",
"public function getNbEpisodesInSeason($season)\n {\n\t\t$today = new \\DateTime('now');\n\t\t$maxNbEpisode = 0;\n\t\tforeach($this->episodes as $key => $episode)\n\t\t{\n\t\t\tif($episode->getSeasonNumber() == $season AND $episode->getFirstAired() < $today)\n\t\t\t{\n\t\t\t\tif($episode->getEpisodeNumber() > $maxNbEpisode)\n\t\t\t\t{\n\t\t\t\t\t$maxNbEpisode = $episode->getEpisodeNumber();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n return $maxNbEpisode;\n }",
"public function count(): int {\n return $this->transitions->count();\n }",
"public function count(): int {\n return $this->transitions->count();\n }",
"public function count()\n {\n return count($this->events);\n }",
"public function count()\n\t{\n\t\treturn $this->timesAveraged;\n\t}",
"public function count()\n {\n return $this->resolution;\n }",
"function Video_count()\n { //getting Video count function starts\n return $this->get_video_count();\n }",
"public function count()\n {\n return count($this->runes) + count($this->instants) + count($this->conjures);\n }",
"function count()\n {\n return count($this->platforms);\n }",
"public function getCount()\n\t{\n\t\t$res = $this->pdo->queryOneRow('SELECT COUNT(id) AS num FROM movieinfo');\n\t\treturn ($res === false ? 0 : $res['num']);\n\t}",
"public function getNbMoviesActifs()\n {\n $nbMovies = DB::table('movies')\n ->where('visible', 1)\n ->count();\n\n return $nbMovies;\n\n }",
"public function count()\n {\n return count($this->_events);\n }",
"public function getNumberOfEntries() {\n return $this->entries;\n }",
"public function count ()\n {\n return count( $this->times );\n }",
"public function count(): int\r\n {\r\n return count($this->rounds);\r\n }",
"public function count(): int\n\t{\n\t\treturn $this->stories->count() ?? 0;\n\t}",
"public function count()\n\t{\n return count($this->_events);\n }",
"public function count(): int\n {\n return count($this->slots) + 1;\n }",
"public function count() {\n\t\treturn (int) $this->count;\n\t}",
"function numEntries()\r\n\t{\r\n\t\treturn count($this->getEntries());\r\n\t}",
"public function count()\n {\n return count($this->players);\n }",
"public function getNumberOfEntries()\n {\n return $this->createQuery()->count();\n }",
"function getNumberOfGames() {\r\n\t\treturn $this->games;\r\n\t}"
] | [
"0.78577805",
"0.74736136",
"0.67823106",
"0.6476263",
"0.6392556",
"0.63693815",
"0.63526344",
"0.62568533",
"0.6163076",
"0.6163076",
"0.61007446",
"0.6098309",
"0.6059992",
"0.6042668",
"0.60282844",
"0.59839135",
"0.598311",
"0.59095716",
"0.5903939",
"0.5888807",
"0.58545715",
"0.58482665",
"0.58479613",
"0.58457917",
"0.58395475",
"0.5838416",
"0.5837532",
"0.58119607",
"0.58093214",
"0.58051455"
] | 0.8064351 | 0 |
Season number from release | public function getReleaseSeasonNumber()
{
return $this->releaseSeasonNumber;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bball_season() {\r\n\tif ( date(\"m\") <= 5 ) {\r\n\t\treturn ( date(\"Y\") - 1 ) . \"-\" . date(\"Y\");\r\n\t}\r\n\telse {\r\n\t\treturn date(\"Y\") . \"-\" . ( date(\"Y\") + 1 );\r\n\t}\r\n}",
"public function getNbSeasons()\n {\n\t\t$today = new \\DateTime('now');\n\t\t$maxNbSeason = 0;\n\t\tforeach($this->episodes as $key => $episode)\n\t\t{\n\t\t\tif($episode->getSeasonNumber() > $maxNbSeason AND $episode->getFirstAired() < $today)\n\t\t\t{\n\t\t\t\t$maxNbSeason = $episode->getSeasonNumber();\n\t\t\t}\n\t\t}\n return $maxNbSeason;\n }",
"public function getIdSeason()\n {\n return $this->id_season;\n }",
"public function getNumberOfSeasons() {\n\t\treturn $this->numberOfSeasons;\n\t}",
"public function getNameSeason()\n {\n return $this->name_season;\n }",
"protected function _premieredseason() {\n\n\t\tif ( !isset( static::$data[ 'premiered' ] ) ) $this->premiered();\n\n\t\treturn ( isset( static::$data[ 'premiered' ][ 'season' ] ) ) ? static::$data[ 'premiered' ][ 'season' ] : FALSE;\n\t}",
"function getLatestSeason(){\n return max(array_keys(Session::get(\"season_dates\")));\n }",
"public function getCurrentSeason(){\r\n $status = 'CURRENT';\r\n $currentSeason = $this->entityManager->getRepository(Season::class)\r\n ->findOneByStatus($status);\r\n \r\n //$season_name = $currentSeason->getSeasonName();\r\n \r\n return $currentSeason;\r\n }",
"private static function returnFormattedSeason($season)\n\t{\n\t\t$season = new fTimestamp($season);\n\t\t\n\t\tswitch ($season->format('m')) {\n\t\t\tcase '03':\n\t\t\t\treturn 'Spring ' . $season->format('Y');\n\t\t\tcase '06':\n\t\t\t\treturn 'Summer ' . $season->format('Y');\n\t\t\tcase '09':\n\t\t\t\treturn 'Fall ' . $season->format('Y');\n\t\t\tcase '12':\n\t\t\t\treturn 'Winter ' . $season->format('Y') . '-' . $season->adjust('+1 year')->format('Y');\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}",
"public function season($string)\n {\n \n $string = date('n', strtotime($string));\n\n $month = intval($string);\n\n $seasons = array( \n 1 => 'Winter',\n 2 => 'Winter',\n 3 => 'Spring',\n 4 => 'Spring',\n 5 => 'Spring',\n 6 => 'Summer',\n 7 => 'Summer',\n 8 => 'Summer',\n 9 => 'Fall',\n 10 => 'Fall',\n 11 => 'Fall',\n 12 => 'Winter');\n\n return $seasons[$month];\n \n }",
"public function getSeasons(): array\n {\n return $this->seasons;\n }",
"public function season()\n {\n $matches = MatchService::getSeasonMatches();\n \n $response = [];\n foreach ($matches as $match) {\n $response['weeks'][$match->week_id][] = MatchService::matchResultsFormatResponse($match);\n }\n \n return response()->json($response);\n }",
"public function getNbEpisodesInSeason($season)\n {\n\t\t$today = new \\DateTime('now');\n\t\t$maxNbEpisode = 0;\n\t\tforeach($this->episodes as $key => $episode)\n\t\t{\n\t\t\tif($episode->getSeasonNumber() == $season AND $episode->getFirstAired() < $today)\n\t\t\t{\n\t\t\t\tif($episode->getEpisodeNumber() > $maxNbEpisode)\n\t\t\t\t{\n\t\t\t\t\t$maxNbEpisode = $episode->getEpisodeNumber();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n return $maxNbEpisode;\n }",
"private function _get_year() {\n // Element is required and may appear once only\n return $this->_eval_query_as_string(\"/{$this->nsp}article/{$this->nsp}admin/{$this->nsp}numero/{$this->nsp}pub/{$this->nsp}annee\");\n }",
"public function getYear() {\n if ($this->isReady) {\n if ($strReturn = $this->matchRegex($this->_strSource, IMDB::IMDB_TITLE, 2)) {\n return substr(preg_replace('~[\\D]~', '', $strReturn), 0, 4);\n }\n return $this->strNotFound;\n }\n return $this->strNotFound;\n }",
"function date_to_semester($date=NULL){\n\tif ($date == NULL)\n\t\t$date = date('U');\n\n\t$semester = (intval(date(\"y\",$date))-14)*3;\n\n\tif (date('n',$date)<=4)\n\t\t$semester += 0;\n\telse if (date('n',$date)>=9)\n\t\t$semester += 2;\n\telse\n\t\t$semester += 1;\n\n\treturn $semester;\n}",
"public function getYear();",
"private function get_current_semester()\n {\n $month=date('m');\n $result=date('Y');\n\n if($month>=9 && $month<=12)\n {\n $result.=\"09\";\n }\n\n else if($month>=1 && $month<=4)\n {\n $result.=\"01\";\n }\n\n else if($month>=5 && $month<=8)\n {\n $result.=\"05\";\n }\n\n return $result;\n }",
"public function getOneSeasonNo() {\r\n $query = 'SELECT \r\n d.id, \r\n d.movieName,\r\n d.seasonNo as seasonNo,\r\n d.createdAt as createdAt\r\n FROM \r\n ' . $this->discriptionTable . ' d\r\n WHERE d.id = ? LIMIT 0,1';\r\n \r\n // prepare statement\r\n $stmt = $this->conn->prepare($query);\r\n\r\n // bind ID to ?\r\n $stmt->bindParam(1, $this->id);\r\n \r\n // Execute\r\n $stmt->execute();\r\n\r\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\r\n // set properties\r\n $this->id = $row['id'];\r\n $this->movieName = $row['movieName'];\r\n $this->seasonNo = $row['seasonNo'];\r\n $this->createdAt = $row['createdAt'];\r\n }",
"protected function getYearString() {\r\n\t\treturn ($this->year != -1 ? $this->year : $this->titleForAllYears());\r\n\t}",
"public function getSeasonSelect()\n {\n $mainframe = Factory::getApplication();\n $db = Factory::getDbo();\n $query = $db->getQuery(true);\n\n $options = array(HTMLHelper::_('select.option', 0, Text::_($this->getParam('seasons_text'))));\n\n $query->select('s.id AS value, s.name AS text');\n $query->from('#__sportsmanagement_season AS s');\n\n $db->setQuery($query);\n $res = $db->loadObjectList();\n if ($res) {\n $options = array_merge($options, $res);\n }\n return HTMLHelper::_('select.genericlist', $options, 's', 'class=\"jlnav-select\"',\n 'value', 'text', $this->getSeasonId());\n }",
"public function startOfYear();",
"public function year();",
"private function findSemester()\n {\n return ($this->dataEachOfFile->first()->Semester & 1) ? ($this->dataEachOfFile->first()->Semester + 1) / 2 : $this->dataEachOfFile->first()->Semester / 2;\n }",
"public function getSeasonFinaleAttribute()\n {\n return DB::table('episodes')\n ->where([\n ['serie_id', $this->serie_id],\n ['episodeSeason', $this->episodeSeason],\n ['episodeNumber', $this->episodeNumber + 1]\n ])\n ->count() == 0;\n }",
"private static function _get_semester() {\n\n $now = getdate();\n $term = \"\";\n\n switch( $now[ 'mon' ] ) {\n\n case 10:\n case 11:\n case 12: // The Fall has already started, so start with Spring the following year.\n $term = \"Spring \" . ( intval( $now['year'] ) + 1 );\n break;\n\n case 1:\n case 2: // Spring again, but without adding to the year.\n $term = \"Spring {$now['year']}\";\n break;\n\n case 3:\n case 4:\n case 5:\n case 6: // The Spring semester, Summer is upcoming.\n $term = \"Summer {$now['year']}\";\n break;\n\n default: // Otherwise, we're focused on Fall\n $term = \"Fall {$now['year']}\";\n break;\n }\n\n return $term; // Return whatever we've come up with.\n }",
"public function getSource()\n {\n return 'season';\n }",
"public function getYear():int\n {\n return (int)$this->format('Y');\n }",
"public function getYear(): int\n {\n return (int) ((string) $this->toFormatInternal('Y'));\n }",
"public function year()\n {\n return $this->config->numbers(date('Y', $this->dateTime));\n }"
] | [
"0.69254154",
"0.6706816",
"0.6668255",
"0.6660798",
"0.652292",
"0.6455085",
"0.63465875",
"0.63351345",
"0.6288714",
"0.6188655",
"0.5845116",
"0.5728047",
"0.5635703",
"0.55562675",
"0.5494632",
"0.5456273",
"0.5449797",
"0.54431933",
"0.5400732",
"0.53990734",
"0.5383804",
"0.5380512",
"0.53650695",
"0.5360782",
"0.53532964",
"0.5352131",
"0.5336828",
"0.5321763",
"0.531968",
"0.5313583"
] | 0.82181114 | 0 |
Comma separated list of episode numbers | public function getReleaseEpisodeNumbers()
{
return $this->releaseEpisodeNumbers;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getExampleEanList() {\n return explode(',', preg_replace('/\\s+/', '', $this->get('example_ean')));\n }",
"public function getEpisodes()\n\t\t\t{\n\t\t\t\treturn $this->episodes;\n\t\t\t}",
"public function getIds() {\r\n\t\t$ids = parent::getValue();\r\n\t\tif (!is_array($ids)) {\r\n\t\t\t$ids = explode(',', $ids);\r\n\t\t}\r\n\t\treturn $ids;\r\n\t}",
"public function ids_to_string()\n\t{\n\t\treturn implode(', ', $this->ids());\n\t\t\n\t}",
"function toList($data) {\n\n $last = count($data)-1;\n $list = '';\n\n for ($i=0; $i <= $last; $i++) {\n $list .= $data[$i];\n if ($i == ($last-1)) {\n $list .= ' and ';\n } elseif ($i < $last) {\n $list .= ', ';\n }\n }\n\n return $list;\n\n}",
"public function getIdsString()\n {\n return implode(',', $this->getCategoryIds());\n }",
"private function parse_comma_list($results = '')\n {\n }",
"public function episodeList(OutputInterface $output, $show, EpisodeList $episodes)\n {\n $seasons = $this->getEpisodeNumbersBySeason($episodes->getEpisodes());\n foreach ($seasons as $season => $episodeNumbers) {\n $episodeList = join(',', $episodeNumbers);\n $output->writeln(sprintf('Season %d: Episode%s %s', $season, count($episodeNumbers)>1?'s':'', $episodeList));\n }\n }",
"public function enemy_list($enemies) {\n $count = count($enemies);\n for ($i=0;$i<$count;$i++) {\n if ($i == $count-1) {\n $enemy_list .= $enemies[$i];\n } else if ($i == $count-2) {\n $enemy_list .= $enemies[$i] . \" and \";\n } else {\n $enemy_list .= $enemies[$i] . \", \";\n }\n }\n $enemy_list .= \".\";\n return $enemy_list;\n }",
"function episodes ($api_key, $tmdb_id) {\n global $sql;\n return $sql->sql_select_array_query(\"SELECT `source_stream_url`, `stream_is_custom`, `tmdb_id`, `tmdb_episode_id`, `tmdb`, `serie_name`, `serie_year`, `serie_season`, `serie_episode`, `serie_trailer`, (SELECT group_name FROM groups WHERE id = s.group_id) as 'group_name', CONCAT('http://', (SELECT source_host FROM playlist WHERE id = s.playlist_id), ':', (SELECT source_port FROM playlist WHERE id = s.playlist_id), '/series/', (SELECT source_username FROM playlist WHERE id = s.playlist_id), '/', (SELECT source_password FROM playlist WHERE id = s.playlist_id), '/', s.source_stream_id, '.', s.source_container_extension) as 'xtream_url' FROM `episodes` s WHERE `user_id` = (SELECT user_id FROM `m3u2strm` WHERE BINARY api_key = '{$api_key}') AND `playlist_id` = (SELECT playlist_id FROM `m3u2strm` WHERE BINARY api_key = '{$api_key}') AND tmdb_id = '{$tmdb_id}' AND tmdb IS NOT NULL AND tmdb <> '' AND `sync_is_removed` = 0\");\n }",
"public function episodes()\n {\n return $this->morphedByMany('App\\Models\\Episode', 'cartable');\n }",
"private function getEpisodeNumbersBySeason(array $episodes)\n {\n return array_reduce($episodes, function($seasons, $episode){\n $seasons[$episode->getSeason()][] = $episode->getNumber();\n return $seasons;\n }, []);\n }",
"private function chargeLesEpisodes()\n\t\t{\n\t\t$resultat=$this->maBD->chargement('episode');\n\t\t$nb=0;\n\t\twhile ($nb<sizeof($resultat))\n\t\t\t{\n\t\t\t$laSaison = $this->toutesLesSaisons->donneObjetSaisonDepuisNumero($resultat[$nb][0],$resultat[$nb][1]);\n\t\t\t$this->tousLesEpisodes->ajouteUnEpisode($resultat[$nb][2],$resultat[$nb][3],$resultat[$nb][4],$laSaison);\n\t\t\t$nb++;\n\t\t\t}\n\n\t\t}",
"public function getReleaseEpisodeTitles()\n {\n return $this->releaseEpisodeTitles;\n }",
"public function toString()\n {\n return (string) $this->join(',');\n }",
"public function getAllEpisodes()\n {\n return Episode::all();\n }",
"public function entry_ids()\n\t{\n\t\t$field_name = ee()->TMPL->fetch_param('field');\n\t\t$query = ee()->db->select('field_id')->where('field_name', $field_name)->get('channel_fields');\n\t\t$field_id = $query->result_array()[0]['field_id'];\n\t\t$field = 'field_id_'.$field_id;\n\n\t\t// get entries\n\t\t$tag = ee()->TMPL->fetch_param('tag');\n\t\t$tag = str_replace('+', ' ', $tag);\n\t\t$query = ee()->db->select('entry_id')->like($field, $tag)->get('channel_data');\n\t\t$entry_ids = array();\n\t\tforeach ($query->result_array() as $row)\n\t\t{\n\t\t\t$entry_ids[] = $row['entry_id'];\n\t\t}\n\t\t\n\t\t// return them, pipe separated\n\t\treturn implode('|', $entry_ids);\n\t}",
"public function getActiveEpisodes()\n {\n return $this->getAllEpisodes()->where('status', 1);\n }",
"public static function to_id_string($items)\n\t{\n\t\t$IDs = [];\n\n\t\tif (empty($items))\n\t\t{\n\t\t\t$items = [];\n\t\t}\n\n\t\tforeach ($items as $item)\n\t\t{\n\t\t\t$IDs[] = $item->id;\n\t\t}\n\t\treturn implode(',', $IDs);\n\t}",
"public function comma() {\r\n\t\t$this->_string .= ',';\r\n\t}",
"public function getSelectedNodeIds() {\n\t\tif (!$this->getPage()->hasData('node_ids')) {\n\t\t\t$ids = array();\n\t\t\tforeach ($this->getNodes() as $node) {\n\t\t\t\tif (isset($node['page_exists']) && $node['page_exists']) {\n\t\t\t\t\t$ids[]= $node['node_id'];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn implode(',', $ids);\n\t\t}\n\t\treturn $this->getPage()->getData('node_ids');\n\t}",
"function get_product_id_list() \r\n\t{\r\n\t\t$product_id_list = '';\r\n\t\t$comas = \"\";\t\t\r\n\t\tforeach ($this->contents as $id=>$product) \r\n\t\t{\t\t\t\t\r\n\t\t\tfor ($i=0; $i<count($product['basket']); $i++)\r\n\t\t\t{\r\n\t\t\t\tif ($product['basket'][$i]['id']>0){\r\n\t\t\t\t\t$product_id_list .= $comas . $product['basket'][$i]['id'];\r\n\t\t\t\t\t$comas = \",\";\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\treturn $product_id_list;\r\n }",
"public function getNumberOfEpisodes() {\n\t\treturn $this->numberOfEpisodes;\n\t}",
"public function getEpisodeHistory() {\n try {\n\n $q = Doctrine_Query::create()\n ->from('StdResult r')\n ->where('r.patient_no = ?', $this->getPatientNo())\n ->andWhere('r.episode_no = ?', $this->getEpisodeNo());\n\n $episodeHistory =$q->fetchArray();\n\n return $episodeHistory;\n\n } catch (Exception $e) {\n\n throw new Exception($e->getMessage());\n\n }\n\n }",
"private function extract_program_series($data) {\n $series = $episode = 0;\n\n if (preg_match('/^(\\d+)(\\/\\d+)?, series (\\d+)$/i', $data, $matches)) {\n $series = (int)$matches[3];\n $episode = (int)$matches[1];\n }\n\n return array($series, $episode);\n }",
"public function show_list($choices = array()) \r\n {\r\n $output = '';\r\n foreach ($choices as $key => $value) {\r\n if ($value) {\r\n $output .= sanitize($value, 'ents') . \", \";\r\n }\r\n }\r\n $output = rstrtrim($output, \", \");\r\n \r\n return $output;\r\n }",
"public function parseVenueId(): array\n {\n return $this->filter('#track_results li')->each(function ($node) {\n return (int)explode('?', explode('/', $node->filter('.track_title a')->attr('href'))[3])[0];\n });\n }",
"public function getNbEpisodes()\n {\n\t\t$nbEpisodes = 0;\n\t\tfor($i = 1 ; $i <= $this->getNbSeasons() ; $i++)\n\t\t{\n\t\t\t$nbEpisodes += $this->getNbEpisodesInSeason($i);\n\t\t}\n return $nbEpisodes;\n }",
"function GetDeptIdArray($connection){ \n $query = $connection ->query(\"SELECT * FROM department \") ;\n // initialize idvariable\n $c_id = 0;\n while ($row = $query->fetch()) {\n $ids = $row['dept_id'] ;\n // print(\"$ids<br>\");\n // return (\"$ids\") ;\n if ($c_id == 0){\n $c_id = $ids;\n } else {\n $c_id = $c_id. \",\" .$ids;\n }\n }\n // return menu_id\n return explode(\",\",$c_id);\n}",
"public function fetchEnrolledCourseIDs(){\n $course_ids=\"\";\n $enrolled_courses = EnrolledCourses::where(['user_id'=>\\Auth::id()])->get(); \n foreach ($enrolled_courses as $key => $course) {\n $course_ids .= $course->course_id .\",\";\n # code...\n } \n $courseIdsArray = explode(\",\", $course_ids);\n return $courseIdsArray;\n }"
] | [
"0.555915",
"0.55426687",
"0.54869753",
"0.54820204",
"0.5422739",
"0.5371787",
"0.52692294",
"0.5253019",
"0.52264285",
"0.51408464",
"0.51217836",
"0.5040482",
"0.49154392",
"0.4884523",
"0.48428062",
"0.48160297",
"0.47934836",
"0.47843167",
"0.4768234",
"0.47582796",
"0.47516736",
"0.4725119",
"0.47207347",
"0.46575856",
"0.46504313",
"0.46263883",
"0.4625215",
"0.4616735",
"0.45927212",
"0.45915502"
] | 0.59493536 | 0 |
Pipe (|) separated list of episode titles | public function getReleaseEpisodeTitles()
{
return $this->releaseEpisodeTitles;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function filter_title( $title ) {\n $substrings = explode( ' | ', $title );\n $title = '';\n \n foreach ($substrings as $key => $s) {\n $title .= ($key % 2 === 0) ? $s : ' <span>' . $s . '</span>';\n }\n \n $substrings = explode( '|', $title );\n $title = '';\n \n foreach ($substrings as $key => $s) {\n $title .= ($key % 2 === 0) ? $s : '<span>' . $s . '</span>';\n }\n \n return $title;\n}",
"public function getShowListByTitle() {\n $query = 'SELECT `title`,`performer`,DATE_FORMAT(`date`,\\'%e/%m/%Y\\') AS `date`,`startTime` FROM `shows` ORDER BY `title`';\n $queryResult = $this->db->query($query);\n return $queryResult->fetchAll(PDO::FETCH_OBJ);\n }",
"function set_titles($titles_sep_by_colon) {\n\t\n\t $this->titles = explode(\"|\",$titles_sep_by_colon);\n\t}",
"private function extractTitle($title){\n $year = '';\n $title = preg_replace('/.'.explode('.', $title)[count(explode('.', $title))-1].'/', '', $title); //remove the file type\n $qualities = ['1080p', '720p', '480p', '360p', 'BlueRay', 'HDRIP', 'DVDRIP', 'HDTV', 'EXTENDED', 'HD-TC', '/S([0-9]{2})E([0-9]{2})/'];\n foreach ($qualities as $qual){\n if (substr($qual, 0, 1) == '/'){\n preg_match($qual, $title, $matches, PREG_OFFSET_CAPTURE);\n if($matches != []){\n if($qual == '/S([0-9]{2})E([0-9]{2})/'){\n $ep = 'Season: '.substr($matches[0][0], 1, 2).' Episode: '.substr($matches[0][0], 4, 5);\n $this->set('episode', $ep);\n } \n $title = substr($title, 0, $matches[0][1]);\n }\n } else { \n if(stripos($title, $qual)){\n $this->set('quality', $qual);\n $title = substr($title, 0, stripos($title, $qual)); \n }\n }\n } \n $title = preg_replace('/[.]/', ' ', $title); //removes full stops\n $title = preg_replace('/ /', ' ', $title); //removes double spaces\n if (substr($title, count($title)-2) == ' '){$title = substr($title, 0, count($title)-2);} //removes trailing space\n if (ctype_digit(explode(' ', $title)[count(explode(' ', $title))-1]) && strlen(explode(' ', $title)[count(explode(' ', $title))-1]) == 4){\n $year = explode(' ', $title)[count(explode(' ', $title))-1];\n $title = substr($title, 0, count($title)-1-5);\n }\n return ['title' => $title, 'year' => $year];\n }",
"public function getEpisodeTitle($GUID) {\n\t \n\t\t$itemIndex = $this->convertGUIDtoItemIndex($GUID);\n\t\t\n\t\t# The only code that should be above this line is the data firewall code.\n\t\t###################################################################\n\t\t# At this point in sequential code processing, all input is now trusted.\t\t\n\t \n\t\t# Warning, description tag will likely contain arbitary HTML\n\t\treturn (string) @$this->podcastXML->channel[0]->item[$itemIndex]->title;\n }",
"public function getEpisodes()\n\t\t\t{\n\t\t\t\treturn $this->episodes;\n\t\t\t}",
"function episodes ($api_key, $tmdb_id) {\n global $sql;\n return $sql->sql_select_array_query(\"SELECT `source_stream_url`, `stream_is_custom`, `tmdb_id`, `tmdb_episode_id`, `tmdb`, `serie_name`, `serie_year`, `serie_season`, `serie_episode`, `serie_trailer`, (SELECT group_name FROM groups WHERE id = s.group_id) as 'group_name', CONCAT('http://', (SELECT source_host FROM playlist WHERE id = s.playlist_id), ':', (SELECT source_port FROM playlist WHERE id = s.playlist_id), '/series/', (SELECT source_username FROM playlist WHERE id = s.playlist_id), '/', (SELECT source_password FROM playlist WHERE id = s.playlist_id), '/', s.source_stream_id, '.', s.source_container_extension) as 'xtream_url' FROM `episodes` s WHERE `user_id` = (SELECT user_id FROM `m3u2strm` WHERE BINARY api_key = '{$api_key}') AND `playlist_id` = (SELECT playlist_id FROM `m3u2strm` WHERE BINARY api_key = '{$api_key}') AND tmdb_id = '{$tmdb_id}' AND tmdb IS NOT NULL AND tmdb <> '' AND `sync_is_removed` = 0\");\n }",
"function link_title($event)\n\t{\n\t\tif (!is_array($event) && strpos($event, '-') !== false)\n\t\t{\n\t\t\tlist($id, $recur) = explode('-', $event, 2);\n\t\t\t$event = $this->read($id, $recur);\n\t\t}\n\t\telse if (!is_array($event) && (int) $event > 0)\n\t\t{\n\t\t\t$event = $this->read($event);\n\t\t}\n\t\tif (!is_array($event))\n\t\t{\n\t\t\treturn $event;\n\t\t}\n\t\t$type = explode(',',$this->cal_prefs['link_title']);\n\t\tif (is_array($type))\n\t\t{\n\t\t\tforeach ($type as &$val)\n\t\t\t{\n\t\t\t\tswitch ($val)\n\t\t\t\t{\n\t\t\t\t\tcase 'end':\n\t\t\t\t\tcase 'modified':\n\t\t\t\t\t\t$extra_fields [$val] = $this->format_date($event[$val]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'participants':\n\t\t\t\t\t\tforeach (array_keys($event[$val]) as $key)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$extra_fields [$val] = accounts::id2name($key, 'account_fullname');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'modifier':\n\t\t\t\t\tcase 'creator':\n\t\t\t\t\tcase 'owner':\n\t\t\t\t\t\t$extra_fields [$val] = accounts::id2name($event[$val], 'account_fullname');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$extra_fields [] = $event[$val];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$str_fields = implode(', ',$extra_fields);\n\t\t\tif (is_array($extra_fields)) return $this->format_date($event['start']) . ': ' . $event['title'] . ($str_fields? ', ' . $str_fields:'');\n\t\t}\n\t\treturn $this->format_date($event['start']) . ': ' . $event['title'];\n\t}",
"public function episodeList(OutputInterface $output, $show, EpisodeList $episodes)\n {\n $seasons = $this->getEpisodeNumbersBySeason($episodes->getEpisodes());\n foreach ($seasons as $season => $episodeNumbers) {\n $episodeList = join(',', $episodeNumbers);\n $output->writeln(sprintf('Season %d: Episode%s %s', $season, count($episodeNumbers)>1?'s':'', $episodeList));\n }\n }",
"function ua_webtide_filter_tribe_get_events_title( $title, $depth = NULL ) {\n\t$title = preg_replace( '/Events\\sfor\\s/i', '', $title );\n\t\t\n\treturn $title;\n\t\n}",
"function title($num) {\n\n $limit = $num+1;\n\n $title = explode(' ', get_the_title(), $limit);\n\n array_pop($title);\n\n $title = implode(\" \",$title).\"...\";\n\n echo $title;\n\n}",
"public function filter_document_title_parts( array $title = [] ) {\n\t\t$sep = apply_filters( 'document_title_separator', '-' );\n\t\t$the_title = $title['title'];\n\n\t\t$new_title = $this->build_title( $title['title'], false );\n\n\t\t/**\n\t\t * Filters the page title built for event single or archive pages.\n\t\t *\n\t\t * @since 4.9.10\n\t\t *\n\t\t * @param string $new_title The new title built for the page.\n\t\t * @param string $title The original title.\n\t\t * @param null|string $sep The separator sequence to separate the title components.\n\t\t */\n\t\t$the_title = apply_filters( 'tribe_events_title_tag', $new_title, $the_title, $sep );\n\n\t\t$title['title'] = $the_title;\n\n\t\treturn $title;\n\t}",
"function adventure_tours_wp_title_filter( $title, $sep, $seplocation ) {\n\t\tif ( is_feed() ) {\n\t\t\treturn $title;\n\t\t}\n\n\t\tif ( ! $title) {\n\t\t\t$title = get_bloginfo('name', 'display') . ( $sep && 'right' == $seplocation ? \" $sep \" : '' );\n\t\t}\n\n\t\tif (!$sep) {\n\t\t\treturn trim($title);\n\t\t}\n\n\t\tglobal $page, $paged;\n\t\t$fullSep = $sep ? \" $sep \" : ' ';\n\t\t$firstSep = 'right' == $seplocation ? '' : $fullSep;\n\n\t\tif ( ( is_home() || is_front_page() ) && ($site_description = get_bloginfo( 'description', 'display' ))) {\n\t\t\t$title .= $firstSep . $site_description;\n\t\t} else {\n\t\t\t$title .= $firstSep . get_bloginfo( 'name', 'display' );\n\t\t}\n\n\t\t// Add a page number if necessary:\n\t\tif ( ( $paged > 1 || $page > 1 ) && ! is_404() ) {\n\t\t\t$title .= $fullSep . sprintf( esc_html__( 'Page %s', 'adventure-tours' ), max( $paged, $page ) );\n\t\t}\n\n\t\treturn $title;\n\t}",
"function of_set_title() {\n global $of_title_ar;\n foreach ($of_title_ar as $item) {\n $title .= \"$item \";\n }\n return $title;\n}",
"function fmt_titles($defs)\n{\n\t\tif (!$defs) return '';\n\t\tforeach($defs as $def) {\n\t\t\t$str[] = access_string($def['title'], true);\n\t\t}\n\t\treturn implode('<br>', array_values($str));\n}",
"function escience_filter_wp_title( $title, $sep ) {\n \n\tglobal $paged, $page;\n\t$new_sep = \"|\";\n\n\tif ( is_feed() ) {\n\t\t\treturn $title;\n\t}\n\n\t// Add the site name.\n\t$title .= get_bloginfo( 'name', 'display' );\n\n\t// Add the site description for the home/front page.\n\t$site_description = get_bloginfo( 'description', 'display' );\n\tif ( $site_description && ( is_home() || is_front_page() ) ) {\n\t\t\t$title = \"$title $new_sep $site_description\";\n\t}\n\n\t// Add a page number if necessary.\n\tif ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {\n\t\t\t$title = \"$title $new_sep \" . sprintf( __( 'Page %s', 'roots' ), max( $paged, $page ) );\n\t}\n\n\treturn $title;\n \n}",
"public static function vid_getTitleParts($title, $part) {\n $titleComponents = explode(\"-\", $title);\n\n\t\t//If explode didn't split the title try a different splitter\n\t\tif ($title == $titleComponents[0]) {\n\t\t\t$titleComponents = explode(\"|\", $title);\n\n\t\t\t//If second splitter wasn't found, give up\n\t\t\tif ($title == $titleComponents[0]) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t}\n\n\t\tif ($part == 'Artist') {\n\t\t\treturn $titleComponents[0];\n\t\t}\n\t\tif ($part == 'TrackName') {\n\t\t\treturn $titleComponents[1];\n\t\t}\n\n }",
"public static function title($episode, $type=0) {\n\t\t// Titles for invalid pages\n\t\tif(!is_object($episode) || $episode == new StdClass()) return '';\n\t\t\n\t\t// Analyze URI\n\t\t$episodeComponents = explode('/', $episode->uri());\n\t\t\n\t\t// Is it an episode?\n\t\tif(!isset($episodeComponents[1])) {\n\t\t\treturn (string)$episode->title();\n\t\t}\n\t\t\n\t\t// The episode name is the second element of the URI (`episodes/$episode`)\n\t\t$episodeString = $episodeComponents[1];\n\t\t$episodeID = (int)$episodeString;\n\t\t\n\t\t// Return the appropriate type\n\t\tswitch($type) {\n\t\t\tcase 0:\n\t\t\t\treturn \"#$episodeID ({$episode->title()})\";\n\t\t\tcase 1:\n\t\t\t\treturn \"#$episodeID <br>({$episode->title()})\";\n\t\t\tcase 2:\n\t\t\t\treturn $episodeID;\n\t\t\tcase 3:\n\t\t\t\treturn $episodeString;\n\t\t\tcase 4:\n\t\t\t\treturn site()->title() . \" #$episodeID ({$episode->title()})\";\n\t\t}\n\t}",
"function modify_document_title_separator( $sep ) {\r\n $sep = \"|\";\r\n return $sep;\r\n}",
"public function getTitles()\n {\n return $this->titles;\n }",
"function aglee_pro_render_title() {\n ?>\n <title><?php wp_title( '|', true, 'right' ); ?></title>\n <?php\n }",
"public function getTitles() {\n\n # First, build the index\n $this->buildIndex();\n\n # Return an array of titles\n return $this->titles;\n }",
"public function episodes()\n {\n return $this->morphedByMany('App\\Models\\Episode', 'cartable');\n }",
"public function title($limit=\"\"){\n if(!$limit){\n return $this->title;\n }else{\n $arv = explode(\" \", $this->title, $limit);\n return implode($arv, \" \");\n }\n }",
"function get_split_title($post_id = false) {\n \tif( !$post_id ) {\n\t \tglobal $post;\n\t \t$post_id = $post->ID;\n \t}\n \t\n $title = get_the_title($post_id);\n $lines = explode(' – ', $title);\n $output = false;\n $count = 0;\n\n foreach( $lines as $line ) {\n $count++;\n $output .= '<span class=\"line line-'.$count.'\">'.$line.'</span> ';\n }\n\n return $output;\n }",
"function onair_PlaylistByTitle($pl_title)\n{\n // Function to show names similar to the one choosen\n // Sorting by day, start time and name..\n global $xoopsDB, $xoopsTpl, $pl_title, $xoopsModuleConfig;\n\n $msg = [];\n $pl_title = $_GET['pl_title'];\n if ('' == $_GET['pl_title']) {\n $pl_title = '';\n }\n $query = 'SELECT * FROM ' . $xoopsDB->prefix('oa_playlist') . ' WHERE pl_title LIKE \"%' . $myts->addSlashes($pl_title) . '%\" ORDER BY pl_date, pl_day, pl_start ASC';\n $result = $xoopsDB->query($query);\n $i = $xoopsDB->getRowsNum($result);\n $myts = MyTextSanitizer::getInstance();\n\n while ($sqlfetch = $xoopsDB->fetchArray($result)) {\n $msg['pl_id'] = $myts->htmlSpecialChars($sqlfetch['pl_id']);\n $msg['pl_day'] = onair_Numbers2Days($myts->htmlSpecialChars($sqlfetch['pl_day']));\n $msg['pl_station'] = $myts->htmlSpecialChars($myts->stripSlashesGPC($sqlfetch['pl_station']));\n $msg['pl_name'] = $myts->htmlSpecialChars($myts->stripSlashesGPC($sqlfetch['pl_name']));\n $msg['pl_title'] = $myts->htmlSpecialChars($myts->stripSlashesGPC($sqlfetch['pl_title']));\n $messagedatetime = strtotime($sqlfetch['pl_date']);\n $messagedate = date('d-m-Y', $messagedatetime);\n $msg['pl_date'] = $myts->htmlSpecialChars($messagedate);\n if (1 == $xoopsModuleConfig['timetype']) {\n $message['start'] = date('h:i:s a', strtotime($sqlfetch['pl_start']));\n $message['stop'] = date('h:i:s a', strtotime($sqlfetch['pl_stop']));\n } else {\n $message['start'] = date('H:i:s', strtotime($sqlfetch['pl_start']));\n $message['stop'] = date('H:i:s', strtotime($sqlfetch['pl_stop']));\n }\n\n $msg['pl_start'] = $myts->htmlSpecialChars($message['start']);\n $msg['pl_stop'] = $myts->htmlSpecialChars($message['stop']);\n $msg['pl_image'] = \"<img src='\" . XOOPS_URL . '/' . $xoopsModuleConfig['imagedir'] . $myts->htmlSpecialChars($sqlfetch['pl_image']) . \"' height='\" . $xoopsModuleConfig['shotheight'] . \"' width='\" . $xoopsModuleConfig['shotwidth'] . \"' alt='\" . _VISITWEBSITE . \"'></img>\";\n $msg['pl_description'] = $myts->displayTarea($myts->stripSlashesGPC($sqlfetch['oa_description']), 1, 1, 1);\n\n $i--;\n $xoopsTpl->append('posts', $msg);\n }\n $xoopsTpl->assign('lang_datename', _MD_ONAIR_DATENAME);\n $xoopsTpl->assign('lang_startname', _MD_ONAIR_STARTNAME);\n $xoopsTpl->assign('lang_stopname', _MD_ONAIR_STOPNAME);\n $xoopsTpl->assign('lang_titlename', _MD_ONAIR_TITLENAME);\n $xoopsTpl->assign('lang_namename', _MD_ONAIR_NAMENAME);\n}",
"function tribe_alter_event_archive_titles ( $original_recipe_title, $depth ) {\n\t// Modify the titles here\n\t// Some of these include %1$s and %2$s, these will be replaced with relevant dates\n\t$title_upcoming = 'Upcoming Events'; // List View: Upcoming events\n\t$title_past = 'Past Events'; // List view: Past events\n\t$title_range = 'Events for %1$s - %2$s'; // List view: range of dates being viewed\n\t$title_month = '%1$s'; // Month View, %1$s = the name of the month\n\t$title_day = 'Events for %1$s'; // Day View, %1$s = the day\n\t$title_all = 'All events for %s'; // showing all recurrences of an event, %s = event title\n\t$title_week = 'Events for week of %s'; // Week view\n\t// Don't modify anything below this unless you know what it does\n\tglobal $wp_query;\n\t$tribe_ecp = Tribe__Events__Main::instance();\n\t$date_format = apply_filters( 'tribe_events_pro_page_title_date_format', tribe_get_date_format( true ) );\n\t// Default Title\n\t$title = $title_upcoming;\n\t// If there's a date selected in the tribe bar, show the date range of the currently showing events\n\tif ( isset( $_REQUEST['tribe-bar-date'] ) && $wp_query->have_posts() ) {\n\t\tif ( $wp_query->get( 'paged' ) > 1 ) {\n\t\t\t// if we're on page 1, show the selected tribe-bar-date as the first date in the range\n\t\t\t$first_event_date = tribe_get_start_date( $wp_query->posts[0], false );\n\t\t} else {\n\t\t\t//otherwise show the start date of the first event in the results\n\t\t\t$first_event_date = tribe_event_format_date( $_REQUEST['tribe-bar-date'], false );\n\t\t}\n\t\t$last_event_date = tribe_get_end_date( $wp_query->posts[ count( $wp_query->posts ) - 1 ], false );\n\t\t$title = sprintf( $title_range, $first_event_date, $last_event_date );\n\t} elseif ( tribe_is_past() ) {\n\t\t$title = $title_past;\n\t}\n\t// Month view title\n\tif ( tribe_is_month() ) {\n\t\t$title = sprintf(\n\t\t\t$title_month,\n\t\t\tdate_i18n( tribe_get_option( 'monthAndYearFormat', 'F Y' ), strtotime( tribe_get_month_view_date() ) )\n\t\t);\n\t}\n\t// Day view title\n\tif ( tribe_is_day() ) {\n\t\t$title = sprintf(\n\t\t\t$title_day,\n\t\t\tdate_i18n( tribe_get_date_format( true ), strtotime( $wp_query->get( 'start_date' ) ) )\n\t\t);\n\t}\n\t// All recurrences of an event\n\tif ( function_exists('tribe_is_showing_all') && tribe_is_showing_all() ) {\n\t\t$title = sprintf( $title_all, get_the_title() );\n\t}\n\t// Week view title\n\tif ( function_exists('tribe_is_week') && tribe_is_week() ) {\n\t\t$title = sprintf(\n\t\t\t$title_week,\n\t\t\tdate_i18n( $date_format, strtotime( tribe_get_first_week_day( $wp_query->get( 'start_date' ) ) ) )\n\t\t);\n\t}\n\tif ( is_tax( $tribe_ecp->get_event_taxonomy() ) && $depth ) {\n\t\t$cat = get_queried_object();\n\t\t$title = '<a href=\"' . esc_url( tribe_get_events_link() ) . '\">' . $title . '</a>';\n\t\t$title .= ' › ' . $cat->name;\n\t}\n\treturn $title;\n}",
"function pl_names() {\n $res = [];\n\n $nameList = getall(run(\"select name from playlist where name like '%Uploads%' order by updated desc\"));\n\n foreach($nameList as $name) {\n $candidate = str_replace(\"Uploads by \", \"\", $name[0]);\n if(strlen($candidate) > 0) {\n $res[] = $candidate;\n }\n }\n return $res;\n}",
"function bavotasan_filter_wp_title( $title, $sep ) {\n\tglobal $paged, $page;\n\n\tif ( is_feed() )\n\t\treturn $title;\n\n\t// Add the site name.\n\t$title .= get_bloginfo( 'name' );\n\n\t// Add the site description for the home/front page.\n\t$site_description = get_bloginfo( 'description', 'display' );\n\tif ( $site_description && ( is_home() || is_front_page() ) )\n\t\t$title = \"$title $sep $site_description\";\n\n\t// Add a page number if necessary.\n\tif ( $paged >= 2 || $page >= 2 )\n\t\t$title = \"$title $sep \" . sprintf( __( 'Page %s', 'matheson' ), max( $paged, $page ) );\n\n\treturn $title;\n}",
"public function createListSubtitle() {\n\t\t\treturn \"\";\n\t\t}"
] | [
"0.6310397",
"0.57078725",
"0.55021787",
"0.53770363",
"0.536787",
"0.5276689",
"0.5246986",
"0.5197213",
"0.5184434",
"0.5183235",
"0.51602304",
"0.5154964",
"0.50990856",
"0.50669783",
"0.5037352",
"0.50227314",
"0.5002836",
"0.49996924",
"0.49872613",
"0.4983318",
"0.49700737",
"0.49633262",
"0.49606878",
"0.49555573",
"0.49308512",
"0.49197772",
"0.491579",
"0.4907065",
"0.4889593",
"0.48846686"
] | 0.6216453 | 1 |
Indexer where the release was grabbed | public function getReleaseIndexer()
{
return $this->releaseIndexer;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getReferenceIndex();",
"public function idx() {\n\n\t}",
"public function getIndex() {}",
"private function getIndexedReleasesList(): array\n {\n $response = (new Client())->get(self::DOWNLOAD_UPDATE_API);\n $signature = $response->getHeader('X-Shopware-Signature');\n\n if ($this->openSSLVerifier->isSystemSupported()\n && !$this->openSSLVerifier->isValid($response->getBody(), $signature[0])\n ) {\n throw new \\RuntimeException('API signature verification failed');\n }\n\n $releases = \\json_decode($response->getBody(), true);\n if (empty($releases)) {\n throw new \\RuntimeException('Could not get releases list package');\n }\n\n $indexedReleases = [];\n foreach ($releases as $release) {\n $indexedReleases[$release['version']] = $release;\n }\n\n return $indexedReleases;\n }",
"public function index()\n {\n return $this->sortedindex();\n }",
"public function getIndex()\n\t{\n\t\treturn $this->hit['_index'];\n\t}",
"public function getLogIndex()\n {\n return $this->log_index;\n }",
"public function getIndex() {\n return $this->index;\n }",
"public static function getIndex()\n {\n return static::$index;\n }",
"public function get_index();",
"public function key()\n\t\t{\n\t\t\treturn $this -> Index;\n\t\t}",
"public function indexes();",
"public function indexes();",
"public function indexes();",
"public function getIndex() {\r\n\t\treturn $this->index;\r\n\t}",
"public function getImageIndex() {\n\t}",
"public function getIndex() \n\t{\n\t\treturn $this->idLog;\n\t}",
"public function getIndex()\r\n\t{\r\n\t\treturn $this->index;\r\n\t}",
"public function key() {\n return $this->index;\n }",
"public final function getIndex(){\n return $this->getEventadd();\n }",
"public function key()\n {\n return $this->index;\n }",
"public function key()\n {\n return $this->index;\n }",
"public function key()\n {\n return $this->index;\n }",
"public function key()\n {\n return $this->index;\n }",
"public function key()\n {\n return $this->index;\n }",
"public function key()\n {\n return $this->index;\n }",
"public function getIndex() {\n return $this->index;\n }",
"public function startIndexing() {\r\n\t\t$tagChar = $this->pObj->extConf['prePostTagChar'];\r\n\t\t$now = strtotime('today');\r\n\r\n\t\t// get YAC records from specified pid\r\n\t\t$fields = '*';\r\n\t\t$table = 'tx_keyac_dates';\r\n\t\t$where = 'pid IN ('.$this->indexerConfig['sysfolder'].') ';\r\n\t\t$where .= ' AND hidden=0 AND deleted=0 ';\r\n\t\t// do not index passed events?\r\n\t\tif ($this->indexerConfig['index_passed_events'] == 'no') {\r\n\t\t\tif (TYPO3_VERSION_INTEGER < 6002000) {\r\n\t\t\t\t$keYacProductsIsLoaded = t3lib_extMgm::isLoaded('ke_yac_products');\r\n\t\t\t} else {\r\n\t\t\t\t$keYacProductsIsLoaded = TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::isLoaded('ke_yac_products');\r\n\t\t\t}\r\n\t\t\tif ($keYacProductsIsLoaded) {\r\n\t\t\t\t// special query if ke_yac_products loaded (VNR)\r\n\t\t\t\t$where .= '\r\n\t\t\t\t\tAND ((\r\n\t\t\t\t\t\ttx_keyacproducts_type<>\"product\"\r\n\t\t\t\t\t\tAND (startdat >= \"'.time().'\" OR enddat >= \"'.time().'\")\r\n\t\t\t\t\t) OR (tx_keyacproducts_type=\"product\" AND tx_keyacproducts_product<>\"\"))';\r\n\t\t\t} else {\r\n\t\t\t\t// \"normal\" YAC events\r\n\t\t\t\t$where .= ' AND (startdat >= \"'.time().'\" OR enddat >= \"'.time().'\")';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields,$table,$where,$groupBy='',$orderBy='',$limit='');\r\n\t\t$resCount = $GLOBALS['TYPO3_DB']->sql_num_rows($res);\r\n\r\n\t\tif ($resCount) {\r\n\t\t\twhile ($yacRecord = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\r\n\t\t\t\t// prepare content for storing in index table\r\n\t\t\t\t$title = strip_tags($yacRecord['title']);\r\n\t\t\t\t$tags = '';\r\n\t\t\t\t$params = '&tx_keyac_pi1[showUid]='.intval($yacRecord['uid']);\r\n\t\t\t\t$abstract = str_replace('<br />', chr(13), $yacRecord['teaser']);\r\n\t\t\t\t$abstract = str_replace('<br>', chr(13), $abstract);\r\n\t\t\t\t$abstract = str_replace('</p>', chr(13), $abstract);\r\n\t\t\t\t$abstract = strip_tags($abstract);\r\n\t\t\t\t$content = strip_tags($yacRecord['bodytext']);\r\n\t\t\t\t$fullContent = $abstract . \"\\n\" . $content;\r\n\t\t\t\t$targetPID = $this->indexerConfig['targetpid'];\r\n\r\n\t\t\t\t// get tags\r\n\t\t\t\tif (TYPO3_VERSION_INTEGER >= 7000000) {\r\n\t\t\t\t\t$yacRecordTags = TYPO3\\CMS\\Core\\Utility\\GeneralUtility::trimExplode(',',$yacRecord['tx_keyacsearchtags_tags'], true);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$yacRecordTags = t3lib_div::trimExplode(',',$yacRecord['tx_keyacsearchtags_tags'], true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$tags = '';\r\n\t\t\t\t$clearTextTags = '';\r\n\t\t\t\tif (count($yacRecordTags)) {\r\n\t\t\t\t\tforeach ($yacRecordTags as $key => $tagUid) {\r\n\t\t\t\t\t\tif($tags) {\r\n\t\t\t\t\t\t\t$tags .= ',' . $tagChar . $this->getTag($tagUid) . $tagChar;\r\n\t\t\t\t\t\t} else $tags = $tagChar . $this->getTag($tagUid) . $tagChar;\r\n\t\t\t\t\t\t$clearTextTags .= chr(13).$this->getTag($tagUid, true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\t// add clearText Tags to content\r\n\t\t\t\tif (!empty($clearTextTags)) $fullContent .= chr(13).$clearTextTags;\r\n\r\n\t\t\t\t\t// make it possible to modify the indexerConfig via hook\r\n\t\t\t\t$indexerConfig = $this->indexerConfig;\r\n\r\n\t\t\t\t\t// hook for custom modifications of the indexed data, e. g. the tags\r\n\t\t\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyYACIndexEntry'])) {\r\n\t\t\t\t\tforeach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyYACIndexEntry'] as $_classRef) {\r\n\t\t\t\t\t\tif (TYPO3_VERSION_INTEGER >= 7000000) {\r\n\t\t\t\t\t\t\t$_procObj = & TYPO3\\CMS\\Core\\Utility\\GeneralUtility::getUserObj($_classRef);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$_procObj = & t3lib_div::getUserObj($_classRef);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$_procObj->modifyYACIndexEntry(\r\n\t\t\t\t\t\t\t$title,\r\n\t\t\t\t\t\t\t$abstract,\r\n\t\t\t\t\t\t\t$fullContent,\r\n\t\t\t\t\t\t\t$params,\r\n\t\t\t\t\t\t\t$tags,\r\n\t\t\t\t\t\t\t$yacRecord,\r\n\t\t\t\t\t\t\t$targetPID,\r\n\t\t\t\t\t\t\t$additionalFields,\r\n\t\t\t\t\t\t\t$indexerConfig\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// store data in index table\r\n\t\t\t\t$this->pObj->storeInIndex(\r\n\t\t\t\t\t$indexerConfig['storagepid'],\t\t\t\t// storage PID\r\n\t\t\t\t\t$title,\t\t\t\t\t\t\t\t\t\t// page/record title\r\n\t\t\t\t\t'ke_yac', \t\t\t\t\t\t\t\t\t// content type\r\n\t\t\t\t\t$targetPID,\t\t\t\t\t\t\t\t\t// target PID: where is the single view?\r\n\t\t\t\t\t$fullContent, \t\t\t\t\t\t\t\t// indexed content, includes the title (linebreak after title)\r\n\t\t\t\t\t$tags,\t\t\t\t \t\t\t\t\t\t// tags\r\n\t\t\t\t\t$params, \t\t\t\t\t\t\t\t\t// typolink params for singleview\r\n\t\t\t\t\t$abstract,\t\t\t\t\t\t\t\t\t// abstract\r\n\t\t\t\t\t$yacRecord['sys_language_uid'],\t\t\t\t// language uid\r\n\t\t\t\t\t$yacRecord['starttime'], \t\t\t\t\t// starttime\r\n\t\t\t\t\t$yacRecord['endtime'], \t\t\t\t\t\t// endtime\r\n\t\t\t\t\t$yacRecord['fe_group'], \t\t\t\t\t// fe_group\r\n\t\t\t\t\tfalse, \t\t\t\t\t\t\t\t\t\t// debug only?\r\n\t\t\t\t\t$additionalFields\t\t\t\t\t\t\t// additional fields added by hooks\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$content = '<p><b>Indexer \"' . $this->indexerConfig['title'] . '\": ' . $resCount . ' YAC records have been indexed.</b></p>'.\"\\n\";\r\n\r\n\t\t$content .= $this->showErrors();\r\n\t\t$content .= $this->showTime();\r\n\r\n\t\treturn $content;\r\n\t}",
"public function getIndexes()\n {\n }",
"public function getIndex()\n\t{\n\t\treturn $this->index;\n\t}"
] | [
"0.57496804",
"0.5744378",
"0.56291354",
"0.56195384",
"0.5550959",
"0.55226225",
"0.5520264",
"0.55121577",
"0.5505822",
"0.5499601",
"0.5466803",
"0.54238826",
"0.54238826",
"0.54238826",
"0.5388124",
"0.53625095",
"0.5340984",
"0.5339914",
"0.5324709",
"0.531775",
"0.5306814",
"0.5306814",
"0.5306814",
"0.5306814",
"0.5306814",
"0.5306814",
"0.5306605",
"0.52970725",
"0.52845734",
"0.5283452"
] | 0.69395703 | 0 |
Size of the release reported by the indexer | public function getReleaseSize()
{
return $this->releaseSize;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getHeapSize()\n {\n return parent::getHeapSize() +\n count($this->_progressiveDownloadInfo) * 8;\n }",
"public function +size()\n {\n // section -64--88-19-1-600b698a:16deea5401e:-8000:0000000000000C13 begin\n // section -64--88-19-1-600b698a:16deea5401e:-8000:0000000000000C13 end\n }",
"public function getSize()\n {\n return $this->info['size'];\n }",
"public function get_size() {\n return $this->size;\n }",
"public function size()\n {\n return $this->size;\n }",
"public function getSize () {}",
"public function \t\t size() {\n Debug::trace();\n return $this->size;\n }",
"function size()\n\t{\n\t\treturn $this->size;\n\t}",
"private function getSize() { return $this->_size; }",
"function getSize() {\n\t\treturn $this->_size;\n\t}",
"function getSize() {\n return $this->size;\n }",
"public function getSize() { \n return $this->size;\n }",
"function getSize() {\n return $this->size;\n }",
"public function size() {\n\t\treturn $this->size;\n\t}",
"public function getSize () {\n\t\treturn $this->size;\n\t}",
"public function getSize() {\n\t}",
"public function getSize() {\n\t\treturn $this->size;\n\t}",
"public function getSize()\n {\n return $this->size;\n }",
"public function getSize()\n {\n return $this->_size;\n }",
"public function getSize ()\n {\n return $this->size;\n }",
"public function getSize()\n\t{\n\t\treturn $this->size; \n\n\t}",
"public function size()\n\t{\n\t\treturn $this->size;\n\t}",
"public function getSize()\n {\n return $this->size;\n }",
"public function getSize()\n {\n return $this->size;\n }",
"public function getSize()\n {\n return $this->size;\n }",
"public function getSize()\n {\n return $this->size;\n }",
"public function getSize()\n {\n return $this->size;\n }",
"public function getSize()\n {\n return $this->size;\n }",
"public function getSize()\n {\n return $this->size;\n }",
"public function getSize()\n {\n return $this->size;\n }"
] | [
"0.6951942",
"0.67957443",
"0.67434025",
"0.6631164",
"0.6584989",
"0.65837586",
"0.65763915",
"0.65739167",
"0.65684474",
"0.6565476",
"0.6559922",
"0.6549454",
"0.6535281",
"0.65287805",
"0.6515408",
"0.6508362",
"0.6507408",
"0.65027803",
"0.6479739",
"0.6479535",
"0.6468265",
"0.64670146",
"0.6458839",
"0.6458839",
"0.6458839",
"0.6458839",
"0.6458839",
"0.6458839",
"0.6458839",
"0.6458839"
] | 0.74007285 | 0 |
Release Group, will not be set if it is unknown | public function getReleaseReleaseGroup()
{
return $this->releaseReleaseGroup;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProjectGroup();",
"private function setReleaseGroupFromArray(array $input): void\n {\n $this->releaseGroup = is_null($releaseGroup = ArrayAccess::getArray($input, 'release-group'))\n ? new ReleaseGroup()\n : new ReleaseGroup($releaseGroup);\n }",
"public function get_group_name(){\n\t\treturn ($this->_logInfo['group_name']) ? $this->_logInfo['group_name'] : NULL ;\n\t}",
"public function setGroup($value) {}",
"function getGroupSubpartName()\n\t{\n\t\t// Else: use GROUP\n\t\tif (array_key_exists('legacyMode', $this->conf)) {\n\t\t\tif ($this->conf['legacyMode'] == '2.5') {\n\t\t\t\treturn '###PRODUCTGROUP###';\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn '###GROUP###';\n\t}",
"public function getGroup(): ?string\n {\n return $this->group;\n }",
"public function getGroup()\n {\n return $this->group;\n\n }",
"public function getRelease() {\n return isset($this->release) ? $this->release : FALSE;\n }",
"function getGroup(){\n\t\t\treturn $this->group;\n\t\t}",
"public function getRelease()\n {\n }",
"public function getGroup()\r\n {\r\n return $this->group;\r\n }",
"public function getGroup ()\n {\n return $this->group;\n }",
"private function _cache_group( $group ) {\n\t\treturn $this->_config->get_string( array( 'genesis.theme', $group ) );\n\t}",
"function release($group_set_id)\n {\n $group_set = $this->find('first', array(\n 'conditions' => array('SurveyGroupSet.id' => $group_set_id),\n 'contain' => array('SurveyGroup' => array('Member')),\n ));\n if (empty($group_set) || $group_set['SurveyGroupSet']['released']) {\n return false;\n }\n\n $event = $this->Event->find('first', array(\n 'conditions' => array('id' => $group_set['SurveyGroupSet']['survey_id']),\n 'contain' => false,\n ));\n $courseId = $event['Event']['course_id'];\n\n $Group = ClassRegistry::init('Group');\n $result = true;\n $groups = array();\n\n //get last group number if exists\n $max_group_num = $Group->getLastGroupNumByCourseId($courseId);\n\n // begin transaction for saving the records\n $dataSource = $this->getDataSource();\n $dataSource->begin($this);\n foreach ($group_set['SurveyGroup'] as $surveyGroup) {\n $group = array();\n $groupNum = $surveyGroup['group_number'];\n $group['Group']['group_num'] = $groupNum + $max_group_num;\n $group['Group']['group_name'] = $group_set['SurveyGroupSet']['set_description'].' Team #'.$surveyGroup['group_number'];\n $group['Group']['course_id'] = $courseId;\n\n //add group members\n foreach ($surveyGroup['Member'] as $surveyGroupMember) {\n $groupMember = array();\n $groupMember['user_id'] = $surveyGroupMember['id'];\n $group['Member'][] = $groupMember;\n }\n $groups[] = $group;\n }\n\n if ($result = $Group->saveAll($groups)) {\n //change status of survey set to released\n $this->id = $group_set['SurveyGroupSet']['id'];\n $result = $this->saveField('released', 1);\n }\n\n if ($result) {\n $dataSource->commit($this);\n } else {\n $dataSource->rollback($this);\n }\n\n return $result;\n }",
"public function get_group_name()\r\n {\r\n return $this->_group_name;\r\n }",
"public static function get_group() {\n return 'group_course_settings';\n }",
"public function getGroup()\n {\n return $this->group;\n }",
"public function getGroup()\n {\n return $this->group;\n }",
"public function getGroup($group)\n {\n return false;\n }",
"public function setGroupMain($value) {}",
"public function get_cache_group() {\n\t\t$key = '';\n\t\tif( function_exists( 'wp_cache_get_last_changed' ) ){\n\t\t\t$key = wp_cache_get_last_changed( self::CACHE_GROUP . ':' . ADVANCED_SIDEBAR_BASIC_VERSION );\n\t\t}\n\n\t\treturn self::CACHE_GROUP . ':' . ADVANCED_SIDEBAR_BASIC_VERSION . ':' . $key;\n\t}",
"public function getGroup()\n {\n return 91;\n }",
"public function getAssetGroup()\n {\n return $this->asset_group;\n }",
"public function getGroup()\n\t{\n\t\treturn $this->group;\n\t}",
"public function getGroup($group) {\n return false;\n }",
"public function getGroup($group) {\n return false;\n }",
"function drush_conduit_group($title = '', $properties = '', $parent = NULL, $owner = 1) {\n $group = new stdClass();\n $group->uid = $owner;\n $group->type = 'conduit_group';\n $group->language = LANGUAGE_NONE;\n $group->title = $title;\n if ($parent) {\n $group->conduit_parent[LANGUAGE_NONE][0]['target_id'] = $parent;\n }\n $group->conduit_properties[LANGUAGE_NONE][0]['value'] = $properties;\n node_save($group);\n echo \"Created group #{$group->nid}.\\n\";\n return $group;\n}",
"function group($group){\n\t\t\t$this->group = $group;\n\t\t}",
"abstract public function getDomainGroup(): string;",
"function getGroup() { return $this->_repo->getGroup($this->_groupid); }"
] | [
"0.633354",
"0.6029932",
"0.5738719",
"0.57272786",
"0.56781346",
"0.5649419",
"0.56348324",
"0.56161636",
"0.56028295",
"0.55743074",
"0.55293804",
"0.5516614",
"0.5490479",
"0.5483431",
"0.54182035",
"0.541559",
"0.540351",
"0.540351",
"0.53927314",
"0.5380158",
"0.5368266",
"0.5366499",
"0.5359996",
"0.5349263",
"0.5347608",
"0.5347608",
"0.5335947",
"0.53209305",
"0.53135085",
"0.526578"
] | 0.79202896 | 0 |
functions that gets data from request (string) name: Name of the parameter that you want to get | function getData($name){
$empty = "NA";
return isset($_REQUEST[$name]) ? $_REQUEST[$name] : $empty;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getParam($name){\n if(isset($this->requestData[$name])){\n return $this->requestData[$name];\n }\n return \"\";\n }",
"public function getParameter($name);",
"function getParameter($name);",
"function get_request_data() {\n}",
"function get($name='',$clean_code=false){\n\t\treturn $this->getCleanData($name,$_GET,$clean_code);\t\n\t}",
"protected function getParameter($name) {/*{{{*/\n if ( !$name ) {\n return null;\n }\n\n $value = $_SERVER['REQUEST_METHOD'] == 'GET'?$_GET[\"$name\"]:$_POST[\"$name\"];\n\n if ( get_magic_quotes_gpc() ) {\n\n\n } \n\n return $value;\n }",
"public function get($name){ }",
"function fetch($name){\n \n return (isset($_GET[$name])? $_GET[$name]:''); \n }",
"function fetch($name){\n \n return (isset($_GET[$name])? $_GET[$name]:''); \n }",
"abstract public function getParam($name);",
"function get($name);",
"public function getGet($name = ''){\n\t\tif(empty($name)){\n\t\t\treturn $_GET;\n\t\t}else{\n\t\t\treturn $_GET[$name];\n\t\t}\n\t}",
"public function __get($name){\n return $this->params[$name];\n }",
"public function getFromRequest(string $name): void\n {\n $this->file = (object) $this->request->get($name);\n }",
"public function get_param($name){\n if(isset($_POST[$name])){\n $value=$_POST[$name];\n }elseif(isset($_GET[$name])){\n $value=$_GET[$name]; \n }else{\n return null;\n }\n return $this->check_param($value);\n }",
"public function getParam($name);",
"protected function _get_request_arg($name)\n {\n $result = '';\n switch ($name) {\n case 'dates':\n $dates = $this->get_dates();\n $result = (empty($dates) ? '' : '&q.date.range=' . $dates);\n break;\n case 'limit':\n $result = '&limit=' . $this->_limit;\n break;\n case 'offset':\n $result = '&offset=' . $this->_offset;\n break;\n case 'tag':\n $tags = '';\n if (!empty($this->_tag)) {\n $tags = $this->_tag . ',';\n }\n if (!empty($this->_region)) {\n $tags .= $this->_region;\n }\n $tags = trim($tags, ',');\n $tags = str_replace(' ', '+', $tags);\n $result = '&q.contentTag=' . $tags;\n break;\n case 'tagExact':\n $result = '&q.contentTag.exact='.$this->_tagExact;\n break;\n case 'tagText':\n $result = '&q.contentTag.text='.$this->_tagText;\n break;\n case 'type':\n if (!empty($this->_type)) {\n $result = '&q.type=' . str_replace(' ', '+', $this->_type);\n }\n break;\n case 'name':\n if (!empty($this->_name)) {\n $result = '&q.name=' . $this->_name;\n }\n break;\n case 'venueID':\n if (!empty($this->_venueID)) {\n $result = '&q.venueID=' . $this->_venueID;\n }\n break;\n case 'userID':\n if (!empty($this->_userID)) {\n $result = '&q.userID=' . $this->_userID;\n }\n break;\n case 'audience':\n if (!empty($this->_audience)) {\n $result = '&q.audience=' . str_replace(' ', '+', $this->_audience);\n }\n break;\n case 'sort':\n $result = '&sort=' . $this->_sort;\n break;\n case 'keywords':\n if (!empty($this->_keywords)) {\n $keywords = str_replace(' ', '+', $this->_keywords);\n if (empty($this->_keyfield)) {\n $key = 'q';\n } else {\n $key = 'q.' . $this->_keyfield;\n }\n $result = '&' . $key . '=' . $keywords;\n }\n break;\n case 'elements':\n $elems = $this->_get_elements();\n $result = (empty($elems) ? '' : '&elements=' . $elems);\n break;\n default:\n $result = '';\n break;\n }\n return $result;\n }",
"public function data($name = null);",
"public function params() { //since this is a public function it can be access directly via the API\n\t\t$this->respond($_GET['string']);//you can still pull from $_GET and $_POST\n\t}",
"public abstract function get_parameter($name);",
"public function get ( string $name ) : string\n { \n $this->getOrFail($name);\n return $this->params[$name]; \n }",
"public function get ($name){\r\n if (isset (self::$data['_GET'][$name]))\r\n return self::$data['_GET'][$name];\r\n elseif (isset (self::$data['_POST'][$name]))\r\n return self::$data['_POST'][$name];\r\n elseif (isset (self::$data['_SESSION'][$name]))\r\n return self::$data['_SESSION'][$name];\r\n else return null;\r\n }",
"public function get($name) {}",
"protected function getParameterFromGET($name) {/*{{{*/\n if ( !$name ) {\n return null;\n }\n\n return $_GET[$name];\n }",
"public function get(string $name);",
"public function get(string $name);",
"public function get(string $name);",
"public function getGetValue($name)\n {\n if (empty($_GET[$name]))\n throw new ToolsExceptions(\"GET['\".$name.\"'] parameter do not exist\");\n\n return $_GET[$name];\n }",
"function getParam ($name);",
"public static function get($name){\n return !isset($_REQUEST[$name]) ? null : $_REQUEST[$name];\n }"
] | [
"0.7386602",
"0.7168137",
"0.71469176",
"0.6948135",
"0.6862745",
"0.68550587",
"0.6845803",
"0.6788161",
"0.6788161",
"0.67651325",
"0.67305523",
"0.6727282",
"0.6720357",
"0.67116493",
"0.66794175",
"0.6676921",
"0.6665594",
"0.6658999",
"0.6653501",
"0.66167665",
"0.659351",
"0.6592235",
"0.65860283",
"0.65840834",
"0.6576006",
"0.6576006",
"0.6576006",
"0.6560912",
"0.65588033",
"0.65566057"
] | 0.72142774 | 1 |
Get one or more field(s) of an user | function userData( $userid, $fields )
{
$select = DB::table( prefix( 'users' ) )->select( $fields, [ 'where' => 'id = \'' . DB::escape( $userid ) . '\'' ] )->getEntry( 0 );
if( is_array( $fields ) )
return $select->getFields();
else
return $select->getField( $fields );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_userfields() {\n return array('id' => 'id',\n 'idnumber' => 'idnumber',\n 'username' => 'username',\n 'email' => 'email');\n }",
"public function getUserFields(){\n\t\treturn CrugeFactory::get()->getICrugeFieldListModels();\n\t}",
"function get_user_field($p_user_id, $p_field)\n{\n global $g_mantis_user_table, $g_use_ldap_email, $g_login_method;\n if ((ON == $g_use_ldap_email) && (\"email\" == $p_field)) {\n # Find out what username belongs to the p_user_id and ask ldap\n return ldap_emailaddy(\"$p_user_id\");\n }\n\n $query = \"SELECT $p_field\n\t\t\t\tFROM $g_mantis_user_table\n\t\t\t\tWHERE id='$p_user_id'\";\n\n\n $result = db_query($query);\n return db_result($result, 0, 0);\n\n}",
"function getUser($id, $field) {\n\trequire 'database.php';\n\n\t$query = $conn->prepare(\"SELECT $field FROM users WHERE id='$id'\");\n\t$query->execute();\n\t$run = $query->fetch(PDO::FETCH_ASSOC);\n\n\treturn $run[$field]; // return field user requests\n}",
"protected function getUserEntityFields() {\n return $this->entityFieldManager->getFieldDefinitions('user', 'user');\n }",
"private function getAllUsers(){\n $query = \\Drupal::database()->select('users_field_data', 'ufd');\n $query->addField('ufd', 'name');\n $query->addField('ufd', 'mail');\n $query->condition('ufd.status', 1);\n return $query->execute()->fetchAll();\n }",
"public function getAllFields()\n {\n $db = dbconnect();\n$db->set_charset(\"utf8\");\n $stmt = $db->prepare(\"SELECT * FROM users WHERE id = ?\");\n $stmt->bind_param(\"i\", $this->id);\n $stmt->execute();\n $result = $stmt->get_result();\n $stmt->close();\n $row = $result->fetch_assoc();\n\n return $row;\n\n }",
"function getFields();",
"function getFields();",
"private function getListOfFields() {\n $listFields = array();\n $userFields = user_load(0);\n return array_keys(get_object_vars($userFields));\n }",
"protected function _get_fields() {\n\t\treturn $this->getData( 'fields' );\n\t}",
"function userDataByEmail( $email, $fields )\n{\n $select = DB::table( prefix( 'users' ) )->select( $fields, [ 'where' => 'email = \\'' . DB::escape( $email ) . '\\'' ] )->getEntry( 0 );\n if( is_array( $fields ) )\n return $select->getFields();\n else\n return $select->getField( $fields );\n}",
"public function get_all_fields($userid){\n\t\t$fields = array();\n\t\t$query = \"SELECT * FROM `\".$this->db_data['meta_table'].\"` WHERE `\".$this->db_data['meta_id'].\"` = $userid\";\n\t\t$sql = mysql_query($query);\n\t\twhile($row = mysql_fetch_array($sql)){\n\t\t\t$fields[] = $row;\n\t\t}\n\t\tif(!empty($fields)){\n\t\t\treturn $fields;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"function get_user_info($p_user_id, $p_field)\n{\n global $g_mantis_user_table, $g_use_ldap_email, $g_login_method;\n if ((ON == $g_use_ldap_email) && (\"email\" == $p_field)) {\n # Find out what username belongs to the p_user_id and ask ldap\n return ldap_emailaddy(\"$p_user_id\");\n }\n\n $query = \"SELECT $p_field\n\t\t\t\tFROM $g_mantis_user_table\n\t\t\t\tWHERE id='$p_user_id'\";\n\n\n $result = db_query($query);\n return db_result($result, 0, 0);\n\n}",
"function authData($field = 'corporate_register_id')\n {\n if( ( $user = Yii::$app->user->getIdentity()) != NULL)\n {\n if( $field == '') return $user;\n return $user->{$field};\n }\n return NULL;\n }",
"function procapi_profile_get_fields() {\n $fields = procapi_get_fields('profile');\n return $fields;\n}",
"public function getFields() {}",
"public function getFields() {}",
"public function getFields() {}",
"function getUserValueFromField($user_id,$field_id) {\n\n\n $a = $this->db->get_where('user_to_fields',array('user_id' => $user_id,'field_id' => $field_id))->row();\n\n if($a)\n\n {\n\n return $a->value;\n\n }else\n\n {\n\n return false;\n\n }\n\n }",
"public static function get_user($field = false) {\n\n if (!Request::is_authenticated())\n return false;\n\n $session = new Session();\n # if $field is not define, return all\n if (!$field) {\n return $session->get('id_account');\n } # return the specific value of the _SESSION\n else {\n $user_data = explode('|', $session->get('id_account'));\n switch ($field) {\n case 'username':\n $index = 1;\n break;\n case 'name':\n $index = 2;\n break;\n case 'type':\n $index = 3;\n break;\n case 'type-display':\n switch ($user_data[3]) {\n case 1:\n return \"Admin\";\n case 2:\n return \"Member\";\n }\n default:\n $index = 0;\n break;\n }\n return $user_data[$index];\n }\n }",
"public function getUserField($id, $field)\n\t{\n\t\t$connect = new connection;\n\t\tif($connect->tryconnect())\n\t\t{\n\t\t\t$connector = $connect->getConnector();\n\t\t\t$sql = \"SELECT $field FROM tab_user WHERE id_user=:u AND active_user = 0\";\n\t\t\t$query = $connector->prepare($sql);\n\t\t\t$query->bindParam(':u', $id, PDO::PARAM_STR);\n\t\t\t$query->execute();\n\t\t\t$rowC = $query->rowCount();\n\t\t\twhile($result=$query->FETCH(PDO::FETCH_OBJ))\n\t\t\t{\n\t\t\t\t$rField = $result->$field;\n\t\t\t}\n\t\t\treturn $rField;\n\t\t}\n\t}",
"public function listField($userId, $field = 'id')\n {\n return $this->model->select($field)\n ->assignedTo($userId)\n ->get();\n }",
"function user_meta_call( $user, $field_name, $request) {\n\t\t\treturn get_user_meta( $user[ 'id' ], $field_name, true );\n\t\t}"
] | [
"0.72062",
"0.71543604",
"0.70265263",
"0.6908252",
"0.6907031",
"0.6900478",
"0.6882053",
"0.68383324",
"0.68383324",
"0.67840546",
"0.671235",
"0.6712052",
"0.6695099",
"0.6693288",
"0.6693288",
"0.6693288",
"0.6693288",
"0.6693288",
"0.6693288",
"0.66063744",
"0.65732414",
"0.6567736",
"0.65310764",
"0.65310764",
"0.65310764",
"0.6515043",
"0.6510351",
"0.6505873",
"0.6487963",
"0.6480183"
] | 0.7594983 | 0 |
Get one or more field(s) of an user identified by email adress | function userDataByEmail( $email, $fields )
{
$select = DB::table( prefix( 'users' ) )->select( $fields, [ 'where' => 'email = \'' . DB::escape( $email ) . '\'' ] )->getEntry( 0 );
if( is_array( $fields ) )
return $select->getFields();
else
return $select->getField( $fields );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_user_info_by_email($email = ''){\n $credential = array( 'email' => $email );\n $result = $this->db->get_where('user' , $credential)->row(); \n return $result; \n }",
"function get_user_by_email($email) {\n\t$pdbo = SiteManager::getDatabase1();\n\treturn $pdbo->getRecord(\"users\", ['email' => $email]);\n}",
"function get_user_field($p_user_id, $p_field)\n{\n global $g_mantis_user_table, $g_use_ldap_email, $g_login_method;\n if ((ON == $g_use_ldap_email) && (\"email\" == $p_field)) {\n # Find out what username belongs to the p_user_id and ask ldap\n return ldap_emailaddy(\"$p_user_id\");\n }\n\n $query = \"SELECT $p_field\n\t\t\t\tFROM $g_mantis_user_table\n\t\t\t\tWHERE id='$p_user_id'\";\n\n\n $result = db_query($query);\n return db_result($result, 0, 0);\n\n}",
"function get_user_by_email($userEmail) {\n $db = dbConnect();\n $sql = 'SELECT * FROM \"user\" WHERE \"userEmail\" = :userEmail';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':userEmail', $userEmail, PDO::PARAM_STR);\n $stmt->execute();\n $userData = $stmt->fetch(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n return $userData;\n }",
"function getuserbyemail($email){\n \n \n $select = $this->select();\n $select->from('user');\n $select->where('email = ?', $email);\n $stmt = $select->query();\n $result = $stmt->fetchAll();\n return $result;\n \n \n \n }",
"function getUserDetails($email){\n \n $this->rk->where(\"email\",$email);\n $this->rk->where(\"status\",0);\n $query = $this->rk->get(\"users\");\n \n return $query;\n \n }",
"public function getUserByEmail($email);",
"public function getUserByEmail() {\n\n // Open database connection\n $db = init_db();\n\n $req = $db->prepare( \"SELECT * FROM user WHERE email = ?\" );\n $req->execute( array( $this->getEmail() ));\n\n // Close databse connection\n $db = null;\n\n return $req->fetch();\n }",
"public function getUserByEmail() {\n\n // Open database connection\n $db = init_db();\n\n $req = $db->prepare( \"SELECT * FROM user WHERE email = ?\" );\n $req->execute( array( $this->getEmail() ));\n\n // Close databse connection\n $db = null;\n\n return $req->fetch();\n }",
"public function search_user_byEmail()\n {\n $query_search_user = \"select user_id, nom, prenom, email,\n date_de_naissance, photo, description, mdp, completed\n from users where email = '$this->email'\";\n return $this->requete($query_search_user);\n }",
"public function getUserDetailsByEmail($email) {\n return $this->fetchRow(\"email = '$email'\");\n }",
"function get_user_info($p_user_id, $p_field)\n{\n global $g_mantis_user_table, $g_use_ldap_email, $g_login_method;\n if ((ON == $g_use_ldap_email) && (\"email\" == $p_field)) {\n # Find out what username belongs to the p_user_id and ask ldap\n return ldap_emailaddy(\"$p_user_id\");\n }\n\n $query = \"SELECT $p_field\n\t\t\t\tFROM $g_mantis_user_table\n\t\t\t\tWHERE id='$p_user_id'\";\n\n\n $result = db_query($query);\n return db_result($result, 0, 0);\n\n}",
"public function getUserByEmail($email)\r\n {\r\n /**\r\n * This function stores the mySQL statement in $stmt variable. The passed in variable $email is then bound and is then exectuted.\r\n * After retrieving the results, the user objects values are then bound to 4 variables, one for each value.\r\n * Then for the user object retrieved the object is assigned 4 key names, and the 4 values that were bound to the variables are assigned\r\n * to the appropriate key and the object is returned.\r\n */\r\n $stmt = $this->conn->prepare(\"SELECT user_id, user_email, user_password, subscription_type FROM user_account WHERE user_email = ?\");\r\n $stmt->bind_param(\"s\", $email);\r\n $stmt->execute(); \r\n $stmt->bind_result($id, $email, $password, $subscriber);\r\n $stmt->fetch(); \r\n $user = array(); \r\n $user['user_id'] = $id; \r\n $user['user_email']=$email; \r\n $user['user_password'] = $password; \r\n $user['subscription_type'] = $subscriber; \r\n \r\n return $user; \r\n }",
"public function getUserByEmail($email, $fields = ' * ', $checkOrig = false)\n {\n $query = sprintf(\"SELECT %s FROM users WHERE userEmail='%s' \", $this->EscapeString($fields), $this->EscapeString($email));\n\n if (true === $checkOrig) {\n $query .= sprintf(\"OR origEmail='%s'\", $this->EscapeString($email));\n }\n\n $query .= \" LIMIT 1 \";\n\n return $this->SelectData($query, PDO::FETCH_ASSOC);\n }",
"function findUserFromEmail($email)\r\n {\r\n $db = JFactory::getDBO();\r\n $query = $db->getQuery(true);\r\n $query->select('*');\r\n $query->from('#__users AS tbl');\r\n $query->where('tbl.email = ' . $db->Quote($email));\r\n $db->setQuery($query);\r\n $user = $db->loadObject();\r\n return $user;\r\n }",
"function getAUserByEmail($email){\n $allUsers = allUsers();\n foreach ($allUsers as $oneUser) {\n if ($oneUser[\"email\"] == $email){\n return $oneUser;\n }\n }\n return NULL;\n}",
"public function getUserByEmail($email)\n {\n $stmt = $this->con->prepare(\"SELECT id, email, username, uniNum FROM users WHERE email = ?\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->bind_result($id, $email, $username, $uniNum);\n $stmt->fetch();\n $user = array();\n $user['id'] = $id;\n $user['email'] = $email;\n $user['username'] = $username;\n $user['uniNum'] = $uniNum;\n return $user;\n }",
"public function findUsingEmail($user = null){\n $field = 'email';\n $data = DBConnection::getInstance()->get('tbl_user', array($field, '=', $user));\n\n if($data->count()){\n $this->data = $data->first();\n return $this->data;\n }\n }",
"public static function getUser($email){\n $db = DBconnect::getInstance();\n\n $statement1 = $db->prepare(\"SELECT diagenkri.user.name, diagenkri.user.surname, diagenkri.user_profile.*\n FROM diagenkri.user JOIN diagenkri.user_profile ON diagenkri.user.`e-mail` = diagenkri.user_profile.`e-mail` WHERE diagenkri.user.`e-mail` = :eposta\");\n $statement1->bindParam(\":eposta\", $email);\n $statement1->execute();\n $result1 = $statement1->fetch(PDO::FETCH_ASSOC);\n\n\n // var_dump($result1);\n // exit();\n return $result1;\n }",
"public function getUserByEmail($email) {\n $stmt = $this->conn->prepare(\"SELECT id, first_name, last_name, email, age, phone, birthdate, gender, profile_picture_uri, created_at, api_key FROM users WHERE email = ?\");\n $stmt->bind_param(\"s\", $email); \n if ($stmt->execute()) {\n $user = $stmt->get_result()->fetch_assoc();\n $stmt->close();\n return $user;\n } else {\n return NULL;\n }\n }",
"public function getUser($email) {\n $db = $this->getAdapter();\n $select = $db->select()\n ->from('users', '*')\n ->where('email = ?', $email);\n $value = $db->fetchAll($select);\n return $value;\n }",
"public static function getAccountUserByEmail($inEmail){\n\n if(validate::emailAddress($inEmail)){\n $selectArray = null; //or array(\"field1\", \"field2\"...)\n $whereClause = \"LoginName = '\".$inEmail.\"'\";\n $orderBy = \"\";\n $limit = \"\";\n $preparedArray = null;\n\n return database::select(\"AccountUser\", $selectArray, $whereClause, $orderBy, $limit, $preparedArray, __METHOD__);\n }\n else{\n return array();\n }\n\n }",
"public static function get_user_by_mail($email){\n\t\tglobal $db;\n\t\tif (filter_var($email, FILTER_VALIDATE_EMAIL) === false) { //validate email to be safe.\n\t\t\tdie();\n\t\t}\n\t\t$result = $db->get_results(\"SELECT * FROM users WHERE email = '$email'\");\n\t\treturn $result;\n\t}",
"function retrieve_user($email)\n{\n if ($email) {\n $query = \"SELECT first_name, last_name, admin FROM users WHERE email='{$email}'\";\n $result = mysql_query($query);\n while ($row = mysql_fetch_array($result, MYSQL_ASSOC))\n {\n $results[] = $row;\n }\n return $results;\n }\n return false;\n}",
"public function SearchUserByEmail($email)\n {\n $email = mysqli_real_escape_string($this->connection, $email);\n $sql = \"SELECT userID, firstName, lastName, email, password, isAdmin FROM users WHERE email like '$email'\";\n\n $users = [];\n $result = mysqli_query($this->connection, $sql);\n if (mysqli_num_rows($result) > 0) {\n while ($row = mysqli_fetch_assoc($result)) {\n $id = $row[\"userID\"];\n $firstName = $row['firstName'];\n $lastName = $row['lastName'];\n $email = $row[\"email\"];\n $password = $row['password'];\n $isAdmin = $row['isAdmin'];\n $user = new User($id, $firstName, $lastName, $email, $password, $isAdmin);\n $users[] = $user;\n }\n return $users;\n }\n }",
"function getUserByEmail($email){\n if ($result = $this->link->query(\"SELECT * FROM user WHERE user_email = '$email'\")) {\n return $result->fetch_object();\n }\n return false;\n }",
"public function getUserInformation($email)\n {\n // set up the query\n $filter = \"(&(objectCategory=person)(userprincipalname=$email))\";\n $fields = array('givenname', 'sn', 'title', 'cn');\n\n // find results\n $result = ldap_search($this->ldap, $this->dn, $filter, $fields);\n if (false !== $result) {\n // get the first entry\n $entries = ldap_get_entries($this->ldap, $result);\n if (isset($entries[0])) {\n // normalize the values\n $values = array();\n foreach ($fields as $field) {\n if (isset($entries[0][$field][0])) {\n $values[$field] = $entries[0][$field][0];\n } else {\n $values[$field] = false;\n }\n }\n return $values;\n }\n }\n\n // fallback if something fails\n return false;\n }",
"function get_information_by_emailpass($users_emailaddress, $users_password)\n {\n $row = $this->db->where($this->users_emailaddress, $users_emailaddress)\n ->where($this->users_password, $users_password)\n ->where($this->users_verified, 'Yes')\n ->where($this->users_deletion, 0)\n ->limit(1)\n ->get($this->table);\n\n return $row->row(); \n }",
"function getUserByEmail($email) {\n global $marketplaceDB;\n $query = 'SELECT\n\t\t\t *\n FROM view_users\n\t\t\t WHERE user_email = :email;';\n try {\n $statement = $marketplaceDB->prepare($query);\n $statement->bindValue(':email', $email);\n $statement->execute();\n $result = $statement->fetch();\n $statement->closeCursor();\n return $result;\n } catch (PDOException $e) {\n $errorMessage = $e->getMessage();\n display_error($errorMessage);\n }\n}",
"function getemaildetails($id,$email)\r\n\t{\r\n\t\tglobal $callConfig;\r\n\t\t$whr=\"user_email='\".$email.\"' and user_id='\".$id.\"' and type='reg' and verify_status='no'\";\r\n\t\t$query=$callConfig->selectQuery(TBL_USER_TEMP,'*',$whr,'','','');\r\n\t\treturn $callConfig->getRow($query);\r\n\t}"
] | [
"0.74344784",
"0.73707116",
"0.73455185",
"0.725368",
"0.7213031",
"0.71944183",
"0.7182661",
"0.712814",
"0.712814",
"0.7113158",
"0.7099163",
"0.7089631",
"0.7030009",
"0.7003543",
"0.6990589",
"0.6926727",
"0.6924794",
"0.690599",
"0.6903519",
"0.69007856",
"0.6890003",
"0.6874294",
"0.68593454",
"0.68584716",
"0.68436104",
"0.6827283",
"0.6810757",
"0.6798467",
"0.6791693",
"0.6787957"
] | 0.81305075 | 0 |
Get one or more field(s) of a project | function projectData( $project, $fields )
{
$select = DB::table( prefix( 'projects' ) )->select( $fields, [ 'where' => 'id = \'' . DB::escape( $project ) . '\'' ] )->getEntry( 0 );
if( is_array( $fields ) )
return $select->getFields();
else
return $select->getField( $fields );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getInfo($projectId = '', $field = '')\n {\n if (empty($projectId)) {\n return TfProject::where('action', 1)->get();\n } else {\n $result = TfProject::where('project_id', $projectId)->first();\n if (empty($field)) {\n return $result;\n } else {\n return $result->$field;\n }\n }\n }",
"function getFields();",
"function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public abstract function getFields();",
"public function getFields() {}",
"public function getFields() {}",
"public function getFields() {}",
"public function project_fields($project_id)\n {\n $metadata = $this->project_metadata($project_id);\n $columns = $metadata['columns'];\n $fields = array();\n foreach ($columns as $column) {\n $name = $column['dataIndex'];\n $description = $column['header'];\n $fields[\"$name\"] = $description;\n }\n\n // other fields do not\n $total = $this->project_assets_count($project_id);\n $per_page = 100;\n for ($start = 0; $start < $total; $start += $per_page) {\n $assets = $this->project_assets($project_id, $start, $per_page);\n foreach ($assets as $asset) {\n foreach ($asset as $k => $v) {\n if (!isset($fields[\"$k\"])) {\n if (is_scalar($k)) {\n $fields[\"$k\"] = '???';\n } else {\n var_dump($asset);\n echo 'nonscalar: ';\n var_dump($k);\n die('here');\n }\n }\n }\n }\n }\n\n if (false === ksort($fields)) {\n throw new Exception(\"can't sort fields for project $project_id\", 1);\n }\n\n return $fields;\n }",
"private function getCustomFields($projectId = null) {\n if($projectId === null) {\n $projectId = $this->getProjectId();\n } \n return $this->callSoapClient('mc_project_get_custom_fields', array('project_id' => (int) $projectId));\n }",
"protected function _get_fields() {\n\t\treturn $this->getData( 'fields' );\n\t}",
"abstract public function getFields();",
"abstract public function getFields();",
"public function getFields(){\t\n\t\t$select = '*, CONCAT( \"'. $this->panel['name'] .'\", \"_\", name ) AS field_id';\t\t\n\t\t$fields = $this->db->get_results( $this->db->prepare(\n\t\t\t'SELECT '. $select .' \n\t\t\tFROM wp_efm_fields \n\t\t\tWHERE owner_type = \"panel\" \n\t\t\tAND owner_id = %d\n\t\t\tORDER BY display_order',\n\t\t\t$this->panel['id']\n\t\t));\n\t\treturn $fields;\n\t}",
"public function getFields() {\n // Get type\n $select = $this->select()\n ->order('mp_id ASC')\n ->order('field_id ASC');\n $result = $this->fetchAll($select);\n return $result;\n }",
"public function getFields(): array;",
"public function &getFields();",
"private function project_fields() {\n //print_r($this->metadata);\n $this->project_fields = array();\n foreach ($this->metadata['columns'] as $column) {\n $map_field = $column['header'];\n $map_field_base = preg_replace('/[0-9]+/', '', $map_field);\n if ($map_field == $map_field_base) {\n $map_field_no = 1;\n }\n else {\n $map_field_no = preg_replace('/^.+([0-9]+).*/', '$1', $map_field);\n }\n $ss_field = $column['dataIndex'];\n if (isset($this->map_fields2[\"$map_field_base\"])) {\n $solr_field = $this->map_fields2[\"$map_field_base\"][\"solr_name\"];\n if ($this->map_fields2[\"$map_field_base\"]['multivalued']) {\n $this->ss2map[\"$ss_field\"] = array('solr' => \"$solr_field\", 'order' => $map_field_no);\n }\n else if (isset($this->project_fields[\"$map_field_base\"])) {\n throw new Exception(\"$map_field_base defined twice: $ss_field\", 1); \n }\n else {\n $this->ss2map[\"$ss_field\"] = array('solr' => $solr_field);\n }\n }\n else {\n echo \"Unknown field: $map_field_base -> $ss_field\\n\"; \n }\n }\n //print_r($this->ss2map);\n\n // eliminate unindexed fields\n }",
"private final function getFields() {\n\t\t\treturn $this->fields;\n\t\t}",
"public static function fields();",
"public static function getFields($class);",
"public function fields()\n {\n return $this->query->get('fields', ['*']);\n }",
"public function fields();",
"public function fields();",
"public function fields();"
] | [
"0.7224101",
"0.69143176",
"0.69143176",
"0.68842095",
"0.68842095",
"0.68842095",
"0.68842095",
"0.68842095",
"0.68842095",
"0.6780408",
"0.67585653",
"0.67585653",
"0.67585653",
"0.6720252",
"0.66764474",
"0.6676056",
"0.6664637",
"0.6664637",
"0.6434802",
"0.63874066",
"0.63865614",
"0.6359775",
"0.6357712",
"0.6330309",
"0.6293468",
"0.62360036",
"0.62316054",
"0.6206329",
"0.6206329",
"0.6206329"
] | 0.8000862 | 0 |
Get one or more field(s) of an issue | function issueData( $issue, $fields )
{
$select = DB::table( prefix( 'issues' ) )->select( $fields, [ 'where' => 'id = \'' . DB::escape( $issue ) . '\'' ] )->getEntry( 0 );
if( is_array( $fields ) )
return $select->getFields();
else
return $select->getField( $fields );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getIssues();",
"public function fields()\n {\n $issues = new FieldsBuilder('issues_block');\n\n $issues\n ->addText('title')\n ->addTrueFalse('images')\n ->addImage('bg');\n\n return $issues->build();\n }",
"function get_specific_issue($id) {\n \n $this->db->where('id', $id);\n $q = $this->db->get('bugs');\n \n if($q->num_rows() > 0)\n {\n foreach ($q->result() as $row)\n {\n $data[] = $row;\n }\n return $data;\n }\n }",
"public function get_issue() {\r\n $data = array();\r\n if (!empty($this->number)) {\r\n $contents = $this->get_response('repos/' . $this->username . '/' . $this->repository . '/issues/'.$this->number);\r\n if ($contents == TRUE) {\r\n $data = json_decode($contents);\r\n }\r\n\r\n } else {\r\n $data = 'issue not found';\r\n }\r\n\r\n return $data;\r\n }",
"public function getFields() {\n // Get type\n $select = $this->select()\n ->order('mp_id ASC')\n ->order('field_id ASC');\n $result = $this->fetchAll($select);\n return $result;\n }",
"protected function _get_fields() {\n\t\treturn $this->getData( 'fields' );\n\t}",
"public function getFields() {}",
"public function getFields() {}",
"public function getFields() {}",
"function getFields();",
"function getFields();",
"public function getField($field);",
"function getEntityDetailFields($id,$field){\n\tGLOBAL $connection;\n\t$id = removeSpecialChars($id);\n\t$field = removeSpecialChars($field);\n\n\t$sql = \"SELECT * FROM entities \n\t\t\tWHERE entities.entity_id='$id'\n\t\";\n\n\t$query = mysqli_query($connection,$sql) or die(mysqli_error($connection));\n\n\treturn mysqli_fetch_assoc($query)[$field];\n}",
"function getFields ($rs) {\n}",
"public function getInfo($projectId = '', $field = '')\n {\n if (empty($projectId)) {\n return TfProject::where('action', 1)->get();\n } else {\n $result = TfProject::where('project_id', $projectId)->first();\n if (empty($field)) {\n return $result;\n } else {\n return $result->$field;\n }\n }\n }",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"abstract public function getFields();",
"abstract public function getFields();",
"public function getFields(){\t\n\t\t$select = '*, CONCAT( \"'. $this->panel['name'] .'\", \"_\", name ) AS field_id';\t\t\n\t\t$fields = $this->db->get_results( $this->db->prepare(\n\t\t\t'SELECT '. $select .' \n\t\t\tFROM wp_efm_fields \n\t\t\tWHERE owner_type = \"panel\" \n\t\t\tAND owner_id = %d\n\t\t\tORDER BY display_order',\n\t\t\t$this->panel['id']\n\t\t));\n\t\treturn $fields;\n\t}",
"public function getIssueDetail()\n {\n return $this->issue_detail;\n }",
"function theo_get_issue_meta( $id = 0 ) {\n\n if ( function_exists('get_field') ) {\n\n $issue_cover = get_field( 'issue_cover_image', $id );\n $issue_volume = get_field( 'issue_volume_number', $id );\n $issue_number = get_field( 'issue_number', $id );\n $issue_date = get_field( 'issue_publication_date_description', $id );\n $issue_cover_credits = get_field( 'issue_cover_image_credits', $id );\n $issue_home_desc = get_field( 'issue_homepage_description', $id );\n\n $meta_check = array(\n $issue_cover,\n $issue_volume,\n $issue_number,\n $issue_date,\n $issue_cover_credits,\n $issue_home_desc\n );\n\n foreach ( $meta_check as $meta ) {\n \n if ( ! empty ( $meta ) ) {\n $meta = $meta;\n } else {\n $meta = false; // give something to test against\n }\n \n } // endforeach $meta_check\n\n $issue_meta = array(\n\n 'cover' => $issue_cover,\n 'volume' => $issue_volume,\n 'number' => $issue_number,\n 'vol_no' => $issue_volume . '.' . $issue_number,\n 'date' => $issue_date,\n 'cover_credits' => $issue_cover_credits,\n 'home_desc' => $issue_home_desc\n\n );\n\n return $issue_meta;\n\n } // endif function_exists(get_field)\n\n}",
"function getIssueObj()\n {\n return $this->data->issue;\n }",
"public abstract function getFields();",
"public function getIssue($id);",
"private final function getFields() {\n\t\t\treturn $this->fields;\n\t\t}"
] | [
"0.6378837",
"0.62542415",
"0.6148459",
"0.61428905",
"0.61208856",
"0.6109343",
"0.6103592",
"0.6103592",
"0.6103592",
"0.6037454",
"0.6037454",
"0.6033323",
"0.60326034",
"0.6014106",
"0.5976021",
"0.59728456",
"0.59728456",
"0.59728456",
"0.59728456",
"0.59728456",
"0.59728456",
"0.5941191",
"0.5941191",
"0.5921505",
"0.59178615",
"0.5914577",
"0.5909051",
"0.58973306",
"0.58760875",
"0.58457565"
] | 0.78648114 | 0 |
Get one or more field(s) of a comment | function commentData( $comment, $fields )
{
$select = DB::table( prefix( 'comment' ) )->select( $fields, [ 'where' => 'id = \'' . DB::escape( $comment ) . '\'' ] )->getEntry( 0 );
if( is_array( $fields ) )
return $select->getFields();
else
return $select->getField( $fields );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getComment()\n {\n return $this->fields['comment'];\n }",
"protected function _get_fields() {\n\t\treturn $this->getData( 'fields' );\n\t}",
"public function getFields() {\n // Get type\n $select = $this->select()\n ->order('mp_id ASC')\n ->order('field_id ASC');\n $result = $this->fetchAll($select);\n return $result;\n }",
"public function fields()\n {\n return $this->query->get('fields', ['*']);\n }",
"function getFields();",
"function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"function _mollom_get_fields($comment = array()) {\t\r\n\tforeach ($comment as $key => $value) { \r\n\t\t// sanitize for non-western encoding sets. Only URL and e-mail adress are exempted. Extra non-wp fields are included.\r\n\t\tswitch ($key) {\r\n\t\t\tcase 'url':\r\n\t\t\tcase 'email':\r\n\t\t\t\tbreak;\r\n\t\t\tdefault: {\r\n\t\t\t\t$charset = get_option('blog_charset');\r\n\t\t\t\t$value = htmlspecialchars(stripslashes($value), ENT_COMPAT, $charset);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\t// output to a hidden field\r\n\t\t?><input type=\"hidden\" name=\"<?php echo $key; ?>\" value=\"<?php echo $value; ?>\" /><?php \r\n\t}\r\n}",
"public function getFieldsForCampaign() {\n\t\treturn 'c.*, u.full_name as owner_name, ' . $this->getFieldForText() . $this->getFieldsForContacInfo() . Phpfox::getUserField().', c.server_id as campaign_server_id';\n\t}",
"abstract public function getFields();",
"abstract public function getFields();",
"public abstract function getFields();",
"function callie_britt_comment_form_fields($comment_fields) {\n\t\tif (callie_britt_get_theme_setting('comment_after_name')) {\n\t\t\t$keys = array_keys($comment_fields);\n\t\t\tif ($keys[0]=='comment') $comment_fields['comment'] = array_shift($comment_fields);\n\t\t}\n\t\treturn $comment_fields;\n\t}",
"public function getComments() {\n\t\tif (!($this->itsComments instanceof Collection))\n\t\t\t$this->loadComments();\n\n\t\treturn call_user_func_array(array($this->itsComments, \"find\"), func_get_args());\n\t}",
"function getComment() {\n return $this->getFieldValue('comment');\n }",
"protected function getFields() {\n $this->dataFetched = true;\n if(is_numeric($this->ID)) {\n return get_fields($this->ID);\n }\n return get_fields(); //Blocks\n }",
"public function getFields() {}",
"public function getFields() {}",
"public function getFields() {}",
"private final function getFields() {\n\t\t\treturn $this->fields;\n\t\t}",
"public function FetchComments()\n {\n $comments = array();\n $stmt = Bugdar::$db->Prepare(\"\n SELECT comments.*, users.alias as post_alias\n FROM \" . TABLE_PREFIX . \"comments comments\n LEFT JOIN \" . TABLE_PREFIX . \"users users\n ON (comments.post_user_id = users.user_id)\n WHERE comments.bug_id = ?\n ORDER BY comments.post_date\n \");\n $stmt->Execute(array($this->bug_id));\n while ($comment = $stmt->FetchObject())\n $comments[] = $comment;\n return $comments;\n }",
"function getComments($pID){\n $sql = 'SELECT commentText, comments.date, comments.uID \n FROM comments, posts \n WHERE comments.postID = ?\n ';\n \n $result = $this->db->getrow($sql, array($pID));\n \n $comments = $result;\n\n return $comments;\n\n }",
"public function getFields()\n {\n return $this->baseCursor->getFields();\n }",
"public function getComments()\n {\n // only populate if comments are unset.\n if (!array_key_exists('comments', $this->data)) {\n $this->populate();\n }\n\n return $this->data['comments'];\n }",
"public function getComment() {\n return $this->_getField(\"comment\", \"\", 1);\n }"
] | [
"0.63096374",
"0.6297203",
"0.6279286",
"0.6177439",
"0.615442",
"0.615442",
"0.6131272",
"0.6131272",
"0.6131272",
"0.6131272",
"0.6131272",
"0.6131272",
"0.6101068",
"0.60714734",
"0.6053466",
"0.6053466",
"0.6045135",
"0.601942",
"0.60188663",
"0.6008164",
"0.5980077",
"0.5971252",
"0.5971252",
"0.5971252",
"0.59315944",
"0.5928804",
"0.5903246",
"0.5886592",
"0.585135",
"0.5832569"
] | 0.7723808 | 0 |
Get one or more field(s) of a label | function labelData( $label, $fields )
{
$select = DB::table( prefix( 'labels' ) )->select( $fields, [ 'where' => 'id = \'' . DB::escape( $label ) . '\'' ] )->getEntry( 0 );
if( is_array( $fields ) )
return $select->getFields();
else
return $select->getField( $fields );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFieldsByLabel() {\n\t\t$fields = $this->getFields();\n\t\t$fieldList = array();\n\t\tforeach($fields as $field) {\n\t\t\t$fieldLabel = $field->get('label');\n\t\t\t$fieldList[$fieldLabel] = $field;\n\t\t}\n\t\treturn $fieldList;\n\t}",
"public function get_label_fields() {\n static $fields = array();\n if (empty($fields)) {\n $matches = array();\n preg_match_all('#\\[\\[(.*)\\]\\]#iU',$this->_label_template,$matches);\n $fields = $matches[1];\n }\n return $fields;\n }",
"public function getLabel() \r\n {\r\n return $this->_fields['Label']['FieldValue'];\r\n }",
"function getFields();",
"function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function findByLabel($label);",
"public function getField();",
"public function getField();",
"public function getField();",
"public function getField();",
"public function getFieldLabel()\n {\n return $this->fieldLabel;\n }",
"public static function fields()\n {\n $fields = collect(self::$fields)->map(function ($val) {\n $val['label'] = trans($val['label']);\n $val['placeholder'] = trans($val['placeholder']);\n if (isset($val['options']) && is_callable($val['options']) && $val['options'] instanceof Closure) {\n $val['options'] = call_user_func($val['options']);\n }\n return $val;\n })\n ->groupBy(['group']);\n\n if (empty(Self::$only)) {\n return $fields->toArray();\n }\n $fields = Arr::undot($fields);\n if (isset($fields[Self::$only])) {\n return collect(Arr::dot($fields[Self::$only]))->toArray();\n }\n\n return [];\n }",
"public static function transform_find_for_field(behat_base $context, string $label, Element $container): array {\n $hasfieldset = strpos($label, '>');\n if (false !== $hasfieldset) {\n [$containerlabel, $label] = explode(\">\", $label, 2);\n $container = $context->find_fieldset(trim($containerlabel), $container);\n $label = trim($label);\n }\n\n return [\n 'selector' => 'named_partial',\n 'locator' => self::normalise_named_selector('field', $label),\n 'container' => $container,\n ];\n }",
"public function getField($field);",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();"
] | [
"0.8161619",
"0.7520942",
"0.66638273",
"0.64310426",
"0.64310426",
"0.62404025",
"0.62404025",
"0.62404025",
"0.62404025",
"0.62404025",
"0.62404025",
"0.6194482",
"0.6175438",
"0.6175438",
"0.6175438",
"0.6175438",
"0.6152263",
"0.6140691",
"0.61306137",
"0.60394967",
"0.60159975",
"0.60159975",
"0.60159975",
"0.60159975",
"0.60159975",
"0.60159975",
"0.60159975",
"0.60159975",
"0.60159975",
"0.60159975"
] | 0.7990181 | 1 |
Get a data field of $plugin | function pluginData( Plugin $plugin, $field )
{
switch( $field )
{
case 'name':
return $plugin->getName();
case 'website':
return $plugin->getWebsite();
case 'author':
return $plugin->getAuthor();
case 'version':
return $plugin->getVersion();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function get_plugin_data() {\n\t\t_deprecated_function( __METHOD__, '3.2', 'AC\\Plugin::get_data()' );\n\n\t\treturn $this->get_data();\n\t}",
"function getDataField(){\n\t\treturn $this->dataField;\n\t}",
"protected function get_data() {\n\t\trequire_once ABSPATH . 'wp-admin/includes/plugin.php';\n\n\t\tif ( null === $this->data ) {\n\t\t\t$this->data = get_plugin_data( $this->get_file(), false, false );\n\t\t}\n\n\t\treturn $this->data;\n\t}",
"function &get_plugin_data($plugin_id)\n{\n global $pwg_loaded_plugins;\n if ( isset($pwg_loaded_plugins[$plugin_id]['plugin_data']) )\n {\n return $pwg_loaded_plugins[$plugin_id]['plugin_data'];\n }\n return null;\n}",
"final public function get_plugin_meta() {\r\n \treturn $this->plugin_meta;\r\n }",
"private function get_plugin_data( $value = 'Version' )\n\t\t\t{\t\n\t\t\t\t$plugin_data = get_plugin_data( __FILE__ );\n\n\t\t\t\treturn $plugin_data[ $value ];\n\t\t\t}",
"private function get_plugin_data( $value = 'Version' )\n\t\t\t{\t\n\t\t\t\t$plugin_data = get_plugin_data( __FILE__ );\n\n\t\t\t\treturn $plugin_data[ $value ];\n\t\t\t}",
"public function getProperty(){\n return 'data';\n }",
"private function getData($plugin)\n\t{\n\t\t$data = array(\n\t\t\t'plugin' => $plugin\n\t\t);\n\n\t\t$data = array_merge($data,\n\t\t\t$this->services->DashboardData->currentUserData(),\n\t\t\t$this->services->Common->subPageName( ucfirst($plugin) . \" | \" ),\n\t\t\t$this->services->Common->runtimeScripts( 'dashboard' )\n\t\t);\n\n\t\treturn $data;\n\t}",
"function field() { return $this->get('field'); }",
"protected function getPlugin(){\n return $this->plugin;\n }",
"public function getData($field, $object);",
"public function get_field_data($name) {\n\t\tif(isset($this->fields[$name])) {\n\t\t\treturn $this->fields[$name];\n\t\t}\n\t\treturn null;\n\t}",
"public function getField();",
"public function getField();",
"public function getField();",
"public function getField();",
"function retrieve_field($id)\n{\n return get_row_data('config_model', 'retrieve_field', array('id' => $id));\n}",
"function getData()\n {\n return $this->getAttribute(\"data\");\n }",
"public function getField(){ return $this->field; }",
"public function dataField($type, $name) {\n\t\t$field = $this->data_fields[array_search($name, $this->logTypes[$type])];\n\t\treturn $field;\n\t}",
"public function Data($field)\n {\n return null;\n }",
"public function field()\n {\n return $this->metadata['field'];\n }",
"public function data($plugin_file_path = '')\n {\n if ($plugin_file_path === '') {\n $plugin_file_path = MOJ_COMPONENT_PLUGIN_PATH;\n }\n\n if (!function_exists('get_plugin_data')) {\n require_once(ABSPATH . 'wp-admin/includes/plugin.php');\n }\n\n $plugin = get_plugin_data($plugin_file_path, false, false);\n return $plugin['Version'] ?? false;\n }",
"public function getField() { \n\t\treturn $this->field;\n\t}",
"function getProperty($field);",
"private function initPluginData()\n {\n \t\t$this->slug = plugin_basename( $this->pluginFile );\n \t\t$this->pluginData = get_plugin_data( $this->pluginFile );\n }",
"public function get_field($query,$field)\n{\n $data = $this->query_single_data($query);\n return $data[$field];\n}",
"function value($field) {\n return $this->Fields[$field];\n}",
"function get($field_name,$type){\n// dbg_tr();\n return data_model::get(get_class($this),$field_name,$type);\n }"
] | [
"0.70776963",
"0.7025644",
"0.68879306",
"0.66972035",
"0.62635756",
"0.62002975",
"0.62002975",
"0.61688983",
"0.61528933",
"0.61463636",
"0.6062755",
"0.60337293",
"0.60095435",
"0.59974414",
"0.59974414",
"0.59974414",
"0.59974414",
"0.59488475",
"0.58838254",
"0.58689547",
"0.58577645",
"0.5849914",
"0.5831802",
"0.5828287",
"0.58227044",
"0.5821897",
"0.58206284",
"0.58148164",
"0.5800799",
"0.5793424"
] | 0.7961381 | 0 |
proccess input data into table 'penambahan_modal' | public function tambah_modal()
{
$tambahModal = $this->tambahModal;
$tambahModal->jumlah = remove_dot(request('jumlah'));
$tambahModal->tanggal = Carbon::now()->format('Y-m-d');
$tambahModal->id_cabang = $this->id_cabang();
$tambahModal->keterangan= request('keterangan');
$tambahModal->save();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function cargarModalAprobarHolgura() \n\t{\n\t\t\theader(\"Content-Type: text/plain; charset=utf-8\"); //Para evitar problemas de acentos\n\t\t\t\n\t\t\t$data['information'] = FALSE;\n\t\t\t$data[\"idHolgura\"] = $this->input->post(\"identificador\");\n\n\n\t\t\tif ($data[\"idHolgura\"] != 'x') \n\t\t\t{\n\t\t\t\t$arrParam = array(\n\t\t\t\t\t\"idHolgura\" => $data[\"idHolgura\"]\n\t\t\t\t);\n\t\t\t\t$data['information'] = $this->novedades_model->get_holguras($arrParam);//informacion holgura\n\t\t\t}\n\t\n\t\t\t$this->load->view(\"holgura_aprobar_modal\", $data);\n }",
"public function Assignment_Modal($username, $monarch){\n \t$trigger=\"'#input-file'\";\n\t\t$query = $this->db->prepare(\"SELECT class.class_name AS class_name, class.id AS id_class FROM enrolled_user, users, class\n \t WHERE users.username= :username AND class.monarch= :monarch AND enrolled_user.id_user=users.id AND enrolled_user.id_class=class.id\");\n\t\t$query->bindParam(\"username\", $username, PDO::PARAM_STR);\n\t\t$query->bindParam(\"monarch\", $monarch, PDO::PARAM_STR);\n $query->execute();\n $codes = array();\n while ($row = $query->fetch(PDO::FETCH_ASSOC)) {\n $codes[] = $row;\n }\n $data_code=\"\";\n if(count($codes)>0){\n \t\n \tforeach($codes as $code){\n \t\t$data_code.='<option value=\"'. $code['id_class'] .'\"\">'. $code['class_name'] .'</option>';\n \t}\n }\n\n\t\t$data='\n\t\t<!--<div class=\"modal fade\" id=\"assignment_modal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\">\n\t\t <div class=\"modal-dialog\" role=\"document\">\n\t\t <div class=\"modal-content\">\n\t\t <div class=\"modal-header\">\n\t\t <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>\n\t\t <h4 class=\"modal-title\" id=\"myModalLabel\">Show Assignment</h4>\n\t\t </div>\n\t\t <div class=\"modal-body\">\n\t\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t\t<label for=\"code\">Show Subject:</label>\n\t\t <select name=\"code\" id=\"code\" class=\"form-control\">\n\t\t\t\t\t\t\t\t<option value=\"\">Choose Subject:</option>\n\t\t\t\t\t\t\t\t'. $data_code .'\n\t\t\t\t\t\t\t</select>\n\t\t </div>\n\t\t\t\t\t</div>\n\t\t <div class=\"modal-footer\">\n\t\t <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Cancel</button>\n\t\t <button type=\"button\" class=\"btn btn-primary\" onclick=\"show_assignment()\">Show</button>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t</div>-->\n\t\t\n\t\t<div class=\"modal fade\" id=\"upload_assignment_modal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\">\n\t\t <div class=\"modal-dialog\" role=\"document\">\n\t\t <div class=\"modal-content\">\n\t\t <div class=\"modal-header\">\n\t\t <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>\n\t\t <h4 class=\"modal-title\" id=\"myModalLabel\">Upload Assignment</h4>\n\t\t </div>\n\t\t <div class=\"modal-body\">\n\t\t\t\t\t\t<!--<div class=\"form-group\">\n\t\t\t\t\t\t\t<label for=\"code\">Show Subject:</label>\n\t\t <select name=\"class_id\" id=\"class_id\" class=\"form-control\" onchange=\"get_assignment_number()\">\n\t\t\t\t\t\t\t\t<option value=\"\">Choose Subject:</option>\n\t\t\t\t\t\t\t\t'. $data_code .'\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</div>-->\n\t\t\t\t\t\t<!--<div class=\"form-group\">\n\t\t\t\t\t\t\t<label for=\"code\">Assignment Number:</label>\n\t\t <select name=\"assignment_number\" id=\"assignment_number\" class=\"form-control\" onchange=\"get_assignment_id()\">\n\t\t\t\t\t\t\t\t<option value=\"\">Assignment Number:</option>\n\t\t\t\t\t\t\t</select>\n\t\t </div>-->\n\t\t <div class=\"form-group\">\n\t\t \t<label for=\"assignment_title\">Assignment Title</label>\n\t\t \t<input type=\"text\" id=\"assignment_title\" class=\"form-control\" placeholder=\"Input Title\">\n\t\t \t<input type=\"hidden\" id=\"hidden_assignment_id\" value=\"\"/>\n\t\t </div>\n\t\t <div class=\"form-group\">\n\t\t \t<label for=\"input-file\">Select File to Upload:</label>\n\t\t \t<input type=\"file\" id=\"input-file\" name=\"input-file\" accept=\"application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document\" required=\"required\">\n\t\t\t\t\t\t\t\n\t\t </div>\n\t\t\t\t\t</div>\n\t\t <div class=\"modal-footer\" id=\"button_div\">\n\t\t <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Cancel</button>\n\t\t <button id=\"upload_student\" type=\"button\" class=\"btn btn-primary\" onclick=\"validate_file_name()\">Upload Assignment</button>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t</div>\n\t\t\n\t\t<!--<div class=\"modal fade\" id=\"submitted_assignment_modal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\">\n\t\t <div class=\"modal-dialog\" role=\"document\">\n\t\t <div class=\"modal-content\">\n\t\t <div class=\"modal-header\">\n\t\t <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>\n\t\t <h4 class=\"modal-title\" id=\"myModalLabel\">Submitted Assignment</h4>\n\t\t </div>\n\t\t <div class=\"modal-body\">\n\t\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t\t<label for=\"class_code\">Show Subject:</label>\n\t\t <select name=\"class_code\" id=\"class_code\" class=\"form-control\">\n\t\t\t\t\t\t\t\t<option value=\"\">Choose Subject:</option>\n\t\t\t\t\t\t\t\t'. $data_code .'\n\t\t\t\t\t\t\t</select>\n\t\t </div>\n\t\t\t\t\t</div>\n\t\t <div class=\"modal-footer\">\n\t\t <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Cancel</button>\n\t\t <button type=\"button\" class=\"btn btn-primary\" onclick=\"submitted_assignment()\">Show</button>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t</div>-->\n\t\t';\n\n\n\t\treturn $data;\n\t}",
"function modal_form() {\n //get custom fields\n\n $view_data['model_info'] = $this->Purchase_Payments_model->get_one($this->input->post('id'));\n $view_data['taxes_dropdown'] = array(\"\" => \"-\") + $this->Taxes_model->get_dropdown_list(array(\"title\"));\n \n $view_data['clients_dropdown'] = array(\"\" => \"-\") + $this->Master_Vendors_model->get_dropdown_list(array(\"name\"));\n\n $this->load->view('payments/modal_form',$view_data);\n }",
"function prosesTambah()\n {\n\n $this->M_donasi->processInsertDonasi();\n }",
"public function cargarModalAprobarOtra() \n\t{\n\t\t\theader(\"Content-Type: text/plain; charset=utf-8\"); //Para evitar problemas de acentos\n\t\t\t\n\t\t\t$data['information'] = FALSE;\n\t\t\t$data[\"idOtra\"] = $this->input->post(\"identificador\");\n\n\n\t\t\tif ($data[\"idOtra\"] != 'x') \n\t\t\t{\n\t\t\t\t$arrParam = array(\n\t\t\t\t\t\"idOtra\" => $data[\"idOtra\"]\n\t\t\t\t);\n\t\t\t\t$data['information'] = $this->novedades_model->get_otras($arrParam);//informacion otra novedad\n\t\t\t}\n\t\n\t\t\t$this->load->view(\"otra_aprobar_modal\", $data);\n }",
"function modal_form()\r\n {\r\n\r\n validate_submitted_data(array(\r\n \"id\" => \"numeric\"\r\n ));\r\n\r\n $view_data['model_info'] = $this->Roles_model->get_one($this->input->post('id'));\r\n $view_data['roles_dropdown'] = array(\"\" => \"-\") + $this->Roles_model->get_dropdown_list(array(\"title\"), \"id\");\r\n $this->load->view('roles/modal_form', $view_data);\r\n }",
"public function create(){\n $this->openModal();\n $this->resetInputFields();\n }",
"function modal_form() {\n\n $this->validate_submitted_data(array(\n \"id\" => \"numeric\"\n ));\n\n $view_data['model_info'] = $this->Payment_methods_model->get_one_with_settings($this->request->getPost('id'));\n\n //get seetings associtated with this payment type\n $view_data['settings'] = $this->Payment_methods_model->get_settings($view_data['model_info']->type);\n\n return $this->template->view('payment_methods/modal_form', $view_data);\n }",
"public function modalAdd(){\n /** atribut identitas modal */\n\t\t$data = array(\n 'modalTitle' => 'Add New Device',\n 'formAction' => base_url('device/do_save'),\n\t\t\t\t'Req' => ''\n );\n /** load view untuk modal */\n\t\t$this->load->view('pages/device/modal_form', $data);\n }",
"public function post_modal(){\n\t\t\n\t}",
"public function show_table(){\r\n\t\t\t\r\n\t\t\t//CONTROLE DE ACESSO ACOES\r\n\t\t\trequire_once '../../models/tb_modulos.php';\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t$co_papel = $_SESSION['codigoPapel'];\r\n\t\t\t$modulos = new tb_modulos(CONEXAOERP);\r\n\t\t\t$acoes = $modulos->possuiPermissaoParaEstaArea($co_papel, PCP, PCP_MOTIVO_PERDA);\r\n\t\t\t\r\n\t\t\t//FIM CONTROLE DE ACESSO\r\n\t\t\t\r\n\t\t\t//Guarda o conte�do tempor�rio da tabela\r\n\t\t\t$s_html = '';\r\n\t\t\t\r\n\t\t\t//Retorna o array com as labels do cabe�alho da tabela\r\n\t\t\t$a_th = $this->thead();\r\n\t\t\t\r\n\t\t\t//Retorna o array com os campos que ir�o preencher as celulas da table\r\n\t\t\t$a_cells = $this->cells();\r\n\t\t\t\r\n\t\t\t//Faz os ajustes na p�gina, para definir a n�mero inicial de registros\r\n\t\t\tif($this->i_page != 1){\r\n\t\t\t\t$n = ($this->i_page - 1) * $this->i_rowsperpage;\r\n\t\t\t}else{\r\n\t\t\t\t$n = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Formula a query\r\n\t\t\t$sql = '\r\n\t\t\t\tSELECT '.$this->s_fields.' \r\n\t\t\t\tFROM '.$this->s_table.' \r\n\t\t\t\tWHERE '.$this->s_where.'\r\n\t\t\t\tORDER BY '.$this->s_orderby.' '.$this->s_orientation.'\r\n\t\t\t\tLIMIT '.$n.','.$this->i_rowsperpage;\r\n\t\t\t\t\r\n\t\t\t$sth = $this->dbh->prepare($sql);\r\n\t\t\t$sth->execute();\r\n\t\t\t\r\n\t\t\t$s_html .= '<script type=\"text/javascript\" src=\"js/pcp/motivo_perda.js\"></script>\r\n\t\t\t\t\t\t<div id=\"confirmaExcluirMotivoPerda\"><p>Deseja realmente excluir esse registro?</p></div>\r\n\t\t\t\t\t\t<div id=\"formularioAlterarMotivoPerda\"></div>';\r\n\t\t\t\r\n\t\t\t//Cria o cabe�alho da tabela\r\n\t\t\t$s_html .= '<table width=\"1003\" border=\"0\" cellpadding=\"3\" cellspacing=\"2\" class=\"LISTA\"><thead><tr>';\r\n\t\t\t\r\n\t\t\tfor($i = 1; $i <= $a_th[0]; $i++){\r\n\t\t\t\t\r\n\t\t\t\tif($this->cols_width != null){\r\n\t\t\t\t\t$s_html .= '<th align=\"left\" width=\"'.$this->cols_width[$i].'\">'.$a_th[$i].'</th>';\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$s_html .= '<th>'.$a_th[$i].'</th>';\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$s_html .= '<th align=\"center\" width=\"60\">Ações</th>';\r\n\t\t\t\r\n\t\t\t$s_html .= '</tr></thead><tbody>';\r\n\t\t\t\r\n\t\t\t//Se n�o forem inseridas colunas manualmente, ent�o apenas mostra os resultados do banco\r\n\t\t\tif($this->a_columns == null){\r\n\t\t\t\t\r\n\t\t\t\t//Cria o corpo da tabela\r\n\t\t\t\twhile($row = $sth->fetch(PDO::FETCH_NUM)){\r\n\t\t\t\t\t\r\n\t\t\t\t\t$s_html .= '<tr>';\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor($i = 0; $i < $a_cells[0]; $i++){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($i == 1){\r\n\t\t\t\t\t\t\tlist ($dia, $mes, $ano, $hora, $min, $seg) = split ('[-. .:]', utf8_encode($row[$i]));\r\n\t\t\t\t\t\t\t$dataCadastro = $ano.\"-\".$mes.\"-\".$dia.\" \".$hora.\":\".$min.\":\".$seg;\r\n\t\t\t\t\t\t\t$s_html .= '<td>'.$dataCadastro.'</td>';\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$s_html .= '<td>'.utf8_encode($row[$i]).'</td>';\r\n\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\r\n\t\t\t\t\t$s_html .= '<td align=\"center\">';\r\n\t\t\t\t\tif($acoes['FL_EXCLUIR']==1){\r\n\t\t\t\t\t$s_html .= '<a title=\"Excluir\" href=\"#\" name=\"excluirMotivoPerda\" id=\"'.$row[0].'\"><img src=\"img/btn/btn_excluir.gif\" width=\"25\" height=\"19\" border=\"0\"/></a>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif($acoes['FL_EDITAR']==1){\r\n\t\t\t\t\t$s_html .= '<a title=\"Editar\" href=\"#\" name=\"alterarMotivoPerda\" id=\"'.$row[0].'\"><img src=\"img/btn/btn_editar.gif\" width=\"25\" height=\"19\" border=\"0\"/></a>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$s_html .= '</td>';\r\n\t\t\t\t\t\r\n\t\t\t\t\t$s_html .= '</tr>';\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t//Caso contr�rio prepara o array(grid) com os valores inseridos manualmente\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\t//Matriz com todos os resultados da tabela\r\n\t\t\t\t$grid = $sth->fetchAll(PDO::FETCH_NUM);\r\n\t\t\t\t\r\n\t\t\t\t//N�mero de linhas retornadas\r\n\t\t\t\t$c = $sth->rowCount();\r\n\t\t\t\t\r\n\t\t\t\t//Insere dentro do grid, no �ndice informado, as colunas que foram inseridas manualmente\r\n\t\t\t\tfor($i = 0; $i < $c; $i++){\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach($this->a_columns as $column){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tarray_splice($grid[$i], $column['index'], 0, str_replace('$?', $i, $column['content']));\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//Prepara a string com o html que ser� impresso em tela\r\n\t\t\t\tfor($i = 0; $i < $c; $i++){\r\n\t\t\t\t\t\r\n\t\t\t\t\t$s_html .='<tr>';\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach($grid[$i] as $value){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$s_html .='<td>'.utf8_encode($value).'</td>';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$s_html .='</tr>';\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$s_html .= '</tbody></table>';\r\n\t\t\t\r\n\t\t\techo($s_html);\r\n\t\t\t\r\n\t\t}",
"function modal_form() {\n $intake_id = $this->request->getPost('id');\n $this->can_access_this_intake($intake_id);\n $view_data = $this->make_intake_modal_form_data($intake_id);\n return $this->template->view('intake/modal_form', $view_data);\n }",
"public function ajoutPartenaireModal()\n {\n $this->modal();\n }",
"public function tambah() {\n\n // Query sql\n $query = \"INSERT INTO \". $this->table . \" SET judul=:judul, penulis=:penulis, penerbit=:penerbit, \n deskripsi=:deskripsi, bahasa=:bahasa, genre=:genre, jumlah_halaman=:jumlah_halaman, tahun_terbit=:tahun_terbit\";\n\n // Prepare statement\n $stmt = $this->koneksi->prepare($query);\n\n // Sanitize input browser\n $this->judul = htmlspecialchars(strip_tags($this->judul));\n $this->penulis = htmlspecialchars(strip_tags($this->penulis));\n $this->penerbit = htmlspecialchars(strip_tags($this->penerbit));\n $this->deskripsi = htmlspecialchars(strip_tags($this->deskripsi));\n $this->bahasa = htmlspecialchars(strip_tags($this->bahasa));\n $this->genre = htmlspecialchars(strip_tags($this->genre));\n $this->jumlah_halaman = htmlspecialchars(strip_tags($this->jumlah_halaman));\n $this->tahun_terbit = htmlspecialchars(strip_tags($this->tahun_terbit));\n\n // Binding isi\n $stmt->bindParam(\":judul\", $this->judul);\n $stmt->bindParam(\":penulis\", $this->penulis);\n $stmt->bindParam(\":penerbit\", $this->penerbit);\n $stmt->bindParam(\":deskripsi\", $this->deskripsi);\n $stmt->bindParam(\":bahasa\", $this->bahasa);\n $stmt->bindParam(\":genre\", $this->genre);\n $stmt->bindParam(\":jumlah_halaman\", $this->jumlah_halaman);\n $stmt->bindParam(\":tahun_terbit\", $this->tahun_terbit);\n\n // Eksekusi query\n if($stmt->execute()) {\n return true;\n }\n\n return false;\n }",
"public function cargarModalEmployeeVerification() \n\t{\n\t\t\theader(\"Content-Type: text/plain; charset=utf-8\"); //Para evitar problemas de acentos\n\t\t\t$data[\"idSafety\"] = $this->input->post(\"idSafety\");\n\n\t\t\t$information = $this->input->post('information');\n\t\t\t$porciones = explode(\"-\", $information);\n\t\t\t$data[\"userType\"] = $porciones[0];\n\t\t\t$data[\"idUser\"] = $porciones[1];\n\t\t\t$data[\"idSafetyWorker\"] = $porciones[2];\n\n\t\t\t$arrParam = array(\n\t\t\t\t\"table\" => \"user\",\n\t\t\t\t\"order\" => \"id_user\",\n\t\t\t\t\"column\" => \"id_user\",\n\t\t\t\t\"id\" => $data[\"idUser\"]\n\t\t\t);\n\t\t\t$this->load->model(\"general_model\");\n\t\t\t$data['information'] = $this->general_model->get_basic_search($arrParam);\n\n\t\t\t$this->load->view(\"modal_verification\", $data);\n }",
"public function get_modal($id)\n\t{\t\n\t\t// $action = $this->input->post('action');\n\t\t// $action_parts = explode('_', $action);\n\t\t// $entity = (!empty($action_parts[2]) ? $action_parts[1] . '_' . $action_parts[2] : $action_parts[1]); \n\t\t$data['column'] = $this->get_column_by_id_lookup($id);\t\n\t\t$this->load->view('templates/admin/column_modal', $data);\t\t\n\t}",
"function tambahresponden ($data) {\n global $conn;\n \n $id_surveyor = $data[\"id_surveyor\"];\n $nama_responden = $data[\"nama_responden\"];\n $alamat = $data[\"alamat\"];\n $provinsi = $data[\"provinsi\"];\n $kab_kota = $data[\"kab_kota\"];\n $kecamatan = $data[\"kecamatan\"];\n $kel_desa = $data[\"kel_desa\"];\n $rt = $data[\"rt\"];\n $rw = $data[\"rw\"];\n $no_hp = $data[\"no_hp\"];\n // $nama_kk = $data[\"nama_kk\"];\n // $no_urut_responden = $data[\"no_urut_responden\"];\n $pertanyaan_12 = $data[\"pertanyaan_12\"];\n $pertanyaan_13 = $data[\"pertanyaan_13\"];\n $pertanyaan_14 = $data[\"pertanyaan_14\"];\n $pertanyaan_15 = $data[\"pertanyaan_15\"];\n $pertanyaan_16 = $data[\"pertanyaan_16\"];\n $pertanyaan_17 = $data[\"pertanyaan_17\"];\n $pertanyaan_18 = $data[\"pertanyaan_18\"];\n $pertanyaan_19 = $data[\"pertanyaan_19\"];\n $pertanyaan_20 = $data[\"pertanyaan_20\"];\n $pertanyaan_21 = $data[\"pertanyaan_21\"];\n $pertanyaan_22 = $data[\"pertanyaan_22\"];\n $pertanyaan_23 = $data[\"pertanyaan_23\"];\n $pertanyaan_24 = $data[\"pertanyaan_24\"];\n $pertanyaan_25 = $data[\"pertanyaan_25\"];\n $pertanyaan_26 = $data[\"pertanyaan_26\"];\n $pertanyaan_27 = $data[\"pertanyaan_27\"];\n $pertanyaan_28 = $data[\"pertanyaan_28\"];\n $pertanyaan_29 = $data[\"pertanyaan_29\"];\n $pertanyaan_30 = $data[\"pertanyaan_30\"];\n $pertanyaan_31 = $data[\"pertanyaan_31\"];\n $pertanyaan_32 = $data[\"pertanyaan_32\"];\n $pertanyaan_33 = $data[\"pertanyaan_33\"];\n $pertanyaan_34 = $data[\"pertanyaan_34\"];\n $pertanyaan_35 = $data[\"pertanyaan_35\"];\n $pertanyaan_36 = $data[\"pertanyaan_36\"];\n $pertanyaan_37 = $data[\"pertanyaan_37\"];\n $pertanyaan_38 = $data[\"pertanyaan_38\"];\n $pertanyaan_39 = $data[\"pertanyaan_39\"];\n $pertanyaan_40 = $data[\"pertanyaan_40\"];\n // $pertanyaan_41 = $data[\"pertanyaan_41\"];\n // $pertanyaan_42 = $data[\"pertanyaan_42\"];\n // $pertanyaan_43 = $data[\"pertanyaan_43\"];\n // $pertanyaan_44 = $data[\"pertanyaan_44\"];\n // $pertanyaan_45 = $data[\"pertanyaan_45\"];\n // $pertanyaan_46 = $data[\"pertanyaan_46\"];\n // $pertanyaan_47 = $data[\"pertanyaan_47\"];\n // $pertanyaan_48 = $data[\"pertanyaan_48\"];\n // $pertanyaan_49 = $data[\"pertanyaan_49\"];\n // $pertanyaan_50 = $data[\"pertanyaan_50\"];\n // $pertanyaan_51 = $data[\"pertanyaan_51\"];\n // $pertanyaan_52 = $data[\"pertanyaan_52\"];\n // $pertanyaan_53 = $data[\"pertanyaan_53\"];\n // $pertanyaan_54 = $data[\"pertanyaan_54\"];\n // $pertanyaan_55 = $data[\"pertanyaan_55\"];\n $lat = $data[\"lat\"];\n $lang = $data[\"lang\"];\n $create_at = $data[\"create_at\"];\n\n\tmysqli_query($conn, \"INSERT INTO responden VALUES('','$id_surveyor', '$nama_responden', '$alamat', '$provinsi', '$kab_kota', '$kecamatan', '$kel_desa', '$rt', '$rw', '$no_hp', '$pertanyaan_12', '$pertanyaan_13', '$pertanyaan_14', '$pertanyaan_15', '$pertanyaan_16', '$pertanyaan_17', '$pertanyaan_18', '$pertanyaan_19', '$pertanyaan_20', '$pertanyaan_21', '$pertanyaan_22', '$pertanyaan_23', '$pertanyaan_24', '$pertanyaan_25', '$pertanyaan_26', '$pertanyaan_27', '$pertanyaan_28', '$pertanyaan_29', '$pertanyaan_30', '$pertanyaan_31', '$pertanyaan_32', '$pertanyaan_33', '$pertanyaan_34', '$pertanyaan_35', '$pertanyaan_36', '$pertanyaan_37', '$pertanyaan_38', '$pertanyaan_39', '$pertanyaan_40', '$lat', '$lang', CURRENT_TIMESTAMP)\");\n\n \n\treturn mysqli_affected_rows($conn);\n}",
"public function create()\n { $this->resetInputFields();\n $this->openModal();\n }",
"public function create()\n { $this->resetInputFields();\n $this->openModal();\n }",
"public function modal_perpanjangan()\n\t{\n\t\t$id = $this->input->get(\"id\");\n\t\t$data = $this->m_petugas->cari(array(\"id\" => $id) ,\"peminjaman\")->row();\n\t\techo json_encode($data);\n\t}",
"public function Quiz_Modal($username, $monarch){\n\t\t$query = $this->db->prepare(\"SELECT class.class_name AS class_name, class.id AS id_class FROM enrolled_user, users, class\n \t WHERE users.username= :username AND class.monarch= :monarch AND enrolled_user.id_user=users.id AND enrolled_user.id_class=class.id\");\n\t\t$query->bindParam(\"username\", $username, PDO::PARAM_STR);\n $query->bindParam(\"monarch\", $monarch, PDO::PARAM_STR);\n $query->execute();\n $codes = array();\n while ($row = $query->fetch(PDO::FETCH_ASSOC)) {\n $codes[] = $row;\n }\n $data_code=\"\";\n if(count($codes)>0){\n \tforeach($codes as $code){\n \t\t$data_code.='<option value=\"'. $code['id_class'] .'\"\">'. $code['class_name'] .'</option>';\n \t}\n }\n $total_question='';\n for($i=1;$i<=20;$i++)\n \t$total_question.='<option value=\"'. $i .'\">'. $i .'</option>';\n\n\t\t$data='\n\t\t<!--<div class=\"modal fade\" id=\"quiz_modal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\">\n\t\t <div class=\"modal-dialog\" role=\"document\">\n\t\t <div class=\"modal-content\">\n\t\t <div class=\"modal-header\">\n\t\t <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>\n\t\t <h4 class=\"modal-title\" id=\"myModalLabel\">Create Quiz</h4>\n\t\t </div>\n\t\t <div class=\"modal-body\">\n\t\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t<div class=\"col-lg-6 col-md-6 col-sm-6 col-xs-12\">\n\t\t\t\t\t\t\t\t\t<label for=\"code\">Choose Subject:</label>\n\t\t\t\t <select name=\"code\" id=\"code\" class=\"form-control\" required >\n\t\t\t\t\t\t\t\t\t\t<option value=\"\">--</option>\n\t\t\t\t\t\t\t\t\t\t'. $data_code .'\n\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"col-lg-6 col-md-6 col-sm-6 col-xs-12\">\n\t\t\t\t\t\t\t\t\t<label for=\"code_test\">Quiz Name</label>\n\t\t\t\t\t\t\t\t\t<input type=\"input\" id=\"code_test\" placeholder=\"\" class=\"form-control\" required />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t </div>\n\t\t <div class=\"form-group\">\n\t\t \t<div class=\"row\">\n\t\t\t\t\t\t\t\t<div class=\"col-lg-6 col-md-6 col-sm-6 col-xs-12\">\n\t\t\t\t\t\t\t\t\t<label for=\"question_mc_n\">Number of Multiple Choices Questions:</label>\n\t\t\t\t <select name=\"question_mc_n\" id=\"question_mc_n\" class=\"form-control\" onchange=\"set_question_mc()\" required >\n\t\t\t\t\t\t\t\t\t\t<option value=\"0\">0</option>\n\t\t\t\t\t\t\t\t\t\t'. $total_question .'\n\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"col-lg-6 col-md-6 col-sm-6 col-xs-12\">\n\t\t\t\t\t\t\t\t\t<label for=\"question_essay_n\">Number of Essay Questions</label>\n\t\t\t\t\t\t\t\t\t<select name=\"question_essay_n\" id=\"question_essay_n\" class=\"form-control\" onchange=\"set_question_essay()\" required >\n\t\t\t\t\t\t\t\t\t\t<option value=\"0\">0</option>\n\t\t\t\t\t\t\t\t\t\t'. $total_question .'\n\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t </div>\n\t\t <div id=\"mc_content\"></div>\n\t\t <div id=\"essay_content\"></div>\n\t\t\t\t\t</div>\n\t\t <div class=\"modal-footer\">\n\t\t <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Cancel</button>\n\t\t <button type=\"button\" class=\"btn btn-primary\" onclick=\"create_quiz()\">Create</button>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t</div>-->\n\t\t<h1>\n\t\t\tQuiz\n\t\t\t<small></small>\n\t\t</h1>\n\t\t</br>\n\t\t\t<div class=\"pull-left\">\n\t\t\t\t<!--<button class=\"btn btn-success btn-md\" data-toggle=\"modal\" data-target=\"#quiz_modal\">Create Quiz</button>-->\n\t\t\t\t<button class=\"btn btn-success btn-md\" data-toggle=\"modal\" data-target=\"#show_quiz_modal\">Show Quiz</button>\n\t\t\t</div>\n\t\t</br></br>\n\t\t';\n\n\n\treturn $data;\n\t}",
"function listJson_padananfp(){\n $padananfp = $this->Tbl_padananfp_model->findAll(); \n //set template\n $this->table->set_template(array('table_open'=>'<table class=\"table table-condensed table-bordered table-striped table-hover dynamic\">'));\n //set table heading\n $this->table->set_heading(array(array('data'=>'Bil.', 'width'=>'30px', 'class'=>'text-center'),array('data'=>'ID Fasiliti Penempatan', 'class'=>'text-center'),array('data'=>'Kod Fasiliti', 'class'=>'text-center'),array('data'=>'Perihal Fasiliti', 'class'=>'text-center'),array('data'=>'Kod Penempatan', 'class'=>'text-center'),array('data'=>'Perihal Penempatan', 'class'=>'text-center'),array('data'=>'Tindakan', 'width'=>'120px', 'class'=>'text-center'))); \n //set table data \n $bil = 1;\n foreach ($padananfp as $key => $val) {\n $button = \"<a href='#myModalView' class='btn btn-mini' id='view' data-toggle='modal' title='Papar Modul' attr='\".$val['idFP'].\"'><i class='icon icon-zoom-in'></i></a>\";\n $button .= nbs(1).\"<a href='#myModalUpdate' class='btn btn-mini' id='edit' data-toggle='modal' title='Kemaskini Modul' attr='\".$val['idFP'].\"'><i class='icon icon-edit'></i></a>\";\n $button .= nbs(1).\"<a href='javascript:void(0);' class='btn btn-mini' title='Hapus Modul' id='delete' attr='\".$val['idFP'].\"'><i class='icon icon-trash'></i></a>\";\n $this->table->add_row(array(array('data'=>$bil, 'class'=>'text-center'),array('data'=>$val['idFP'], 'class'=>'text-center'),array('data'=>$val['kodFasiliti'], 'class'=>'text-center'),$val['perihalFasiliti'],array('data'=>$val['kodPenempatan'], 'class'=>'text-center'),$val['perihalPenempatan'],array('data'=>$button, 'class'=>'text-center'))); \n $bil++;\n }\n //generate table\n echo $this->table->generate(); \n $sDom = '\"sDom\": \"<\\'row-fluid\\'<\\'span4\\'l><\\'span8\\'f>r>t<\\'row-fluid\\'<\\'span8\\'i><\\'span4\\'p>>\", \"sPaginationType\": \"bootstrap\", \"oLanguage\": {\"sLengthMenu\": \"_MENU_ rekod per halaman\"}, \"aoColumnDefs\": [{\"aTargets\": [ 0 ], \"bSortable\": false },{\"aTargets\": [ -1 ], \"bSortable\": false },{ \"aTargets\": [ \\'_all\\' ], \"bSortable\": true }]';\n //load class dynamic di Controller, tidak boleh load pada View sbb nanti nak Search, Paging dan Sorting\n echo \"<script>$(document).ready(function() { $('.dynamic').dataTable({\".$sDom.\"}); });</script>\"; \n }",
"function process() {\n\t\t\t$id_transaksi = $this->insert_model->getkodeunik();\n $waktu = $this->insert_model->getJam();\n $no_meja = '01';\n\n //memanggil nilai yang dikandung elemen bernama 'kd_menu' dan 'quantity' pada form yang memanggil method process ini. Dalam kasus ini elemennya adalah input text yang mengandung nilai kode menu dan jumlah menu yang dipesan\n\n\t\t\t$id_menu = $this->input->post('kd_menu');\n\t\t\t$jumlah = $this->input->post('quantity');\n\n //array penampung\n\t\t\t$data = array (\n\n //sebelah kiri itu field-field database yang mau diinsert\n\t\t\t\t'id_transaksi'=>$id_transaksi,\n 'waktu'=>$waktu,\n 'no_meja'=>$no_meja,\n\t\t\t\t'id_menu'=>$id_menu,\n\t\t\t\t'jumlah'=>$jumlah\n\t\t\t\t);\n\n //sintaks CI untuk insert data ke tabel 'pembeli'\n\t\t\t$this->db->insert('pembeli', $data);\n\t\t}",
"public function cargarModalCheckout() \n\t{\n\t\t\theader(\"Content-Type: text/plain; charset=utf-8\"); //Para evitar problemas de acentos\n\t\t\t\n\t\t\t$data['information'] = FALSE;\n\t\t\t$data[\"idCheckin\"] = $this->input->post(\"idCheckin\");\t\n\n\t\t\tif ($data[\"idCheckin\"] != 'x') {\n\t\t\t\t$arrParam = array(\n\t\t\t\t\t\"idCheckin\" => $data[\"idCheckin\"]\n\t\t\t\t);\n\t\t\t\t$data['information'] = $this->general_model->get_checkin($arrParam);\n\t\t\t}\n\t\t\t$this->load->view(\"checkout_modal\", $data);\n }",
"function listJson_jawapan(){\n $jawapan = $this->Tbl_jawapan_model->findAll();\n //set template\n $this->table->set_template(array('table_open'=>'<table class=\"table table-condensed table-bordered table-striped table-hover dynamic\">'));\n //set table heading\n $this->table->set_heading(array(array('data'=>'Bil.', 'width'=>'30px', 'class'=>'text-center'),array('data'=>'ID Jawapan', 'class'=>'text-center'),array('data'=>'Pilihan Jawapan', 'class'=>'text-center'),array('data'=>'Skor', 'class'=>'text-center'),array('data'=>'Jenis Input', 'class'=>'text-center'),array('data'=>'Tindakan', 'width'=>'120px', 'class'=>'text-center')));\n //set table data\n $bil = 1;\n foreach ($jawapan as $key => $val) {\n $button = \"<a href='#myModalView' class='btn btn-mini' id='view' data-toggle='modal' title='Papar Modul' attr='\".$val['idJawapan'].\"'><i class='icon icon-zoom-in'></i></a>\";\n $button .= nbs(1).\"<a href='#myModalUpdate' class='btn btn-mini' id='edit' data-toggle='modal' title='Kemaskini Modul' attr='\".$val['idJawapan'].\"'><i class='icon icon-edit'></i></a>\";\n $button .= nbs(1).\"<a href='javascript:void(0);' class='btn btn-mini' title='Hapus Modul' id='delete' attr='\".$val['idJawapan'].\"'><i class='icon icon-trash'></i></a>\";\n $this->table->add_row(array(array('data'=>$bil, 'class'=>'text-center'),array('data'=>$val['idJawapan'], 'class'=>'text-center'),$val['pilihanJawapan'],array('data'=>$val['skor'], 'class'=>'text-center'),$val['inputType'],array('data'=>$button, 'class'=>'text-center'))); \n $bil++;\n }//end foreach\n //generate table\n echo $this->table->generate(); \n $sDom = '\"sDom\": \"<\\'row-fluid\\'<\\'span4\\'l><\\'span8\\'f>r>t<\\'row-fluid\\'<\\'span8\\'i><\\'span4\\'p>>\", \"sPaginationType\": \"bootstrap\", \"oLanguage\": {\"sLengthMenu\": \"_MENU_ rekod per halaman\"}, \"aoColumnDefs\": [{\"aTargets\": [ 0 ], \"bSortable\": false },{\"aTargets\": [ -1 ], \"bSortable\": false },{ \"aTargets\": [ \\'_all\\' ], \"bSortable\": true }]';\n //load class dynamic di Controller, tidak boleh load pada View sbb nanti nak Search, Paging dan Sorting\n echo \"<script>$(document).ready(function() { $('.dynamic').dataTable({\".$sDom.\"}); });</script>\"; \n }",
"public function tambah_data()\n {\n $date = date(\"Y-m-d\");\n // * ambil data no trans terakhir berdasarkan tanggal saat ini\n $no_trans = $this->model(\"Pembelian_model\")->no_trans($date);\n // ? cek apakah no trans terakhir ada \n if ($no_trans[\"no_trans\"] != null) {\n // * jika ada maka ambil data 10 digit no trans\n $ambil = substr($no_trans[\"no_trans\"], 10);\n // * tambahkan 1 pada no_trans pada 10 digit dan tambahkan angka 0 disebelah kiri\n $kode = str_pad($ambil + 1, 4, \"0\", STR_PAD_LEFT);\n } else {\n // * jika data no trans tidak ada,maka gunakan default\n $kode = \"0001\";\n }\n $tanggal_no_trans = date(\"ymd\");\n\n $no_trans = \"B\" . \"-\" . $tanggal_no_trans . \"-\" . $kode;\n $supplier = htmlentities(strip_tags(trim($_POST[\"supplier\"])));\n $qty = htmlentities(strip_tags(trim($_POST[\"qty\"])));\n $kd_barang = htmlentities(strip_tags(trim($_POST[\"kd_barang\"])));\n $nama_barang = htmlentities(strip_tags(trim($_POST[\"nama_barang\"])));\n $harga_beli = htmlentities(strip_tags(trim($_POST[\"harga_beli\"])));\n $harga_jual = htmlentities(strip_tags(trim($_POST[\"harga_jual\"])));\n $total = htmlentities(strip_tags(trim($_POST[\"total\"])));\n\n // ? apakah ada jumlah baris (rows) yang dipengaruhi dari hasil tambah data >= 0\n if ($this->model(\"Pembelian_model\")->tambah($no_trans, $supplier, $qty, $kd_barang, $nama_barang, $harga_beli, $harga_jual, $total) >= 0) {\n $data = $this->data[\"data\"] = $this->model(\"Pembelian_model\")->tampilkan();\n $response = [\n \"status\" => \"berhasil\",\n \"data\" => $data,\n \"pesan\" => \"Data berhasil ditambahkan\"\n ];\n }\n\n echo json_encode($response, JSON_PRETTY_PRINT);\n }",
"public function run()\n {\n DB::table('TB_SRD_MODALIDAD')->delete();\n DB::table('TB_SRD_MODALIDAD')->insert([\n ['FK_I_ID_DEPORTE' => 1, 'V_NOMBRE_MODALIDAD' => 'Canoa'],\n ['FK_I_ID_DEPORTE' => 1, 'V_NOMBRE_MODALIDAD' => 'Kayak'],\n ['FK_I_ID_DEPORTE' => 2, 'V_NOMBRE_MODALIDAD' => 'Florete'],\n ['FK_I_ID_DEPORTE' => 2, 'V_NOMBRE_MODALIDAD' => 'Sable'],\n ['FK_I_ID_DEPORTE' => 2, 'V_NOMBRE_MODALIDAD' => 'Espada'],\n ['FK_I_ID_DEPORTE' => 3, 'V_NOMBRE_MODALIDAD' => 'Pista'],\n ['FK_I_ID_DEPORTE' => 3, 'V_NOMBRE_MODALIDAD' => 'Campo'],\n /******ARTE********/\n /* ['FK_I_ID_DEPORTE' => 1, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 2, 'V_NOMBRE_MODALIDAD' => 'No aplica'], \n ['FK_I_ID_DEPORTE' => 3, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 4, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 5, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 7, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 8, 'V_NOMBRE_MODALIDAD' => 'No aplica'], \n ['FK_I_ID_DEPORTE' => 9, 'V_NOMBRE_MODALIDAD' => 'No aplica'], \n /******COMBATE********/\n /* ['FK_I_ID_DEPORTE' => 11, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 12, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 13, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 14, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 15, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 16, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n /*******PELOTA*********/\n /* ['FK_I_ID_DEPORTE' => 17, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 18, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 19, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 20, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 22, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 23, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 24, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 25, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 26, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 27, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 28, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n /*******ACUATICO*********/\n /* ['FK_I_ID_DEPORTE' => 31, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 33, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 34, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n /*******TERRESTRE*********/\n /* ['FK_I_ID_DEPORTE' => 36, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 38, 'V_NOMBRE_MODALIDAD' => 'No aplica'],\n ['FK_I_ID_DEPORTE' => 39, 'V_NOMBRE_MODALIDAD' => 'No aplica'],*/\n ]);\n /* $gimnasia = ['Artística', 'Rítmica'];\n for ($contador = 0; $contador < count($gimnasia); $contador ++) {\n DB::table('TB_SRD_MODALIDAD')->insert([\n 'FK_I_ID_DEPORTE' => 6,\n 'V_NOMBRE_MODALIDAD' => ($gimnasia [$contador])\n ]);\n }\n $tiro = ['Rifles', 'Pistolas', 'Escopetas'];\n for ($contador = 0; $contador < count($tiro); $contador ++) {\n DB::table('TB_SRD_MODALIDAD')->insert([\n 'FK_I_ID_DEPORTE' => 10,\n 'V_NOMBRE_MODALIDAD' => ($tiro [$contador])\n ]);\n }\n $futbol = ['Fútbol Sala'];\n for ($contador = 0; $contador < count($futbol); $contador ++) {\n DB::table('TB_SRD_MODALIDAD')->insert([\n 'FK_I_ID_DEPORTE' => 21,\n 'V_NOMBRE_MODALIDAD' => ($futbol [$contador])\n ]);\n } \n $voleibol = ['Coliseo', 'Arena'];\n for ($contador = 0; $contador < count($voleibol); $contador ++) {\n DB::table('TB_SRD_MODALIDAD')->insert([\n 'FK_I_ID_DEPORTE' => 29,\n 'V_NOMBRE_MODALIDAD' => ($voleibol [$contador])\n ]);\n }\n $subacuaticas = ['Piscina', 'Aguas abiertas'];\n for ($contador = 0; $contador < count($subacuaticas); $contador ++) {\n DB::table('TB_SRD_MODALIDAD')->insert([\n 'FK_I_ID_DEPORTE' => 30,\n 'V_NOMBRE_MODALIDAD' => ($subacuaticas [$contador])\n ]);\n }\n $natacion = ['Carreras', 'Clavados', 'Polo', 'Sincronizado'];\n for ($contador = 0; $contador < count($natacion); $contador ++) {\n DB::table('TB_SRD_MODALIDAD')->insert([\n 'FK_I_ID_DEPORTE' => 32,\n 'V_NOMBRE_MODALIDAD' => ($natacion [$contador])\n ]);\n }\n $atletismo = ['Fondo', 'Semi-fondo', 'Marcha', 'Velocidad', 'Saltos', 'Lanzamientos'];\n for ($contador = 0; $contador < count($atletismo); $contador ++) {\n DB::table('TB_SRD_MODALIDAD')->insert([\n 'FK_I_ID_DEPORTE' => 35,\n 'V_NOMBRE_MODALIDAD' => ($atletismo [$contador])\n ]);\n }\n $ciclismo = ['Ciclismo ruta', 'Ciclismo pista', 'Ciclismo BMX', 'Ciclo-montañismo'];\n for ($contador = 0; $contador < count($ciclismo); $contador ++) {\n DB::table('TB_SRD_MODALIDAD')->insert([\n 'FK_I_ID_DEPORTE' => 37,\n 'V_NOMBRE_MODALIDAD' => ($ciclismo [$contador])\n ]);\n }*/\n }",
"public function tambah_data() {\n // $dariDB = $this->m_pendaftaran->selectMaxID();\n // $nourut = substr($dariDB, 3);\n // $kodeBarangSekarang = $nourut + 1;\n // $data = array('ID_PND' => $kodeBarangSekarang);\n\n $data['title'] = 'Dashboard';\n $data['user'] = $this->db->get_where('user', [\n 'email' =>\n $this->session->userdata('email') \n ])->row_array();\n \n // $data['comboPR'] = $this->m_pendaftaran->comboPR()->result();\n $data['comboDS'] = $this->m_pendaftaran->comboDS()->result();\n $data['bulan'] = $this->m_pendaftaran->bulan()->result();\n $data['jumlah_pr'] = $this->m_pendaftaran->jmlh_pr()->result();\n $data['mahasiswa'] = $this->db->get('mahasiswa')->result_array();\n $mhs = $this->m_pendaftaran->get_mhs();\n $data['mhs'] = $mhs;\n\n $this->load->view('templates/header', $data);\n $this->load->view('templates/sidebar', $data);\n $this->load->view('templates/topbar', $data);\n $this->load->view('pendaftaran/vi_tmbh_pend', $data);\n $this->load->view('templates/footer');\n\n }",
"public function personSelect()\n\t{\n\t\t$sql = mysqli_query($this->open(), \"SELECT p.dni ,p.paterno,p.materno,p.nombre,p.foto,p.celular,c.nombre,p.email,p.sexo as cargo from person p inner join cargo c on p.cargoid=c.cargoid; \");\n\t\techo \"\n\t<table class='striped responsive-table'>\n\t <tr>\n\t\t<th>Dni</th>\n\t\t<th>Paterno</th>\n\t\t<th>Materno</th>\n\t\t<th>Nombre</th>\n\t\t<th>Celular</th>\n\t\t<th height='100'>Foto</th>\n\t\t<th>Cargo</th>\n\t\t<th>Email</th>\n\t\t<th>Opción</th>\n\t\t<th>Opción</th>\n\t </tr>\";\n\t\twhile ($row = mysqli_fetch_array($sql)) {\n\t\t\techo \"<tr>\";\n\t\t\t$cod_person = $row[0];\n\t\t\techo \"<td>\" . $row[0] . \"</td>\";\n\t\t\techo \"<td>\" . $row[1] . \"</td>\";\n\t\t\techo \"<td>\" . $row[2] . \"</td>\";\n\t\t\techo \"<td>\" . $row[3] . \"</td>\";\n\t\t\techo \"<td>\" . $row[5] . \"</td>\";\n\t\t\t// decodificar base 64\n\t\t\t$foto = base64_encode($row[4]);\n\t\t\tif ($foto == \"\") {\n\t\t\t\techo \"<td height='100'>No Disponible</td>\";\n\t\t\t} else {\n\t\t\t\techo \"<td height='100'><img src='data:image/jpeg;base64,$foto' width='100'height='100'></td>\";\n\t\t\t}\n\n\t\t\techo \"<td>\" . $row[6] . \"</td>\";\n\t\t\techo \"<td>\" . $row[7] . \"</td>\";\n?>\n\t\t\t<!-- Modal Trigger -->\n\t\t\t<td><a class=\"waves-effect waves-light btn modal-trigger blue\" href=\"\" onclick=\"personSelectOne('<?php echo $cod_person ?>'); Cancelar(); return false\">Seleccionar</a></td>\n\t\t\t<td><a class=\"waves-effect waves-light btn red\" href=\"\" onclick=\"personDelete('<?php echo $cod_person ?>'); return false\">Eliminar</a></td>\n\t\t<?php\n\t\t\techo \"</tr>\";\n\t\t}\n\n\t\techo \"</table>\";\n\t}",
"public function cargarModalEditarHolgura() \n\t{\n\t\t\theader(\"Content-Type: text/plain; charset=utf-8\"); //Para evitar problemas de acentos\n\t\t\t\n\t\t\t$data['information'] = FALSE;\n\n\t\t\t$identificador = $this->input->post(\"identificador\");\t\t\t\n\t\t\t//como se coloca un ID diferente para que no entre en conflicto con los otros modales, toca sacar el ID\n\t\t\t$porciones = explode(\"-\", $identificador);\n\t\t\t$data[\"idHolgura\"] = $porciones[1];\n\n\t\t\t$this->load->model(\"general_model\");\n\t\t\t//lista de snp holguras\n\t\t\t$arrParam = array(\n\t\t\t\t\"table\" => \"snp_holguras\",\n\t\t\t\t\"order\" => \"snp_holgura\",\n\t\t\t\t\"id\" => \"x\"\n\t\t\t);\n\t\t\t$data['snpHolgura'] = $this->general_model->get_basic_search($arrParam);//lista de snp holguras\n\t\n\n\t\t\tif ($data[\"idHolgura\"] != 'x') \n\t\t\t{\n\t\t\t\t$arrParam = array(\n\t\t\t\t\t\"idHolgura\" => $data[\"idHolgura\"]\n\t\t\t\t);\n\t\t\t\t$data['information'] = $this->novedades_model->get_holguras($arrParam);\n\t\t\n\t\t\t\t//busco si el sitio tiene asociadas sesiones\t\t\t\n\t\t\t\t$arrParam = array(\"idSitio\" => $data['information'][0]['id_sitio']);\n\t\t\t\t$conteoSesiones = $this->general_model->countSesionesbySitio($arrParam);//reviso si el sitio tiene sesiones\n\t\t\t\t$data['infoSesiones'] = false;\n\t\t\t\tif($conteoSesiones != 0){//si tiene sesiones las busco\n\t\t\t\t\t$data['infoSesiones'] = $this->general_model->get_sesiones_sitio($arrParam);//sesiones del sitio\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//busco informacion del sitio\n\t\t\t\t$arrParam = array(\"idSitio\" => $data['information'][0]['id_sitio']);\n\t\t\t\t$data['infoSitoDelegado'] = $this->general_model->get_sitios($arrParam);//busco el id del sitio\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$this->load->view(\"holgura_aprobar_editar_modal\", $data);\n }"
] | [
"0.623108",
"0.6182032",
"0.61667544",
"0.6136307",
"0.6084849",
"0.60739994",
"0.6004361",
"0.5994252",
"0.5965917",
"0.5917045",
"0.59156305",
"0.5899335",
"0.58975685",
"0.58882445",
"0.5885307",
"0.5876879",
"0.5876352",
"0.58742017",
"0.58742017",
"0.5862111",
"0.58442676",
"0.5841419",
"0.5835991",
"0.5833851",
"0.5832525",
"0.58206886",
"0.5817237",
"0.5792737",
"0.5726061",
"0.57205135"
] | 0.7037317 | 0 |
Creating userfriendly path to scope | protected function createScopePath(Store $store)
{
return '[' . $store->getWebsite()->getName() . '] -> ['
. $store->getGroup()->getName() . '] -> [' . $store->getName() . ']';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getUrlToPath($path)\n{\n return \"%%ROOT%%\" . $path;\n}",
"protected function setPath(){\n $this->aScope['path'] = $this->parse('path_all');\n }",
"public function getScopeDocsUrl();",
"function path() {\n\t}",
"protected function setPath(){\n $oRequest = AMI::getSingleton('env/request');\n if((int)$oRequest->get('flt_id_parent', 0)){\n $this->aScope['path'] = $this->parse('path_all');\n }\n }",
"public function path() {\n if ($this->get(\"dir\") == \"private\")\n return PRIVATE_PATH.\"/\".$this->get(\"uri\");\n else\n return PUBLIC_PATH.\"/\".$this->get(\"uri\");\n }",
"public function path();",
"public function path();",
"public function getBasePath(string $scope = ScopeInterface::PROJECT);",
"public function path()\n {\n return \"/@{$this->username}\";\n }",
"public function path(): string\n {\n return Docs::path(\n $this->category.'/'\n .$this->page\n .($this->subpage == '' ? '' : '/'.$this->subpage)\n .'.md'\n );\n }",
"function make_clickable_path($path) {\n global $langRoot, $base_url, $group_sql;\n\n $cur = $out = '';\n foreach (explode('/', $path) as $component) {\n if (empty($component)) {\n $out = \"<a href='{$base_url}openDir=/'>$langRoot</a>\";\n } else {\n $cur .= rawurlencode(\"/$component\");\n $row = Database::get()->querySingle(\"SELECT filename FROM document\n WHERE path LIKE '%/$component' AND $group_sql\");\n $dirname = $row->filename;\n $out .= \" <span class='fa fa-chevron-right px-2 small-text'></span> <a href='{$base_url}openDir=$cur'>\".q($dirname).\"</a>\";\n }\n }\n return $out;\n}",
"public function getPathname() : string;",
"function getPath()\n\t{\n\t\treturn dirname(__FILE__) . \"/../restrict/event_resource/\" . $this->club_id . \"/\" . $this->event_id . \"/\" . $this->id;\n\t}",
"public function getPathAttribute()\n {\n return \"/{$this->slug}\";\n }",
"public function getScope(): string;",
"function path( $path = \"\" ) {\n return BASE_URL . $path;\n}",
"public function __toString() {\n\t\t$path = '/' ;\n\t\t\n\t\tif (strlen($this->_base)) {\n\t\t\t$path .= trim($this->_base, '/') . '/' ;\n\t\t}\n\t\t\n\t\tif (!empty($this->_directories)) {\n\t\t\t$path .= implode('/', $this->_directories) . '/' ;\n\t\t}\n\t\t\n\t\tif (!empty($this->_params)) {\n\t\t\t$params = array() ;\n\t\t\tforeach($this->_params as $key => $value) {\n\t\t\t\t$params[] = $key . '=' . urlencode($value) ;\n\t\t\t}\n\t\t\t$path .= '?' . implode('&', $params) ;\n\t\t}\n\t\t\n\t\treturn $path ;\n\t}",
"public function path() \r\n {\r\n\r\n }",
"private function pathForTypeAndId(): string\n {\n if ($this->inList()) {\n return $this->path;\n }\n\n if ($this->inRelationships()) {\n return $this->parent();\n }\n\n return $this->path;\n }",
"public function getFullSlugPathAttribute(): string\n {\n $slugs = $this->ancestors->pluck('slug')->toArray();\n $slugs[] = $this->slug;\n return '/' . implode('/', $slugs);\n }",
"public function path()\n\t{\n\t\treturn apply_filters( 'rf_framework_path', untrailingslashit( get_template_directory() . '/rf-framework' ) );\n\t}",
"public function pathToString() {\n\t\t\treturn $this->key . ($this->next ? '.' . $this->next->pathToString() : '');\n\t\t}",
"public function getPathAttribute()\n {\n return route('api.journal.show', $this->id);\n }",
"public function getPathInfo(): string\n {\n $route = $this->languageInPath ? Str::sub(parent::getPathInfo(), Str::length($this->language) + 1) : parent::getPathInfo();\n if (!Str::startsWith('/', $route)) {\n $route = '/' . $route;\n }\n return $route;\n }",
"function _path($variable) {\n\t\t$namespace = $this->_config['storage']['namespace'];\n return rtrim($this->_config['storage']['path'],'/').$this->_relative(\n $this->_hashns($namespace), $this->_hashkey($variable)).basename_safe($variable);\n }",
"function getPath() {\n\t\tswitch ($this->getId()) {\n\t\t\tcase ROLE_ID_SUBMITTER:\n\t\t\t\treturn ROLE_PATH_SUBMITTER;\n\t\t\tdefault:\n\t\t\t\treturn parent::getPath();\n\t\t}\n\t}",
"public function path()\n {\n return \"/stories/{$this->story->id}/chapters/{$this->getNumber()}\";\n }",
"public function getContextPath();",
"function GetPath($apiname) // this function gets the local HTTP path\n{\n $ourscript = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? \"https\" : \"http\") . \"://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n $ourdir = substr($ourscript,0,strrpos($ourscript,\"/\")+1);\n return $ourdir.$apiname;\n}"
] | [
"0.59766895",
"0.59309745",
"0.58534133",
"0.57837385",
"0.5771833",
"0.5763894",
"0.5751818",
"0.5751818",
"0.56007916",
"0.558757",
"0.55675375",
"0.55096453",
"0.5494408",
"0.54922336",
"0.54885995",
"0.54763037",
"0.547223",
"0.5440593",
"0.54187346",
"0.5413009",
"0.54108673",
"0.53748304",
"0.5374211",
"0.5365596",
"0.53605705",
"0.5347184",
"0.5336622",
"0.53231394",
"0.53047127",
"0.530381"
] | 0.60354215 | 0 |
Exports headers to a PO entry | public function exportHeaders()
{
$headerString = '';
foreach($this->meta as $header => $value) {
$headerString.= "$header: $value\n";
}
$poified = self::poify($headerString);
$poified = 'msgid ""' . "\n" .
'msgstr ' . rtrim($poified);
return $poified;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _writeHeader()\n {\n \tfwrite($this->_fileForExport, \"availability\\tid\\tproduct_type\\ttitle\\tdescription\\tprice\\tcondition\\tlink\\timage_link\\texpiration_date\\tgtin\\tbrand\\tmpn\\tgoogle_product_category\\tgender\\tage_group\\tsize\\tcolor\");\n\n if (isset($this->_settings[\"froogle_location\"]) && $this->_settings[\"froogle_location\"] != null)\n {\n \tfwrite($this->_fileForExport, \"\\tlocation\");\n }\n if (isset($this->_settings[\"froogle_payment_notes\"]) && $this->_settings[\"froogle_payment_notes\"] != null)\n {\n \tfwrite($this->_fileForExport, \"\\tpayment_notes\");\n }\n if (isset($this->_settings[\"froogle_payment_accepted\"]) && $this->_settings[\"froogle_payment_accepted\"] != null)\n {\n fwrite($this->_fileForExport, \"\\tpayment_accepted\");\n }\n fwrite($this->_fileForExport, \"\\n\");\n }",
"public function output_headers() {\n\t\theader( \"Content-type: text/csv\" );\n\t\theader( \"Content-Disposition: attachment; filename=download-monitor-export.csv\" );\n\t\theader( \"Pragma: no-cache\" );\n\t\theader( \"Expires: 0\" );\n\t}",
"function getHeaderExportBill($o = array()){\n\t$field = isset($o['field']) ? $o['field'] : array();\n\t$title = isset($o['title']) ? $o['title'] : '';\n\t$tax = isset($o['tax']) && $o['tax'] == true ? $o['tax'] : false;\n\t$file_name = isset($o['file_name']) ? $o['file_name'] : '';\n\t$bg_color = isset($o['bg_color']) ? $o['bg_color'] : 'yellow';\n\t$customerInfo = isset($o['customerInfo']) ? $o['customerInfo'] : false;\n\t$cp = count($field);\n\n\t$address = '';\n\n\n\t$html = '<tr class=\"sui-row\">';\n\t$html .= '<td class=\"sui-cell\" colspan=\"'.$cp.'\" style=\"text-align:center;font-weight:bold;font-size:14pt\">'.$title.'</td>';\n\t$html .= '</tr>';\n\n\t$html .= '<tr class=\"sui-row\">';\n\t$html .= '<td class=\"sui-cell\" colspan=\"'.$cp.'\" style=\"text-align:center;font-size:10pt\"></td>';\n\t$html .= '</tr>';\n\n\n\t$html .= '<tr class=\"sui-row\">';\n\t$html .= '<td class=\"sui-cell\" colspan=\"'.$cp.'\"></td>';\n\t$html .= '</tr>';\n\n\tif(!empty($field)){\n\t\t$html .='<tr class=\"sui-columnheader\">';\n\t\tforeach ($field as $f){\n\t\t\t$name = $f; $width='auto';\n\t\t\tif(is_array($f)){\n\t\t\t\t$name = $f['name'];\n\t\t\t\t$width = isset($f['width']) ? $f['width'] : $width;\n\t\t\t}\n\t\t\t$html .= '<th class=\"sui-headercell\" style=\"background-color:'.$bg_color.'; border:0.5pt solid black;width:'.$width.'\"><b class=\"sui-link\">'.$name.'</b></th>';\n\t\t}\n\t\t$html .='</tr>';\n\t}\n\n\treturn $html;\n}",
"public function globo_exim_export_template() {\n\t\t$csv = new CSV();\n\t\t\n\t\t// set headings\n\t\tif( $_GET['download_type'] == 'company' ) {\n\t\t\t$csv->setHeading( $this->post_heading );\t\n\t\t} else {\n\t\t\t$csv->setHeading( $this->industry_heading );\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t \n\t\t// output the csv\n\t\t$csv->output();\n\t\t\n\t\t// clear the buffer\n\t\t$csv->clear();\n\n\n\t\twp_die();\n\n }",
"function export_send_header($rows, $output='csv', $filename='data') {\n switch($output) {\n case 'csv':\n // output headers so that the file is downloaded rather than displayed\n header('Content-Type: text/csv; charset=utf-8');\n header('Content-Disposition: attachment; filename='.$filename.'.csv');\n if(sizeof($rows) == 0)\n exit;\n\n // Create the header data\n $header = array_keys($rows[0]);\n\n // create a file pointer connected to the output stream\n $output = fopen('php://output', 'w');\n fputcsv($output, $header);\n fclose($output);\n break;\n\n case 'json':\n header('Content-Type: application/json');\n echo(\"[\");\n break;\n }\n}",
"public function doHeaders() { }",
"public static function headers();",
"public function createheader()\n {\n //\n }",
"public function export_headers( $headers = array() ) {\n\n\t\t\t$headers['wc_sc_payment_method_ids'] = __( 'Payment methods', 'woocommerce-smart-coupons' );\n\n\t\t\treturn $headers;\n\n\t\t}",
"abstract function printHeader();",
"function print_header(){\n\t\tglobal $worksheet, $xlsRow;\n\n\t\t$worksheet->set_column(0, 0, 10);\n\t\t$worksheet->set_column(1, 1, 35);\n\t\t$worksheet->set_column(2, 2, 35);\n\t\t$worksheet->set_column(3, 3, 10);\n\t\t$worksheet->set_column(4, 4, 30);\n\t\t$worksheet->set_column(5, 5, 15);\n\t\t$worksheet->set_column(6, 6, 15);\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"ลำดับที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"ชื่อ-สกุล\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 2, \"ตำแหน่ง/ระดับ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 3, \"เลขที่ตำแหน่ง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 4, \"$ORG_TITLE\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"วันที่เริ่มรับราชการ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"วันเดือนปีเกิด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t}",
"function print_header(){\n\t\tglobal $worksheet, $xlsRow;\n\n\t\t$worksheet->set_column(0, 0, 6);\n\t\t$worksheet->set_column(1, 1, 10);\n\t\t$worksheet->set_column(2, 2, 35);\n\t\t$worksheet->set_column(3, 3, 35);\n\t\t$worksheet->set_column(4, 4, 15);\n\t\t$worksheet->set_column(5, 5, 10);\n\t\t$worksheet->set_column(6, 6, 30);\n\t\t$worksheet->set_column(7, 7, 30);\n\t\t$worksheet->set_column(8, 8, 30);\n\t\t$worksheet->set_column(9, 9, 40);\n\n\t\tset_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0);\n\t\t\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"ลำดับที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"เลขที่ตำแหน่ง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 2, \"ชื่อตำแหน่งในการบริหารงาน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 3, \"ชื่อตำแหน่งในสายงาน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 4, \"ประเภทตำแหน่ง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"ระดับตำแหน่ง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"$ORG_TITLE\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 7, \"$ORG_TITLE1\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 8, \"$ORG_TITLE2\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 9, \"หมายเหตุ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t}",
"public function writeHeaders()\n {\n $headers = $this->getStatus();\n foreach ($headers as $name => $value) {\n $name = str_replace('_', '-', $name);\n header(\"x-bucket-{$name}: {$value}\");\n }\n }",
"function csvHeaders($outfile) {\n $headers = [\n 'Cache-Control' => 'must-revalidate, post-check=0, pre-check=0'\n , 'Content-type' => 'text/csv'\n , 'Content-Disposition' => \"attachment; filename={$outfile}\"\n , 'Expires' => '0'\n , 'Pragma' => 'public'\n ];\n return $headers;\n }",
"private function _exportHeaders($type, $name)\n {\n // For some reason, IE has trouble handling content types under SSL\n // (possibly only when self-signed certificates are involved -- further\n // testing is needed). For now, as a work-around, let's always use the\n // text/plain content type when we're dealing with IE and SSL -- the\n // file extension should still allow the browser to do the right thing.\n if (array_key_exists('HTTPS', $_SERVER) && ($_SERVER['HTTPS'] == 'on')\n && strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE')\n ) {\n $type = 'text/plain';\n }\n header('Content-type: ' . $type);\n header(\"Content-Disposition: attachment; filename=\\\"{$name}\\\";\");\n }",
"public function buildHeader();",
"protected function export($data): void\n {\n if(!empty($data) && $this->hasHeader) {\n $header = join($this->delimiter, array_keys((array) $data[0]));\n\n array_push($this->header, $header);\n }\n\n \n foreach($data as $row) {\n $columns = join($this->delimiter, array_values((array) $row));\n \n array_push($this->body, $columns);\n }\n }",
"function Page_Exporting() {\n\n\t\t//$this->ExportDoc->Text = \"my header\"; // Export header\n\t\t//return FALSE; // Return FALSE to skip default export and use Row_Export event\n\n\t\treturn TRUE; // Return TRUE to use default export and skip Row_Export event\n\t}",
"function Page_Exporting() {\n\n\t\t//$this->ExportDoc->Text = \"my header\"; // Export header\n\t\t//return FALSE; // Return FALSE to skip default export and use Row_Export event\n\n\t\treturn TRUE; // Return TRUE to use default export and skip Row_Export event\n\t}",
"function Page_Exporting() {\n\n\t\t//$this->ExportDoc->Text = \"my header\"; // Export header\n\t\t//return FALSE; // Return FALSE to skip default export and use Row_Export event\n\n\t\treturn TRUE; // Return TRUE to use default export and skip Row_Export event\n\t}",
"function Page_Exporting() {\n\n\t\t//$this->ExportDoc->Text = \"my header\"; // Export header\n\t\t//return FALSE; // Return FALSE to skip default export and use Row_Export event\n\n\t\treturn TRUE; // Return TRUE to use default export and skip Row_Export event\n\t}",
"function Page_Exporting() {\n\n\t\t//$this->ExportDoc->Text = \"my header\"; // Export header\n\t\t//return FALSE; // Return FALSE to skip default export and use Row_Export event\n\n\t\treturn TRUE; // Return TRUE to use default export and skip Row_Export event\n\t}",
"function Page_Exporting() {\n\n\t\t//$this->ExportDoc->Text = \"my header\"; // Export header\n\t\t//return FALSE; // Return FALSE to skip default export and use Row_Export event\n\n\t\treturn TRUE; // Return TRUE to use default export and skip Row_Export event\n\t}",
"function Page_Exporting() {\n\n\t\t//$this->ExportDoc->Text = \"my header\"; // Export header\n\t\t//return FALSE; // Return FALSE to skip default export and use Row_Export event\n\n\t\treturn TRUE; // Return TRUE to use default export and skip Row_Export event\n\t}",
"function Page_Exporting() {\n\n\t\t//$this->ExportDoc->Text = \"my header\"; // Export header\n\t\t//return FALSE; // Return FALSE to skip default export and use Row_Export event\n\n\t\treturn TRUE; // Return TRUE to use default export and skip Row_Export event\n\t}",
"function Page_Exporting() {\n\n\t\t//$this->ExportDoc->Text = \"my header\"; // Export header\n\t\t//return FALSE; // Return FALSE to skip default export and use Row_Export event\n\n\t\treturn TRUE; // Return TRUE to use default export and skip Row_Export event\n\t}",
"protected function prepare_headers(&$mpdf){\n global $ID;\n global $REV;\n global $conf;\n\n if($_GET['pdfbook_title']){\n $title = $_GET['pdfbook_title'];\n }else{\n $title = p_get_first_heading($ID);\n }\n if(!$title) $title = noNS($ID);\n\n // prepare replacements\n $replace = array(\n '@ID@' => $ID,\n '@PAGE@' => '{PAGENO}',\n '@PAGES@' => '{nb}',\n '@TITLE@' => $title,\n '@WIKI@' => $conf['title'],\n '@WIKIURL@' => DOKU_URL,\n '@UPDATE@' => dformat(filemtime(wikiFN($ID,$REV))),\n '@PAGEURL@' => wl($ID,($REV)?array('rev'=>$REV):false, true, \"&\"),\n '@DATE@' => dformat(time()),\n );\n\n // do the replacements\n $fo = str_replace(array_keys($replace), array_values($replace), $this->getConf(\"footer_odd\"));\n $fe = str_replace(array_keys($replace), array_values($replace), $this->getConf(\"footer_even\"));\n $ho = str_replace(array_keys($replace), array_values($replace), $this->getConf(\"header_odd\"));\n $he = str_replace(array_keys($replace), array_values($replace), $this->getConf(\"header_even\"));\n\n // set the headers\n\tif($this->getConf(\"html_header\")) {\t\t\n\t\t$mpdf->SetHTMLHeader($ho);\n\t\t$mpdf->SetHTMLHeader($he, 'E');\n\t}else{\n\t $mpdf->SetHeader($ho);\n \t$mpdf->SetHeader($he, 'E');\n\t}\n\t// set the footers\n\tif($this->getConf(\"html_footer\")) {\t\t\n\t $mpdf->SetHTMLFooter($fo);\n\t $mpdf->SetHTMLFooter($fe, 'E');\n\t}else{\n\t $mpdf->SetFooter($fo);\n\t $mpdf->SetFooter($fe, 'E');\n\t}\n\n // title\n $mpdf->SetTitle($title);\n }",
"function print_header(){\n\t\tglobal $worksheet, $xlsRow;\n\n\t\t$worksheet->set_column(0, 0, 6);\n\t\t$worksheet->set_column(1, 1, 6);\n\t\t$worksheet->set_column(2, 2, 30);\n\t\t$worksheet->set_column(3, 3, 25);\n\t\t$worksheet->set_column(4, 4, 8);\n\t\t$worksheet->set_column(5, 5, 12);\n\t\t$worksheet->set_column(6, 6, 30);\n\t\t$worksheet->set_column(7, 7, 25);\n\t\t$worksheet->set_column(8, 8, 8);\n\t\t$worksheet->set_column(9, 9, 12);\n\t\t$worksheet->set_column(10, 10, 8);\n\t\t$worksheet->set_column(11, 11, 20);\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"ลำดับ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"ตำแหน่ง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 2, \"ส่วนราชการและตำแหน่งที่กำหนดไว้เดิม\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 3, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 4, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 5, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 6, \"ส่วนราชการและตำแหน่งที่ขอกำหนดใหม่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 7, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 8, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 9, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 10, \"อัตรา\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 11, \"หมายเหตุ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"ที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"เลขที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 2, \"ชื่อตำแหน่งในการบริหารงาน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 3, \"ชื่อตำแหน่งในสายงาน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 4, \"ประเภท\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"ระดับ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"ชื่อตำแหน่งในการบริหารงาน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 7, \"ชื่อตำแหน่งในสายงาน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 8, \"ประเภท\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 9, \"ระดับ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 10, \"เงินเดือน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 11, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 2, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 3, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 4, \"ตำแหน่ง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 7, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 8, \"ตำแหน่ง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 9, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 10, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 11, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t}",
"public function actionExport(){\n// $allModels = $provider->getModels();\n// \\moonland\\phpexcel\\Excel::export([\n// 'models' => $allModels,\n// 'columns' => ['column1', 'column2', 'column3'], //without header working, because the header will be get label from attribute label. \n// ]);\n \n $person = User::findBySql(self::ExcelProvider())->all();\n var_dump($person);\n \\moonland\\phpexcel\\Excel::export([\n 'savePath' => \"\",\n 'format' => 'Excel5',\n 'models' => $person,\n\n 'columns' => ['email'],\n//without header working, because the header will be get label from attribute label.\n// 'headers' => ['Id' => 'IDs','Course' => 'Cuzos', 'Code' => 'Codes'],\n\n ]);\n }",
"public function Header() {\n $this->imprime($this->format['header']);\n }"
] | [
"0.6360453",
"0.63546973",
"0.61842656",
"0.61653304",
"0.59687495",
"0.5951972",
"0.5951355",
"0.58710694",
"0.58667135",
"0.58662915",
"0.5863792",
"0.5845372",
"0.5784246",
"0.57784474",
"0.57725275",
"0.57651526",
"0.57474947",
"0.57239777",
"0.57239777",
"0.57239777",
"0.57239777",
"0.57239777",
"0.57239777",
"0.57239777",
"0.57239777",
"0.57239777",
"0.5721494",
"0.5717434",
"0.5693121",
"0.56563973"
] | 0.6954299 | 0 |
Exports all entries to PO format | public function exportEntries()
{
//TODO sorting
return implode("\n\n", array_map(array('self', 'exportEntry'), $this->getEntries()));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function write_entries() {\n }",
"public function exportAction()\n\t{\n\t\t// start the model to find available options\n\t\t$model = new $this->_primaryModel;\n\t\t\n\t\t// fetch items\n\t\t$items = $model->fetchNotTrashed()->toArray();\n\t\t\t\t\t\t\n\t\t// fetch field names\n\t\t$fields = $model->info(Zend_Db_Table_Abstract::COLS);\n\t\t\t\t\n\t\t// construct filename\n\t\t$filename = str_replace(\"Default_Model_\", \"\", $this->_primaryModel);\n\t\t$filename .= date(\"_Y-m-d_H-i\");\n\t\t$filename .= \".csv\";\n\t\t\n\t\t// create file\n\t\t$file = APPLICATION_PATH . '/data/exports/'.$filename;\n\t\t$fp = fopen($file, 'w');\n\t\tchmod($file, 0755);\n\t\t\t\t\n\t\t// add field names to start of file\n\t\tfputcsv($fp, $fields);\t\t\n\t\t\n\t\t// loop through results\n\t\tforeach ($items as $key => $values) {\n\t\t\tfputcsv($fp, $values);\n\t\t}\n\n\t\t\n\t\t// Both layout and view renderer should be disabled\n Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')->setNoRender(true);\n\n\t\t// no need for the layout\n\t\t$this->_helper->layout->disableLayout();\n\t\t$this->_response\n\t\t\t->setHeader('Content-Type', 'text/plain; charset=utf-8')\n\t\t\t->setHeader(\"Expires\",\" Mon, 26 Jul 1997 05:00:00 GMT\")\n\t\t\t->setHeader(\"Last-Modified\", gmdate(\"D,d M YH:i:s\") . \" GMT\")\n\t\t\t->setHeader(\"Cache-Control\",\"no-cache, must-revalidate\")\n\t\t\t->setHeader(\"Pragma\",\"no-cache\")\n\t\t\t->setHeader(\"Content-type\",\"text/plain\")\n\t\t\t->setHeader(\"Content-Disposition\",\"attachment; filename=\\\"\" . $filename . \"\\\"\" )\n\t\t\t->setHeader(\"Content-Description\",\"PHP/INTERBASE Generated Data\");\n\t readfile($file);\n\t}",
"function export()\n\t{\n\t\t$zip = $this->buildExportFile();\n\t\t\n\t ilUtil::deliverFile($zip, $this->object->getTitle().\".zip\", '', false, true);\n\t}",
"public function export(){\n $products = $this->Paginator->paginate($this->Products->find());\n\n $this->autoRender = false;\n $this->layout = false;\n $fileName = \"bookreport_\".date(\"d-m-y:h:s\").\".xls\";\n\n $headerRow = array(\"ID\", \"Title\", \"Type\", \"Description\", \"Price\", \"Rating\");\n $data = array();\n foreach ($products as $product) {\n array_push($data, array($product->id, $product->description, $product->title, $product->price, $product->rating));\n }\n //debug($data);\n ini_set('max_execution_time', 1600); //increase max_execution_time to 10 min if data set is very large\n $fileContent = implode(\"\\t \", $headerRow).\"\\n\";\n foreach($data as $result) {\n $fileContent .= implode(\"\\t \", $result).\"\\n\";\n }\n header('Content-type: application/ms-excel'); /// you can set csv format\n header('Content-Disposition: attachment; filename='.$fileName);\n echo $fileContent;\n }",
"public function exportall()\n\t{\n\t\t// Set memory limit to unlimited to allow heavy usage\n\t\tini_set('memory_limit', '-1');\n\n\t\t$this->load->model('adif_data');\n\n\t\t$data['qsos'] = $this->adif_data->export_all();\n\n\n\t\t$this->load->view('adif/data/exportall', $data);\n\t}",
"function write_export_data( ) {\n\n\t\t$output = '';\n\t\t$sep = ',';\n\t\t$quo = '\"';\n\n\t\t//header to be downloaded and saved locally\n\t\t//$output .= \"header('Content-Disposition: attachment; filename=' . $this->export_fname)\" . \"\\n\";\n\t\t//$output .= \"header('Content-Type: text/plain')\" . \"\\n\";\n\t\t\n\t\t//ID, post_title, post.php?post=ID&action=edit, /post_name/, idies_update_status, idies_update_reviewer, idies_update_comment, post_modified\n\t\t$output .= $quo . implode( $quo . $sep . $quo , $this->csv_fields ). $quo . \"\\n\"; \n\t\t\n\t\t/* \n\t\t$output .= \n\t\t\t$quo . \"ID\" . $quo . $sep . \n\t\t\t$quo . \"Title\" . $quo . $sep .\n\t\t\t$quo . \"Edit\" . $quo . $sep .\n\t\t\t$quo . \"View\" . $quo . $sep .\n\t\t\t$quo . \"Status\" . $quo . $sep .\n\t\t\t$quo . \"Reviewer\" . $quo . $sep .\n\t\t\t$quo . \"Comment\" . $quo . $sep .\n\t\t\t$quo . \"Last Revised\" . $quo . \"\\n\";\n\t\t*/\n\t\t\t\n\t\tforeach ( $this->all_pages as $thispage ){\n\t\t\t$output .= \n\t\t\t\t$thispage->ID . $sep . \n\t\t\t\t$quo . $thispage->post_title . $quo . $sep . \n\t\t\t\t$quo . site_url( \"wp-admin/post.php?post=\" . $thispage->ID . \"&action=edit\" ) . $quo . $sep . \n\t\t\t\t$quo . get_the_permalink( $thispage->ID ) . $quo . $sep . \n\t\t\t\t$quo . $this->statuses[ get_post_meta( $thispage->ID, \"idies_update_status\" , true )] . $quo . $sep . \n\t\t\t\t$quo . get_post_meta( $thispage->ID, \"idies_update_reviewer\" , true ) . $quo . $sep . \n\t\t\t\t$quo . get_post_meta( $thispage->ID, \"idies_update_comment\" , true ) . $quo . $sep . \n\t\t\t\t$quo . $thispage->post_modified . $quo . \"\\n\";\n\t\t}\n\t\t\n\t\t//write temp file\n\t\t$expfile = fopen( $this->default_tmppath . $this->export_fname , \"w\") or die(\"Unable to create \". $this->default_tmppath . $this->export_fname .\" file.\");\n\t\tfwrite($expfile, $output);\n\t\tfclose($expfile);\n\t\t\n\t}",
"public function dataToExport();",
"function export()\n {\n $dict = $this->getDictionary();\n $export = array();\n \n foreach ( $dict as $word )\n {\n $export[] = array( $word['name'], $word['definition'] );\n }\n \n return $export;\n }",
"public function export();",
"public function export();",
"public function export();",
"public function export(){\n\n // Create filter from contacts selected\n if(App::request()->getParams('contacts')) {\n $filter = new DBExample(array(\n 'userId' => App::session()->getUser()->id,\n 'id' => array(\n '$in' => explode(',', App::request()->getParams('contacts'))\n )\n ));\n }\n else {\n $filter = new DBExample(array(\n 'userId' => App::session()->getUser()->id,\n ));\n }\n\n // Get contacts from db\n $listContacts = HContact::getListByExample($filter, 'id', array(), array('firstName' => DB::SORT_ASC));\n\n // Create temporary file\n $tempFileName = 'contacts_' . uniqid() . '.csv';\n $file = fopen( Plugin::get('h-connect')->getPublicUserfilesDir() . $tempFileName, \"w\");\n\n $questions = HContactQuestion::getAll();\n $dataTitle = array(\n 'lastName', \n 'firstName', \n 'job', \n 'company',\n 'phoneNumber',\n 'cellNumber',\n 'personalNumber',\n 'email',\n 'address',\n 'city',\n 'postcode',\n 'country'\n );\n\n foreach ($questions as $key => $q) {\n if($q->type == 'file'){\n unset($questions[$key]);\n }\n else{\n $dataTitle[] = $q->name; \n } \n }\n\n // Write title in first line\n fputcsv($file, $dataTitle, ',');\n\n // For each contacts add data on one line\n foreach ($listContacts as $contact){\n $data = array(\n $contact->lastName, \n $contact->firstName, \n $contact->job, \n $contact->company,\n $contact->phoneNumber,\n $contact->cellNumber,\n $contact->personalNumber,\n $contact->email,\n $contact->address,\n $contact->city,\n $contact->postcode,\n $contact->country\n );\n\n foreach ($questions as $q) {\n $data[] = HContactValue::getValueByName($q->name, $contact->id);\n }\n\n fputcsv($file, $data, ',');\n }\n\n // Close file\n fclose($file);\n\n // Read data\n $data = file_get_contents(Plugin::get('h-connect')->getPublicUserfilesDir() . $tempFileName);\n\n // Remove remporaray file\n shell_exec('rm ' . Plugin::get('h-connect')->getPublicUserfilesDir() . $tempFileName);\n\n // Create response\n $response = App::response();\n $response->setContentType('text');\n $response->header('Content-Disposition', 'attachment; filename=\"contacts.csv\"');\n\n return $data;\n }",
"public function prepare_data_to_export() {\n\t\t$entry_ids = evf_search_entries(\n\t\t\tarray(\n\t\t\t\t'limit' => -1,\n\t\t\t\t'order' => 'ASC',\n\t\t\t\t'form_id' => $this->form_id,\n\t\t\t)\n\t\t);\n\n\t\t// Get the entries.\n\t\t$entries = array_map( 'evf_get_entry', $entry_ids );\n\t\t$this->row_data = array();\n\n\t\tforeach ( $entries as $entry ) {\n\t\t\t$this->row_data[] = $this->generate_row_data( $entry );\n\t\t}\n\n\t\treturn $this->row_data;\n\t}",
"public function exportData();",
"function diglabs_export_to_file( $rows )\n{\n ob_end_clean();\n\n $fileName = 'items.txt';\n header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' );\n header( 'Content-Description: File Transfer' );\n header( 'Content-type: text/plain' );\n header( 'Content-Disposition: attachment; filename=' . $fileName );\n header( 'Expires: 0' );\n header( 'Pragma: public' );\n\n $fh = @fopen( 'php://output', 'w' );\n\n $header = array(\n \"Xfer Date\",\n \"Create Date\",\n \"Id\",\n \"Person\",\n \"Is Live\",\n \"Amount\",\n \"Fee\",\n \"Xfer\",\n \"Description\"\n );\n $header_line = '#' . join( \"\\t\", $header ) . \"\\n\";\n fwrite( $fh, $header_line );\n\n foreach( $rows as $row )\n {\n $line_data = array(\n $row[ 'transferred' ],\n $row[ 'created' ],\n $row[ 'charge_id' ],\n $row[ 'name' ],\n $row[ 'is_live' ],\n number_format( $row[ 'amount' ], 2 ),\n number_format( $row[ 'fee' ], 2 ),\n number_format( $row[ 'amount' ] - $row[ 'fee' ], 2 ),\n $row[ 'description' ]\n );\n $line = join( \"\\t\", $line_data ) . \"\\n\";\n fwrite( $fh, $line );\n }\n\n fclose( $fh );\n exit();\n}",
"abstract protected function export_format($contents);",
"public function export(){\n return $this->toArray();\n }",
"function export(){\n\t $options = array(\n\t 'conditions' => $this->getIgnoreConditions()\n\t );\n\t return parent::export($options);\n\t}",
"public function export()\n {\n $headers = array(\n 'naam organisatie' => 'OrganisationName',\n 'straat' => 'Street',\n 'huisnummer' => 'NrAndBox',\n 'postcode' => 'ZipCode',\n 'woonplaats' => 'Village',\n 'email' => 'Email',\n 'telefoon' => 'Telephone',\n 'website' => 'Website',\n 'contact voornaam' => 'contact_firstname',\n 'contact achternaam' => 'contact_lastname',\n 'omschrijving' => 'Description',\n 'omschrijving (frans)' => 'Description_Translated',\n 'wedstrijd' => 'marketing_campaign_disclaimer',\n 'geimporteerd' => 'is_csv_import',\n 'status' => 'FK_ApplicationStatus',\n 'aangemaakt' => 'created_at',\n );\n\n $apps = $this->results()->get(array_values($headers));\n\n $file = Export::go($apps, array_keys($headers));\n\n return Response::download($file);\n }",
"function export( $args, $assoc_args ) {\n extract( $assoc_args );\n\n $field_groups = [];\n\n if ( isset( $field_group ) ) {\n $name = sanitize_title( $field_group );\n $field_groups = [acf_get_field_group($name)];\n if ( empty( $field_groups ) ) {\n WP_CLI::error( 'No fieldgroups found that match this field group name' );\n }\n } else if ( isset( $all ) ) {\n $field_groups = acf_get_field_groups();\n } else {\n $choice = $this->menu_choice_export_field_group();\n\n if ( $choice == 'all' ) {\n $field_groups = acf_get_field_groups();\n } else {\n $field_groups = [acf_get_field_group($choice)];\n }\n }\n\n if ( empty( $export_path ) ) {\n $export_path = $this->menu_choice_export_path();\n }\n\n $export_path = \\ACFWPCLI\\CLIUtils::expand_tilde( $export_path );\n\n if ( ! is_dir( $export_path ) && ! mkdir( $export_path, 0755, false ) ) {\n WP_CLI::error( 'fieldgroup directory exists or cant be created!' );\n }\n\n // var_dump($field_groups);exit;\n\n foreach ( $field_groups as $field_group ) {\n $file = $export_path . sanitize_title( $field_group['title'] ) . '.json';\n\n \n $field_group = \\ACFWPCLI\\FieldGroup::to_array( $field_group );\n \\ACFWPCLI\\FieldGroup::to_json_file( $field_group, $file );\n WP_CLI::success( \"Exported field group: {$field_group['title']}\" );\n }\n }",
"function exportSpec(&$sheet){\n $headers=array('table','forder');\n $langs=array_keys($GLOBALS['TZR_LANGUAGES']);\n foreach($langs as $lg) $headers[]='label['.$lg.']';\n $headers=array_merge($headers,array('field','ftype','fcount','compulsory','queryable','translatable','browsable','multivalued','published','target'));\n $rows=array();\n $table=$this->getTable();\n foreach($this->desc as $fn=>&$f){\n $row=array();\n $row['table']=$table;\n $row['forder']=$f->forder;\n $labels=array();\n $rs=&selectQuery('select * from MSGS where MTAB=\"'.$table.'\" and FIELD=\"'.$fn.'\" and MLANG in (\"'.implode('\",\"',$langs).'\")');\n while($rs && $ors=$rs->fetch()) $labels[$ors['MLANG']]=$ors['MTXT'];\n foreach($langs as $lg) $row['label['.$lg.']']=$labels[$lg];\n $row['field']=$f->field;\n $row['ftype']=$f->ftype;\n $row['fcount']=$f->fcount;\n $row['compulsory']=$f->compulsory;\n $row['queryable']=$f->queryable;\n $row['translatable']=$f->translatable;\n $row['browsable']=$f->browsable;\n $row['multivalued']=$f->multivalued;\n $row['published']=$f->published;\n $row['target']=$f->target;\n if($row['target']=='%') $row['target']='';\n $opts=$f->_options->getAllValues($f, array('for_export' => 1));\n $row=array_merge($row,$opts);\n foreach($opts as $optn=>$opt) if(!in_array($optn,$headers)) $headers[]=$optn;\n $rows[]=$row;\n }\n foreach($headers as $i=>$h) {\n $sheet->setCellValueByColumnAndRow($i, 1, $h);\n }\n $line=1;\n foreach($rows as $row){\n $line++;\n foreach($headers as $i=>$h){\n\tif(array_key_exists($h,$row)) $sheet->setCellValueByColumnAndRow($i, $line, $row[$h]);\n }\n }\n }",
"public function all_to_excel() {\n $this->load->library('export');\n $sql = $this->photoid->get_reports();\n $filename = 'DTIS_all_photoid_'.date('Y-m-d-Hi');\n\t\t\t$this->export->to_excel($sql, $filename); \n\t\t\t\n }",
"public function export()\n\t{\n\t\treturn new Collection(array(\n\t\t\t'events' => Event::allSortById(array('id', 'readable_id', 'short_name', 'name', 'attempts', 'show_average')),\n\t\t\t'rounds' => Round::all(),\n\t\t\t'competitions' => Competition::all(array('id', 'short_name', 'name', 'date', 'events')),\n\t\t\t'users' => User::all(array('id', 'club_id', 'name', 'last_name')),\n\t\t));\n\t}",
"function exportar()\n\t{\n\t\tif (!$this->iniciada()) {\n\t\t\tthrow new toba_error(\"PERSONALIZACION: Debe iniciar la personalización antes de exportarla\");\n\t\t}\n\t\t\n\t\tif ($this->existe_exportacion_incompleta() &&\t$this->consola->dialogo_simple('La exportación anterior fue incompleta?', 's') == 's' ) {\n\t\t\t$this->restaurar_schema_trabajo();\n\t\t}\n\t\t$this->crear_directorios();\n\t\t$this->consola->mensaje('Generando esquema alterno..');\n\t\t$this->generar_schema_diff();\t\t//Genero el schema con los metadatos originales para hacer el diff\t\t\n\t\t$this->consola->mensaje('Calculando diferenciales..');\n\t\t$this->exportar_tablas();\n\t\t$this->exportar_componentes();\t//Aca hay que asegurarse que se agregue la clase del componente como descripcion\n\t\t$this->consola->mensaje('Restaurando entorno de trabajo..');\n\t\t$this->restaurar_schema_trabajo();\n\t}",
"public static function exportEntry(&$entry)\n {\n if (is_null($entry->getString())) {\n return false;\n }\n $po = array();\n $comments = $entry->getTranslatorComment();\n if (!empty($comments)) {\n $po[] = self::commentBlock($comments);\n }\n $comments = $entry->getDeveloperComment();\n if (!empty($comments)) {\n $po[] = self::commentBlock($comments, '.');\n }\n $references = $entry->getReference();\n if (!empty($references)) {\n $po[] = self::commentBlock(implode(' ', $references), ':');\n }\n $flags = $entry->getFlags();\n if (!empty($flags)) {\n $po[] = self::commentBlock(implode(', ', $flags), ',');\n }\n $context = $entry->getContext();\n if (!empty($context)) {\n $po[] = 'msgctxt ' . self::poify($context);\n }\n $po[] = 'msgid ' . self::poify($entry->getString());\n $translations = $entry->getTranslations();\n if (!$entry->isPlural()) {\n $translation = empty($translations) ? '' : $translations[0];\n $po[] = 'msgstr ' . self::poify($translation);\n } else {\n $po[] = 'msgid_plural ' . self::poify($entry->getPlural());\n $translations = empty($translations) ? array('', '') : $translations;\n foreach ($translations as $i => $translation) {\n $po[] = 'msgstr[' . $i . '] ' . self::poify($translation);\n }\n }\n return implode(\"\\n\", $po);\n }",
"public function generateExport()\n {\n }",
"function action_exportpm()\n\t{\n\t\t\n\t\tDB::init();\n\t\t\n\t\t$q = 'SELECT COUNT(*) FROM mybb_privatemessages WHERE folder=1 GROUP BY toid';\n\t\t\n\t\tif ($req = DB::query($q))\n\t\t{\n\t\t\t$res = $req->fetchAll();\n\t\t\t\n\t\t\tvar_export($res);\n\t\t\t\n\t\t}\n\t\t\n\t}",
"function ExportData() {\n\t\tglobal $acc_setting_coa;\n\t\t$sCsvStr = \"\";\n\n\t\t// Default export style\n\t\t$sExportStyle = \"h\";\n\n\t\t// Load recordset\n\t\t$rs = $this->LoadRecordset();\n\t\t$this->lTotalRecs = $rs->RecordCount();\n\t\t$this->lStartRec = 1;\n\n\t\t// Export all\n\t\tif ($acc_setting_coa->ExportAll) {\n\t\t\t$this->lStopRec = $this->lTotalRecs;\n\t\t} else { // Export 1 page only\n\t\t\t$this->SetUpStartRec(); // Set up start record position\n\n\t\t\t// Set the last record to display\n\t\t\tif ($this->lDisplayRecs < 0) {\n\t\t\t\t$this->lStopRec = $this->lTotalRecs;\n\t\t\t} else {\n\t\t\t\t$this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;\n\t\t\t}\n\t\t}\n\t\tif ($acc_setting_coa->Export == \"xml\") {\n\t\t\t$XmlDoc = new cXMLDocument();\n\t\t} else {\n\t\t\techo ew_ExportHeader($acc_setting_coa->Export);\n\n\t\t\t// Horizontal format, write header\n\t\t\tif ($sExportStyle <> \"v\" || $acc_setting_coa->Export == \"csv\") {\n\t\t\t\t$sExportStr = \"\";\n\t\t\t\techo ew_ExportLine($sExportStr, $acc_setting_coa->Export);\n\t\t\t}\n\t\t}\n\n\t\t// Move to first record\n\t\t$this->lRecCnt = $this->lStartRec - 1;\n\t\tif (!$rs->EOF) {\n\t\t\t$rs->MoveFirst();\n\t\t\t$rs->Move($this->lStartRec - 1);\n\t\t}\n\t\twhile (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {\n\t\t\t$this->lRecCnt++;\n\t\t\tif (intval($this->lRecCnt) >= intval($this->lStartRec)) {\n\t\t\t\t$this->LoadRowValues($rs);\n\n\t\t\t\t// Render row for display\n\t\t\t\t$acc_setting_coa->RowType = EW_ROWTYPE_VIEW; // Render view\n\t\t\t\t$this->RenderRow();\n\t\t\t\tif ($acc_setting_coa->Export == \"xml\") {\n\t\t\t\t\t$XmlDoc->BeginRow();\n\t\t\t\t\t$XmlDoc->EndRow();\n\t\t\t\t} else {\n\t\t\t\t\tif ($sExportStyle == \"v\" && $acc_setting_coa->Export <> \"csv\") { // Vertical format\n\t\t\t\t\t}\telse { // Horizontal format\n\t\t\t\t\t\t$sExportStr = \"\";\n\t\t\t\t\t\techo ew_ExportLine($sExportStr, $acc_setting_coa->Export);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$rs->MoveNext();\n\t\t}\n\n\t\t// Close recordset\n\t\t$rs->Close();\n\t\tif ($acc_setting_coa->Export == \"xml\") {\n\t\t\theader(\"Content-Type: text/xml\");\n\t\t\techo $XmlDoc->XML();\n\t\t} else {\n\t\t\techo ew_ExportFooter($acc_setting_coa->Export);\n\t\t}\n\t}",
"public function globo_exim_export_template() {\n\t\t$csv = new CSV();\n\t\t\n\t\t// set headings\n\t\tif( $_GET['download_type'] == 'company' ) {\n\t\t\t$csv->setHeading( $this->post_heading );\t\n\t\t} else {\n\t\t\t$csv->setHeading( $this->industry_heading );\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t \n\t\t// output the csv\n\t\t$csv->output();\n\t\t\n\t\t// clear the buffer\n\t\t$csv->clear();\n\n\n\t\twp_die();\n\n }",
"public function export()\n\t{\n\t\tJSession::checkToken() or jexit('Invalid Token');\n\n\t\t$this->sendHeaders(\"events.csv\", \"text/csv\");\n\t\t$this->getModel()->getCsv();\n\t\tjexit();\n\t}"
] | [
"0.61677957",
"0.6075461",
"0.5958144",
"0.5935244",
"0.5921709",
"0.58406854",
"0.58398145",
"0.5839197",
"0.5758941",
"0.5758941",
"0.5758941",
"0.5752754",
"0.5726047",
"0.56858325",
"0.5683242",
"0.5674143",
"0.56004447",
"0.5583079",
"0.55589575",
"0.54977506",
"0.5460524",
"0.5454",
"0.54405683",
"0.54334694",
"0.54198354",
"0.5400516",
"0.5392946",
"0.5375844",
"0.53677857",
"0.5365703"
] | 0.67334527 | 0 |
Inserts $with in the beginning of every new line of $string and returns the modified string | private static function prependEachLine($string, $with)
{
$php_with = var_export($with, true);
$lines = explode("\n", $string);
// do not prepend the string on the last empty line, artefact by explode
if ("\n" == substr($string, -1)) {
unset($lines[count($lines) - 1]);
}
$res = implode("\n", array_map(create_function('$x', "return $php_with.\$x;"), $lines));
// give back the empty line, we ignored above
if ("\n" == substr($string, -1)) {
$res .= "\n";
}
return $res;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function merge($string, $with, $as=NULL, $glue=NULL)\n {\n return Processor::merge($string, $with, $as, $glue);\n }",
"public function prepend(string $string): LightStreamInterface;",
"function pb_replace_with($target, $with)\n{\n global $pb_string;\n global $pb_error;\n\n // %% signifies special strings\n $target = \"%%\" . $target . \"%%\";\n \n // There's no simple function to replace the first occurence of a substring\n $pos = strpos($pb_string,$target);\n if ($pos !== false) {\n $pb_string = substr_replace($pb_string,$with,$pos,strlen($target));\n return true;\n }\n return false;\n}",
"public function prependContent($string)\r\n {\r\n $this->content = $string . $this->content;\r\n }",
"static function OnspaceBefore($string,$search){\n\t\t$string = str_replace($search,' '.$search,$string);\n\t\t$string = str_replace(' '.$search,' '.$search,$string);\n\t\treturn($string);\n\t}",
"abstract protected function with() : string;",
"public function prepend($string) {\n\t\t$this->prepend = $string;\n\t\treturn $this;\n\t}",
"static function for_each($string, $with, $as=NULL, $and=NULL, $glue=NULL)\n {\n if(!$as) {$as = 'value';}\n if(!$and) {$and = 'key';}\n \n if(!is_array($with) && $GLOBALS['X']['SETTINGS']['log_warnings']) {\n return ErrorLib::set_warning(\"No with array supplied for for_each\");\n }\n \n foreach($with as $key => $value)\n {\n $local_array = array($and => $key, $as => $value, $key => $value);\n $new_string_array[] = Processor::process_with_data($string, $local_array);\n }\n \n return join($new_string_array, $glue);\n }",
"function wrap_lines($string, $prefix, $suffix = '')\n{\n if (empty($string)) {\n return '';\n }\n\n return $prefix . str_replace(\"\\n\", $suffix . \"\\n\" . $prefix, $string) . $suffix;\n}",
"public function &appendString($string){\n\t\t$this->content += REQUIRED_VAR($string);\n\t\t$this->_writePending = true;\n\t\treturn $this;\n\t}",
"public function before(string $string): Text\n {\n Assertion::contains($this->value, $string, 'Must contain the string argument');\n return new self(substr($this->value, 0, $this->positionOf($string)));\n }",
"private function _indent_lines($string) {\n\t\treturn $this->_i.str_replace(\"\\n\", \"\\n\".$this->_i, $string);\n\t}",
"private function _wrap ($string, $width, $break = PHP_EOL) {\n\t\tif ($width <= 1)\n\t\t\t$width = $this->_strlen ($break) + 1;\n\n\t\tif ($width <= $this->_strlen ($break))\n\t\t\t$break = PHP_EOL;\n\n\n\t\t$breakLength = $this->_strlen ($break);\n\n\t\t$lines = explode (PHP_EOL, $string);\n\n\t\t$glue = array ();\n\n\t\tfor ($i = 0; $i < count ($lines); ++$i) {\n\t\t\tif ($this->_strlen ($lines[$i]) > $width) {\n\t\t\t\t$line = $lines[$i];\n\n\t\t\t\t$breakPoint = strrpos (substr ($line, 0, $width - $breakLength), ' ');\n\n\t\t\t\tif ($breakPoint !== false)\n\t\t\t\t\t$breakPoint2 = $breakPoint + 1;\n\t\t\t\telse\n\t\t\t\t\t$breakPoint2 = $breakPoint = $width - $breakLength;\n\n\t\t\t\tarray_splice ($lines, $i, 1, array (substr ($line, 0, $breakPoint) . $break, substr ($line, $breakPoint2)));\n\t\t\t\t$glue[] = $i + 1;\n\t\t\t}\n\t\t}\n\n\t\tfor ($i = count ($lines); $i >= 0; --$i) {\n\t\t\tif (in_array ($i, $glue))\n\t\t\t\tarray_splice ($lines, $i - 1, 2, array ($lines[$i - 1] . $lines[$i]));\n\t\t}\n\n\t\treturn implode (PHP_EOL, $lines);\n\t}",
"public function sequentialReplace($swapArray, $withArray, $inText)\n {\n $outText = $inText; \n $cursor = 0; \n\n foreach ($swapArray as $i => $swap) { \n\n $with = $withArray[$i]; \n\n $swapLength = strlen($swap); \n $withLength = strlen($with); \n\n $position = strpos($outText, $swap, $cursor);\n\n if ($position === false) { \n $cursor += $swapLength; \n } else { \n $outText = substr_replace($outText, $with, $position, $swapLength); \n $cursor = $position + $withLength; \n }\n\n }\n\n return $outText; \n }",
"function line_break_replace($string) \n\t{\n\t\treturn stripslashes(trim(preg_replace(\"/\\s+/\", \" \", $string)));\n\t}",
"function str_wrap($string, $wrapper) : string\n {\n return $wrapper . $string . $wrapper;\n }",
"protected function insertInputWords($string) {\n\t\tif (preg_match_all('`%(\\d+)`', $string, $matches, PREG_SET_ORDER)) {\n\t\t\tforeach ($matches as $match) {\n\t\t\t\t$string = str_replace($match[0], $this->input[$match[1] - 1], $string);\n\t\t\t}\n\t\t}\n\t\treturn $string;\n\t}",
"private function insertBeforeString($initial_string, $search_string, $add_string)\n {\n $position = strpos($initial_string, $search_string);\n if ($position !== false) {\n return substr_replace($initial_string, $add_string, $position, 0);\n }\n $this->log('[ FAILED ] Failed to locate search string');\n return $initial_string;\n }",
"public function replaceString($line, $oldToken, $newToken);",
"public function compileInsertString( $data );",
"private function insertAfterString($initial_string, $search_string, $add_string)\n {\n $position = strpos($initial_string, $search_string);\n if ($position !== false) {\n return substr_replace($initial_string, $add_string, $position + strlen($search_string), 0);\n }\n $this->log('[ FAILED ] Failed to locate search string');\n return $initial_string;\n }",
"public static function prepend(string $str, string $string): string\n {\n return (string)BaseStringy::create($str)->prepend($string);\n }",
"public function replace();",
"function str_inline(string $txt): string{\n $txt = preg_replace($regex = '/(\\s{2,}|\\\\n)/ui', ' ', $txt);\n return $txt;\n}",
"function rJ($line, $str, $pos){\n\t$space = \" \";\n\t$start = strlen($line);\n\t$spaceStop = $pos - strlen($str);\n\tfor($i = $start; $i < $spaceStop; $i++)\n\t\t$line.= $space;\n\n\t$line.=$str;\n\treturn $line;\n}",
"function quoteit($text) {\n\n\t$lines = explode(\"\\n\", $text);\n\t$quotelevel = 0;\n\t$new = \"\";\n\tforeach ($lines as $line) {\n\t\t// Count the number of '> ' strings at the beginning of the line.\n\t\t$cql = 0;\n\t\t$slen = strlen($line);\n\t\twhile ( ($slen >= ($cql+1)*2 && $line[$cql*2] == '>' && $line[$cql*2+1] == ' ') ||\n\t\t\t($slen == ($cql+1)*2 && $line[$cql*2] == '>' && $line[$cql*2+1] == \"\\r\") ||\n\t\t\t($slen == $cql*2 + 1 && $line[$cql*2] == '>'))\n\t\t\t$cql++;\n\t\t// $cql = substr_count($line, \"> \");\n\t\tif ($cql > $quotelevel) { // new quote level\n\t\t\t$newlevels = $cql - $quotelevel;\n\t\t\twhile ($newlevels) {\n\t\t\t\t$new .= \"[quote]\";\n\t\t\t\t$newlevels--;\n\t\t\t}\n\t\t\t$new .= substr($line, $cql*2) . \"\\n\";\n\t\t\t$quotelevel = $cql;\n\t\t}\n\t\telseif ($cql < $quotelevel) {\n\t\t\t$newlevels = $quotelevel - $cql;\n\t\t\twhile ($newlevels) {\n\t\t\t\t$new .= \"[/quote]\";\n\t\t\t\t$newlevels--;\n\t\t\t}\n\t\t\t$new .= \"\\n\" . substr($line, $cql*2) . \"\\n\";\n\t\t\t$quotelevel = $cql;\n\t\t}\n\t\telse\n\t\t\t$new .= substr($line, $cql*2) . \"\\n\";\n\t}\n\n\treturn $new;\n}",
"private function _appendTextProperly($insert) {\r\n\r\n\t\t$this->_text = preg_replace('/\\n*(\\[\\['.$this->_l10n->getNamespaceName(14).'|\\[\\[('.$this->_iwikiList.'):|$)/ui', \"\\n\\n{{\".$insert.\"}}\\n\\n\\\\1\", $this->_text, 1);\r\n\t}",
"static function cleanNewLines($string) {\n\n $string = preg_replace(\"/\\r\\n/\", \" \", $string);\n $string = preg_replace(\"/\\n/\", \" \", $string);\n $string = preg_replace(\"/\\r/\", \" \", $string);\n return $string;\n }",
"public function withString($string) {\n return $this->cloneInstance(\n function (StringObject $new) use ($string) {\n $new->string = $string;\n }\n );\n }",
"public function addFront($add) {\n if (substr($this->_str, 0, strlen($add)) !== $add) {\n $this->_str = $add . $this->_str;\n }\n return $this;\n }"
] | [
"0.5632233",
"0.5399653",
"0.53605694",
"0.5330618",
"0.523068",
"0.52260184",
"0.519619",
"0.51910686",
"0.5062618",
"0.5054481",
"0.50181395",
"0.50084144",
"0.49985433",
"0.49883398",
"0.4942676",
"0.49359766",
"0.4922831",
"0.4913099",
"0.48164392",
"0.48057082",
"0.47845215",
"0.4776806",
"0.47357106",
"0.47353932",
"0.47282782",
"0.4714857",
"0.46866748",
"0.46854657",
"0.4673851",
"0.46216407"
] | 0.7873136 | 0 |
Prepare a text as a comment wraps the lines and prepends and a special character to each line | private function commentBlock($text, $char = ' ')
{
$text = wordwrap($text, PO_MAX_LINE_LEN - 3);
return self::prependEachLine($text, '#' . $char . ' ');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function import_prepare_text($text) {\n\n // Replace successional empty lines by \\\\\n // (m-option lets ^ match after newlines)\n $text = preg_replace('/^\\r?\\n(?:^\\r?\\n)+/m', '\\\\\\\\\\\\\\\\', $text);\n // Then replace left over normal line breaks just by a free space\n $text = preg_replace('/\\r?\\n/', ' ', $text);\n // Finally, implement the remaining \\ \\\n $text = preg_replace('/\\\\\\\\\\\\\\\\/', '<br/>', $text);\n\n // Replace non-breaking spaces by space\n $text = preg_replace('/~/', ' ', $text);\n $text = preg_replace('/--/','-', $text);\n\n // Replace thin spaces when not in math mode\n $text = preg_replace('/\\\\\\\\,/',' ', $text);\n // Replace control spaces when not in math mode\n $text = preg_replace('/\\\\\\\\ /',' ', $text);\n\n $text = preg_replace('/\\\\\\\\emph\\{(.*?)}/s','<i>\\\\1</i>', $text);\n $text = preg_replace('/\\\\\\\\textit\\{(.*?)}/s','<i>\\\\1</i>', $text);\n $text = preg_replace('/\\\\\\\\textbf\\{(.*?)}/s','<b>\\\\1</b>', $text);\n\n // bf toggles bold font (normally somewhere enclosed by {},\n // but we ignore it here\n $text = preg_replace('/\\\\\\\\bf/s','', $text);\n // \\(...\\) is another way of italic\n $text = preg_replace('/\\\\\\\\\\((.*?)\\)/s','<i>\\\\1</i>', $text);\n $text = preg_replace('/\\\\\\\\underline\\{(.*?)}/s','<u>\\\\1</u>', $text);\n // Remove escaping from curly brackets\n $text = preg_replace('/\\\\\\\\(\\{|\\})/s','\\\\1', $text);\n $text = preg_replace('/\\\\\\\\vskip\\S*/s','', $text);\n\n // Replace both \\\"o and \"o by a Unicode ö\n $text = preg_replace('/(\\\\\\\\\"o|\"o)/','ö', $text);\n $text = preg_replace('/(\\\\\\\\\"O|\"O)/','Ö', $text);\n $text = preg_replace('/(\\\\\\\\\"a|\"a)/','ä', $text);\n $text = preg_replace('/(\\\\\\\\\"A|\"A)/','Ä', $text);\n $text = preg_replace('/(\\\\\\\\\"u|\"u)/','ü', $text);\n $text = preg_replace('/(\\\\\\\\\"U|\"U)/','Ü', $text);\n $text = preg_replace('/(\\\\\\\\\"s|\"s)/','ß', $text);\n\n // Handle some special symbols\n $text = preg_replace('/\\\\\\\\Big(\\W{1})/',\n '<font size=\\'+1\\'>\\\\1</font> ', $text);\n $text = preg_replace('/\\\\\\\\textbackslash/','\', $text);\n $text = preg_replace('/\\\\\\\\ldots/','...', $text);\n $text = preg_replace('/\\\\\\\\dots/','...', $text);\n\n return $text;\n }",
"function cd_pre_comment_text( $arg ) {\n $arg['comment_notes_before'] = \"Want to see your pic by your comment? Get a free custom avatar at <a href='http://www.gravatar.com' target='_blank' >Gravatar</a>.\";\n return $arg;\n}",
"private function commentBlock() {\n $comment = '';\n $this->matches('<!');\n while ($this->look() !== '>' && $this->pos < $this->len) {\n if ($this->lookMatches('--')) {\n $comment .= $this->comment();\n } else {\n $this->matchAny(); // Ignore characters outside comment\n }\n }\n $this->match('>');\n $this->fireComment($comment);\n }",
"public function render()\n {\n $comment = '/**' . PHP_EOL;\n\n if (strpos($this->comment, PHP_EOL) !== false) {\n $commentAry = explode(PHP_EOL, $this->comment);\n } else {\n $commentAry = (strlen($this->comment) > 80) ?\n explode(PHP_EOL, wordwrap($this->comment, 80, PHP_EOL)) : [$this->comment];\n }\n\n foreach ($commentAry as $line) {\n $comment .= ' * ' . $line . PHP_EOL;\n }\n\n $comment .= ' */' . PHP_EOL;\n\n return $comment;\n }",
"private function fixNoLineBeforeComment()\n {\n $this->phpcsFile->fixer->beginChangeset();\n\n $offset = $this->commentStartToken['column'] === 1 ? 0 : 1;\n\n $this->phpcsFile->fixer->addNewlineBefore($this->commentStartPtr - $offset);\n\n $this->phpcsFile->fixer->endChangeset();\n }",
"private function processOneLineComments($startIndex) {\n\t\t//--\n\t\t$thirdCommentString = substr($this->input, $this->index, 1);\n\t\t//-- kill rest of line\n\t\t$this->getNext(\"\\n\");\n\t\t//--\n\t\tunset($this->c);\n\t\t//--\n\t\tif((string)$thirdCommentString == '@') {\n\t\t\t$endPoint = $this->index - $startIndex;\n\t\t\t$this->c = \"\\n\" . substr($this->input, $startIndex, $endPoint);\n\t\t} //end if\n\t\t//--\n\t}",
"protected function buildCommentString(): string\n {\n if ($this->getComment() === null) {\n return '';\n }\n\n return ' COMMENT ' . (string) (new Quoter('`', '`'))->quoteValue($this->getComment());\n }",
"private function refill_line()\n\t{\n\t\t$attrs = '';\n\t\t// compile attributes\n\t\tforeach($this->attr as $type => $val)\n\t\t{\n\t\t\t$val = addslashes(trim($val));\n\t\t\t$attrs .= ($this->quotes == \"double\")\n\t\t\t\t\t? \" $type=\\\"$val\\\"\"\n\t\t\t\t\t: \" $type='$val'\";\n\t\t}\n\t\t$replace = array('[[KOHAML::ATTR]]', ' ');\n\t\t$fill = array($attrs, ' ');\n\t\t$this->line = str_replace($replace, $fill, $this->line);\n\t\t// replace php\n\t\tif ($this->php)\n\t\t{\n\t\t\tforeach($this->php as $php)\n\t\t\t{\n\t\t\t\t$this->line = preg_replace('/\\[\\[KOHAML::PHP\\]\\]/', $php, $this->line, 1);\n\t\t\t}\n\t\t}\n\t}",
"function processCommentBody($body)\n{\n $body = htmlspecialchars($body);\n $body = nl2br($body);\n return str_replace([\"\\r\", \"\\n\"], '', $body);\n}",
"public function setLeadingComments($var) {}",
"function text_format($text,$is_text_wrapped=true) {\n if(stristr($text, '<!-- raw html -->') !== false) return $text;\n\n include_once('inc/inc.validate.php');\n\n // remove starting and trailing whitespace and blank lines\n $text = preg_replace('/^[\\s\\n]*/s' ,'',$text);\n $text = preg_replace( '/[\\s\\n]*$/s','',$text);\n\n // place into paragraph array and add spaces to both sides\n if($is_text_wrapped == true) {\n // strip out lines with only whitespace chars and reduce multiple blank lines to one\n $text = preg_replace('/^(\\s)*$/m','',$text);\n $paragraphs = explode(\"\\n\\n\",$text);\n foreach($paragraphs as $key => $value) { $paragraphs[$key] = ' '.$value.' '; }\n } else {\n $paragraphs = array(' '.str_replace(\"\\n\",\" <br/>\\n \",$text).' '); // extra spaces are needed for pattern matching\n }\n\n $start = '%(\\s[\\*_/><\\.,-]*)';\n $end = \"([\\*_/><\\.,-]*\\s)%U\";\n $middle = \"((?![^\\S]).*(?![^\\S]))\";\n $m1 = '((?![^\\S])(.(?![';\n $m2 = ']{2}))*[\\S]*(?![^\\S]))';\n $patterns = array(\n '/ & /' => ' & ',\n '/^\\s*# ([^#]*)$/' => '<ul><li>$1</li></ul>', // # bullet point\n '/([ ,.!-])(\\d+)C([ ,.!-])/' => '$1$2°C$3', // add ° degree sign after 2C\n\n $start.'(\"(?![^\\S])[^\"]{80,}(?![^\\S])\"[\\.,\\s]+)' .$end => '$1<p class=\"blockquote\"> $2 </p>$3', // \"Big ... Quote\"\n\n $start.'##'.$middle.'##'.$end => '$1<h3 style=\"text-align:center\">$2</h3>$3', // ##Header##\n $start.'\\*'.$middle.'\\*'.$end => '$1<strong>$2</strong>$3', // *Bold*\n //$start.'_' .$middle.'_' .$end => '$1<u>$2</u>$3', // _Underline_\n $start.'//'.$middle.'//'.$end => '$1<em>$2</em>$3', // //Italics//\n $start.'\"' .$middle.'\"' .$end => '$1<em>"$2"</em>$3', // \"Italics\"\n\n $start.'>>'.$m1.'<'.$m2.'>>'.$end => '$1<div style=\"text-align:right;\">$2</div>$3', // >>AlignRight>>\n $start.'<<'.$m1.'>'.$m2.'<<'.$end => '$1<div style=\"text-align:left\">$2</div>$3', // <<AlignLeft<<\n $start.'>>'.$m1.'>'.$m2.'<<'.$end => '$1<div style=\"text-align:center\">$2</div>$3', // >>Center<<\n $start.'<<'.$m1.'<'.$m2.'>>'.$end => '$1<div style=\"text-align:justify\">$2</div>$3', // <<Justify>>\n\n $start.'\\[\\s*'.$middle.'\\s*\\]'.$end => '$1<span class=\"source\">[ $2 ]</span>$3', // [End Quote]\n );\n // run formatting on paragraphs;\n $paragraphs = preg_replace(array_keys($patterns),$patterns,$paragraphs);\n\n // locate and a href emails and links\n foreach($paragraphs as $key => $value) {\n $paragraphs[$key] = highlight_emails($paragraphs[$key]);\n $paragraphs[$key] = highlight_links ($paragraphs[$key]);\n }\n\n foreach($paragraphs as $key => $value) {\n $html .= \" <div>\".$paragraphs[$key].\"</div>\\n\";\n }\n return $html;\n}",
"private function prepareComment($comment)\n {\n if (strlen($comment) > 500) return substr($comment, 0, 400) . ' [...]';\n return $comment;\n }",
"function encode_code_in_comment($source) {\n\t$encoded = preg_replace_callback('/<code>(.*?)<\\/code>/ims',\n\tcreate_function('$matches', '$matches[1] = preg_replace(array(\"/^[\\r|\\n]+/i\", \"/[\\r|\\n]+$/i\"), \"\", $matches[1]); \n\treturn \"<code>\" . htmlentities($matches[1]) . \"</\".\"code>\";'), $source);\n\tif ($encoded)\n\t\treturn $encoded;\n\telse\n\t\treturn $source;\n}",
"function formatCommentsForOutput($inputComments) {\n $comments = encode_rg_input($inputComments);\n // RG1 uses #cr##nl# and #nl# to allow saving to text file\n $comments = str_replace(\"#cr##nl#\", \"\\n\", $comments);\n $comments = str_replace(\"#nl#\", \"\\n\", $comments);\n $comments = str_replace(\"<br>\", \"\\n\", $comments);\n return $comments;\n}",
"private function complexPreProcess($text) {\n // Regex to match } *whitespace* {\n $regex = \"/}\\\\s*{/im\";\n \n preg_match_all($regex, $text, $matches);\n \n for($i = 0; $i < count($matches[0]); $i += 1) {\n $text = str_replace_first($matches[0][$i], \"¦\", $text);\n }\n return $text;\n }",
"public function comment($cdata);",
"function plcomment( $data, $title = 'DEBUG', $type = 'html' ) {\n\n\n\tif( is_pl_debug() ){\n\t\t$open\t= ( 'html' == $type ) ? \"\\n<!-- \" : \"\\n/* \";\n\t\t$close\t= ( 'html' == $type ) ? \" -->\\n\" : \"*/\\n\";\n\n\t\t$pre = sprintf( '%s START %s %s', $open, $title, $close );\n\t\t$post = sprintf( '%s END %s %s', $open, $title, $close );\n\n\t\treturn $pre . $data . $post;\n\n\t} else {\n\t\treturn $data;\n\t}\n}",
"private function processMultiLineComments($startIndex) {\n\t\t//--\n\t\t$this->getChar(); // current C\n\t\t$thirdCommentString = $this->getChar();\n\t\t//-- kill everything up to the next */ if it's there\n\t\tif($this->getNext('*/')) {\n\t\t\t//--\n\t\t\t$this->getChar(); // get *\n\t\t\t$this->getChar(); // get /\n\t\t\t$char = $this->getChar(); // get next real character\n\t\t\t//-- now we reinsert conditional comments and YUI-style licensing comments\n\t\t\tif(($this->options['flaggedComments'] && $thirdCommentString === '!') || ($thirdCommentString === '@') ) {\n\t\t\t\t//-- if conditional comments or flagged comments are not the first thing in the script we need to add to output a and fill it with a space before moving on.\n\t\t\t\tif($startIndex > 0) {\n\t\t\t\t\t//--\n\t\t\t\t\t$this->output .= (string) $this->a;\n\t\t\t\t\t$this->a = \" \";\n\t\t\t\t\t//-- if the comment started on a new line we let it stay on the new line\n\t\t\t\t\tif($this->input[($startIndex - 1)] === \"\\n\") {\n\t\t\t\t\t\t$this->output .= (string) \"\\n\";\n\t\t\t\t\t} //end if\n\t\t\t\t\t//--\n\t\t\t\t} //end if\n\t\t\t\t//--\n\t\t\t\t$endPoint = ($this->index - 1) - $startIndex;\n\t\t\t\t$this->output .= (string) substr($this->input, $startIndex, $endPoint);\n\t\t\t\t//--\n\t\t\t\t$this->c = $char;\n\t\t\t\t//--\n\t\t\t\treturn;\n\t\t\t\t//--\n\t\t\t} //end if\n\t\t\t//--\n\t\t} else {\n\t\t\t//--\n\t\t\t$char = false;\n\t\t\t//--\n\t\t} //end if else\n\t\t//--\n\t\tif($char === false) {\n\t\t\tthrow new Exception('Unclosed multiline comment at position: '.($this->index - 2));\n\t\t} //end if\n\t\t//-- if we're here c is part of the comment and therefore tossed\n\t\t$this->c = $char;\n\t\t//--\n\t}",
"function text_prepare($text) {\n\treturn trim($text);\n}",
"private static function compileComments($code){\n return preg_replace('~\\{#\\s*(.+?)\\s*\\#}~is','',$code);\n }",
"public function defendingCommentary() {\n $commentary = [];\n\n $commentary[0] = ' are under pressure here, they may be in serious trouble here if they cannot regain possession';\n $commentary[1] = ' have all 11 men behind the ball as they attempt to weather this onslaught';\n\n // return commentary\n return $commentary;\n }",
"function import_text( $text ) {\r\n // quick sanity check\r\n if (empty($text)) {\r\n return '';\r\n }\r\n $data = $text[0]['#'];\r\n return addslashes(trim( $data ));\r\n }",
"function remove_remarks(&$sql)\n{\n\t$sql = preg_replace('/\\n{2,}/', \"\\n\", preg_replace('/^#.*$/m', \"\\n\", $sql));\r\n}",
"public static function inlines($text)\n {\n $delims = array(\n array('*', '<strong>\\1</strong>'),\n array('_', '<em>\\1</em>'),\n array('`', '<code>\\1</code>')\n );\n \n foreach ($delims as $delim)\n {\n list($delim, $replacement) = $delim;\n $delim = preg_quote($delim);\n $pattern = \"#\n (?<=\\p{^L}|\\A)\n {$delim}\n ((?>[^{$delim}]+|{$delim}\\p{L}+))\n {$delim}\n (?=\\p{^L}|\\z)#ux\";\n $text = preg_replace($pattern, $replacement, $text);\n }\n \n return $text;\n }",
"function recogeComentario($comment){\n $comment = strip_tags($comment);\n\n //Quita los saltos de linea extra dejando solo uno\n $comment = preg_replace(\"/[\\r\\n]+/\", \"\\n\", $comment);\n\n //Deja solo un espacio si hay dos o más seguidos y quita las tabulaciones\n $comment = preg_replace(array('/\\s{2,}/', '/[\\t]/'), ' ', $comment);\n\n //Quita los espacios del principio y del final\n $comment = nl2br(trim($comment, \" \"));\n\n //Quita los saltos de linea en blanco del final\n $comment = rtrim($comment);\n\n //Limitar comentario a 280\n $comment = mb_substr($comment,0,280);\n \n return $comment;\n}",
"function head($add=NULL){\n $short = strlen($this->text) < $this->short;\n $lines = $short?array($this->text):explode('@#+*',wordwrap($this->text,$this->width-10,'@#+*'));\n\n if(!empty($add)){\n if($short) $lines = array_merge($lines,(array)$add);\n else $lines = array_merge($lines,array('- - -'),(array)$add);\n }\n\n if($this->level==0) return '<!-- ' . implode(' ',$lines) . ' -->';\n\n $char = $this->chars[$this->level];\n \n if(count($lines)==1){\n $bl = $this->repeat($char,$this->width-10);\n return \"\\n<!-- \" . $this->mid($bl,$lines[0]) . \" -->\\n\";\n }\n\n if($char=='') return \"\\n<!-- \" . implode(\"\\n \",$lines) . \"\\n-->\\n\";\n\n $lchar = $this->line_chars[$this->level];\n\n $fl = $this->repeat($char,$this->width-10);\n $el = $fl;\n if($short) $fl = $this->left($fl,array_shift($lines));\n\n $res = array_map(create_function('$x','return $x . str_repeat(\\' \\','\n\t\t\t\t . ($this->width-10) . '-strlen($x));'),\n\t\t $lines);\n array_unshift($res,$fl);\n $res[] = $el;\n $impl = ' ' . $this->repeat($lchar,4) . \"\\n\" . $this->repeat($lchar,4) . ' ';\n return \"\\n<!-- \" . implode($impl,$res) . \" -->\\n\";\n }",
"function processComment($content = '') {\n\t\t\tif ( !is_feed() ) { // ignore feeds\n\t\t\t\t$translate_block = $this -> generate_translate_block('comment');\n\t\t\t\t$translate_hr = ( $this -> options['hlineEnable'] ) ? ( '<hr class=\"translate_hr\" />' . \"\\n\" ) : \"\";\n\t\t\t\t$content = $content .\n\t\t\t\t\t'<div class=\"translate_block\" style=\"display: none;\">' . \"\\n\" .\n\t\t\t\t\t$translate_hr .\n\t\t\t\t\t$translate_block .\n\t\t\t\t\t\"</div>\\n\";\n\t\t\t}\n\t\t\treturn $content;\n\t\t}",
"private function __commentRender($text){\r\n\r\n # IF THERE IS USERNAMES\r\n $newdata = array();\r\n\r\n # GET ALL USERNAME FROM TEXT =USERNAME\r\n preg_match_all (\"/=([a-zA-Z0-9_]+)/\", $text, $usernames);\r\n\r\n # @TODO SIMPLER AND MORE EFFICIENT\r\n foreach($usernames[1] as $username) {\r\n $u = new Apps\\Netcoid\\Models\\Users;\r\n $data = $u->getDataForComments($username);\r\n if (!empty($data)) {\r\n $newdata[$username] = array(\r\n 'role' => $data['role'], \r\n 'name' => $data['name'], \r\n 'uid' => $data['uid']\r\n );\r\n }\r\n }\r\n\r\n # @TODO SIMPLER AND MORE EFFICIENT\r\n foreach ($newdata as $username => $values) {\r\n switch ($values ['role']) {\r\n case '1' :\r\n $text = preg_replace('/=(' . $username . ')/', '<a class=\"u\" href=\"/'. strtolower ( '\\1' ) .'\">'. $values ['name'] .' ✔</a>', $text);\r\n break;\r\n\r\n case '5' :\r\n $text = preg_replace('/=(' . $username . ')/', \r\n '<a class=\"u\" href=\"/'. strtolower ( '\\1' ) .'\">*'. $values ['name'] .'</a>', $text);\r\n break;\r\n \r\n case '0' :\r\n $text = preg_replace('/=(' . $username . ')/', '<a class=\"u\" href=\"/'. strtolower ( '\\1' ) .'\">'. $values ['name'] .'</a>', $text);\r\n break;\r\n \r\n default :\r\n $text = preg_replace('/=(' . $username . ')/', '<a class=\"u\" href=\"/'. strtolower ( '\\1' ) .'\">'. $values ['name'] .'</a>', $text);\r\n break;\r\n }\r\n }\r\n\r\n # SET RETURN\r\n $return = array(\r\n 'usernames' => $newdata,\r\n 'text' => $text \r\n );\r\n\r\n return $return;\r\n }",
"public static function escapeHtmlComment($s): string\n\t{\n\t\t$s = (string) $s;\n\t\tif ($s && ($s[0] === '-' || $s[0] === '>' || $s[0] === '!')) {\n\t\t\t$s = ' ' . $s;\n\t\t}\n\n\t\t$s = str_replace('--', '- - ', $s);\n\t\tif (substr($s, -1) === '-') {\n\t\t\t$s .= ' ';\n\t\t}\n\n\t\treturn $s;\n\t}",
"public function remove_comments($text)\r\n {\r\n if(!is_string($text)){\r\n return false;\r\n }\r\n \r\n // string with no comments\r\n $clean_text = '';\r\n \r\n // keep track comment start and end\r\n $is_comment = false;\r\n\r\n for($i = 0; $i < strlen($text); $i++){\r\n // next element\r\n $next = $text[$i+1] ?? '';\r\n $comment = ($text[$i] ?? '') . $next;\r\n\r\n // check if current item and next are single line comment\r\n if($comment == '//' && $is_comment == false){\r\n $is_comment = true;\r\n }else{\r\n // check if not comment\r\n if(!$is_comment){\r\n $clean_text .= $text[$i];\r\n }else{\r\n // check if new line\r\n if(in_array($text[$i], $this::NEW_LINE)){\r\n $is_comment = false;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return $clean_text;\r\n }"
] | [
"0.62311435",
"0.58138",
"0.57820624",
"0.5598327",
"0.55945474",
"0.55803984",
"0.5576131",
"0.5553294",
"0.55293185",
"0.5508566",
"0.55002093",
"0.54979837",
"0.5493055",
"0.547145",
"0.5470323",
"0.54656756",
"0.5415324",
"0.5376073",
"0.53687143",
"0.5293365",
"0.5292245",
"0.5288707",
"0.5273822",
"0.5272241",
"0.52710664",
"0.52614266",
"0.52575344",
"0.5254759",
"0.5243125",
"0.52355313"
] | 0.624177 | 0 |
Builds a string from the entry for inclusion in PO file | public static function exportEntry(&$entry)
{
if (is_null($entry->getString())) {
return false;
}
$po = array();
$comments = $entry->getTranslatorComment();
if (!empty($comments)) {
$po[] = self::commentBlock($comments);
}
$comments = $entry->getDeveloperComment();
if (!empty($comments)) {
$po[] = self::commentBlock($comments, '.');
}
$references = $entry->getReference();
if (!empty($references)) {
$po[] = self::commentBlock(implode(' ', $references), ':');
}
$flags = $entry->getFlags();
if (!empty($flags)) {
$po[] = self::commentBlock(implode(', ', $flags), ',');
}
$context = $entry->getContext();
if (!empty($context)) {
$po[] = 'msgctxt ' . self::poify($context);
}
$po[] = 'msgid ' . self::poify($entry->getString());
$translations = $entry->getTranslations();
if (!$entry->isPlural()) {
$translation = empty($translations) ? '' : $translations[0];
$po[] = 'msgstr ' . self::poify($translation);
} else {
$po[] = 'msgid_plural ' . self::poify($entry->getPlural());
$translations = empty($translations) ? array('', '') : $translations;
foreach ($translations as $i => $translation) {
$po[] = 'msgstr[' . $i . '] ' . self::poify($translation);
}
}
return implode("\n", $po);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __toString(): string\n {\n return 'Entry ' . $this->getKey() . ': ' . $this->getShortForm();\n }",
"public function __toString() {\n return 'Entry #' . $this->id;\n }",
"public function toString(): string\n {\n $this->sortEntries();\n $entriesCount = count($this->references);\n $string = \"xref\\n\";\n $sectionStartEntry = 0;\n $writtenEntries = 0;\n while ($writtenEntries < $entriesCount) {\n // überspringe nicht vorhandene Einträge\n while (!$this->hasEntry($sectionStartEntry))\n ++ $sectionStartEntry;\n\n // zähle Einträge, die nacheinander sind\n $sectionEndEntry = $sectionStartEntry;\n while ($this->hasEntry($sectionEndEntry))\n ++ $sectionEndEntry;\n\n // schreibe die Sektion\n $string .= \"{$sectionStartEntry} \" . ($sectionEndEntry - $sectionStartEntry) . \"\\n\";\n for ($i = $sectionStartEntry; $i < $sectionEndEntry; ++$i) {\n $string .= $this->getEntry($i)->toString();\n }\n\n // bereite nächste Sektion vor\n $writtenEntries += $sectionEndEntry - $sectionStartEntry;\n $sectionStartEntry = $sectionEndEntry;\n }\n return $string;\n }",
"protected function docTitle(Entry $entry): string\n {\n $docTitle = $this->pageTitle($entry);\n\n if ($entry->getIsDraft()) {\n /** @var Entry|DraftBehavior $entry */\n $docTitle .= ' (' . $entry->draftName . ')';\n } else if ($entry->getIsRevision()) {\n /** @var Entry|RevisionBehavior $entry */\n $docTitle .= ' (' . $entry->getRevisionLabel() . ')';\n }\n\n return $docTitle;\n }",
"public function buildFileContents()\n {\n $data = array('pages' => $this->getPages());\n $output = array();\n $output[] = \"var tipuesearch = \" . json_encode($data) . \";\";\n $output[] = null;\n\n return implode(PHP_EOL, $output);\n }",
"function ccgn_vp_format_field ( $entry, $item ) {\n $html = '';\n // Make sure the entry has a value for this item\n if( isset( $entry[ $item[ 1 ] ] ) ) {\n $html = '<p><strong>'\n . $item[ 0 ] . '</strong><br />'\n . ccgn_vp_clean_string( $entry[ $item[ 1 ] ] )\n . '</p>';\n }\n return $html;\n}",
"public function getStringsAsPOT() {\n\n ob_start();\n\n $pot = '';\n\n foreach($this->strings as $string) {\n\n $entry = <<<EOD\n#: %s \nmsgid \"%s\"\nmsgstr \"%s\"\n\n\nEOD;\n\n $pot .= sprintf($entry, implode(', ', $string['locations']), str_replace('\"', '\\\"', $string['term']), str_replace('\"', '\\\"', $string['definition']));\n\n }\n\n return $pot;\n\n }",
"public function toString() {\n return $this->getClassName().'['.$this->descr.' @ '.$this->prop->getFilename().']';\n }",
"public function __toString()\n {\n if (null === $this->metadata) {\n $this->metadata = new \\Pop\\Pdf\\Document\\Metadata();\n }\n\n // Set the CreationDate and the ModDate if they are null.\n if (null === $this->metadata->getCreationDate()) {\n $this->metadata->setCreationDate(date('D, M j, Y h:i A'));\n }\n if (null === $this->metadata->getModDate()) {\n $this->metadata->setModDate(date('D, M j, Y h:i A'));\n }\n\n return str_replace(\n [\n '[{info_index}]', '[{title}]', '[{subject}]', '[{author}]',\n '[{creator}]', '[{producer}]', '[{mod_date}]', '[{creation_date}]'\n ],\n [\n $this->index, $this->metadata->getTitle(), $this->metadata->getSubject(), $this->metadata->getAuthor(),\n $this->metadata->getCreator(), $this->metadata->getProducer(), $this->metadata->getModDate(), $this->metadata->getCreationDate()\n ],\n $this->data\n );\n }",
"public function __toString ( ) {\n\n return implode(PHP_EOL, array(\n $this->type,\n $this->severity, \n \"alert_id: \" . $this->alert_id,\n \"event_id: \" . $this->event_id,\n \"key name: \" . $this->key_name,\n \"key value: \" . $this->key_value,\n \"device_name: \" . $this->device,\n \"l4_dst_port_sup1-1: \" . $this->sup1_outport,\n \"l4_dst_port_sup1-2: \" . $this->sup2_outport,\n \"device_input_int_sup2-1: \" . $this->sup1_inint,\n \"device_input_int_sup2-2: \" . $this->sup2_inint,\n \"source_IP_addresssup1-1: \" . $this->sup1_src,\n \"source_IP_addresssup1-2: \" . $this->sup2_src\n PHP_EOL\n )\n ); \n }",
"public function __toString()\n {\n $string = \"\";\n\n foreach ($this->comment as $commentLine) {\n $string .= sprintf(\";%s\\n\", $commentLine);\n }\n\n $string .= sprintf(\"[%s]\\n\", $this->name);\n\n foreach ($this->properties as $property) {\n $string .= $property;\n }\n\n return $string;\n }",
"public function __toString() {\r\n\t\t/* PROTECTED REGION ID(php.implementation._16_9_8a7027a_1297195977073_836868_2825) ENABLED START */\r\n\t\treturn $this->author . ' (' . $this->email . ') said on ' . $this->date->format('Y-m-d') . ':' . chr(10) . $this->content . chr(10);\r\n\t\t/* PROTECTED REGION END */\r\n\t}",
"public function __toString(): string\n {\n //var_dump('hi');exit();\n if ($this->template != null) {\n $template = $this->template;\n } elseif ($this->form != null) {\n $template = $this->form->getTemplate();\n } else {\n $template = '<div class=\"formgroup\">:label: :field: :error: :helptext:</div><br />' . \"\\n\";\n }\n\n $label = $this->outputLabel();\n if ($this->editable) {\n $element = $this->outputElement();\n } else {\n $element = $this->outputValue();\n }\n $name = $this->attributes['name'];\n\n $error = $this->outputError();\n if ($label . $element . $error != '') {\n $line = $template;\n $line = str_replace(':label:', $label, $line);\n $line = str_replace(':field:', $element, $line);\n $line = str_replace(':error:', $error, $line);\n $line = str_replace(':fieldname:', $name, $line);\n $line = str_replace(':helptext:', $this->outputHelpText(), $line);\n } else {\n $line = '';\n }\n return $line;\n }",
"private function generateMetaInformation(): string\n {\n return \"<title>{$this->configuration->title()}</title>\n <link>{$this->configuration->siteUrl()}</link>\n <description>{$this->configuration->description()}</description>\n <pubDate>{$this->configuration->lastModified()->toRfc7231String()}</pubDate>\n <lastBuildDate>{$this->configuration->lastModified()->toRfc7231String()}</lastBuildDate>\n <docs>{$this->configuration->feedUrl()}</docs>\n <atom:link href=\\\"{$this->configuration->feedUrl()}\\\" rel=\\\"self\\\" type=\\\"application/rss+xml\\\" />\n <generator>https://github.com/roelofjan-elsinga/rss-feed-generator</generator>\n <managingEditor>{$this->configuration->author()}</managingEditor>\n <webMaster>{$this->configuration->author()}</webMaster>\\n\";\n }",
"public function retrieve()\n {\n $entries = [];\n\n foreach ($this->entries as $entry) {\n $parts = [];\n $author = implode(', ', $entry['authors'] ?? []);\n if ('' !== $author) {\n $parts[] = $author;\n }\n\n if ('' !== $entry['title']) {\n $parts[] = $entry['title'];\n }\n\n if ('' !== $entry['journal']) {\n $parts[] = $entry['journal'];\n }\n\n $meta = '';\n if ('' !== $entry['year']) {\n $meta .= $entry['year'] . ';';\n }\n\n if ('' !== $entry['volume']) {\n $meta .= $entry['volume'];\n }\n\n if ('' !== $entry['issue']) {\n $meta .= \"({$entry['issue']})\";\n }\n\n if ('-' !== $entry['page']) {\n $meta .= \":{$entry['page']}\";\n }\n\n if ('' !== $meta) {\n $parts[] = $meta;\n }\n\n $entries[] = implode('. ', $parts) . '.';\n }\n\n return implode(PHP_EOL, $entries);\n }",
"public function fieldDoSomething($oEntry){\n return '';\n }",
"public function __toString()\n {\n return $this->getKeyword() . ' \"' . str_replace('\"', '\\\\\"', $this->text) . '\"';\n }",
"function csv_format_os_build( $p_os_build ) {\r\n\t\treturn csv_escape_string( $p_os_build );\r\n\t}",
"public function __toString()\n {\n $str = \"; This is a configuration file\\n\";\n $str .= \"; Comments start with ';', as in php.ini\\n\\n\";\n\n foreach ($this->_data as $section_name=>$section_value) {\n $str .= \"[\".$section_name.\"]\\n\\n\";\n\n if (is_array($section_value)) {\n foreach ($section_value as $param_name=>$param_value) {\n $str .= $param_name.\" = \".$param_value.\"\\n\";\n }\n }\n\n $str .= \"\\n\";\n }\n\n return $str;\n }",
"function __toString() {\n $info = $this->getBaseString();\n \n $info .= $this->getExtraString();\n \n return $info;\n }",
"public function getSelectionEntry() {\n \n $selectionEntry = '';\n\t\tif ($this->get_postmanu()) {\n\t\t\t// use data from post1-7\n\t\t\t$cnt = 5;\n\t\t\tfor ($i = 1; $cnt && ($i <= 7); $i++) {\n\t\t\t\t$getter = 'get_post'.$i;\n\t\t\t\tif ($this->$getter() != '') {\n\t\t\t\t\t$cnt--;\n\t\t\t\t\tif ($selectionEntry != '') {\n\t\t\t\t\t\t$selectionEntry .= ' ';\n\t\t\t\t\t}\n\t\t\t\t\t$selectionEntry .= $this->$getter();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$selectionEntry = $this->getFullName();\n\t\t\tif ($this->get_streetAndNo() != '') {\n\t\t\t\t$selectionEntry .= ', '.$this->get_streetAndNo();\n\t\t\t}\n\t\t\telse if ($this->get_poBox != '') {\n\t\t\t\tif (($this->country == 'DE') || ($this->country == 'AT')) {\n\t\t\t\t\t$selectionEntry .= ', Postfach';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$selectionEntry .= ', P.O.Box';\n\t\t\t\t}\n\t\t\t\t$selectionEntry .= ' '.$this->get_poBox();\n\t\t\t}\n\t\t\t$selectionEntry .= ', '.$this->get_city();\n\t\t\tif (tx_ptgsauserreg_countrySpecifics::isForeignCountry($this->get_country())) {\n\t\t\t\t$selectionEntry .= ', '.$this->get_country();\n\t\t\t}\n\t\t}\n\n\t\treturn $selectionEntry;\n\t}",
"function __toString(): string\n {\n $string = \"BI\\n\";\n foreach ($this->imageConfig as $key => $value) {\n $string .= (new PdfName($key))->toString() . \" \" . $value->toString() . \"\\n\";\n }\n $string .= \"ID\\n\" . $this->imageData . \"\\nEI\\n\";\n return $string;\n }",
"public function __toString(): string{\n return sprintf(\"%s.\", $this->keydata['ownerName']);\n }",
"public function __toString() {\n \t\t$retString=\"\n [ TYPE: Picasa_Author \n NAME: \".$this->name.\"\n USER: \".$this->user.\"\n NICKNAME: \".$this->nickname.\" \n THUMBNAIL: \".$this->thumbnail.\"\n\t]\";\n\n\t \treturn $retString;\n\t}",
"public function __toString() {\n return '<red>cfddns INI file must contain</red>' . PHP_EOL .\n ' - <white>apikey</white>' . PHP_EOL .\n ' - <white>email</white>' . PHP_EOL .\n ' - <white>hostname</white>';\n }",
"public function build(): string;",
"public static function convert_to_atom($entry) {\n try {\n if (!($entry instanceof Entry))\n throw new Exception();\n\n $content = \"\n <entry>\n <author>\n <name>{$entry->author_name}</name>\n <uri>{$entry->author_uri}</uri>\n </author>\n <title type=\\\"html\\\"><![CDATA[{$entry->title}]]></title>\n <link rel=\\\"alternate\\\" type=\\\"text/html\\\" href=\\\"{$entry->link}\\\" />\n <id>{$entry->link}</id>\n <updated>{$entry->date_modified}</updated>\n <published>{$entry->date_created}</published>\n \n <content type=\\\"html\\\"><![CDATA[{$entry->content}]]></content>\n </entry>\";\n\n return $content;\n } catch (Exception $ex) {\n return false;\n }\n }",
"public function toString() {\n return sprintf(\n \"%s@{\\n required : [%s]\\n commandset : %s\\n}\",\n $this->getClassName(),\n implode(', ', $this->required),\n str_replace(\"\\n\", \"\\n \", xp::stringOf($this->commandset))\n );\n }",
"function _get_lang_file_map($b,&$entries,$descriptions=NULL,$given_whole_file=false)\n{\n\tif (!$given_whole_file)\n\t{\n\t\tif (!file_exists($b)) return;\n\n\t\t$lines=file($b);\n\t} else $lines=explode(chr(10),unixify_line_format($b));\n\n\tif ((!$given_whole_file) && ($b[strlen($b)-1]=='o')) // po file.\n\t{\n\t\t// No description support btw (but shouldn't really be needed, once you save it will make a .ini and that does have description support)\n\t\tif ($descriptions===true) return;\n\n\t\t// Parse po file\n\t\t$matches=array();\n\t\t$doing=NULL;\n\t\t$value='';\n\t\t$processing=false;\n\t\tforeach ($lines as $line)\n\t\t{\n\t\t\tif ($line=='') continue;\n\n\t\t\tif (($line[0]=='#') && (preg_match('/#: \\[strings\\](.*)/',$line,$matches)!=0))\n\t\t\t{\n\t\t\t\tif ((!is_null($doing)) && ($value!='')) $entries[$doing]=$value;\n\t\t\t\t$doing=$matches[1];\n\t\t\t\t$value='';\n\t\t\t\t$processing=false;\n\t\t\t}\n\t\t\tif ($processing)\n\t\t\t{\n\t\t\t\tif ($line[0]=='\"')\n\t\t\t\t{\n\t\t\t\t\t$v=substr(rtrim($line,\"\\r\\n\"),1);\n\t\t\t\t\tif (substr($v,-1)=='\"') $v=substr($v,0,strlen($v)-1);\n\t\t\t\t\t$value.=stripslashes($v);\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$processing=false;\n\t\t\t\t\tif ((!is_null($doing)) && ($value!=''))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (($doing=='en_left') && ($value!='left') && ($value!='right')) $value='left';\n\t\t\t\t\t\tif (($doing=='en_right') && ($value!='left') && ($value!='right')) $value='right';\n\t\t\t\t\t\t$entries[$doing]=$value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$processing)\n\t\t\t{\n\t\t\t\tif (substr($line,0,8)=='msgstr \"')\n\t\t\t\t{\n\t\t\t\t\t$processing=true;\n\t\t\t\t\t$v=substr(rtrim($line,\"\\r\\n\"),8);\n\t\t\t\t\tif (substr($v,-1)=='\"') $v=substr($v,0,strlen($v)-1);\n\t\t\t\t\t$value.=stripslashes($v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ((!is_null($doing)) && ($value!='')) $entries[$doing]=$value;\n\t\tif (substr(basename($b),0,6)=='global' || $given_whole_file)\n\t\t{\n\t\t\t$entries['charset']='utf-8'; // Has to be\n\t\t}\n\t\treturn;\n\t}\n\n//\tif (!is_null($descriptions)) // Full parsing needed for this then (this algorithm would support non-descriptions, but it's just slower)\n//\t{\n\t\t$in_lang=false;\n\n\t\t$nl=\"\\r\\n\";\n\n\t\tforeach ($lines as $line)\n\t\t{\n\t\t\t$line=rtrim($line,$nl);\n\t\t\tif ($line=='') continue;\n\n\t\t\tif ($line[0]=='[')\n\t\t\t{\n\t\t\t\tif ($line=='[strings]') $in_lang=($descriptions!==true);\n\t\t\t\telseif ($line=='[descriptions]') $in_lang=($descriptions===true);\n\t\t\t}\n\n\t\t\tif ($in_lang)\n\t\t\t{\n\t\t\t\t$parts=explode('=',$line,2);\n\n\t\t\t\tif (isset($parts[1]))\n\t\t\t\t{\n\t\t\t\t\t$entries[$parts[0]]=rtrim($parts[1],$nl);/*str_replace('\\n',\"\\n\",$parts[1]);*/\n\t\t\t\t}\n\t\t\t}\n\t\t}\n//\t} else // Efficient parsing possible\n//\t{\n//\t\tforeach ($lines as $line) // [descriptions] now comes before [strings], so we don't need to filter (it'll just overwrite correctly if there's a dupe between them)\n//\t\t{\n//\t\t\t$parts=explode('=',$line,2);\n//\n//\t\t\tif (isset($parts[1]))\n//\t\t\t\t$entries[$parts[0]]=rtrim($parts[1]);/*str_replace('\\n',\"\\n\",$parts[1]);*/\n//\t\t}\n//\t}\n}",
"public function build($args) {\n\t\t$path = '';\n\n\t\tif (isset($args->resource)) {\n\t\t\t$path = $args->resource;\n\n\t\t\tif (isset($args->id)) $path .= FS . $args->id;\n\t\t\tif (isset($args->layout)) $path .= FS . $args->layout;\n\t\t}\n\n\t\treturn $path;\n\t}"
] | [
"0.61849076",
"0.5954847",
"0.55826306",
"0.54837036",
"0.547639",
"0.5466453",
"0.5363294",
"0.53124845",
"0.5266911",
"0.5247739",
"0.52452093",
"0.52445185",
"0.52313703",
"0.52176815",
"0.52036834",
"0.5194108",
"0.51393884",
"0.5119151",
"0.51121145",
"0.5109051",
"0.50984883",
"0.509577",
"0.50858414",
"0.5078039",
"0.50723916",
"0.5055466",
"0.5045639",
"0.5033653",
"0.50324595",
"0.50249845"
] | 0.6699995 | 0 |
Get full config path | public function getConfigPath()
{
$this->_locationPath = $this->getLocationPath();
$path = $this->_locationPath.$this->_configPath;
return $path;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getConfigurationPath()\n {\n return $this->modulable->unifyLocalSlashes($this->getRocketeerPath().'/config');\n }",
"protected function getConfigPath()\n {\n return config_path($this->configFileName);\n }",
"public function configPath()\n {\n return $this->get('path.config');\n }",
"public function configPath(): string\n {\n return $this->basePath() . DIRECTORY_SEPARATOR . 'config';\n }",
"public static function getConfigPath()\n {\n if (self::$configPath) return self::$configPath;\n return __DIR__.\"/../../config\";\n }",
"public function getPath() {\n\t\treturn substr(__FILE__, 0, strlen(__FILE__) - 15) . \"/config/\" . $this->file . \".conf\";\n\t}",
"protected function getConfigPath() {\n return __DIR__ . StreamRefresh::RELATIVE_CONFIG_PATH;\n }",
"function config_path()\n {\n return base_path() . '/config';\n }",
"public function getConfigFilePath()\n {\n // get the child class full path (the Client class)\n $fullFilePathName = (new ReflectionClass(get_class($this)))->getFileName();\n\n // remove the file name (to get the package root directory) and move forward to the Config directory\n return $this->removeLastDir($fullFilePathName, 1) . '/Config';\n }",
"public function configPath(): string\n {\n return realpath(__DIR__ . '/../config/amfl.php');\n }",
"private function getConfigurationPath() {\n\t\treturn __DIR__ . '/' . '..';\n\t}",
"public function getConfigPath() : string\n {\n return $this->configPath;\n }",
"public function getConfigPath();",
"private static function getConfigPath()\n {\n return __DIR__.'/../Util/ConfigTemplate/client-config.ovpn';\n }",
"protected function configPath()\n {\n return __DIR__ . '/resources/config/otp.php';\n }",
"function config_path($path = '')\n {\n return app('resources')->get('config').($path ? DS.$path : $path);\n }",
"function configPath(){\r\n\treturn basePath().'config/';\r\n}",
"public function getConfigPath(): string\n {\n if ($this->_configPath !== null) {\n return $this->_configPath;\n }\n\n $configPath = Craft::getAlias('@config');\n\n if ($configPath === false) {\n throw new Exception('There was a problem getting the config path.');\n }\n\n return $this->_configPath = FileHelper::normalizePath($configPath);\n }",
"public function getConfigFilePath()\n {\n return dirname(__DIR__) . '/config/config.php';\n }",
"protected function configPath()\n {\n return $this->laravel->basePath().DIRECTORY_SEPARATOR.'config/lararsa.php';\n }",
"protected function getConfigPath()\n {\n return config_path('hipercaptcha.php');\n }",
"function config_path($path = '')\n {\n return app()->basePath() . '/config' . ($path ? '/' . $path : $path);\n }",
"function config_path($path = '')\n {\n return app()->basePath() . '/config' . ($path ? '/' . $path : $path);\n }",
"function config_path($path = '')\n {\n return app()->basePath() . '/config' . ($path ? '/' . $path : $path);\n }",
"function config_path($path = '')\n {\n return app()->basePath() . '/config' . ($path ? '/' . $path : $path);\n }",
"function config_path($path = '')\n {\n return app()->basePath() . '/config' . ($path ? '/' . $path : $path);\n }",
"function config_path($path = '')\n {\n return app()->basePath() . '/config' . ($path ? '/' . $path : $path);\n }",
"protected function getConfigPath()\n {\n return config_path('laraoutpress.php');\n }",
"protected function getPathToConfigFile(): string\n {\n return __DIR__ . '/../config/postcode-nl.php';\n }",
"function getCfgPath() {\r\n\t$cfgPath = $_SERVER[ 'PATH_TRANSLATED' ];\r\n\t$exploded = explode( '/', $cfgPath );\r\n\tarray_pop( $exploded );\r\n\tarray_push( $exploded, 'cfg.include.php' );\r\n $cfgPath = implode( '/', $exploded );\r\n\t\r\n\treturn( $cfgPath );\r\n\r\n}"
] | [
"0.84188694",
"0.83950776",
"0.8371474",
"0.8307504",
"0.8254137",
"0.825193",
"0.8176644",
"0.8150981",
"0.8032128",
"0.7965538",
"0.7934021",
"0.78943676",
"0.7821814",
"0.77329665",
"0.7723982",
"0.7695983",
"0.76659846",
"0.7665034",
"0.7644754",
"0.75769436",
"0.7562901",
"0.755771",
"0.755771",
"0.755771",
"0.755771",
"0.755771",
"0.755771",
"0.75152427",
"0.7508281",
"0.7507578"
] | 0.8432936 | 0 |
Get full service areas path | public function getServiceAreasPath()
{
$this->_locationPath = $this->getLocationPath();
$path = $this->_locationPath.$this->_serviceAreasPath;
return $path;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function get_service_path() {\n\n $url = new \\moodle_url('/mod/lti/services.php');\n\n return $url->out(false);\n\n }",
"public function allResourcesPath(): string\n {\n return \"/api/{$this->getApiVersion()}/namespaces/{$this->getNamespace()}/services\";\n }",
"public function getCachedServicesPath();",
"public function getFullpath()\n {\n return (!empty($this->path) ? $this->path . '/' : '') . $this->name;\n }",
"public function getCachedServicesPath()\n {\n // TODO: Implement getCachedServicesPath() method.\n }",
"public function getCachedServicesPath()\n {\n // TODO: Implement getCachedServicesPath() method.\n }",
"public static function getServicesPath()\n {\n return __DIR__ . DIRECTORY_SEPARATOR . 'services.php';\n }",
"public function resourcePath(): string\n {\n return \"/api/{$this->getApiVersion()}/namespaces/{$this->getNamespace()}/services/{$this->getIdentifier()}\";\n }",
"public function basePath();",
"public function basePath();",
"public function basePath();",
"public function getUserlandPath()\n {\n return $this->modulable->unifyLocalSlashes($this->getRocketeerPath().'/app');\n }",
"public function getCachedServicesPath(): string\n {\n return $this->serverApplication->getCachedServicesPath();\n }",
"public function getLocationPath()\n {\n if ($this->_locationPath == null) {\n\n $read = Mage::getSingleton('core/resource')->getConnection('core_read');\n $result = $read->fetchOne(\"select `path` from `core_config_data` where `value` = '{$this->_apiToken}' and `path` like 'tiramizoo_config/%'\");\n\n $result = explode('/', $result);\n\n if (count($result) != 3) {\n throw new Exception('Api Token is not valid.');\n }\n\n $return = $result[0].'/'.$result[1];\n } else {\n $return = $this->_locationPath;\n }\n\n return $return;\n }",
"public function getConfigPath()\n {\n $this->_locationPath = $this->getLocationPath();\n $path = $this->_locationPath.$this->_configPath;\n\n return $path;\n }",
"function getPath()\n\t{\n\t\treturn dirname(__FILE__) . \"/../restrict/event_resource/\" . $this->club_id . \"/\" . $this->event_id . \"/\" . $this->id;\n\t}",
"public function getAreas()\n {\n $templates = sfConfig::get('app_'.$this->engine.'_templates');\n return $templates[$this['template']]['areas'];\n }",
"protected function getServiceRootUrl()\n {\n if (!isset($this->serviceRootUrl)) {\n $this->serviceRootUrl = $this->getContext()->getUrl() . ClientContext::$ServicePath;\n }\n return $this->serviceRootUrl;\n }",
"public function getPath(): string {\n return $this->components->path;\n }",
"public function getFullPath() {\n return $this->__full_path;\n }",
"public function saveServiceAreas()\n {\n $pickupContact = $this->getParam('pickup_contact');\n $path = $this->getServiceAreasPath();\n\n $oStartDate = new DateTime(date('Y-m-d'));\n $oEndDate = new DateTime(date('Y-m-d'));\n $oEndDate->modify('+2 days');\n\n $startDate = $oStartDate->format('Y-m-d\\TH:i:s\\Z');\n $endDate = $oEndDate->format('Y-m-d\\TH:i:s\\Z');\n\n $rangeDates = array(\n 'express_from' => $startDate,\n 'express_to' => $endDate,\n 'standard_from' => $startDate,\n 'standard_to' => $endDate\n );\n\n $avaialbleServiceAreas = Mage::getModel('tiramizoo/api', array('api_token' => $this->_apiToken))\n ->getAvailableServiceAreas($pickupContact['postal_code'], $rangeDates);\n\n\n if ($avaialbleServiceAreas['http_status'] != 200) {\n throw new Exception(\"Can't connect to Tiramizoo API\", 1);\n }\n\n if (isset($avaialbleServiceAreas['response'])) {\n\n // var_dump(array('Path' => $path, 'ServiceAreas' => $avaialbleServiceAreas['response']));\n // $avaialbleServiceAreas['response'] = $this->objectToArray($avaialbleServiceAreas['response']);\n\n Mage::getModel('core/config')->saveConfig($path, json_encode($avaialbleServiceAreas['response']));\n }\n\n return $this;\n }",
"public function getFullPath()\n {\n return Yii::getAlias(\"$this->path/$this->name\");\n }",
"public function getCachedServicesPath()\n {\n return $this->paths->get('bootstrap', 'cache/services.php');\n }",
"public function getCachedServicesPath()\n {\n return $this->basePath().'/bootstrap/cache/services.json';\n }",
"public function getFullPath(): string;",
"public function getRootPath();",
"public function getFullBasePath()\n {\n $fullBasePath = $this->getStorage()->basePath . '/' . $this->getBaseSubPath();\n $fullBasePath = rtrim($fullBasePath, '/');\n return $fullBasePath;\n }",
"public function getFullpath() {\n return $this->fullpath;\n }",
"public function getWebappPath();",
"public function getWebappPath();"
] | [
"0.6673846",
"0.6459989",
"0.6170667",
"0.6086709",
"0.6034691",
"0.6034691",
"0.60047066",
"0.60001534",
"0.58680916",
"0.58680916",
"0.58680916",
"0.58581513",
"0.5845819",
"0.58440375",
"0.58253354",
"0.58250827",
"0.5820689",
"0.58145976",
"0.58122087",
"0.5760498",
"0.5755991",
"0.57292867",
"0.5719752",
"0.5717194",
"0.57168466",
"0.57084435",
"0.57066816",
"0.56981647",
"0.568683",
"0.568683"
] | 0.8580136 | 0 |
Get available time windows | public function getAvailableTimeWindows()
{
if ($aTimeWindows = $this->getServiceAreas('time_windows')) {
//sort by delivery from date
foreach ($aTimeWindows as $oldKey => $aTimeWindow)
{
$oTimeWindow = Mage::getModel('tiramizoo/time_window', $aTimeWindow);
$aTimeWindows[$oTimeWindow->getDeliveryFromDate()->getTimestamp()] = $aTimeWindow;
unset($aTimeWindows[$oldKey]);
}
ksort($aTimeWindows);
}
return $aTimeWindows ? $aTimeWindows : array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDeliveryWindows()\n {\n setlocale(LC_TIME, \"ES_es\");\n\n $delivery_windows = array();\n foreach($this->response->getDeliveryWindows() as $time_window)\n {\n $formatted_time = strftime(\"%A %e %B\", $time_window->getStartTime()->getTimestamp());\n $formatted_time .= \" entre las \".$time_window->getStartTime()->format(\"H\").\"h\";\n $formatted_time .= \" y las \".$time_window->getEndTime()->format(\"H\").\"h\";\n $delivery_windows[] = $formatted_time;\n }\n return $delivery_windows;\n }",
"public function validWindowProvider()\n {\n return array(\n array($this->createISO8601FromModification('-58 seconds')),\n array($this->createISO8601FromModification('-55 seconds')),\n array($this->createISO8601FromModification('-30 seconds')),\n array($this->createISO8601FromModification('-1 second')),\n );\n }",
"public function getTimes() {\n\t\t$data = array();\n\t\tfor ( $i = 0; $i < 24; $i ++ ) {\n\t\t\tforeach ( apply_filters( 'wd_scan_get_times_interval', array( '00', '30' ) ) as $min ) {\n\t\t\t\t$time = $i . ':' . $min;\n\t\t\t\t$data[ $time ] = apply_filters( 'wd_scan_get_times_hour_min', $time );\n\t\t\t}\n\t\t}\n\n\t\treturn apply_filters( 'wd_scan_get_times', $data );\n\t}",
"public function getScheduleTimes();",
"public static function getCurrentWeeksRange()\n {\n $tickets = self::weeklyTicketsByTypeQuery();\n $weeks = array();\n\n foreach ($tickets as $row)\n {\n array_push($weeks, $row['weekno']);\n }\n return $weeks;\n }",
"function getTimeSlices($timestamp = FALSE)\n{\n global $TIMESTEP;\n\n if($timestamp)\n {\n $tstart = strtotime(TIMESTART, $timestamp);\n $tend = strtotime(TIMEEND, $timestamp); \n }\n else\n {\n $tstart = strtotime(TIMESTART);\n $tend = strtotime(TIMEEND); \n }\n \n $timeSlices = array();\n for($i = $tstart ; $i < $tend; )\n {\n $start = $i;\n $end = addTime($i, $TIMESTEP);\n $timeSlices[] = array( \"start\" => $start, \"end\" => $end );\n $i = $end;\n }\n return $timeSlices;\n}",
"function station_current_schedule($scheds = array()) {\r\n\t$now = current_time(\"timestamp\");\r\n\t$current = array();\r\n\t\r\n\tforeach($scheds as $sched) {\r\n\t\r\n\t\tif($sched['day'] != date(\"l\", $now)) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t\t\r\n\t\t$start = strtotime(date('Y-m-d', $now).$sched['start_hour'].':'.$sched['start_min'].' '.$sched['start_meridian']);\r\n\t\t\t\r\n\t\tif($sched['start_meridian'] == 'pm' && $sched['end_meridian'] == 'am') { //check for shows that run overnight into the next morning\r\n\t\t\t$end = strtotime(date('Y-m-d', ($now+86400)).$sched['end_hour'].':'.$sched['end_min'].' '.$sched['end_meridian']);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$end = strtotime(date('Y-m-d', $now).$sched['end_hour'].':'.$sched['end_min'].' '.$sched['end_meridian']);\r\n\t\t}\r\n\t\t\r\n\t\t//a show can't end before it begins... if it does, it ends the following day.\r\n\t\tif($end <= $start) {\r\n\t\t\t$end = $end + 86400;\r\n\t\t}\r\n\t\t\t\r\n\t\t//compare to the current timestamp\r\n\t\tif($start <= $now && $end >= $now) {\r\n\t\t\t$current = $sched;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $current;\r\n}",
"public function getImmediateTimeWindow()\n {\n $return = null;\n\n foreach ($this->_timeWindows as $_timeWindow)\n {\n\t\t\t$timeWindow = Mage::getModel('tiramizoo/time_window', $_timeWindow);\n\n if ($timeWindow->isValid() && $timeWindow->isToday()) {\n $return = $timeWindow;\n break;\n }\n }\n\n return $return;\n }",
"function getAvailableTimes($date) {\n if ($date . dayOfWeek == \"Monday\") {\n return array(\"8:00 AM\", \"9:00 AM\", \"10:00 AM\");\n } else if ($date . dayOfWeek == \"Tuesday\") {\n return array(\"11:00 AM\", \"12:00 PM\", \"1:00 PM\");\n } else if ($date . dayOfWeek == \"Wednesday\") {\n return array(\"2:00 PM\", \"3:00 PM\", \"4:00 PM\");\n } else if ($date . dayOfWeek == \"Thursday\") {\n return array(\"5:00 PM\", \"6:00 PM\", \"7:00PM\");\n } else if ($date . dayOfWeek == \"Friday\") {\n return array(\"8:00 AM\", \"9:00 AM\", \"10:00 AM\");\n } else if ($date . dayOfWeek == \"Saturday\") {\n return array(\"11:00 AM\", \"12:00 PM\", \"1:00 PM\");\n } else if ($date . dayOfWeek == \"Sunday\") {\n return array(\"2:00 PM\", \"3:00 PM\", \"4:00 PM\");\n }\n }",
"function getCurrentEnds()\n{\t\n\t// set time zone and get the day\n\t//date_default_timezone_set(\"America/Toronto\");\n\t\n\t//get current time in time stamp\n\t//*****change this date to get a different as a measurement day*****\n\t$c_time = date(\"Y/m/d\");\n\t//echo $c_time;\n\n\t$week_array = getEndsOfWeek($c_time);\n return $week_array;\n}",
"function _calcWeeks()\r\n\t{\r\n\t\tif ($this->_spandir==1) // start is before stop (positive span)\r\n\t\t{\r\n\t\t\t$dtStart = new DateClass($this->StartDate);\r\n\t\t\t$dtStart = $dtStart->BOW();\r\n\t\t\t$dtStop = $this->StopDate;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$dtStart = new DateClass($this->StopDate);\r\n\t\t\t$dtStart = $dtStart->BOW();\r\n\t\t\t$dtStop = $this->StartDate;\r\n\t\t}\r\n\t\t\r\n\t\t//--------------------------------------------------\r\n\t\t//\tcount times crossing period boundries\r\n\t\t//--------------------------------------------------\r\n\t\t$counter=0;\r\n\t\twhile ($dtStart->TimeStamp() < $dtStop->TimeStamp())\r\n\t\t{\r\n\t\t\t$counter++;\t\t\t\r\n\t\t\t$dtStart->Add(\"day\",7);\r\n\t\t}\r\n\t\t$this->_weeks = $counter-1;\r\n\t\t$this->_weeks *= $this->_spandir;\r\n\t\t\r\n\t\treturn ($this->_weeks);\r\n\r\n\t}",
"public function getAvailabilityStarts();",
"function getTimeShifts()\n {\n $rawShift = DB::table('users')->find(Auth::user()->id)->shift;\n $listShiftId = explode('-', $rawShift);\n $shifts = DB::table('session')->whereIn('id', $listShiftId)->get()->toArray();\n return array_map(function ($shift) {\n $shiftStart = Carbon::parse($shift->start);\n $shiftEnd = Carbon::parse($shift->end);\n $start = $shiftStart->hour + $shiftStart->minute / 60; //hour unit\n $end = $shiftEnd->hour + $shiftEnd->minute / 60; //hour unit\n $spent = $end - $start;\n return [\n 'start' => $start,\n 'end' => $end,\n 'spent' => $spent\n ];\n }, $shifts);\n }",
"function getWeekSpan($max_week){\n\t\t$thisWeek = $this->getWeek(time());\n\t\t$FarthestWeek = $this->getWeek($thisWeek[\"start\"], $max_week);\n\t\t$now = time() - (40 * 60);\n\t\treturn array(\"start\" => $thisWeek[\"start\"], \"now\" => $now\t,\"end\" => $FarthestWeek[\"end\"]);\n\t}",
"public function timespan() {\n $timestamp = time() - (55*30*21*5*12*2);\n $timestamp2 = time() - (32*3*2*7*31*1*3*200);\n echo Kohana::debug(date::timespan($timestamp));\n print Kohana::debug(date::timespan($timestamp,time(),'months,days,minutes,seconds'));\n print Kohana::debug(date::timespan($timestamp,$timestamp2));\n }",
"public function getAvailabilityEnds();",
"function get_time_interval_label() {\n global $selected_time_window;\n\n if ($selected_time_window == day_time_window) {\n return \"1 day\";\n } else if ($selected_time_window == week_time_window) {\n return \"1 week\";\n } else if ($selected_time_window == month_time_window) {\n return \"1 month\";\n } else {\n return \"an unknown amount of time\";\n }\n}",
"function getTimes()\n {\n $ret = array();\n $ret['nolimit']=_(\"no limit\"); \n foreach(array(1,2,4,8,12,24,36,48) as $i){\n if($i == 1){\n $ret[$i] = $i.\" \"._(\"hour\");\n }else{\n $ret[$i] = $i.\" \"._(\"hours\");\n }\n }\n return($ret);\n }",
"public function testTimezoneToWindows()\n {\n $value = Zend_Locale_Data::getList('de_AT', 'timezonetowindows');\n $result = [\n 'Dateline Standard Time' => 'Etc/GMT+12',\n 'UTC-11' => 'Etc/GMT+11',\n 'Hawaiian Standard Time' => 'Pacific/Honolulu',\n 'Alaskan Standard Time' => 'America/Anchorage',\n 'Pacific Standard Time (Mexico)' => 'America/Santa_Isabel',\n 'Pacific Standard Time' => 'America/Los_Angeles',\n 'US Mountain Standard Time' => 'America/Phoenix',\n 'Mountain Standard Time (Mexico)' => 'America/Chihuahua',\n 'Mountain Standard Time' => 'America/Denver',\n 'Central America Standard Time' => 'America/Guatemala',\n 'Central Standard Time' => 'America/Chicago',\n 'Central Standard Time (Mexico)' => 'America/Mexico_City',\n 'Canada Central Standard Time' => 'America/Regina',\n 'SA Pacific Standard Time' => 'America/Bogota',\n 'Eastern Standard Time' => 'America/New_York',\n 'US Eastern Standard Time' => 'America/Indianapolis',\n 'Venezuela Standard Time' => 'America/Caracas',\n 'Paraguay Standard Time' => 'America/Asuncion',\n 'Atlantic Standard Time' => 'America/Halifax',\n 'Central Brazilian Standard Time' => 'America/Cuiaba',\n 'SA Western Standard Time' => 'America/La_Paz',\n 'Pacific SA Standard Time' => 'America/Santiago',\n 'Newfoundland Standard Time' => 'America/St_Johns',\n 'E. South America Standard Time' => 'America/Sao_Paulo',\n 'Argentina Standard Time' => 'America/Buenos_Aires',\n 'SA Eastern Standard Time' => 'America/Cayenne',\n 'Greenland Standard Time' => 'America/Godthab',\n 'Montevideo Standard Time' => 'America/Montevideo',\n 'Bahia Standard Time' => 'America/Bahia',\n 'UTC-02' => 'Etc/GMT+2',\n 'Azores Standard Time' => 'Atlantic/Azores',\n 'Cape Verde Standard Time' => 'Atlantic/Cape_Verde',\n 'Morocco Standard Time' => 'Africa/Casablanca',\n 'UTC' => 'Etc/GMT',\n 'GMT Standard Time' => 'Europe/London',\n 'Greenwich Standard Time' => 'Atlantic/Reykjavik',\n 'W. Europe Standard Time' => 'Europe/Berlin',\n 'Central Europe Standard Time' => 'Europe/Budapest',\n 'Romance Standard Time' => 'Europe/Paris',\n 'Central European Standard Time' => 'Europe/Warsaw',\n 'W. Central Africa Standard Time' => 'Africa/Lagos',\n 'Namibia Standard Time' => 'Africa/Windhoek',\n 'GTB Standard Time' => 'Europe/Bucharest',\n 'Middle East Standard Time' => 'Asia/Beirut',\n 'Egypt Standard Time' => 'Africa/Cairo',\n 'Syria Standard Time' => 'Asia/Damascus',\n 'South Africa Standard Time' => 'Africa/Johannesburg',\n 'FLE Standard Time' => 'Europe/Kiev',\n 'Turkey Standard Time' => 'Europe/Istanbul',\n 'Israel Standard Time' => 'Asia/Jerusalem',\n 'Libya Standard Time' => 'Africa/Tripoli',\n 'Jordan Standard Time' => 'Asia/Amman',\n 'Arabic Standard Time' => 'Asia/Baghdad',\n 'Kaliningrad Standard Time' => 'Europe/Kaliningrad',\n 'Arab Standard Time' => 'Asia/Riyadh',\n 'E. Africa Standard Time' => 'Africa/Nairobi',\n 'Iran Standard Time' => 'Asia/Tehran',\n 'Arabian Standard Time' => 'Asia/Dubai',\n 'Azerbaijan Standard Time' => 'Asia/Baku',\n 'Russian Standard Time' => 'Europe/Moscow',\n 'Mauritius Standard Time' => 'Indian/Mauritius',\n 'Georgian Standard Time' => 'Asia/Tbilisi',\n 'Caucasus Standard Time' => 'Asia/Yerevan',\n 'Afghanistan Standard Time' => 'Asia/Kabul',\n 'West Asia Standard Time' => 'Asia/Tashkent',\n 'Pakistan Standard Time' => 'Asia/Karachi',\n 'India Standard Time' => 'Asia/Calcutta',\n 'Sri Lanka Standard Time' => 'Asia/Colombo',\n 'Nepal Standard Time' => 'Asia/Katmandu',\n 'Central Asia Standard Time' => 'Asia/Almaty',\n 'Bangladesh Standard Time' => 'Asia/Dhaka',\n 'Ekaterinburg Standard Time' => 'Asia/Yekaterinburg',\n 'Myanmar Standard Time' => 'Asia/Rangoon',\n 'SE Asia Standard Time' => 'Asia/Bangkok',\n 'N. Central Asia Standard Time' => 'Asia/Novosibirsk',\n 'China Standard Time' => 'Asia/Shanghai',\n 'North Asia Standard Time' => 'Asia/Krasnoyarsk',\n 'Singapore Standard Time' => 'Asia/Singapore',\n 'W. Australia Standard Time' => 'Australia/Perth',\n 'Taipei Standard Time' => 'Asia/Taipei',\n 'Ulaanbaatar Standard Time' => 'Asia/Ulaanbaatar',\n 'North Asia East Standard Time' => 'Asia/Irkutsk',\n 'Tokyo Standard Time' => 'Asia/Tokyo',\n 'Korea Standard Time' => 'Asia/Seoul',\n 'Cen. Australia Standard Time' => 'Australia/Adelaide',\n 'AUS Central Standard Time' => 'Australia/Darwin',\n 'E. Australia Standard Time' => 'Australia/Brisbane',\n 'AUS Eastern Standard Time' => 'Australia/Sydney',\n 'West Pacific Standard Time' => 'Pacific/Port_Moresby',\n 'Tasmania Standard Time' => 'Australia/Hobart',\n 'Yakutsk Standard Time' => 'Asia/Yakutsk',\n 'Central Pacific Standard Time' => 'Pacific/Guadalcanal',\n 'Vladivostok Standard Time' => 'Asia/Vladivostok',\n 'New Zealand Standard Time' => 'Pacific/Auckland',\n 'UTC+12' => 'Etc/GMT-12',\n 'Fiji Standard Time' => 'Pacific/Fiji',\n 'Magadan Standard Time' => 'Asia/Magadan',\n 'Tonga Standard Time' => 'Pacific/Tongatapu',\n 'Samoa Standard Time' => 'Pacific/Apia',\n ];\n $this->assertEquals($result, $value);\n\n $value = Zend_Locale_Data::getContent('de_AT', 'timezonetowindows', 'Fiji Standard Time');\n $this->assertEquals(\"Pacific/Fiji\", $value);\n }",
"public function getWeekRange()\n {\n $myConfig = $this->getConfig();\n\n // initializing one week before current..\n $iFrom = oxRegistry::get(\"oxUtilsDate\")->getWeekNumber($myConfig->getConfigParam('iFirstWeekDay'), strtotime(oxRegistry::getConfig()->getRequestParameter(\"time_from\")));\n $iTo = oxRegistry::get(\"oxUtilsDate\")->getWeekNumber($myConfig->getConfigParam('iFirstWeekDay'), strtotime(oxRegistry::getConfig()->getRequestParameter(\"time_to\")));\n\n return array($iFrom - 1, $iTo + 1);\n }",
"public function getWindowSize(): DateInterval;",
"public function invalidWindowProvider()\n {\n return array(\n array($this->createISO8601FromModification('-61 seconds')),\n array($this->createISO8601FromModification('-1 day')),\n array($this->createISO8601FromModification('-1 year')),\n array($this->createISO8601FromModification('-100 year')),\n\n // Anything positive should fail\n array($this->createISO8601FromModification('+10 second')),\n array($this->createISO8601FromModification('+61 seconds')),\n array($this->createISO8601FromModification('+1 day')),\n array($this->createISO8601FromModification('+1 year')),\n array($this->createISO8601FromModification('+100 years')),\n );\n }",
"public function getDefaultTimeWindow()\n\t{\n\t\treturn $this->getImmediateTimeWindow();\n\t}",
"function getCurrentTimeWindow(){\n $tw=getCurrentTime();\n //$tw=06; \n if ($tw/2 <> intval($tw/2)) $tw-=1;\n // format to 2 digit (prefix 0) \n $prefixDigit=\"\";\n if (strlen($tw)<2) $prefixDigit=\"0\";\n // convert to text with hour so it match the row name in table\n $tw=$prefixDigit.$tw;\n return $tw;\n}",
"protected function getValidTimeRange()\n {\n $order2ECCmdLog = CommandLog::where('command_name', OrderEC2DB::class)->first();\n $ec2PosCmdLog = CommandLog::where('command_name', OrderDB2POS::class)->first();\n\n $start = !empty($ec2PosCmdLog) ? $ec2PosCmdLog['last_succeed_time'] : '';\n $end = !empty($order2ECCmdLog) ? $order2ECCmdLog['last_succeed_time'] : '';\n\n return [\n 'start' => $start,\n 'end' => $end\n ];\n }",
"function bank($active_time,$process_time){\n $count=count($active_time);\n $window=[];\n for ($i=0;$i<$count;$i++){\n if (count($window)<4){\n $window[]=$active_time[$i]+$process_time[$i];\n continue;\n }\n sort($window);\n $now_time=array_shift($window);\n if ($now_time>$active_time[$i]){\n $wait_time=$now_time-$active_time[$i];\n $window[]=$now_time+$process_time[$i];\n }else{\n $window[]=$active_time[$i]+$process_time[$i];\n }\n }\n return $wait_time/$count;\n}",
"public static function getTimeIntervals()\n {\n return self::$timeIntervals;\n }",
"public function getOpeningTimes()\n {\n return $this->openingTimes;\n }",
"public function getDaySpanning() {\n\t\tlist($start, $end) = $this->getStartEndDays();\n\t\t$inters = $this->getTimeIntervals($start, $end);\n\t\t$n = $this->getDayNumber($start, $end);\n\t\t$inter_n = array_fill(0, count($inters), 0);\n\t\t$day_span = array_fill(0, $n+1, $inter_n);\n\t\tforeach ($this->events as $event) {\n\t\t\t// The event must be between $start and $end\n\t\t\t$e_dstart = substr($event['start'], 0, 10);\n\t\t\t$e_dend = substr($event['end'], 0, 10);\n\t\t\tif ($e_dend < $start or $e_dstart > $end) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$day = $this->getDayNumber($start, substr($event['end'], 0, 10));\n\t\t\t$e_start = substr($event['start'], 11, 5);\n\t\t\t$e_end = substr($event['end'], 11, 5);\n\t\t\t$i = 0;\n\t\t\tforeach ($inters as $inter) {\n\t\t\t\tif ($inter < $e_end and $inter >= $e_start) {\n\t\t\t\t\t$day_span[$day][$i]++;\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\treturn $day_span;\n\t}",
"function count_hours($punch1,$punch2){\n\t//window is 5 minutes, or 300 seconds\n\t$window = 300;\n\t//interval is 15 minutes, or 900 seconds\n\t$interval = 900;\n\n\t$time = $punch2 - $punch1;\n\t$i=0;\n\twhile (($i*$interval)-$window < $time) {\n\t\t$i++;\n\t}\n\t$i -= 1;\n\treturn $i/4;\n}"
] | [
"0.6334556",
"0.6079271",
"0.60220903",
"0.59533215",
"0.58187765",
"0.579458",
"0.57570267",
"0.5736098",
"0.57314897",
"0.5731396",
"0.5591428",
"0.55886817",
"0.5585733",
"0.5514259",
"0.54976445",
"0.5440249",
"0.5359904",
"0.5357379",
"0.53380615",
"0.5324529",
"0.52820355",
"0.5260961",
"0.5254182",
"0.5244254",
"0.5214961",
"0.5209035",
"0.52063906",
"0.518323",
"0.51660985",
"0.5142259"
] | 0.7875894 | 0 |
Get service areas from API and save to config | public function saveServiceAreas()
{
$pickupContact = $this->getParam('pickup_contact');
$path = $this->getServiceAreasPath();
$oStartDate = new DateTime(date('Y-m-d'));
$oEndDate = new DateTime(date('Y-m-d'));
$oEndDate->modify('+2 days');
$startDate = $oStartDate->format('Y-m-d\TH:i:s\Z');
$endDate = $oEndDate->format('Y-m-d\TH:i:s\Z');
$rangeDates = array(
'express_from' => $startDate,
'express_to' => $endDate,
'standard_from' => $startDate,
'standard_to' => $endDate
);
$avaialbleServiceAreas = Mage::getModel('tiramizoo/api', array('api_token' => $this->_apiToken))
->getAvailableServiceAreas($pickupContact['postal_code'], $rangeDates);
if ($avaialbleServiceAreas['http_status'] != 200) {
throw new Exception("Can't connect to Tiramizoo API", 1);
}
if (isset($avaialbleServiceAreas['response'])) {
// var_dump(array('Path' => $path, 'ServiceAreas' => $avaialbleServiceAreas['response']));
// $avaialbleServiceAreas['response'] = $this->objectToArray($avaialbleServiceAreas['response']);
Mage::getModel('core/config')->saveConfig($path, json_encode($avaialbleServiceAreas['response']));
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getServiceAreas($name)\n {\n $return = false;\n\n if (!$this->_serviceAreas) {\n $this->_serviceAreas = Mage::getStoreConfig($this->getServiceAreasPath());\n }\n\n if ($this->_serviceAreas) {\n $config = json_decode($this->_serviceAreas, true);\n\n if (is_array($config) && isset($config[$name])) {\n $return = $config[$name];\n }\n }\n\n return $return;\n }",
"protected function mapService() {\n $this->validateService();\n\n $url = $this->oas['servers'][0]['url'];\n $parsedUrl = parse_url($url);\n\n return [\n 'name' => $this->sanitizeName($this->oas['info']['title']),\n 'host' => $parsedUrl['host'],\n 'path' => $parsedUrl['path'],\n ];\n }",
"public function config(){\n\t\t\n\t\t//Set the API url\n\t\t$mode = 'configuration';\n\t\t$apiKey = '?api_key='.API_KEY; // API_KEY is defined in config/constants.php\n\t\t$url_search = URL_API.$mode.$apiKey; //URL APIS is defined in config/constants.php\n\t\t//Use curl for get the json object \n\t\t$ca = curl_init();\n\t\tcurl_setopt($ca, CURLOPT_URL, $url_search);\n\t\tcurl_setopt($ca, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ca, CURLOPT_HEADER, FALSE);\n\t\tcurl_setopt($ca, CURLOPT_HTTPHEADER, array(\"Accept: application/json\"));\n\t\t$response = curl_exec($ca);\n\t\tcurl_close($ca);\n\t\t$config = json_decode($response, true);\n\t\treturn $config;\n\t\t\n\t}",
"private function getAreaService()\n {\n $service = new AreaService();\n\n return $service;\n }",
"public function getServices();",
"public function getServices();",
"public function getServices();",
"public static function get_admin_services_info() {\r\t\t\r\t\t$services = array();\r\t\t$services = Config::_get_services_info();\r\t\treturn $services;\r\t\r\t}",
"public function getAreas()\n {\n $templates = sfConfig::get('app_'.$this->engine.'_templates');\n return $templates[$this['template']]['areas'];\n }",
"public function getConfig(){\n\t\treturn array(\n\t\t\t'url' => $this->url,\n\t\t\t'useSandbox' => $this->useSandbox,\n\t\t\t'apikey' => $this->apikey\n\t\t);\n\t}",
"public function servicesProvider()\n {\n $config = $this->getServiceManager()->get('Config');\n $return = [];\n $servicesList = [];\n // Get all everything from the service manager\n foreach ($config['service_manager'] as $type => $serviceConfig) {\n if (!in_array($type, ['aliases', 'factories', 'invokables', 'services'])) {\n continue;\n }\n\n $servicesList = array_merge($servicesList, array_keys($serviceConfig));\n }\n\n // Gets everything from the config abstract factory\n foreach (array_keys($config[ConfigAbstractFactory::class]) as $service) {\n array_push($servicesList, $service);\n }\n\n sort($servicesList);\n foreach ($servicesList as $service) {\n if (in_array($service, $this->blackList)) {\n continue;\n }\n\n $return[$service] = [$service];\n }\n\n return $return;\n }",
"public function providerSetApiModeAndSetRegion()\n {\n return array(\n // Correct data\n array(Client::TANKS, Client::REGION_KOREA, null, 'api.worldoftanks.kr', false, false),\n array(Client::TANKS, Client::REGION_NORTH_AMERICA, null, 'api.worldoftanks.com', false, false),\n array(Client::TANKS, Client::REGION_RUSSIA, null, 'api.worldoftanks.ru', false, false),\n array(Client::TANKS, Client::REGION_EUROPE, null, 'api.worldoftanks.eu', false, false),\n array(Client::TANKS, Client::REGION_ASIA, null, 'api.worldoftanks.asia', false, false),\n\n array(Client::PLANES, Client::REGION_KOREA, null, 'api.worldofwarplanes.kr', false, false),\n array(Client::PLANES, Client::REGION_NORTH_AMERICA, null, 'api.worldofwarplanes.com', false, false),\n array(Client::PLANES, Client::REGION_RUSSIA, null, 'api.worldofwarplanes.ru', false, false),\n array(Client::PLANES, Client::REGION_EUROPE, null, 'api.worldofwarplanes.eu', false, false),\n array(Client::PLANES, Client::REGION_ASIA, null, 'api.worldofwarplanes.asia', false, false),\n\n // Valid apimode and setting a custom host\n array(Client::TANKS, null, 'example.com', 'example.com', false, false),\n array(Client::PLANES, null, 'example.ru', 'example.ru', false, false),\n\n // Invalid data\n // Invalid apimode and invalid region\n array('invalid_api_mode', 'invalid_region', null, 'api.worldoftanks.ru', true, true),\n // Invalid apimode and no region\n array('invalid_api_mode', null, null, 'api.worldoftanks.ru', true, false),\n // Invalid apimode with valid region\n array('invalid_api_mode', Client::REGION_RUSSIA, null, 'api.worldoftanks.ru', true, false),\n // Invalid apimode, no region and setting a custom host\n array('invalid_api_mode', null, 'api.worldoftanks.ru', 'api.worldoftanks.ru', true, false),\n // Invalid region and no custom host for all apimodes\n array(Client::TANKS, 'invalid_region', null, 'api.worldoftanks.ru', false, true),\n array(Client::PLANES, 'invalid_region', null, 'api.worldoftanks.ru', false, true)\n );\n }",
"public function getServiceConfig ()\n {\n $factories = array ();\n\n $factories['ExampleDataAPI\\Service'] = 'Example\\ExampleDataAPI\\Service\\Factory';\n $factories['ExampleDataAPI\\RouteStack'] = 'Example\\ExampleDataAPI\\RouteStack\\Factory';\n\n $factories['Example\\Resource\\Game'] = 'Example\\ExampleDataAPI\\Resource\\Game\\Factory';\n\n /**\n * Invokables should be used for a simple instantiation with no\n * dependencies.\n * If you have logic required to create the requested\n * service or object, use a factory\n *\n * Generally, invokables are great for strategy objects / Listeners\n */\n $invokables = array ();\n\n $service_config = array (\n 'factories' => $factories,\n 'invokables' => $invokables\n );\n\n return $service_config;\n }",
"private function getAreaService()\n {\n $service = new AreaService();\n $service->setUser($this->user);\n\n return $service;\n }",
"public static function services() {\n return [\n // Domestic services.\n 'AUS_SERVICE_OPTION_STANDARD' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Standard Post - 2-6 Days'),\n 'service_code' => ServiceCodes::AUS_PARCEL_REGULAR,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_STANDARD,\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n ],\n 'AUS_SERVICE_OPTION_SIGNATURE' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Standard Post, Signature required - 2-6 Days'),\n 'service_code' => ServiceCodes::AUS_PARCEL_REGULAR,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_SIGNATURE_ON_DELIVERY,\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n ],\n 'AUS_SERVICE_OPTION_INS' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Standard Post (Insured) - 2-6 Days'),\n 'service_code' => ServiceCodes::AUS_PARCEL_REGULAR,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_STANDARD,\n 'sub_opt_code' => ServiceOptions::AUS_SERVICE_OPTION_EXTRA_COVER,\n 'extra_cover' => 300,\n ],\n 'AUS_SERVICE_OPTION_SIG_INS' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Standard Post (Insured), Signature required - 2-6 Days'),\n 'service_code' => ServiceCodes::AUS_PARCEL_REGULAR,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_SIGNATURE_ON_DELIVERY,\n 'sub_opt_code' => ServiceOptions::AUS_SERVICE_OPTION_EXTRA_COVER,\n 'extra_cover' => 5000,\n ],\n 'AUS_PARCEL_EXPRESS' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Express Post - 1-3 Days'),\n 'service_code' => ServiceCodes::AUS_PARCEL_EXPRESS,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_STANDARD,\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n ],\n 'AUS_PARCEL_EXPRESS_SIGNATURE' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Express Post, Signature required - 1-3 Days'),\n 'service_code' => ServiceCodes::AUS_PARCEL_EXPRESS,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_SIGNATURE_ON_DELIVERY,\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n ],\n 'AUS_PARCEL_EXPRESS_INS' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Express Post (Insured) - 1-3 Days'),\n 'service_code' => ServiceCodes::AUS_PARCEL_EXPRESS,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_STANDARD,\n 'sub_opt_code' => ServiceOptions::AUS_SERVICE_OPTION_EXTRA_COVER,\n 'extra_cover' => 300,\n ],\n 'AUS_PARCEL_EXPRESS_SIG_INS' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Express Post (Insured), Signature required - 1-3 Days'),\n 'service_code' => ServiceCodes::AUS_PARCEL_EXPRESS,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_SIGNATURE_ON_DELIVERY,\n 'sub_opt_code' => ServiceOptions::AUS_SERVICE_OPTION_EXTRA_COVER,\n 'extra_cover' => 5000,\n ],\n 'AUS_PARCEL_COURIER' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Courier Post - Same Day Delivery'),\n 'service_code' => ServiceCodes::AUS_PARCEL_COURIER,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_STANDARD,\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n ],\n 'AUS_PARCEL_COUR_INS' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Courier Post (Insured) - Same Day Delivery'),\n 'service_code' => ServiceCodes::AUS_PARCEL_COURIER,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_STANDARD,\n 'sub_opt_code' => ServiceOptions::AUS_SERVICE_OPTION_EXTRA_COVER,\n 'extra_cover' => 5000,\n ],\n // International services.\n 'INT_PARCEL_SEA_OWN_PACKAGING' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post International Economy Sea - 30+ Days'),\n 'service_code' => ServiceCodes::INT_PARCEL_SEA_OWN_PACKAGING,\n 'option_code' => '',\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n ],\n 'INT_PARCEL_SEA_OWN_PACK_SIG' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post International Economy Sea, Signature required - 30+ Days'),\n 'service_code' => ServiceCodes::INT_PARCEL_SEA_OWN_PACKAGING,\n 'option_code' => ServiceOptions::INT_SIGNATURE_ON_DELIVERY,\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n ],\n 'INT_PARCEL_SEA_OWN_PACK_INS' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post International Economy Sea (Insured) - 30+ Days'),\n 'service_code' => ServiceCodes::INT_PARCEL_SEA_OWN_PACKAGING,\n 'option_code' => ServiceOptions::INT_EXTRA_COVER,\n 'sub_opt_code' => '',\n 'extra_cover' => 5000,\n ],\n // @codingStandardsIgnoreStart\n // Not working due to issues with AusPost.\n // 'INT_PAR_SEA_OWN_PACK_SIG_INS' => [\n // 'type' => ServiceTypes::self::PARCEL,\n // 'destination' => ServiceDestinations::INTERNATIONAL,\n // 'description' => t('Australia Post International Economy Sea (Insured), Signature required - 30+ Days'),\n // 'service_code' => ServiceCodes::INT_PARCEL_SEA_OWN_PACKAGING,\n // 'option_code' => [\n // '0' => ServiceOptions::INT_SIGNATURE_ON_DELIVERY,\n // '1' => ServiceOptions::INT_EXTRA_COVER,\n // ],\n // 'sub_opt_code' => '',\n // 'extra_cover' => 5000,\n // ],\n // @codingStandardsIgnoreEnd\n 'INT_PARCEL_AIR_OWN_PACKAGING' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post International Economy Air - 10+ Days'),\n 'service_code' => ServiceCodes::INT_PARCEL_AIR_OWN_PACKAGING,\n 'option_code' => '',\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n ],\n 'INT_PARCEL_AIR_OWN_PACK_SIG' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post International Economy Air, Signature required - 10+ Days'),\n 'service_code' => ServiceCodes::INT_PARCEL_AIR_OWN_PACKAGING,\n 'option_code' => ServiceOptions::INT_SIGNATURE_ON_DELIVERY,\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n ],\n 'INT_PARCEL_AIR_OWN_PACK_INS' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post International Economy Air (Insured) - 10+ Days'),\n 'service_code' => ServiceCodes::INT_PARCEL_AIR_OWN_PACKAGING,\n 'option_code' => ServiceOptions::INT_EXTRA_COVER,\n 'sub_opt_code' => '',\n 'extra_cover' => 5000,\n ],\n // @codingStandardsIgnoreStart\n // Not working due to issues with AusPost.\n // 'INT_PAR_AIR_OWN_PACK_SIG_INS' => [\n // 'type' => ServiceTypes::self::PARCEL,\n // 'destination' => ServiceDestinations::INTERNATIONAL,\n // 'description' => t('Australia Post International Economy Air (Insured), Signature required - 10+ Days'),\n // 'service_code' => ServiceCodes::INT_PARCEL_AIR_OWN_PACKAGING,\n // 'option_code' => [\n // '0' => ServiceOptions::INT_SIGNATURE_ON_DELIVERY,\n // '1' => ServiceOptions::INT_EXTRA_COVER,\n // ],\n // 'sub_opt_code' => '',\n // 'extra_cover' => 5000,\n // ],\n // @codingStandardsIgnoreEnd\n 'INT_PARCEL_STD_OWN_PACKAGING' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post International Standard - 6+ Days'),\n 'service_code' => ServiceCodes::INT_PARCEL_STD_OWN_PACKAGING,\n 'option_code' => '',\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n ],\n 'INT_PARCEL_STD_OWN_PACK_SIG' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post International Standard, Signature required - 6+ Days'),\n 'service_code' => ServiceCodes::INT_PARCEL_STD_OWN_PACKAGING,\n 'option_code' => ServiceOptions::INT_SIGNATURE_ON_DELIVERY,\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n ],\n 'INT_PARCEL_STD_OWN_PACK_INS' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post International Standard (Insured) - 6+ Days'),\n 'service_code' => ServiceCodes::INT_PARCEL_STD_OWN_PACKAGING,\n 'option_code' => ServiceOptions::INT_EXTRA_COVER,\n 'sub_opt_code' => '',\n 'extra_cover' => 5000,\n ],\n // @codingStandardsIgnoreStart\n // Not working due to issues with AusPost.\n // 'INT_PAR_STD_OWN_PACK_SIG_INS' => [\n // 'type' => ServiceTypes::self::PARCEL,\n // 'destination' => ServiceDestinations::INTERNATIONAL,\n // 'description' => t('Australia Post International Standard (Insured), Signature Required - 6+ Days'),\n // 'service_code' => ServiceCodes::INT_PARCEL_STD_OWN_PACKAGING,\n // 'option_code' => [\n // '0' => ServiceOptions::INT_SIGNATURE_ON_DELIVERY,\n // '1' => ServiceOptions::INT_EXTRA_COVER,\n // ],\n // 'sub_opt_code' => '',\n // 'extra_cover' => 5000,\n // ],\n // @codingStandardsIgnoreEnd\n 'INT_PARCEL_EXP_OWN_PACKAGING' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post International Express - 2-4 Days'),\n 'service_code' => ServiceCodes::INT_PARCEL_EXP_OWN_PACKAGING,\n 'option_code' => '',\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n ],\n 'INT_PARCEL_EXP_OWN_PACK_INS' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post International Express (Insured) - 2-4 Days'),\n 'service_code' => ServiceCodes::INT_PARCEL_EXP_OWN_PACKAGING,\n 'option_code' => ServiceOptions::INT_EXTRA_COVER,\n 'sub_opt_code' => '',\n 'extra_cover' => 5000,\n ],\n 'INT_PARCEL_COR_OWN_PACKAGING' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post International Courier - 1-2 Days'),\n 'service_code' => ServiceCodes::INT_PARCEL_COR_OWN_PACKAGING,\n 'option_code' => '',\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n ],\n 'INT_PARCEL_COR_OWN_PACK_INS' => [\n 'type' => ServiceTypes::PARCEL,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post International Courier (Insured) - 1-2 Days'),\n 'service_code' => ServiceCodes::INT_PARCEL_COR_OWN_PACKAGING,\n 'option_code' => ServiceOptions::INT_EXTRA_COVER,\n 'sub_opt_code' => '',\n 'extra_cover' => 5000,\n ],\n // Domestic Letter services.\n 'L_AUS_LETTER_SM' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Standard Letter - 2-6 Days'),\n 'service_code' => ServiceCodes::AUS_LETTER_REGULAR_SMALL,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_STANDARD,\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 240,\n 'width' => 130,\n 'height' => 5,\n 'weight' => 250,\n ],\n ],\n 'L_AUS_LETTER_SM_PRIORITY' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Standard Letter Priority - 1-4 Days'),\n 'service_code' => ServiceCodes::AUS_LETTER_PRIORITY_SMALL,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_STANDARD,\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 240,\n 'width' => 130,\n 'height' => 5,\n 'weight' => 250,\n ],\n ],\n 'L_AUS_LETTER_LG' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Standard Letter - 2-6 Days'),\n 'service_code' => ServiceCodes::AUS_LETTER_REGULAR_LARGE,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_STANDARD,\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 360,\n 'width' => 260,\n 'height' => 20,\n 'weight' => 500,\n ],\n ],\n 'L_AUS_LETTER_LG_PRIORITY' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Standard Letter Priority - 1-4 Days'),\n 'service_code' => ServiceCodes::AUS_LETTER_PRIORITY_LARGE_500,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_STANDARD,\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 360,\n 'width' => 260,\n 'height' => 20,\n 'weight' => 500,\n ],\n ],\n 'L_AUS_LETTER_SM_REG_POST' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Registered Post Letter - 2-6 Days'),\n 'service_code' => ServiceCodes::AUS_LETTER_REGULAR_SMALL,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_REGISTERED_POST,\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 240,\n 'width' => 130,\n 'height' => 20,\n 'weight' => 500,\n ],\n ],\n 'L_AUS_LETTER_SM_REG_CONF' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Registered Post Letter - Confirmation - 2-6 Days'),\n 'service_code' => ServiceCodes::AUS_LETTER_REGULAR_SMALL,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_REGISTERED_POST,\n 'sub_opt_code' => ServiceOptions::AUS_SERVICE_OPTION_DELIVERY_CONFIRMATION,\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 240,\n 'width' => 130,\n 'height' => 20,\n 'weight' => 500,\n ],\n ],\n 'L_AUS_LETTER_SM_REG_P2P' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Registered Post Letter - Person to Person - 2-6 Days'),\n 'service_code' => ServiceCodes::AUS_LETTER_REGULAR_SMALL,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_REGISTERED_POST,\n 'sub_opt_code' => ServiceOptions::AUS_SERVICE_OPTION_PERSON_TO_PERSON,\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 240,\n 'width' => 130,\n 'height' => 20,\n 'weight' => 500,\n ],\n ],\n // @codingStandardsIgnoreStart\n // Not working due to issues with AusPost.\n // 'L_AUS_LET_SM_REG_CONF_P2P' => [\n // 'type' => ServiceTypes::LETTER,\n // 'destination' => static::self::SERVICE_DEST_DOMESTIC,\n // 'description' => t('Australia Post Registered Post Letter - Person to Person - Confirmation - 2-6 Days'),\n // 'service_code' => ServiceCodes::AUS_LETTER_REGULAR_SMALL,\n // 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_REGISTERED_POST,\n // 'sub_opt_code' => [\n // '0' => ServiceOptions::AUS_SERVICE_OPTION_DELIVERY_CONFIRMATION,\n // '1' => ServiceOptions::AUS_SERVICE_OPTION_PERSON_TO_PERSON,\n // ],\n // 'extra_cover' => 0,\n // 'max_dimensions' => [\n // 'length' => 240,\n // 'width' => 130,\n // 'height' => 20,\n // 'weight' => 500,\n // ],\n // ],\n // @codingStandardsIgnoreEnd\n 'L_AUS_LETTER_LG_REG_POST' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Registered Post Letter Large - 2-6 Days'),\n 'service_code' => ServiceCodes::AUS_LETTER_REGULAR_LARGE,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_REGISTERED_POST,\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 360,\n 'width' => 260,\n 'height' => 20,\n 'weight' => 500,\n ],\n ],\n 'L_AUS_LETTER_LG_REG_POST_CONF' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Registered Post Letter Large - Confirmation - 2-6 Days'),\n 'service_code' => ServiceCodes::AUS_LETTER_REGULAR_LARGE,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_REGISTERED_POST,\n 'sub_opt_code' => ServiceOptions::AUS_SERVICE_OPTION_DELIVERY_CONFIRMATION,\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 360,\n 'width' => 260,\n 'height' => 20,\n 'weight' => 500,\n ],\n ],\n 'L_AUS_LETTER_LG_REG_P2P' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Registered Post Letter - Person to Person - 2-6 Days'),\n 'service_code' => ServiceCodes::AUS_LETTER_REGULAR_LARGE,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_REGISTERED_POST,\n 'sub_opt_code' => ServiceOptions::AUS_SERVICE_OPTION_PERSON_TO_PERSON,\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 360,\n 'width' => 260,\n 'height' => 20,\n 'weight' => 500,\n ],\n ],\n // @codingStandardsIgnoreStart\n // Not working due to issues with AusPost.\n // 'L_AUS_LET_LG_REG_CONF_P2P' => [\n // 'type' => ServiceTypes::LETTER,\n // 'destination' => static::self::SERVICE_DEST_DOMESTIC,\n // 'description' => t('Australia Post Registered Post Letter - Person to Person - Confirmation - 2-6 Days'),\n // 'service_code' => ServiceCodes::AUS_LETTER_REGULAR_LARGE,\n // 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_REGISTERED_POST,\n // 'sub_opt_code' => [\n // '0' => ServiceOptions::AUS_SERVICE_OPTION_DELIVERY_CONFIRMATION,\n // '1' => ServiceOptions::AUS_SERVICE_OPTION_PERSON_TO_PERSON,\n // ],\n // 'extra_cover' => 0,\n // 'max_dimensions' => [\n // 'length' => 360,\n // 'width' => 260,\n // 'height' => 20,\n // 'weight' => 500,\n // ],\n // ],\n // @codingStandardsIgnoreEnds\n 'L_AUS_LETTER_SM_EXP_POST' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Express Post Envelope Small - 1-3 Days'),\n 'service_code' => ServiceCodes::AUS_LETTER_EXPRESS_SMALL,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_STANDARD,\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 220,\n 'width' => 110,\n 'height' => 20,\n 'weight' => 500,\n ],\n ],\n 'L_AUS_LETTER_SM_EXP_SIG' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Express Post Envelope Small - Signature - 1-3 Days'),\n 'service_code' => ServiceCodes::AUS_LETTER_EXPRESS_SMALL,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_SIGNATURE_ON_DELIVERY,\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 220,\n 'width' => 110,\n 'height' => 20,\n 'weight' => 500,\n ],\n ],\n 'L_AUS_LETTER_MD_EXP' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Express Post Envelope Medium - 1-3 Days'),\n 'service_code' => ServiceCodes::AUS_LETTER_EXPRESS_MEDIUM,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_STANDARD,\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 229,\n 'width' => 162,\n 'height' => 20,\n 'weight' => 500,\n ],\n ],\n 'L_AUS_LETTER_MD_EXP_SIG' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Express Post Envelope Medium - Signature - 1-3 Days'),\n 'service_code' => ServiceCodes::AUS_LETTER_EXPRESS_MEDIUM,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_SIGNATURE_ON_DELIVERY,\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 229,\n 'width' => 162,\n 'height' => 20,\n 'weight' => 500,\n ],\n ],\n 'L_AUS_LETTER_LG_EXPRESS_POST' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Express Post Envelope Large - 1-3 Days'),\n 'service_code' => ServiceCodes::AUS_LETTER_EXPRESS_LARGE,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_STANDARD,\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 353,\n 'width' => 250,\n 'height' => 20,\n 'weight' => 500,\n ],\n ],\n 'L_AUS_LETTER_LG_EXP_POST_SIG' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::DOMESTIC,\n 'description' => t('Australia Post Express Post Envelope Large - Signature - 1-3 Days'),\n 'service_code' => ServiceCodes::AUS_LETTER_EXPRESS_LARGE,\n 'option_code' => ServiceOptions::AUS_SERVICE_OPTION_SIGNATURE_ON_DELIVERY,\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 353,\n 'width' => 250,\n 'height' => 20,\n 'weight' => 500,\n ],\n ],\n // International Letter services.\n 'L_INTL_SERVICE_AIR_MAIL_LGT' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post Air Mail Light - 6+ Days'),\n 'service_code' => ServiceCodes::INT_LETTER_AIR_OWN_PACKAGING_LIGHT,\n 'option_code' => '',\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 360,\n 'width' => 260,\n 'height' => 20,\n 'weight' => 50,\n ],\n ],\n 'L_INTL_SERVICE_AIR_MAIL_MED' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post Air Mail Medium - 6+ Days'),\n 'service_code' => ServiceCodes::INT_LETTER_AIR_OWN_PACKAGING_MEDIUM,\n 'option_code' => '',\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 360,\n 'width' => 260,\n 'height' => 20,\n 'weight' => 250,\n ],\n ],\n 'L_INTL_SERVICE_AIR_MAIL_HVY' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post Air Mail Heavy - 6+ Days'),\n 'service_code' => ServiceCodes::INT_LETTER_AIR_OWN_PACKAGING_HEAVY,\n 'option_code' => '',\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 360,\n 'width' => 260,\n 'height' => 20,\n 'weight' => 500,\n ],\n ],\n 'L_INT_LETTER_REG_SMALL' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post International Registered Prepaid DL Envelope - 6+ Days'),\n 'service_code' => ServiceCodes::INT_LETTER_REG_SMALL_ENVELOPE,\n 'option_code' => '',\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 240,\n 'width' => 130,\n 'height' => 5,\n 'weight' => 500,\n ],\n ],\n 'L_INT_LETTER_REG_LARGE' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post International Registered Prepaid B4 Envelope - 6+ Days'),\n 'service_code' => ServiceCodes::INT_LETTER_REG_LARGE_ENVELOPE,\n 'option_code' => '',\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 265,\n 'width' => 250,\n 'height' => 20,\n 'weight' => 500,\n ],\n ],\n 'L_INT_LET_EXP_OWN_PKG' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post International Express Letter - 2+ Days'),\n 'service_code' => ServiceCodes::INT_LETTER_EXP_OWN_PACKAGING,\n 'option_code' => '',\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 360,\n 'width' => 260,\n 'height' => 20,\n 'weight' => 500,\n ],\n ],\n 'L_INT_LET_EXP_OWN_PKG_INS' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post International Express Letter (Insured) - 2+ Days'),\n 'service_code' => ServiceCodes::INT_LETTER_EXP_OWN_PACKAGING,\n 'option_code' => ServiceOptions::INT_EXTRA_COVER,\n 'sub_opt_code' => '',\n 'extra_cover' => 5000,\n 'max_dimensions' => [\n 'length' => 360,\n 'width' => 260,\n 'height' => 20,\n 'weight' => 500,\n ],\n ],\n 'L_INT_LET_COR_OWN_PKG' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post International Courier Letter - 2+ Days'),\n 'service_code' => ServiceCodes::INT_LETTER_COR_OWN_PACKAGING,\n 'option_code' => '',\n 'sub_opt_code' => '',\n 'extra_cover' => 0,\n 'max_dimensions' => [\n 'length' => 360,\n 'width' => 260,\n 'height' => 20,\n 'weight' => 500,\n ],\n ],\n 'L_INT_LET_COR_OWN_PKG_INS' => [\n 'type' => ServiceTypes::LETTER,\n 'destination' => ServiceDestinations::INTERNATIONAL,\n 'description' => t('Australia Post International Courier Letter (Insured) - 2+ Days'),\n 'service_code' => ServiceCodes::INT_LETTER_COR_OWN_PACKAGING,\n 'option_code' => ServiceOptions::INT_EXTRA_COVER,\n 'sub_opt_code' => '',\n 'extra_cover' => 5000,\n 'max_dimensions' => [\n 'length' => 360,\n 'width' => 260,\n 'height' => 20,\n 'weight' => 500,\n ],\n ],\n ];\n }",
"private function setEndpoints() {\n $this->endpoints = array(\n \"login\" => $this->baseurl . \"api/token/\",\n \"refresh\" => $this->baseurl . \"api/token/refresh/\",\n \"users\" => $this->baseurl . \"api/users/\",\n \"groups\" => $this->baseurl . \"api/researchgroups/\",\n \"projects\" => $this->baseurl . \"api/projects/\",\n \"locations\" => $this->baseurl . \"api/locations/\",\n \"locationtypes\"=> $this->baseurl . \"api/locationtypes/\",\n \"useragents\" => $this->baseurl . \"api/useragents/\"\n );\n }",
"private function __getAreaInfo()\r\n {\r\n foreach($this->names_data as $name_detail)\r\n {\r\n $this->allAreaArray = array();\r\n $content = file_get_contents(self::AREA_URL . $name_detail->zh_name . '/');\r\n $reg = \"/<ul[^>]id=\\\"zone-id\\\" data-zone-id=\\\"None\\\">(.+?)<\\/ul>/si\";\r\n $regid = \"/<li><a[^>].*?data-zone=\\\"(.+?)\\\".*?>.*?<\\/a><\\/li>/is\";\r\n $regname = \"/<a[^>].*?data.+?>(.+?)<\\/a>/si\";\r\n\r\n preg_match($reg,$content,$match);\r\n $content = $match[0];\r\n\r\n //获取豆瓣区域ID\r\n preg_match_all($regname,$content,$match);\r\n $this->allAreaArray['name'] = $match[1];\r\n\r\n //获取豆瓣区域ID\r\n preg_match_all($regid,$content,$match);\r\n $this->allAreaArray['id'] = $match[1];\r\n $this->__disposeAreaData($name_detail->id);\r\n sleep(20);\r\n }\r\n\r\n\r\n }",
"public static function get_services(){\r\n\t\t// return [ ];\r\n\t\treturn [\r\n\t\t\tPages\\Admin::class,\r\n\t\t\tBase\\Enqueue::class,\r\n\t\t\tBase\\SettingsLinks::class \r\n\t\t];\r\n\t}",
"protected function get_webservices_config() {\n $file = $this->rlscriptsdir.'/automation/rlscripts/webservices_config';\n if (file_exists($file)) {\n $config = json_decode(trim(shell_exec($file)));\n if (($config != null) && array_key_exists('server', $config)) {\n $this->serverurl = $config->server;\n }\n if (($config != null) && array_key_exists('identity', $config)) {\n $this->identity = (array) $config->identity;\n }\n }\n }",
"public function coordinacion_areas()\n {\n // if ($request->ajax()) {\n\n $local_id = Input::get('localID');\n $area = Area::where([\n ['locales_id', '=', $local_id],\n ['deleted_at', null],\n ['estado', 1],\n ])->get();\n return response()->json($area);\n // }\n }",
"public function getServiceConfig()\n {\n // TODO: Implement getServiceConfig() method.\n }",
"protected function initParts() {\r\n return array(\r\n 'getConfigurationResponse' => new PartnerAPITypeGetConfigurationResponse()\r\n );\r\n }",
"public function getServiceAreasPath()\n {\n $this->_locationPath = $this->getLocationPath();\n $path = $this->_locationPath.$this->_serviceAreasPath;\n\n return $path;\n }",
"public function fetchLocations(){\n\t\t\n\t\t$locationsArr = array();\n\t\t$access_token = $this->generateGmbAccessToken(); \n\t\t\n\t\ttry{\n\t\t\t\n\t\t\t// fetching Location Groups\n\t\t\t\n\t\t\t$endpoint = 'https://mybusiness.googleapis.com/v4/accounts/';\t\n\n\t\t\t$client = new \\GuzzleHttp\\Client(['headers' => ['Authorization' => 'Bearer '.$access_token, 'Content-type'=> 'application/json']]);\n\t\t\t$response = $client->request('GET', $endpoint);\n\t\t\t$statusCode = $response->getStatusCode();\n\t\t\t$content = $response->getBody();\n\t\t\t$dataObj = json_decode($content);\t\t\t\n\t\t\t\n\t\t\tforeach($dataObj->accounts as $account){\n\t\t\t\t\n\t\t\t\t$path = $account->name;\n\t\t\t\t$name = $account->accountName;\n\t\t\t\t\n\t\t\t\t//fetching Locations\n\t\t\t\t\n\t\t\t\t$endpoint = 'https://mybusiness.googleapis.com/v4/'.$path.'/locations';\t\n\t\t\t\t$client = new \\GuzzleHttp\\Client(['headers' => ['Authorization' => 'Bearer '.$access_token, 'Content-type'=> 'application/json']]);\n\t\t\t\t$response = $client->request('GET', $endpoint);\n\t\t\t\t$statusCode = $response->getStatusCode();\n\t\t\t\t$content = $response->getBody();\n\t\t\t\t$locationsObj = json_decode($content);\n\t\t\t\t\n\t\t\t\tif(isset($locationsObj->locations)){\n\t\t\t\t\tforeach($locationsObj->locations as $location){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$location->locationGroupID = $path;\n\t\t\t\t\t\t$location->locationGroupName = $name;\n\t\t\t\t\t\tif(isset($location->locationState->isVerified)){\n\t\t\t\t\t\t\tif($location->locationState->isVerified == 1){\n\t\t\t\t\t\t\t\tarray_push($locationsArr, $location);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} // end foreach (locations)\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} // end foreach (accounts)\n\t\t\t\n\t\t\t return $locationsArr;\n\t\t\t \n\t\t\t\n\t\t\t\n\t\t}catch(\\Exception $ex){\n\n\t\t\treturn $locationsArr;\n\t\t}\n\t\t\n\t}",
"public function getServiceProviders();",
"protected function getServices(): array\n {\n }",
"protected function getServices(): array\n {\n }",
"public function getConfigMap();",
"private function getHotelServiceConfig()\n {\n $hotelServiceConfig = new \\HotelBundle\\Model\\HotelServiceConfig();\n $hotelServiceConfig->setIsRest(true);\n $hotelServiceConfig->setTransactionSourceId($this->transactionSourceId);\n $hotelServiceConfig->setPageSrc($this->pageSrc);\n\n return $hotelServiceConfig;\n }",
"function config(){\n\t\t$this->listen(array(\n\t\t\t\"max\" => 2,\n\t\t\t\"url\" => array(\"api\", \"/^(.*)$/\")\n\t\t\t),\n\t\t\tfunction() {\n\t\t\t\tsave(array(\"class\" => \"person\", \"method\"=> \"api\", \"mod\" => \"list\"));\n\t\t\t\t$this->permission =array(\"classification\" => array(\"select\" => array(\"public\", \"private\")));\n\t\t\t} \n\t\t);\n\n\t\t//------------------------------ person api to get list of auto complete \n\t\t$this->listen(array(\n\t\t\t\"max\" => 3,\n\t\t\t\"url\" => array(\"extera\" , \"status\" => \"detail\")\n\t\t\t),\n\t\t\tfunction() {\n\t\t\t\tsave(array(\"person\", \"exteradetail\"));\t\n\t\t\t\t$this->permission =array(\"person_extera\" => array(\"select\" => array(\"public\", \"private\")));\n\t\t\t} \n\t\t);\n\n\t\t//------------------------------ person api to get list of auto complete \n\t\t$this->listen(array(\n\t\t\t\"max\" => 3,\n\t\t\t\"url\" => array(\"extera\")\n\t\t\t),\n\t\t\tfunction() {\n\t\t\t\tsave(array(\"person\", \"extera\"));\t\n\t\t\t\t$this->permission =array(\"person_extera\" => array(\"select\" => array(\"public\", \"private\")));\n\t\t\t} \n\t\t);\n\t}"
] | [
"0.63996184",
"0.5842143",
"0.58187",
"0.56846654",
"0.561128",
"0.561128",
"0.561128",
"0.5566956",
"0.55604255",
"0.5556256",
"0.5526531",
"0.5499232",
"0.549492",
"0.54911906",
"0.54637724",
"0.54522574",
"0.5449711",
"0.54334",
"0.5419057",
"0.5413195",
"0.54056054",
"0.5375445",
"0.53688186",
"0.535445",
"0.5352327",
"0.53491765",
"0.53491765",
"0.5346234",
"0.53454804",
"0.53388953"
] | 0.72848934 | 0 |
Get config from API and save to config | public function saveRemoteConfig()
{
$path = $this->getConfigPath();
$result = Mage::getModel('tiramizoo/api', array('api_token' => $this->_apiToken))
->getRemoteConfiguration();
if ($result['http_status'] != 200) {
throw new Exception("Can't connect to Tiramizoo API", 1);
}
if (isset($result['response'])) {
Mage::getModel('core/config')->saveConfig($path, json_encode($result['response']));
$this->_config = json_encode($result['response']);
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function config(){\n\t\t\n\t\t//Set the API url\n\t\t$mode = 'configuration';\n\t\t$apiKey = '?api_key='.API_KEY; // API_KEY is defined in config/constants.php\n\t\t$url_search = URL_API.$mode.$apiKey; //URL APIS is defined in config/constants.php\n\t\t//Use curl for get the json object \n\t\t$ca = curl_init();\n\t\tcurl_setopt($ca, CURLOPT_URL, $url_search);\n\t\tcurl_setopt($ca, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ca, CURLOPT_HEADER, FALSE);\n\t\tcurl_setopt($ca, CURLOPT_HTTPHEADER, array(\"Accept: application/json\"));\n\t\t$response = curl_exec($ca);\n\t\tcurl_close($ca);\n\t\t$config = json_decode($response, true);\n\t\treturn $config;\n\t\t\n\t}",
"public function &getConfig();",
"public function get_site_config() {\n $config_path = $this->site_path().\"/config.json\";\n $raw_config = file_get_contents($config_path); // check for existance first\n $this->_config = json_decode($raw_config, true);\n $this->_dist_config = $this->_config;\n }",
"public function getConfig(){\n\t\treturn array(\n\t\t\t'url' => $this->url,\n\t\t\t'useSandbox' => $this->useSandbox,\n\t\t\t'apikey' => $this->apikey\n\t\t);\n\t}",
"protected function getConfig()\n {\n return C::get(C::JSON_API);\n }",
"public function getConfig();",
"public function getConfig();",
"public function getConfig();",
"public function getConfig();",
"function LoadConfig() {\r\n\t\tif(file_exists(__DIR__ . '/resources/data/config.json')) {\r\n\t\t\t$cfgCont = file_get_contents(__DIR__ . '/resources/data/config.json');\r\n\r\n\t\t\t$cfgCont = json_decode($cfgCont, true);\r\n\r\n\t\t\treturn $cfgCont;\r\n\t\t}\r\n\t}",
"public function getConfig(): Config;",
"private function getConfig() {\n static $config;\n if($config) {\n return $config;\n }\n\n // hard coded for now\n $files = array();\n $files[] = APP_ROOT_DIR . 'config/routing/main.json';\n\n\n // foreach($files as $file) {\n $config = json_decode(file_get_contents(self::getFullPath('config/routing/main.json')));\n return $config;\n // }\n\n }",
"private function getData() { return new Config($this->getDataFolder().\"settings.json\",Config::JSON); }",
"private function getConfig() {\n $config = $this->configFactory->get('collaborate_integration.auth_settings');\n return (object) [\n 'url' => $config->get('url'),\n 'key' => $config->get('key'),\n 'secret' => $config->get('secret'),\n ];\n }",
"public function config()\n { \n $path = $this->prepare_path(($this->settings())->configuration->path).'.php';\n\n $data = include($path);\n $data = json_decode(json_encode($data));\n\n return $data;\n }",
"function getConfig() {\n\tglobal $config;\n\tif ( !isset($config) || !$config ) {\n\t\t$config = json_decode( @file_get_contents(__DIR__ . '/config.json') );\n\t}\n\treturn $config;\n}",
"function config($api,$key=false)\n{\n\t$config=\\ui\\config($api);\n\tif($key){if(isset($config[$key]))\n\t\treturn $config[$key];\n\telse return NULL;\n\t}\n\treturn $config;\n}",
"public function getConfig(){\n return $this->getClient()->getConfig();\n }",
"protected function fetchConfigurationData()\n\t{\n\t\treturn $this->readConfig('config');\n\t}",
"protected function getConfig() {\n return $this->config;\n }",
"protected function _getConfig()\n {\n return Mage::getSingleton('checkoutapi_chargePayment/config');\n }",
"public function getConfig()\n {\n return Json::decode($this->config);\n }",
"protected function _getConfig()\n {\n return Mage::getSingleton('cybersource/config');\n }",
"function config()\n{\n return Config::get();\n}",
"private function _getConfig() {\n\t\treturn $this->_config;\n\t}",
"public function getConfig()\n {\n }",
"function getConfig();",
"function getConfig();",
"protected function getConfig()\n {\n return Mage::getSingleton('postfinance/config');\n }",
"protected function _getConfig()\n {\n\n return Mage::getSingleton('smsservice/config');\n }"
] | [
"0.7514833",
"0.6830446",
"0.6751721",
"0.67418456",
"0.663987",
"0.66224796",
"0.66224796",
"0.66224796",
"0.66224796",
"0.66051304",
"0.65884113",
"0.6565793",
"0.65004474",
"0.6490371",
"0.64549327",
"0.64107597",
"0.6395054",
"0.63564545",
"0.63527757",
"0.63292044",
"0.63010716",
"0.6288485",
"0.6286151",
"0.6278299",
"0.6268844",
"0.62600535",
"0.62127286",
"0.62127286",
"0.62125313",
"0.61983615"
] | 0.6930842 | 1 |
Remove common prefix. The common prefix is used in all cms pages. If prefix is remove, all cms page cache will be reset | public static function removePrefix()
{
Yii::app()->cmsCache->delete(self::getPrefixKey());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function removePrefixPage($slug)\n\t{\n\t Yii::app()->cmsCache->delete(self::getPrefixPageKey($slug));\n\t}",
"function removePrefix($name) {\n\t\tif(isset($this->params['remove_prefix']) && $this->params['remove_prefix'] != '') {\n\t\t\t$cname = preg_replace('@^'.$this->params['remove_prefix'].'@i', \"\", $name);\n\t\t} else {\n\t\t\t$cname = $name;\n\t\t}\n\t\treturn $cname;\n\t}",
"public function _remove($db_prefix = \"\");",
"function xcache_unset_by_prefix($prefix)\n{\n return XcacheMock::unsetByPrefix($prefix);\n}",
"private function prefix() {\n\n global $WC;\n\n $prefix = $this->local_prefix;\n\n $cache_prefix = xcache_get($prefix.\"_cache_prefix\");\n\n if($cache_prefix===false){\n $cache_prefix = $this->set_cache_prefix();\n }\n\n $prefix.=\"_$cache_prefix\";\n\n return $prefix;\n }",
"function remove_prefix(string $prefix, string $content): string\n{\n if (str_starts_with($content, $prefix)) {\n return substr($content, strlen($prefix));\n }\n\n return $content;\n}",
"public static function clearSessionVarsWithPrefix($prefix) {\n \tif (!isset($_SESSION)) {\r\n \t session_start();\r\n \t}\n \tforeach ($_SESSION as $key=>$val) {\n \t $pos = strpos($key, $prefix);\n if (($pos !== false) && ($pos == 0)) {\n \t \tunset($_SESSION[$key]);\n \t }\n \t}\n }",
"public function clear() {\n\n global $WC;\n\n $this->set_cache_prefix();\n\n }",
"function session_clear($prefix = NULL)\n{\n\tglobal $table_prefix;\n\t_session_start();\n\tif (is_null($prefix))\n\t\tsession_destroy();\n\telse\n\t{\n\t\t$prefix = $table_prefix . $prefix . '$';\n\t\tforeach ($_SESSION as $name => $val)\n\t\t\tif (substr($name, 0, strlen($prefix)) == $prefix)\n\t\t\t\tunset($_SESSION[$name]);\n\t}\n}",
"private function set_cache_prefix() {\n\n global $WC;\n\n $prefix = microtime(true);\n\n xcache_set($this->local_prefix.\"_cache_prefix\", $prefix);\n\n return $prefix;\n }",
"protected function clearNamespace() {\n if($this->className == 'plement')\n\t\t\t$this->oh->dbcache->clearNamespace($this->id);\n\t elseif ($this->className == 'season' OR $this->className == 'name' OR $this->className == 'directrule' OR $this->className == 'passthru')\n\t\t\t$this->oh->dbcache->clearNamespace($this->element_id);\n }",
"function unset_challenge($sess_prefix) {\n\t\t// Remove it bro!\n\t\t$this->CI->session->remove($sess_prefix . '_challenge');\n\t}",
"public function clearBase()\n {\n return $this -> setBase('') -> setPrefix('');\n }",
"public function cleanUp()\n {\n $this->filesystem->remove($this->builder->buildPrefix());\n }",
"public function remove_name_prefix() {\n $this->prefix_name = 0;\n\n return $this;\n }",
"static public function clearInterwikiCache() {\r\n\t\tglobal $wgLocalDatabases, $wgDBname;\r\n\t\tglobal $wgMemc;\r\n\r\n\t\twfProfileIn( __METHOD__ );\r\n\t\tif ( empty($wgLocalDatabases) ) {\r\n\t\t\t$wgLocalDatabases = array();\r\n\t\t}\r\n\t\t$wgLocalDatabases[] = $wgDBname;\r\n\r\n\t\t$dbr = wfGetDB( DB_SLAVE );\r\n\t\t$res = $dbr->select( 'interwiki', array( 'iw_prefix' ), false );\r\n\t\t$prefixes = array();\r\n\t\t$loop = 0;\r\n\t\twhile ( $row = $dbr->fetchObject( $res ) ) {\r\n\t\t\tforeach ( $wgLocalDatabases as $db ) {\r\n\t\t\t\t$wgMemc->delete(\"$db:interwiki:\" . $row->iw_prefix);\r\n\t\t\t\t$loop++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\twfProfileOut( __METHOD__ );\r\n\t\treturn $loop;\r\n\t}",
"public static function reset(string $prefix)\n {\n unset($_SESSION[$prefix . self::SUFFIX_VALUE]);\n unset($_SESSION[$prefix . self::SUFFIX_END_TIME]);\n }",
"static function delCookie($prefix, $domain=null) {\n foreach ($_COOKIE as $key => $cookie) {\n $isPrefix = WebBaseUtility::startWith($prefix, $key);\n if ($isPrefix) {\n setcookie($key, \"\", time() - 3600, null, $domain);\n $_COOKIE[$key] = null;\n }\n }\n }",
"public static function getPrefixKey()\n\t{\n return 'cms_page_prefix_key';\n\t}",
"function delete_options_prefixed( $prefix ) {\r\n global $wpdb;\r\n $wpdb->query( \"DELETE FROM {$wpdb->options} WHERE option_name LIKE '%{$prefix}%'\" );\r\n\r\n\r\n\t}",
"public static function clear($cacheIdPrefix)\n {\n if (extension_loaded('apc')) {\n if (!class_exists('APCIterator')) {\n throw new Kwf_Exception_NotYetImplemented(\"We don't want to clear the whole\");\n } else {\n static $prefix;\n if (!isset($prefix)) $prefix = Kwf_Cache_Simple::getUniquePrefix().'-';\n $it = new APCIterator('user', '#^'.preg_quote($prefix.$cacheIdPrefix).'#', APC_ITER_NONE);\n if ($it->getTotalCount() && !$it->current()) {\n //APCIterator is borked, delete everything\n //see https://bugs.php.net/bug.php?id=59938\n apc_clear_cache('user');\n } else {\n //APCIterator seems to work, use it for deletion\n apc_delete($it);\n }\n }\n } else {\n throw new Kwf_Exception_NotYetImplemented(\"We don't want to clear the whole\");\n }\n }",
"private function remove_wp_table_prefix( $table_name, $prefix ) {\n\t\t$prefix_len = strlen( $prefix );\n\t\tif ( substr( $table_name, 0, $prefix_len ) === $prefix ) {\n\t\t\treturn substr( $table_name, $prefix_len );\n\t\t}\n\t\treturn false;\n\t}",
"function wpms_remove_prefix_wp( $structure_permalink ) {\n\tforeach ( BEA_CHECK_SLUG as $slug ) {\n\t\t$slug = sprintf( '/%s/', $slug );\n\n\t\t// Stricly check if /%s/{something_else} begins with /%s/\n\t\tif ( substr( $structure_permalink, 0, strlen( $slug ) ) == $slug ) {\n\t\t\t// As it can match only one slug, directly returns the first guess one\n\t\t\t// Returns the same $structure_permalink without /%s first characters\n\t\t\treturn substr( $structure_permalink, strlen( $slug ) - 1, strlen( $structure_permalink ) );\n\t\t}\n\t}\n\n\t// return default one\n\treturn $structure_permalink;\n}",
"public static function add_prefix() {\n\t\t\tglobal $wpdb;\n\t\t\tif ( $wpdb->get_var( \"SHOW TABLES LIKE '\" . self::TABLE_NAME . \"'\" ) == self::TABLE_NAME ) {\n\t\t\t\t$query = 'ALTER TABLE ' . self::TABLE_NAME . ' RENAME TO ' . $wpdb->prefix . self::TABLE_NAME . ';';\n\t\t\t\t$wpdb->query( $query ); // db call ok; no-cache ok.\n\t\t\t}\n\t\t}",
"public function stripPrefix(string $path): string\n {\n return $this->getPrefixer()->stripPrefix($path);\n }",
"function ccfm_clear_cache_for_customized_theme() {\n ccfm_clear_cache_for_me( 'customize' ); \n}",
"function erase_comcode_cache()\n{\n static $done_once = false; // Useful to stop it running multiple times in admin_cleanup module, as this code takes time\n if ($done_once) {\n return;\n }\n\n cms_profile_start_for('erase_comcode_cache');\n\n if (multi_lang_content()) {\n if ((substr(get_db_type(), 0, 5) == 'mysql') && (!is_null($GLOBALS['SITE_DB']->query_select_value_if_there('db_meta_indices', 'i_fields', array('i_table' => 'translate', 'i_name' => 'decache'))))) {\n $GLOBALS['SITE_DB']->query('UPDATE ' . get_table_prefix() . 'translate FORCE INDEX (decache) SET text_parsed=\\'\\' WHERE ' . db_string_not_equal_to('text_parsed', '')/*this WHERE is so indexing helps*/);\n } else {\n $GLOBALS['SITE_DB']->query('UPDATE ' . get_table_prefix() . 'translate SET text_parsed=\\'\\' WHERE ' . db_string_not_equal_to('text_parsed', '')/*this WHERE is so indexing helps*/);\n }\n } else {\n global $TABLE_LANG_FIELDS_CACHE;\n foreach ($TABLE_LANG_FIELDS_CACHE as $table => $fields) {\n foreach (array_keys($fields) as $field) {\n if (strpos($field, '__COMCODE') !== false) {\n $GLOBALS['SITE_DB']->query('UPDATE ' . get_table_prefix() . $table . ' SET ' . $field . '__text_parsed=\\'\\' WHERE ' . db_string_not_equal_to($field . '__text_parsed', '')/*this WHERE is so indexing helps*/);\n }\n }\n }\n }\n\n $done_once = true;\n\n cms_profile_end_for('erase_comcode_cache');\n}",
"public static function getPrefix()\n\t{\n\t $prefixKey = Yii::app()->cmsCache->get(self::getPrefixKey());\n\t if ($prefixKey === false) {\n\t $prefixKey = uniqid(mt_rand(), true);\n\t Yii::app()->cmsCache->set(self::getPrefixKey(), $prefixKey);\n\t }\n\n\t return $prefixKey;\n\t}",
"public function remove_label_prefix() {\n $this->prefix_label = 0;\n\n return $this;\n }",
"function shoestrap_text_css_cache_reset() {\n delete_transient( 'shoestrap_text_css' );\n shoestrap_text_css_cache();\n}"
] | [
"0.62655026",
"0.6083905",
"0.6010923",
"0.5901193",
"0.5881476",
"0.5825416",
"0.5775695",
"0.5709219",
"0.5548052",
"0.54182756",
"0.54110533",
"0.53587",
"0.5338921",
"0.5257344",
"0.5255883",
"0.5232511",
"0.52103907",
"0.5207333",
"0.5196423",
"0.5192998",
"0.5191789",
"0.5186169",
"0.51801825",
"0.5120492",
"0.51161176",
"0.5107936",
"0.51002526",
"0.5076119",
"0.50613254",
"0.5041807"
] | 0.8302885 | 0 |
Remove prefix page. If prefix page is reset, the page cache will be reset in each languages. | public static function removePrefixPage($slug)
{
Yii::app()->cmsCache->delete(self::getPrefixPageKey($slug));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function removePrefix()\n\t{\n\t Yii::app()->cmsCache->delete(self::getPrefixKey());\n\t}",
"function osc_reset_static_pages() {\n return View::newInstance()->_erase('pages');\n }",
"function xcache_unset_by_prefix($prefix)\n{\n return XcacheMock::unsetByPrefix($prefix);\n}",
"function remove_prefix(string $prefix, string $content): string\n{\n if (str_starts_with($content, $prefix)) {\n return substr($content, strlen($prefix));\n }\n\n return $content;\n}",
"private function removeL10nPageOrphans()\n {\n if ($this->Database->tableExists('tl_page_i18nl10n')) {\n $this->Database->query('DELETE FROM tl_page_i18nl10n WHERE NOT EXISTS (SELECT * FROM tl_page as p WHERE tl_page_i18nl10n.pid = p.id)');\n }\n }",
"function erase_comcode_page_cache()\n{\n $GLOBALS['NO_QUERY_LIMIT'] = true;\n\n do {\n $rows = $GLOBALS['SITE_DB']->query_select('cached_comcode_pages', array('string_index'), null, '', 50, null, true, array());\n if (is_null($rows)) {\n $rows = array();\n }\n foreach ($rows as $row) {\n delete_lang($row['string_index']);\n $GLOBALS['SITE_DB']->query_delete('cached_comcode_pages', array('string_index' => $row['string_index']));\n }\n } while (count($rows) != 0);\n erase_persistent_cache();\n\n $GLOBALS['NO_QUERY_LIMIT'] = false;\n}",
"public function clear() {\n\n global $WC;\n\n $this->set_cache_prefix();\n\n }",
"public static function clearSessionVarsWithPrefix($prefix) {\n \tif (!isset($_SESSION)) {\r\n \t session_start();\r\n \t}\n \tforeach ($_SESSION as $key=>$val) {\n \t $pos = strpos($key, $prefix);\n if (($pos !== false) && ($pos == 0)) {\n \t \tunset($_SESSION[$key]);\n \t }\n \t}\n }",
"function purgeCache($page) {\n return $this->query('?action=purge&titles='.urlencode($page).'&format=php');\n }",
"public static function reset(string $prefix)\n {\n unset($_SESSION[$prefix . self::SUFFIX_VALUE]);\n unset($_SESSION[$prefix . self::SUFFIX_END_TIME]);\n }",
"public static function clearPage()\n {\n static::$page = null;\n }",
"function lt_clear_lang_meta() {\n\n $prefix = LT_META_PREFIX;\n\n //get order id\n $order_id = lt_get_order_cookie();\n \n //clear translate to order meta\n update_post_meta( $order_id, $prefix . 'tran_to', '' );\n \n}",
"public function deletePageLocation() {\r\n\t\t// location\r\n\t\t$sql = \"DELETE FROM wcf\".WCF_N.\"_page_location\r\n\t\tWHERE locationName LIKE 'wcf.content.page.page-\".$this->pageID.\"'\";\r\n\t\tWCF::getDB()->sendQuery($sql);\r\n\t\t\r\n\t\t// reset cache\r\n\t\tWCF::getCache()->clear(WCF_DIR.'cache', '*.php', true);\r\n\t}",
"public function removeLocalizedPageSlug($uuid)\n {\n unset($this->localized_slugs['pages'][$uuid]);\n }",
"public function purge() {\n\t\tforeach(glob($this->_cachepath . '*.page') as $file) {\n\t\t\tunlink($file);\n\t\t}\n\t}",
"public function _remove($db_prefix = \"\");",
"function delete_options_prefixed( $prefix ) {\r\n global $wpdb;\r\n $wpdb->query( \"DELETE FROM {$wpdb->options} WHERE option_name LIKE '%{$prefix}%'\" );\r\n\r\n\r\n\t}",
"public function clearPageCache()\n {\n $this->clear(CacheConfig::URL);\n $this->clear(CacheConfig::MENU);\n $this->clear(CacheConfig::MENU_PAGES);\n $this->clear(CacheConfig::PAGE_LANGUAGE_FOR_URL);\n $this->clear(CacheConfig::PAGE_LANGUAGE_FOR_KEY);\n $this->clear(CacheConfig::PAGE_FOR_KEY);\n $this->clear(CacheConfig::URL_FOR_KEY);\n\n $this->existingPageCacheService->clear();\n }",
"function remove_gutenberg() {\n\tremove_menu_page( 'gutenberg' );\n}",
"public function remove_homepage_templates() {\n\t\tremove_action( 'homepage', 'storefront_featured_products', 40 );\n\t\tremove_action( 'homepage', 'storefront_homepage_content', 10 );\n\t\t//remove_action( 'storefront_header', 'storefront_header_cart', \t\t\t60 );\n\t}",
"public function removeTitlePage()\n {\n $xhtmlFilename = self::TITLE_PAGE_ID . '.xhtml';\n\n // remove title page file from zip\n $this->zip->deleteName($this->packageDir . $xhtmlFilename);\n\n // remove title page file from manifest\n $nodes = $this->packageXPath->query('//opf:manifest/opf:item[@id=\"' . self::TITLE_PAGE_ID . '\"]');\n foreach ($nodes as $node) {\n /** @var EpubDomElement $node */\n $node->delete();\n }\n\n // remove title page spine item\n $nodes = $this->packageXPath->query('//opf:spine/opf:itemref[@idref=\"' . self::TITLE_PAGE_ID . '\"]');\n foreach ($nodes as $node) {\n /** @var EpubDomElement $node */\n $node->delete();\n }\n\n // remove title page guide reference\n $nodes = $this->packageXPath->query('//opf:guide/opf:reference[@href=\"' . $xhtmlFilename . '\"]');\n foreach ($nodes as $node) {\n /** @var EpubDomElement $node */\n $node->delete();\n }\n }",
"public function remove_label_prefix() {\n $this->prefix_label = 0;\n\n return $this;\n }",
"public function clearPageCache() {\n\t\t// Initialize\n\t\t$i_pid = intval(t3lib_div::_GET('id'));\n\t\t\n\t\t// Clear RealURL cache tables\n\t\t$GLOBALS['TYPO3_DB']->exec_DELETEquery(\n\t\t\t'tx_realurl_pathcache',\n\t\t\t'page_id = '.$i_pid\n\t\t);\n\t\t$GLOBALS['TYPO3_DB']->exec_DELETEquery(\n\t\t\t'tx_realurl_urldecodecache',\n\t\t\t'page_id = '.$i_pid\n\t\t);\n\t\t$GLOBALS['TYPO3_DB']->exec_DELETEquery(\n\t\t\t'tx_realurl_urlencodecache',\n\t\t\t'page_id = '.$i_pid\n\t\t);\n\t\t\n\t\t// Get page properties\n\t\t$a_pageData = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(\n\t\t\t'doktype',\n\t\t\t'pages',\n\t\t\t'uid = '.$i_pid\n\t\t);\n\t\t\n\t\t// Process page, if page is found and if it's a SysFolder\n\t\tif($a_pageData[0]['doktype'] == 254) {\n\t\t\t// First we need to get all tables that have records stored on this page, and \n\t\t\t// that could unique aliasses. Since looping through all tables in the TCA \n\t\t\t// takes simply too much time, we will use a more clever aproach. We will first \n\t\t\t// select the tables that are stored inside the tx_realurl_uniqalias table.\n\t\t\t$a_availableTables = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(\n\t\t\t\t'DISTINCT tablename, field_id',\n\t\t\t\t'tx_realurl_uniqalias',\n\t\t\t\t'1=1'\n\t\t\t);\n\t\t\t\n\t\t\t// Find all records for this table that match our criteria\n\t\t\tforeach($a_availableTables as $a_tableData) {\n\t\t\t\t// First we get all the records found in tx_realurl_uniqalias matching $a_tableData[tablename]\n\t\t\t\t$a_dataRecords = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(\n\t\t\t\t\t$a_tableData['field_id'],\n\t\t\t\t\t$a_tableData['tablename'],\n\t\t\t\t\t'pid = '.$i_pid\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t// To keep some speed, limit each delete query to have 10 list items\n\t\t\t\t$i_itemLimit = 10;\n\t\t\t\t$i_totalItems = count($a_dataRecords);\n\t\t\t\t$a_deleteBatches = array();\n\t\t\t\t$a_batchData = array();\n\t\t\t\t\n\t\t\t\t// Create the actual batches\n\t\t\t\tforeach($a_dataRecords as $a_dataRecord) {\n\t\t\t\t\t$a_batchData[] = $a_dataRecord['uid'];\n\t\t\t\t\t\n\t\t\t\t\t// If the batch is full, add it and create a new one\n\t\t\t\t\tif(count($a_batchData) == $i_itemLimit) {\n\t\t\t\t\t\t$a_deleteBatches[] = \"'\".implode(\"','\",$a_batchData).\"'\";\n\t\t\t\t\t\t$a_batchData = array();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$a_deleteBatches[] = \"'\".implode(\"','\",$a_batchData).\"'\";\n\t\t\t\t\n\t\t\t\t// Loop through the batches to delete the actual data\n\t\t\t\tforeach($a_deleteBatches as $s_recordList) {\n\t\t\t\t\t$GLOBALS['TYPO3_DB']->exec_DELETEquery(\n\t\t\t\t\t\t'tx_realurl_uniqalias',\n\t\t\t\t\t\t'value_id IN ('.$s_recordList.') AND tablename = \\''.$a_tableData['tablename'].'\\' AND field_id = \\''.$a_tableData['field_id'].'\\''\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function session_clear($prefix = NULL)\n{\n\tglobal $table_prefix;\n\t_session_start();\n\tif (is_null($prefix))\n\t\tsession_destroy();\n\telse\n\t{\n\t\t$prefix = $table_prefix . $prefix . '$';\n\t\tforeach ($_SESSION as $name => $val)\n\t\t\tif (substr($name, 0, strlen($prefix)) == $prefix)\n\t\t\t\tunset($_SESSION[$name]);\n\t}\n}",
"function removePrefix($name) {\n\t\tif(isset($this->params['remove_prefix']) && $this->params['remove_prefix'] != '') {\n\t\t\t$cname = preg_replace('@^'.$this->params['remove_prefix'].'@i', \"\", $name);\n\t\t} else {\n\t\t\t$cname = $name;\n\t\t}\n\t\treturn $cname;\n\t}",
"public function deletePageCache() {\n \t$uid = $this['uid'];\n \ttx_pttools_assert::isValidUid($uid, array('message' => 'Adding to cache is only possible for saved objects.'));\n \t$cacheIdentifier = $this->getClassName() . '_' . $uid;\n \ttx_tcaobjects_cacheControl::flushByTag($cacheIdentifier);\n }",
"public function resetPageCount();",
"private function remove_wp_table_prefix( $table_name, $prefix ) {\n\t\t$prefix_len = strlen( $prefix );\n\t\tif ( substr( $table_name, 0, $prefix_len ) === $prefix ) {\n\t\t\treturn substr( $table_name, $prefix_len );\n\t\t}\n\t\treturn false;\n\t}",
"public function removeIndexPageStatus();",
"function wp_list_pages_deinstall()\n{\n\tdelete_option('wp_list_pages_tweaks');\n}"
] | [
"0.7729884",
"0.61288905",
"0.5994597",
"0.5955794",
"0.5912164",
"0.5838849",
"0.58051735",
"0.57446134",
"0.5663612",
"0.5656767",
"0.5635831",
"0.56212443",
"0.55766195",
"0.5563972",
"0.5500948",
"0.54809576",
"0.54789317",
"0.5475454",
"0.54625094",
"0.54518926",
"0.5409369",
"0.5396404",
"0.53655267",
"0.535905",
"0.5341226",
"0.5337098",
"0.5335805",
"0.53298223",
"0.5321757",
"0.5315694"
] | 0.7160405 | 1 |
Parse html content to find widget | protected function _parseContent($html, &$controller)
{
$list = array();
preg_match_all("#\<cms_widget id=\"(.*)\">(.*)</cms_widget>#msU", $html, $list, PREG_SET_ORDER);
$find = array();
$replace = array();
foreach ($list as $function) {
$model = UCmsWidget::model()->findByPk($function[1]);
if($model !== null) {
$arg = CJSON::decode($model->arg);
if($arg === null) {
$arg = array();
}
$find[] = '<cms_widget id="'.$function[1].'">'.$function[2].'</cms_widget>';
$replace[] = $controller->widget($model->path, $arg, true);
}
}
return str_replace($find, $replace, $html);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function parseHtml();",
"protected function parseHTML()\n {\n $crawler = new Crawler($this->html);\n $change = $crawler->filter('#daychange1')->first();\n if(false === strpos($change->attr('class'), 'Loss') ) {\n $changeDirection = 'up';\n } else {\n $changeDirection = 'down';\n }\n\n $change = $this->plainNumber( $change->text() );\n $price = $crawler->filter('.ofLikeComponent .ofMedium strong')->first()->text();\n $price = $this->plainNumber( $price );\n\n $this->liveData->sell_price = $price;\n $this->liveData->last_price = $price;\n $this->liveData->last_change = $change;\n $this->liveData->last_direction = $changeDirection;\n\n $this->liveData->m3 = $this->lookupCell('3 Months',$crawler);\n $this->liveData->m6 = $this->lookupCell('6 Months',$crawler);\n $this->liveData->m12 = $this->lookupCell('1 Year',$crawler);\n }",
"public function ajax_get_widget()\n\t{\n\t\t$widget = $this->_widgets[$this->EE->input->get('wgt')];\n\t\t$obj = $this->_get_widget_object($widget['mod'], $widget['wgt']);\n\t\t$content = $obj->index(json_decode($widget['stng']));\n\t\t$result = array(\n\t\t\t'title'\t\t=> $obj->title,\n\t\t\t'content' \t=> $content\n\t\t\t);\n\t\techo json_encode($result);\n\t\texit();\n\t}",
"public function parse($html);",
"public function get_widget()\n\t{\n\t\t$widget = $this->_widgets[$this->_EE->input->get('wgt')];\n\t\t$obj = $this->_get_widget_object($widget['mod'], $widget['wgt']);\n\t\t$this->_add_widget_package_path($widget['mod']);\n\t\t$content = $obj->index(json_decode($widget['stng']));\n\t\t$result = array(\n\t\t\t'title'\t\t=> $obj->title,\n\t\t\t'content' \t=> $content\n\t\t\t);\n\t\techo json_encode($result);\n\t\texit();\n\t}",
"public function findInfo($html);",
"abstract protected function get_widget();",
"public function renderWidget()\n\t{\n\t\t$heading = str_replace('{heading}', $this->heading, Yii::app()->cms->widgetHeadingTemplate);\n\t\t$content = $this->renderHeading($heading, $this->body);\n\t\t$content = $this->renderLinks($content);\n\t\t$content = $this->renderEmails($content);\n\t\t$content = $this->renderImages($content);\n\t\t$content = $this->renderAttachments($content);\n\t\t$content = preg_replace($this->_patterns['node'], '', $content); // widgets do not render inline nodes\n\n\t\treturn $content;\n\t}",
"function get_content($url,$tag)\n{\n $html = file_get_html($url);\n global $metars;\n echo '<br><br>';\n \n foreach(($html->find('#content #primary_content '.$tag)) as $i=>$metar)\n {\n echo $metar;\n $metars[] = $metar;\n }\n}",
"public function parseHtmlRaw( $html ) {\n \n }",
"function cot_parse_html($text)\n{\n\treturn $text;\n}",
"public function parseHtmlDom( simple_html_dom $html ) {\n \n }",
"private function parse_html($content){\n return $content;\n }",
"function html() {\n\n $tpl=new gs_tpl();\n\t\t$tpl=$tpl->init();\n\n $tpl->addTemplateDir(dirname(__FILE__).DIRECTORY_SEPARATOR.'templates');\n\n\n\n\t\t$params=$this->params;\n\t\t\n $params['value']=$this->value;\n\t\t$params['fieldname']=$this->fieldname;\n\n\t\t$tpl->assign('params',$params);\n\t\t$tpl->assign('data',$this->data);\n\n\t\treturn $tpl->fetch('widget.html');\n\n\t}",
"abstract protected function _builtWidget($element);",
"public function widget_content() {\n\t\techo \"Example extension's widget\";\n\t}",
"public function parseContentWithCandidates()\n {\n $dom = XmlParser::getHtmlDocument('<?xml version=\"1.0\" encoding=\"UTF-8\">'.$this->html);\n $xpath = new DOMXPath($dom);\n\n // Try to lookup in each tag\n foreach ($this->candidatesAttributes as $candidate) {\n\n Logger::setMessage(get_called_class().': Try this candidate: \"'.$candidate.'\"');\n\n $nodes = $xpath->query('//*[(contains(@class, \"'.$candidate.'\") or @id=\"'.$candidate.'\") and not (contains(@class, \"nav\") or contains(@class, \"page\"))]');\n\n if ($nodes !== false && $nodes->length > 0) {\n $this->content = $dom->saveXML($nodes->item(0));\n Logger::setMessage(get_called_class().': Find candidate \"'.$candidate.'\" ('.strlen($this->content).' bytes)');\n break;\n }\n }\n\n // Try to fetch <article/>\n if (strlen($this->content) < 200) {\n\n $nodes = $xpath->query('//article');\n\n if ($nodes !== false && $nodes->length > 0) {\n $this->content = $dom->saveXML($nodes->item(0));\n Logger::setMessage(get_called_class().': Find <article/> tag ('.strlen($this->content).' bytes)');\n }\n }\n\n // Get everything\n if (strlen($this->content) < 50) {\n\n $nodes = $xpath->query('//body');\n\n if ($nodes !== false && $nodes->length > 0) {\n Logger::setMessage(get_called_class().' No enought content fetched, get //body');\n $this->content = $dom->saveXML($nodes->item(0));\n }\n }\n\n Logger::setMessage(get_called_class().': Strip garbage');\n $this->stripGarbage();\n }",
"protected function parse_content($content)\n {\n $pattern = '#<Table.*id=\"masterDataTable\".*>';\n $pattern .= '.*<td class=\"TrOdd\".*><img src=\"./Buildingimages/(?P<picture>.+)\".*></td>';\n $pattern .= '.*<td class=\"ThRows\">Additional Images</td><td class=\"TrOdd\".*>.*<b>(?P<pics_count>\\d+)</b>.*</td>'; // pictutes count\n $pattern .= '.*<td class=\"ThRows\">Name & Location</td><td class=\"TrOdd\".*><font size = 4><b>(?P<name>.+)</font><br>(?P<address>.+)<br>(?P<location>.+)</b></td>'; // name, address, location\n $pattern .= '.*<td class=\"ThRows\">Other Identification</td><td class=\"TrOdd\".*>(?P<identification>.+)</td>'; // identification\n $pattern .= '.*<td class=\"ThRows\">Notes</td><td class=\"TrOdd\".*>(?P<notes>.*)</td>'; // notes\n $pattern .= '.*<td class=\"ThRows\">Quote</td><td class=\"TrOdd\".*>(?P<quote>.*)</td>'; // quote\n $pattern .= '.*<td class=\"ThRows\">Status</td><td class=\"TrOdd\".*>(?P<status>.+)</td>'; // status\n $pattern .= '.*<td class=\"ThRows\">Year Completed</td><td class=\"TrOdd\".*>(?P<year_completed>.+)</td>'; // year completed\n $pattern .= '.*<td class=\"ThRows\">Companies</td><td class=\"TrOdd\".*>(?P<companies>.*)</td>'; // companies\n $pattern .= '.*<td class=\"ThRows\">Click for Google Map</td><td class=\"TrOdd\".*>(?P<google_map>.+)</td>'; // google map\n $pattern .= '.*<td class=\"ThRows\"><font size = 3>Height and Building Data</font></td><td class=\"TrOdd\".*>(?P<building_data>.*)</td>'; // building data\n $pattern .= '.*<td class=\"ThRows\">Floors</td><td class=\"TrOdd\".*>(?P<floors>.+)</td>'; // floors\n $pattern .= '.*<td class=\"ThRows\">Height \\(m\\)</td><td class=\"TrOdd\".*>(?P<height>.+)</td>'; // height\n $pattern .= '.*<td class=\"ThRows\">Building type</td><td class=\"TrOdd\".*>(?P<type>.+)</td>'; // type\n $pattern .= '.*<td class=\"ThRows\">General use</td><td class=\"TrOdd\".*>(?P<general_use>.*)</td>'; // general use\n $pattern .= '.*<td class=\"ThRows\">Specific Use</td><td class=\"TrOdd\".*>(?P<specific_use>.*)</td>'; // specific use\n $pattern .= '.*<td class=\"ThRows\">Former Use</td><td class=\"TrOdd\".*>(?P<former_use>.*)</td>'; // former use\n $pattern .= '.*<td class=\"ThRows\">Heritage</td><td class=\"TrOdd\".*>(?P<heritage>.+)</td>'; // heritage\n $pattern .= '.*<td class=\"ThRows\">Main Style</td><td class=\"TrOdd\".*>(?P<main_style>.+)</td>.*'; // main style\n $pattern .= '</Table>#sU';\n\n $content = iconv('ISO-8859-1', 'UTF-8', $content);\n\n preg_match($pattern, $content, $matches);\n\n // get db table keys\n $keys = array_keys(ORM::factory('house')->table_columns());\n\n // extract values from matches\n $values = Arr::extract($matches, $keys);\n\n // append main image name & count for download them\n // later will be unset\n $values['pics_count'] = Arr::get($matches, 'pics_count', 0);\n\n // remove white spaces\n return Arr::map('trim', $values);\n }",
"function parse_dom($html) { \n return get_dom_tree($html); //domparser.php\n}",
"private function parse()\r\n {\r\n // add current action to js data\r\n $this->addJSData('Settings', array('Action' => $this->getAction()));\r\n\r\n // add js\r\n $this->addJS('marked-0.3.3/marked.min.js', false);\r\n $this->addJS('highlight-8.4/highlight.pack.js', false);\r\n $this->addJS('taboverride-4.0.2/taboverride.js', false);\r\n $this->addJS('Purify.js', false);\r\n\r\n // highlight theme\r\n $this->addCSS('highlight-8.4/styles/github.css', false);\r\n\r\n // parse form\r\n $this->frm->parse($this->tpl);\r\n }",
"public function parseContent($html) {\n\t\treturn $this->getHtmlParser()->parse($html);\n\t}",
"function parseContent()\n{\n global $app;\n\n for($i = 0; $i < count($this->items); $i++) {\n if ($this->items[$i]['visible']) {\n $this->items[$i]['TextList'] = $app->parseChunk($this->items[$i]['TextList']);\n }\n if ($this->items[$i]['showit']) {\n $this->items[$i]['TextChunk'] = $app->parseChunk($this->items[$i]['TextChunk']);\n $this->items[$i]['TextFooter'] = $app->parseChunk($this->items[$i]['TextFooter']);\n // Set the main variable for this item since we're showing it.\n $this->dispItem = $this->items[$i];\n }\n }\n // Now, get the children of the displayed item, if any.\n for($i = 0; $i < count($this->items); $i++) {\n if ($this->items[$i]['ParentID'] == $this->dispItem['CatConID']) {\n array_push($this->dispChildren, $this->items[$i]);\n }\n }\n}",
"function rad_rss_widget_content(){\n\techo '<div class=\"rss-widget\">';\n\twp_widget_rss_output( array(\n\t\t'url' => 'http://rss1.smashingmagazine.com/feed/',\n\t\t'items' => 4,\n\t\t'show_summary' => 1,\n\t\t'show_author' => 0,\n\t\t'show_date' => 1,\n\t) );\n\techo '</div>';\n}",
"function saasland_get_html_tag( $tag = 'blockquote', $content = '' ) {\n $dom = new DOMDocument();\n $dom->loadHTML($content);\n $divs = $dom->getElementsByTagName( $tag );\n $i = 0;\n foreach ( $divs as $div ) {\n if ( $i == 1 ) {\n break;\n }\n echo \"<p>{$div->nodeValue}</p>\";\n ++$i;\n }\n}",
"private function parseType($html) {\n\n $sidebarInformation = $html->find('div#contentWrapper div#content div.js-scrollfix-bottom div');\n foreach($sidebarInformation as $value) {\n if(strpos($value->plaintext, 'Type:') !== false) {\n if(strpos($value->plaintext, 'Unknown') === false) {\n return strtolower(trim($value->find('text', 2)->innertext));\n }\n }\n }\n\n }",
"protected function collectFormElements()\n\t{\n\t\t$label = new LabelField('label', 'big');\n\t\t$label->setDefaultValue(Loc::getMessage('REPORT_WIDGET_DEFAULT_TITLE'));\n\t\t$label->addAssets(array(\n\t\t\t'js' => array('/bitrix/js/report/js/visualconstructor/fields/reporttitle.js')\n\t\t));\n\t\t$label->setIsDisplayLabel(false);\n\n\n\t\t$timePeriod = new TimePeriod('time_period', $this->getWidget()->getFilterId());\n\t\t$timePeriod->setLabel(Loc::getMessage('REPORT_CALCULATION_PERIOD'));\n\n\n\t\t$colorPicker = new ColorPicker('color');\n\t\t$colorPicker->setLabel(Loc::getMessage('BACKGROUND_COLOR_OF_WIDGET'));\n\t\t$colorPicker->setDefaultValue('#ffffff');\n\n\t\t$previewBlockField = new PreviewBlock('view_type');\n\t\t$previewBlockField->setWidget($this->getWidget());\n\t\t$previewBlockField->addJsEventListener($previewBlockField, $previewBlockField::JS_EVENT_ON_VIEW_SELECT, array(\n\t\t\t'class' => 'BX.Report.VisualConstructor.FieldEventHandlers.PreviewBlock',\n\t\t\t'action' => 'viewTypeSelect'\n\t\t));\n\n\t\t$previewBlockField->addJsEventListener($label, $label::JS_EVENT_ON_CHANGE, array(\n\t\t\t'class' => 'BX.Report.VisualConstructor.FieldEventHandlers.PreviewBlock',\n\t\t\t'action' => 'reloadWidgetPreview'\n\t\t));\n\t\t$previewBlockField->addJsEventListener($timePeriod, $timePeriod::JS_EVENT_ON_SELECT, array(\n\t\t\t'class' => 'BX.Report.VisualConstructor.FieldEventHandlers.PreviewBlock',\n\t\t\t'action' => 'reloadWidgetPreview'\n\t\t));\n\n\t\t$previewBlockField->addAssets(array(\n\t\t\t'js' => array('/bitrix/js/report/js/visualconstructor/fields/previewblock.js')\n\t\t));\n\t\t$titleContainer = new Div();\n\t\t$titleContainer->addClass('report-configuration-row');\n\t\t$titleContainer->addClass('report-configuration-no-padding-bottom');\n\t\t$titleContainer->addClass('report-configuration-row-white-background');\n\t\t$titleContainer->addClass('report-configuration-row-margin-bottom');\n\t\t$this->addFormElement($titleContainer->start());\n\t\t$this->addFormElement($label);\n\t\t$this->addFormElement($colorPicker);\n\t\t$this->addFormElement($titleContainer->end());\n\n\t\t$timePeriodContainer = new Div();\n\t\t$timePeriodContainer->addClass('report-configuration-row');\n\t\t$timePeriodContainer->addClass('report-configuration-row-white-background');\n\t\t$this->addFormElement($timePeriodContainer->start());\n\t\t$this->addFormElement($timePeriod);\n\t\t$this->addFormElement($timePeriodContainer->end());\n\n\t\t$previewBlockContainer = new Div();\n\t\t$previewBlockContainer->addClass('report-configuration-row');\n\t\t$previewBlockContainer->addClass('report-configuration-row-margin-top-big');\n\t\t$previewBlockContainer->addClass('report-configuration-row-white-background');\n\t\t$this->addFormElement($previewBlockContainer->start());\n\t\t$this->addFormElement($previewBlockField);\n\t\t$this->addFormElement($previewBlockContainer->end());\n\n\t}",
"function widget_display() { }",
"public function getHTML();",
"public function widget()\n {\n /* $modulo = Registry::get('Request')->getModulo();\n $widget = Registry::get('application')->layout;\n \n // Carga Widget Principales si se configuro de ese modo.\n if ($widget->widget) {\n $widget->dir = 'default';\n $this->_loadTemplateWidget(DIR_BASE . 'layout' . DS . $widget->dir . DS . 'phtml' . DS . 'widget.phtml');\n }\n $this->_loadTemplateWidget(DIR_BASE . DIR_MODULO . $modulo . DS . 'layout' . DS . 'phtml' . DS . 'widget.phtml');\n */\n // Levanto los Widgets Dinamicos\n if (!$this->_render) {\n foreach ($this->_widgetDinamicos as $widget) {\n $this->loadWidget($widget['modulo'], $widget['controlador'],$widget['accion']); \n } \n }\n }",
"function parseMainPage()\n{\n \n}"
] | [
"0.6257904",
"0.5929971",
"0.5799601",
"0.5787054",
"0.5735",
"0.56839883",
"0.55968726",
"0.55797863",
"0.54342586",
"0.5313614",
"0.5296065",
"0.5251951",
"0.52282",
"0.5131155",
"0.51274955",
"0.51224655",
"0.51154",
"0.51141334",
"0.5103064",
"0.51013917",
"0.50881374",
"0.5066115",
"0.50506467",
"0.50427634",
"0.5008365",
"0.50073653",
"0.4993489",
"0.49848464",
"0.49790215",
"0.49643922"
] | 0.64261 | 0 |
Get all Speakers related to this one | public function relatedSpeakers()
{
// Get the talks from this speaker, find the other speakers of these talks
$talks = array_pluck($this->talks->all(), 'id');
$speakers = DB::table('speaker_talk')->whereIn('talk_id', $talks)->lists('speaker_id');
$speakers = array_unique($speakers);
// Get all the speakers
unset($speakers[array_search($this->id, $speakers)]);
$speakers = static::whereIn('id', array_unique($speakers))->get();
return $speakers;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSpeakers(): array\n {\n if (is_array($this->speakers)) {\n return $this->speakers;\n }\n\n $devices = $this->collection->getDevices();\n if (count($devices) < 1) {\n throw new \\RuntimeException(\"No devices in this collection\");\n }\n\n $this->getLogger()->info(\"creating speaker instances\");\n\n $this->speakers = [];\n foreach ($devices as $device) {\n if (!$device->isSpeaker()) {\n continue;\n }\n\n $speaker = new Speaker($device);\n\n try {\n $speaker->getGroup();\n } catch (UnknownGroupException $e) {\n continue;\n }\n\n $this->speakers[$device->getIp()] = $speaker;\n }\n\n return $this->speakers;\n }",
"public function getGuestSpeakers() {\n if (!$this->guest_speaker) {\n $this->guest_speaker = $this->findDependentRowset('Application_Model_DbTable_GuestSpeaker');\n }\n\n return $this->guest_speaker;\n }",
"protected function fetchSpeakerItems()\n {\n $countSpeakerItems = $this->container->get('request')->get('count') ?: $this->container->getParameter('api_items_per_page');\n\n $speakerRepository = $this->getDoctrine()->getRepository('ProtalkMediaBundle:Speaker');\n $speakerItems = $speakerRepository->getSpeakers($countSpeakerItems, Query::HYDRATE_ARRAY);\n\n return new \\RecursiveArrayIterator($speakerItems);\n }",
"public function all()\n {\n return Subject::all();\n }",
"public function getOtherConfirmedSpeakersAttribute()\n {\n return $this->program\n ->confirmed_speakers\n ->filter(function($speaker){\n return $speaker->brand_id == $this->brand->id;\n });\n }",
"public function talks()\n\t{\n\t\treturn $this->belongsToMany('Conferencer\\Models\\Talk')->orderBy('from', 'asc');\n\t}",
"public function subjects()\n {\n return $this->hasMany(__NAMESPACE__ . '\\Subject', 'object_id', 'id');\n }",
"public function speaker_list()\n {\n $speakers = Cnf_speaker::select('*')->get();\n $userRoles = Sentinel::getRoles()->lists('name', 'id')->all();\n return View('backend.partials.modules.conference.lists.speaker_list', compact('userRoles', 'speakers'));\n }",
"public function allPushers()\r\n {\r\n return $this->hasMany(\\Martindevnow\\Smartshelf\\Engineering\\Pusher::class, 'reader_id', 'id');\r\n }",
"public function getAllPublishers()\n {\n return $this->all_publishers;\n }",
"public function conversations()\n\t{\n\t\treturn $this->embedsMany('Conversation');\n\t}",
"public function getRebroadcasts()\n {\n return Factory::getInstance()->get('Rebroadcasts')\n ->fetchByProfileId($this->getId());\n }",
"public function getAllSpeakers($unique = false, $presentationKey = false)\n\t{\n\t\t$list = array();\n\t\t$method = ($unique) ? 'fetchAssoc' : 'fetchAll';\n\n\t\t$sessionIds = $this->_getSessionIds();\n\n\t\tif (count($sessionIds) == 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$query = \"select user_id, session_id, presentation_id, fname, lname, email, organisation, file_id\n\t\t from vw_sessions_speakers where session_id IN (\".implode(',', $sessionIds).\")\";\n\n\t\t$speakers = $this->getTable()->getAdapter()->$method($query);\n\n\t\tforeach ($speakers as $speaker) {\n\t\t\tif ($presentationKey) {\n\t\t\t\t$list[$speaker['session_id']][$speaker['presentation_id']][] = $speaker;\n\t\t\t} else {\n\t\t\t\t$list[$speaker['session_id']][$speaker['user_id']] = $speaker;\n\t\t\t}\n\t\t}\n\n\t\treturn $list;\n\t}",
"public function polls()\n {\n return $this->morphedByMany(Poll::class, 'notificationable');\n }",
"public static function getsubjects()\n {\n $subjects = Subjects::all();\n return $subjects;\n }",
"private function _setEventsAndSpeakers() {\n\t\t//workaround for mongodb datasource bug. internal error it the collection is empty and you call ->find('list');\n\t\t$this->loadModel('Speaker');\n\t\t\n\t\t$speakers = $this->Speaker->find('count');\t\t\t\n\t\t\n\t\tif($speakers > 0) $speakers = $this->Speaker->find('list',array('order' => array('Speaker.created' => -1)));\n\t\tif($speakers == 0) $speakers = array();\n\t\t\n\t\t$this->loadModel('Event');\n\t\t\n\t\t$events = $this->Event->find('count');\t\t\t\n\t\t\n\t\tif($events > 0) $events = $this->Event->find('list');\n\t\tif($events == 0) $events = array();\n\t\t\n\t\t$this->loadModel('Topic');\n\t\t$topics = $this->Topic->find('count');\t\t\n\t\t\n\t\tif($topics > 0) $topics = array_merge(array('-1' => 'Kein Thema'),$this->Topic->find('list'));\n\t\tif($topics == 0) $topics = array('-1' => 'Kein Thema');\n\t\t\n\t\t\n\t\t$this->set(compact('speakers','events','topics'));\n\t}",
"public function get()\r\n\t{\r\n\t\t$this->setSubscribers();\r\n\r\n\t\treturn $this->subscribers;\r\n\t}",
"function getAll() {\r\n\t\treturn SurveyQuestionQuery::create()->find();\r\n\t}",
"public function getPublishers()\n {\n $result = $this->executeSql($this->getSelect())->fetchAll();\n\n return $this->getObjectMapper()->populateCollection($result, PublishersMaps::MAP_PUBLISHER);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('OrganizationManagementBundle:Speaker')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function getSubjects(): array\n {\n return $this->subjects;\n }",
"public function all()\n {\n return $this->translations;\n }",
"public function getSenderMessages()\n {\n return $this->hasMany(Message::className(), ['sender_id' => 'id']);\n }",
"public function streams()\n {\n\t\treturn $this->hasMany('t2t2\\LiveHub\\Models\\Stream');\n\t}",
"function getSongs()\n {\n return $this->_songs;\n }",
"public function getAllSurveys()\n {\n $result = $this->surveyLangRepository->getAllSurveys();\n\n return $result;\n }",
"public function get_subjects()\n {\n return $this->subjects;\n }",
"public function getSubscribers() {\n\t\treturn $this->subscribers;\n\t}",
"public function getSubscribers() {\n\t\treturn $this->subscribers;\n\t}",
"public function getSubscribers() {\n\t\treturn $this->subscribers;\n\t}"
] | [
"0.6844331",
"0.6609284",
"0.6219927",
"0.61848176",
"0.6072046",
"0.57788354",
"0.5751912",
"0.5663732",
"0.56220675",
"0.5610336",
"0.55494815",
"0.553488",
"0.5532237",
"0.5498969",
"0.5497092",
"0.54787904",
"0.53919184",
"0.5373647",
"0.5366816",
"0.5344999",
"0.5304068",
"0.5303709",
"0.5295267",
"0.5288867",
"0.5288129",
"0.5250951",
"0.52490747",
"0.5238036",
"0.5238036",
"0.5238036"
] | 0.7781911 | 0 |
Retrieves an unique token for the given key. | private function getToken(Key $key)
{
if (!$key->hasState(__CLASS__)) {
$token = base64_encode(random_bytes(32));
$key->setState(__CLASS__, $token);
}
return $key->getState(__CLASS__);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function generateToken(string $key): ?string\n {\n if (!$this->storage->has(self::TOKEN_KEY)) {\n $this->storage->set(self::TOKEN_KEY, $this->hasher->hash($key));\n }\n\n return $this->storage->get(self::TOKEN_KEY);\n }",
"public function generate(string $key): string\n {\n $extra = '';\n if ($this->doOriginCheck === true) {\n $extra = hash('SHA256', $_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT']);\n }\n\n // token generation (basically base64_encode any random complex string, time() is used for token expiration)\n $token = base64_encode(time() . $extra . $this->randomString(32));\n // store the one-time token in session\n $_SESSION['csrf_' . $key] = $token;\n\n return $token;\n }",
"private function get_from_token( $key ) {\n\t\treturn $this->decoded_token && property_exists( $this->decoded_token, $key )\n\t\t\t? $this->decoded_token->{$key}\n\t\t\t: null;\n\t}",
"public function getConsumerToken ( $token_key );",
"public function getToken()\n\t{\n\t\treturn $this->key;\n\t}",
"private function token($key)\n {\n //Step 1: get id and secret from ghost generated admin key\n list($id, $secret) = explode(':', $key);\n\n //Step 2: prepare header, payload, and secret to create JSON web token (jwt)\n //header, passing kid in as parameter to JWT::encode which is added to default header\n //payload\n $payload = [\n \"aud\" => \"{$this->config['version']}/admin/\", //audience\n \"iat\" => time(), //Issued at Time, Unix timestamp\n \"exp\" => strtotime('+5 minutes'), //expiration Unix timestamp\n ];\n\n //Decode the hexadecimal secret\n $decodedSecret = pack('H*', $secret);\n\n //Step 3: create token\n $token = JWT::encode($payload, $decodedSecret, 'HS256', $id);\n\n //debug. return original payload\n //$decoded = JWT::decode($token, $decodedSecret, ['HS256']);\n\n return $token;\n }",
"public function getServerToken ( $token_key );",
"final protected function cacheItemRetrieve($key) {\n $tok = call_user_func(\n $this->params['token_cache_callback'],\n self::OAUTH_CACHE_KEY_PREFIX.\"/$this->id/$key\");\n return $tok;\n }",
"public function generate($key = '')\n {\n $token = base64_encode(time().sha1(md5($_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_USER_AGENT'])).randStr(255));\n\n if(empty($_SESSION['CSRF_'.$key]))\n {\n $_SESSION['CSRF_'.$key] = $token;\n return $token;\n }\n else\n return $_SESSION['CSRF_'.$key];\n }",
"function generate_token(){\n $res = do_hash(time().mt_rand());\n $new_key = substr($res,0,config_item('rest_key_length'));\n return $new_key;\n\n }",
"public static function Get(string $key)\n {\n static::init();\n return static::$handler->Get(static::$token, $key);\n }",
"public static function getUniqueToken()\n {\n $prefix = '';\n $moreEntropy = TRUE;\n $token = sha1(uniqid($prefix, $moreEntropy));\n return $token;\n\n }",
"static function getToken(){\n return 'b1e9ce5e3a97b02da706ccb739d0e2a7';\n }",
"public function get($key, &$token = null);",
"protected function generateToken()\n {\n return hash_hmac('sha256', Str::random(48), $this->hashKey);\n }",
"public function generateToken();",
"public function generateToken();",
"public function generateToken();",
"private function get_unique_token()\r\n {\r\n redirect('http://www.reddit.com/r/MineshafterSquared');\r\n \r\n $uid = uniqid();\r\n \r\n if (User::find_by_async_token($uid))\r\n {\r\n return $this->get_unique_token();\r\n }\r\n else\r\n {\r\n return $uid;\r\n }\r\n }",
"public static function get_token()\n\t{\n\t\treturn Charcoal::token( isset( Charcoal::$config['nonce'] ) ? Charcoal::$config['nonce'] : null );\n\t}",
"function _generate_token(){\n\n\t\t$this->load->helper('security');\n\t\t$salt = do_hash(time().mt_rand());\n\t\t$new_key = substr($salt, 0, 20);\n\t\treturn $new_key;\n\t}",
"public static function generateToken(){\n\t\treturn sha1(uniqid(rand(), true));\n\t}",
"static protected function generateToken()\n {\n return hash_hmac('sha256', Str::random(40), config('app.key'));\n }",
"public function getToken(SignerInterface $signer, Key $key): Plain;",
"public static function token()\n {\n // Get token hash key\n $token = md5(uniqid(rand(), true) . self::TOKEN_SALT);\n\n // Set token to session\n Session::getInstance()->write(self::TOKEN_KEY, $token);\n\n return $token;\n }",
"public function getToken(): string;",
"function token() {\n \n return sha1( uniqid(mt_rand(), true));\n }",
"public function generate_token ( $key, $time = 1800 )\n {\n if ( !isset($_SESSION['csrf_' . $key]) ) {\n $token = $this->create_token();\n $this->create_session($key, $token);\n } else if ( !isset($_SESSION['csrf_start_time' . $key]) || (time() - $_SESSION['csrf_start_time' . $key] > $time ) ) {\n $token = $this->create_token();\n $this->create_session($key, $token);\n } else {\n $token = $_SESSION['csrf_' . $key];\n }\n\n //retorna o token\n return $token;\n\n }",
"protected function generateUniqueToken() {\n return $this->uuidService->generate();\n }",
"public function generateToken() {\n return $this->_session->put('token', md5(uniqid(rand(), true)));\n }"
] | [
"0.780658",
"0.7116743",
"0.70585656",
"0.7037456",
"0.7011952",
"0.7010379",
"0.6943239",
"0.68132573",
"0.67924684",
"0.6714218",
"0.6665836",
"0.65475684",
"0.65331995",
"0.64777523",
"0.6469129",
"0.64170736",
"0.64170736",
"0.64170736",
"0.63436073",
"0.63154966",
"0.62823415",
"0.6266838",
"0.6263229",
"0.62571687",
"0.625327",
"0.6248644",
"0.62420124",
"0.6236069",
"0.623302",
"0.62143266"
] | 0.7578331 | 1 |
Generates the theme definition and slots | public function generate()
{
if (!$this->configurationHandler->isTheme() || $this->theme->getName() != $this->configurationHandler->handledTheme()) {
return;
}
$templates = array_keys($this->templates["template"]);
$homepage = json_decode(file_get_contents($this->configurationHandler->pagesDir() . '/' .$this->configurationHandler->homepage() . '/page.json'), true);
$homepageTemplate = $homepage["template"];
if (!in_array($homepageTemplate, $templates)) {
$homepageTemplate = $templates[0];
}
$themeDefinition = array(
"home_template" => $homepageTemplate,
"templates" => $templates,
);
$this->synchronizeThemeSlots();
FilesystemTools::writeFile($this->themeDir . '/theme.json', json_encode($themeDefinition));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function setupTheme()\n {\n File::cleanDirectory(resource_path('views/vendor/spark'));\n File::copyDirectory(__DIR__ . '/stubs/spark', resource_path('views/vendor/spark'));\n $this->setupWelcomePage();\n }",
"function page_themes() {\n $f3=$this->framework;\n\t\t$f3->set('themes', $this->themes() );\n\t\t$f3->set('content','themes.html');\n\t\t$f3->set('html_title','Themes - '.$this->site_title() );\n\t\tprint Template::instance()->render( \"page.html\" );\n\t}",
"public function run() {\n\t\t\tfactory(GameTheme::class, 100)->create();\n\t\t}",
"public function run()\n {\n //\n $themes = [\n ['name' => 'charity','active'=> false, 'id'=>1 ],\n ['name' => 'eStartup', 'active'=> true,'id'=>2 ],\n ];\n foreach($themes as $theme){\n App\\Theme::create($theme);\n }\n }",
"public function generate()\n {\n $stub = $this->finder->get(__DIR__ . '/../stubs/composerJson.stub');\n\n $stub = $this->replaceContentInStub($stub);\n\n $this->finder->put($this->themePathForFile($this->options['name'], 'composer.json'), $stub);\n }",
"public function ThemeEngineRender() {\n // Save to session before output anything\n $this->session->StoreInSession();\n\n // Get the paths and settings for the theme\n $themeName = $this->config['theme']['name'];\n $themePath = MOVIC_INSTALL_PATH . \"/themes/{$themeName}\";\n $themeUrl = $this->request->base_url . \"themes/{$themeName}\";\n \n // Add stylesheet path to the $mo->data array\n $this->data['stylesheet'] = \"{$themeUrl}/style.css\";\n\n // Include the global functions.php and the functions.php that are part of the theme\n $mo = &$this;\n include(MOVIC_INSTALL_PATH . '/themes/functions.php');\n $functionsPath = \"{$themePath}/functions.php\";\n if(is_file($functionsPath)) {\n include $functionsPath;\n }\n\n // Extract $mo->data and $mo->view->data to own variables and handover to the template file\n extract($this->data); \n extract($this->views->GetData()); \n include(\"{$themePath}/default.tpl.php\");\n }",
"public function ThemeEngineRender() {\n\t\t//Get paths and settings for the theme\n\t\t$themeName = $this->config['theme']['name'];\n\t\t$themePath = LYDIGAMVC_INSTALL_PATH . \"/themes/{$themeName}\";\n\t\t$themeURL = $this->request->base_url . \"themes/{$themeName}\";\n\n\t\t//Add stylesheet path to the data array\n\t\t$this->data['stylesheet'] = \"{$themeURL}/style.css\";\n\n\t\t// Include the global functions.php and the functions.php\n\t\t// that is part of the theme.\n\t\t$ly = &$this;\n\t\t$functionsPath = \"{$themePath}/functions.php\";\n\t\tinclude LYDIGAMVC_INSTALL_PATH . '/themes/functions.php';\n\t\tif (is_file($functionsPath)) {\n\t\t\tinclude $functionsPath;\n\t\t}\t\n\n\t\t// Extract $ly->data to own variables and hand over to the\n\t\t// template file.\n\t\textract($this->data);\n\t\tinclude(\"{$themePath}/default.tpl.php\");\n\t}",
"protected function generateTheme()\n {\n // Create base themes directory\n if (!$this->files->isDirectory(public_path(config('themes.paths.base')))) {\n $this->files->makeDirectory(public_path(config('themes.paths.base')));\n }\n\n $directory = config('themes.paths.absolute') . '/' . $this->container['slug'];\n $source = __DIR__ . '/../../../resources/theme';\n\n $this->files->makeDirectory($directory);\n\n $sourceFiles = $this->files->allFiles($source, true);\n\n foreach ($sourceFiles as $file) {\n $contents = $this->replacePlaceholders($file->getContents());\n $subPath = $file->getRelativePathname();\n\n $filePath = $directory . '/' . $subPath;\n $dir = dirname($filePath);\n\n if (!$this->files->isDirectory($dir)) {\n $this->files->makeDirectory($dir, 0755, true);\n }\n\n $this->files->put($filePath, $contents);\n }\n }",
"public function generateTheme()\n {\n // Get the current theme folder\n $themePath = $this->getThemePath();\n \n // Create a Less parse so we can compile the theme\n $lessParser = new \\Less_Parser();\n\n // If a theme.json file already exist, we can use the details inside to apply\n // custom modifications to the base bootstrap theme\n if (file_exists($themePath . '/theme.json')) {\n $themeOptions = file_get_contents($themePath . '/theme.json');\n $themeOptions = json_decode($themeOptions);\n }\n\n // Try to parse the source files and modify the variables if theme.json exists\n try {\n $lessParser->parseFile($this->getKernelRootDir() . '/../vendor/ilp/bootstrap-theme-bundle/ILP/BootstrapThemeBundle/Resources/public/Cluckles/build/less/bootstrap.less');\n \n if (isset($themeOptions)) {\n $lessParser->ModifyVars($themeOptions);\n }\n } catch (Exception $ex) {\n }\n\n // Now get the compiled CSS and save it in the current theme folder\n $compiledCss = $lessParser->getCss();\n\n // Save the compiled theme file to the current Theme directory\n file_put_contents($themePath . '/theme.css', $compiledCss);\n \n // Now Install/Dump the Theme so the changes to the css files will appear\n return $this->installTheme();\n }",
"public function run()\n {\n $theme_whoweare = [\n [\n 'id' => 1,\n 'title' => 'Who We Are',\n 'sub_title' => 'Services we serve to all over the world',\n 'description' => 'Nulla quis lorem ut libero malesuada feugiat. Pellentesque in ipsum id orci porta dapibus. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec velit neque, auctor sit amet aliquam vel, ullamcorper sit amet ligula. Pellentesque in ipsum id orci porta dapibus.',\n 'button_text1' => 'Get Started',\n 'url1' => '#getstarted',\n 'button_text2' => 'Free Trial',\n 'url2' => '#freetrial',\n ],\n ];\n\n ThemeBio::insert($theme_whoweare);\n }",
"function ds_child_theme_setup(){\r\n}",
"function bbp_setup_theme()\n{\n}",
"public function setSections() {\n // Background Patterns Reader\n $sample_patterns_path = ReduxFramework::$_dir . '../sample/patterns/';\n $sample_patterns_url = ReduxFramework::$_url . '../sample/patterns/';\n $sample_patterns = array();\n\n if ( is_dir( $sample_patterns_path ) ) :\n\n if ( $sample_patterns_dir = opendir( $sample_patterns_path ) ) :\n $sample_patterns = array();\n\n while ( ( $sample_patterns_file = readdir( $sample_patterns_dir ) ) !== false ) {\n\n if ( stristr( $sample_patterns_file, '.png' ) !== false || stristr( $sample_patterns_file, '.jpg' ) !== false ) {\n $name = explode( '.', $sample_patterns_file );\n $name = str_replace( '.' . end( $name ), '', $sample_patterns_file );\n $sample_patterns[] = array(\n 'alt' => $name,\n 'img' => $sample_patterns_url . $sample_patterns_file\n );\n }\n }\n endif;\n endif;\n\n ob_start();\n\n $ct = wp_get_theme();\n $this->theme = $ct;\n $item_name = $this->theme->get( 'Name' );\n $tags = $this->theme->Tags;\n $screenshot = $this->theme->get_screenshot();\n $class = $screenshot ? 'has-screenshot' : '';\n\n $customize_title = sprintf( __( 'Customize “%s”', 'business-review' ), $this->theme->display( 'Name' ) );\n\n ?>\n <div id=\"current-theme\" class=\"<?php echo esc_attr( $class ); ?>\">\n <?php if ( $screenshot ) : ?>\n <?php if ( current_user_can( 'edit_theme_options' ) ) : ?>\n <a href=\"<?php echo wp_customize_url(); ?>\" class=\"load-customize hide-if-no-customize\"\n title=\"<?php echo esc_attr( $customize_title ); ?>\">\n <img src=\"<?php echo esc_url( $screenshot ); ?>\"\n alt=\"<?php esc_attr_e( 'Current theme preview', 'business-review' ); ?>\"/>\n </a>\n <?php endif; ?>\n <img class=\"hide-if-customize\" src=\"<?php echo esc_url( $screenshot ); ?>\"\n alt=\"<?php esc_attr_e( 'Current theme preview', 'business-review' ); ?>\"/>\n <?php endif; ?>\n\n <h4><?php echo $this->theme->display( 'Name' ); ?></h4>\n\n <div>\n <ul class=\"theme-info\">\n <li><?php printf( __( 'By %s', 'business-review' ), $this->theme->display( 'Author' ) ); ?></li>\n <li><?php printf( __( 'Version %s', 'business-review' ), $this->theme->display( 'Version' ) ); ?></li>\n <li><?php echo '<strong>' . __( 'Tags', 'business-review' ) . ':</strong> '; ?><?php printf( $this->theme->display( 'Tags' ) ); ?></li>\n </ul>\n <p class=\"theme-description\"><?php echo $this->theme->display( 'Description' ); ?></p>\n <?php\n if ( $this->theme->parent() ) {\n printf( ' <p class=\"howto\">' . __( 'This <a href=\"%1$s\">child theme</a> requires its parent theme, %2$s.', 'business-review' ) . '</p>', __( 'http://codex.wordpress.org/Child_Themes', 'business-review' ), $this->theme->parent()->display( 'Name' ) );\n }\n ?>\n\n </div>\n </div>\n\n <?php\n $item_info = ob_get_contents();\n\n ob_end_clean();\n\n $sampleHTML = '';\n if ( file_exists( dirname( __FILE__ ) . '/info-html.html' ) ) {\n Redux_Functions::initWpFilesystem();\n\n global $wp_filesystem;\n\n $sampleHTML = $wp_filesystem->get_contents( dirname( __FILE__ ) . '/info-html.html' );\n }\n $this->sections[] = array(\n 'title' => __( 'Settings', 'business-review' ),\n 'icon' => 'el el-cogs',\n 'fields' => array(\n array(\n 'id' => 'locations',\n 'type' => 'multi_text',\n 'title' => __( 'Locations', 'business-review' ),\n 'desc' => __( 'Different locations where the business have branches.', 'business-review' )\n ),\n array(\n 'id' => 'rating_fields',\n 'type' => 'grid_input',\n 'title' => __( 'Review fields', 'business-review' ),\n 'subtitle' => __( 'List all the fields or rating criterias here.', 'business-review' ),\n 'desc' => __( 'Changing this setting may mess up your existing reviews.', 'business-review' ) ),\n array(\n 'id' => 'satisfaction_threshold',\n 'type' => 'text',\n 'title' => __( 'Satisfaction Threshold', 'business-review' ),\n 'subtitle' => __( 'Minimum average rating to consider a review is positive.', 'business-review' ),\n 'default' => '4'\n ),\n array(\n 'id' => 'review_page',\n 'type' => 'select',\n 'data' => 'pages',\n 'title' => __( 'Review Page', 'business-review' ),\n 'subtitle' => __( 'The page where you placed the [business_review] shortcode to display reviews.', 'business-review' ),\n 'default' => 0\n ),\n array(\n 'id' => 'number_of_reviews',\n 'type' => 'text',\n 'title' => __( 'Number of Reviews to Show', 'business-review'),\n 'default' => 30\n ),\n array(\n 'id' => 'review_columns',\n 'type' => 'text',\n 'title' => __( 'Review Columns', 'business-review' ),\n 'subtitle' => __( 'Number of columns to divide the reviews in.', 'business-review' ),\n 'default' => 2\n ),\n array(\n 'id' => 'show_gravatar',\n 'type' => 'switch',\n 'title' => __('Show Gravatar', 'business-review'),\n 'subtitle' => __('Display the global avatar of the user.', 'business-review'),\n 'default' => true,\n ),\n array(\n 'id' => 'verify_poor_rating',\n 'type' => 'switch',\n 'title' => __('Verify Negative Reviews', 'business-review'),\n 'subtitle' => __('Instead of directly publishing, keep reviews pending if it\\'s negative.', 'business-review'),\n 'default' => false,\n ),\n array(\n 'id' => 'restriction_scope',\n 'type' => 'select',\n 'title' => __('Review Restriction Scope', 'business-review'),\n 'subtitle' => __('Let user post only one review in the site or one review per location.', 'business-review'),\n 'options' => array( 'location' => __( 'One review per location', 'business-review' ), 'website' => __( 'Review only ones regardless of what location choosen', 'business-review' ) ),\n 'default' => 'location',\n ),\n array(\n 'id' => 'one_review_per_ip',\n 'type' => 'switch',\n 'title' => __('One Review Per IP', 'business-review'),\n 'subtitle' => __('Prevent multiple reviews from single IP.', 'business-review'),\n 'default' => true,\n ),\n array(\n 'id' => 'one_review_per_email',\n 'type' => 'switch',\n 'title' => __('One Review Per Email', 'business-review'),\n 'subtitle' => __('Prevent multiple reviews from same email.', 'business-review'),\n 'default' => true,\n ),\n array(\n 'id' => 'review_form',\n 'type' => 'editor',\n 'title' => __( 'Review Form', 'business-review' ),\n 'subtitle' => __( 'The form that will be used to review', 'business-review' ) ),\n array(\n 'id' => 'thank_you_message_positive',\n 'type' => 'editor',\n 'title' => __( 'Thank You Message for Positive Review', 'business-review' ),\n 'default' => __( 'Thank you for your feedback. Your feedback inspires us making the service better.', 'business-review' )\n ),\n array(\n 'id' => 'thank_you_message_negative',\n 'type' => 'editor',\n 'title' => __( 'Thank You Message for Negative Review', 'business-review' ),\n 'default' => __( 'We are sorry to see that you were not satisfied with our service. Before publishing this review, we will contact you trying to fix your issue if possible.', 'business-review' )\n ),\n array(\n 'id' => 'review_duplicate_error',\n 'type' => 'editor',\n 'title' => __( 'Already Reviewed Error Message', 'business-review' ),\n 'default' => __( 'We only accept one review per person to protect the integrity.', 'business-review' )\n ),\n array(\n 'id' => 'custom_css',\n 'type' => 'ace_editor',\n 'title' => __('Custom CSS Code', 'business-review'),\n 'subtitle' => __('Paste your CSS code here.', 'business-review'),\n 'mode' => 'css',\n 'theme' => 'monokai',\n 'default' => ''\n )\n\n )\n );\n\n $this->sections[] = array(\n 'type' => 'divide',\n );\n }",
"function _setup_theme() {\n\n\t\t\tload_theme_textdomain( 'theme', get_template_directory() . '/languages' );\n\n\t\t\t/**\n\t\t\t*\n\t\t\t* Widget Positions\n\t\t\t* You will be able to add widgets to these positions in the WordPress admin.\n\t\t\t*\n\t\t\t**/\n\n\t\t\t/*\n\t\t\tregister_sidebar( array(\n\t\t\t\t'name' => 'Column One',\n\t\t\t\t'id' => 'column-one',\n\t\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t\t'after_widget' => \"</div>\",\n\t\t\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t\t'after_title' => '</h3>',\n\t\t\t) );\n\t\t\t*/\n\n\n\t\t\t/**\n\t\t\t*\n\t\t\t* Menus\n\t\t\t*\n\t\t\t**/\n\n\t\t\tregister_nav_menus( array(\n\t\t\t\t'main_menu' => 'Main Menu',\n\t\t\t\t// Add additional menus, ie.\n\t\t\t\t// 'secondary_menu' => 'Secondary Menu',\n\t\t\t) );\n\n\n\n\t\t\t/**\n\t\t\t*\n\t\t\t* Images\n\t\t\t* refer to http://codex.wordpress.org/Function_Reference/add_image_size\n\t\t\t*\n\t\t\t**/\n\t\t\t// add_image_size('my-image-size', 500,500,false);\n\n\n\t\t}",
"public function cssgenerate()\n\t{\n\t\t$section = Mage::app()->getRequest()->getParam('section');\n\t\tif ($section == 'themeoptions')\n\t\t{\n\t\t\t$store_ids = array();\n\t\t\tif(Mage::app()->getRequest()->getParam('store') && Mage::app()->getRequest()->getParam('website'))\n\t\t\t{\n\t\t\t\t$store_ids[] = Mage::getModel( \"core/store\" )->load(Mage::app()->getRequest()->getParam('store'))->getStore_id();\n\t\t\t}\n\t\t\telseif(Mage::app()->getRequest()->getParam('website'))\n\t\t\t{\n\t\t\t\t$store_ids = Mage::getModel('core/website')->load(Mage::app()->getRequest()->getParam('website'))->getstoreIds();\n\t\t\t}else{\n\t\t\t\tforeach (Mage::app()->getWebsites() as $website){\n\t\t\t\t\tforeach ($website->getGroups() as $group){\n\t\t\t\t\t\t$stores = $group->getStores();\n\t\t\t\t\t\tforeach ($stores as $store) {\n\t\t\t\t\t\t\t$store_ids[] = $store->getId();\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\tforeach($store_ids as $store_id)\n\t\t\t{\n\t\t\t\t$this->setLocation($store_id);\n\t\t\t\t\n\t\t\t\tif(!$this->getConfig('reset_css',$store_id))\n\t\t\t\t{ \n\t\t\t\t\tif($this->getConfig('font_main',$store_id))\n\t\t\t\t\t\t$css .= '.top-cart-title,.pt_custommenu div.pt_menu .parentMenu a,.pt_custommenu div.pt_menu .parentMenu span.block-title,.ratings .amount a,.item-options dt,.item-options dd,.block-best h2,.block-featured h2{font-family:'.str_replace(\"+\",\" \",$this->getConfig('font',$store_id)).';font-weight:'.$this->getConfig('font_weight',$store_id).'}';\n\t\t\t\t\t\n\t\t\t\t\tif($this->getConfig('font_content_main',$store_id))\n\t\t\t\t\t$css .= 'body,.breadcrumbs li,.footer-static-2{font-family:'.str_replace(\"+\",\" \",$this->getConfig('font_content',$store_id)).';\n\t\t\t\t\t\tfont-weight:'.$this->getConfig('font_contentweight',$store_id).'}';\n\n\t\t\t\t\tif($this->getConfig('font_price_main',$store_id))\n\t\t\t\t\t$css .= ' .new-icon,.sale-icon,.block-layered-nav h2,.price-box .price,.footer-static .footer-title h2,.banner-static .banner-box .box-hover a,.banner-left .banner-content h1,.title-vmega-menu h2{font-family:'.str_replace(\"+\",\" \",$this->getConfig('font_price',$store_id)).';\n\t\t\t\t\t\tfont-weight:'.$this->getConfig('font_priceweight',$store_id).'}';\n\t\t\t\t\t\t\n\t\t\t\t\t// background_color\t\n\t\t\t\t\t$css .= $this->getConfig('color_tag',$store_id).'{background-color:'.$this->getConfig('color',$store_id).'}';\n\t\t\t\t\t\n\t\t\t\t\t// background_color_hover\n\t\t\t\t\t$css .= $this->getConfig('color_hover_tag',$store_id).'{background-color:'.$this->getConfig('color_hover',$store_id).'}'; \n\t\t\t\t\t\n\t\t\t\t\t// text_color\n\t\t\t\t\t$css .= $this->getConfig('text_color_tag',$store_id).'{color:'.$this->getConfig('text_color',$store_id).'}';\n\t\t\t\t\t\n\t\t\t\t\t// text_color_hover\n\t\t\t\t\t$css .= $this->getConfig('text_color_hover_tag',$store_id).'{color:'.$this->getConfig('text_color_hover',$store_id).'}';\n\t\t\t\t\t\n\t\t\t\t\t// border\n\t\t\t\t\t$css .= $this->getConfig('border_tag',$store_id).'{border-color:'.$this->getConfig('border',$store_id).'}';\n\t\t\t\t\t\n\t\t\t\t\t// border_hover\n\t\t\t\t\t$css .= $this->getConfig('border_hover_tag',$store_id).'{border-color:'.$this->getConfig('border_hover',$store_id).'}';\n\t\t\t\t\t\n\t\t\t\t\t$image_bg = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'frontend/'.$this->dir_store.'/images/pattern/'.$this->getConfig('bg_pattern',$store_id).'.png';\n\t\t\t\t\t$css .= 'body{background-color:'.$this->getConfig('bg_color',$store_id);\n\t\t\t\t\t\n\t\t\t\t\tif($this->getConfig('bg_pattern',$store_id ))\n\t\t\t\t\t\t$css .=';background-image:url(\"'.$image_bg.'\")';\n\t\t\t\t\t\t$css .='}'; \n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t$css = '';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\t$fh = new Varien_Io_File(); \n\t\t\t\t\t$fh->setAllowCreateFolders(true); \n\t\t\t\t\t$fh->open(array('path' => $this->dirPath));\n\t\t\t\t\t$fh->streamOpen($this->filePath, 'w+'); \n\t\t\t\t\t$fh->streamLock(true); \n\t\t\t\t\t$fh->streamWrite($css); \n\t\t\t\t\t$fh->streamUnlock(); \n\t\t\t\t\t$fh->streamClose(); \n\t\t\t\t}\n\t\t\t\tcatch (Exception $e) {\n\t\t\t\t\tMage::getSingleton('adminhtml/session')->addError(Mage::helper('themeoptions')->__('Failed creation custom css rules. '.$e->getMessage()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function crb_setup_theme() {\r\n\t\tload_theme_textdomain( 'crb', get_template_directory() . '/languages' );\r\n\r\n\t\t# Autoload dependencies\r\n\t\t$autoload_dir = CRB_THEME_DIR . 'vendor/autoload.php';\r\n\t\tif ( ! is_readable( $autoload_dir ) ) {\r\n\t\t\twp_die( __( 'Please, run <code>composer install</code> to download and install the theme dependencies.', 'crb' ) );\r\n\t\t}\r\n\t\tinclude_once( $autoload_dir );\r\n\t\t\\Carbon_Fields\\Carbon_Fields::boot();\r\n\r\n\t\t# Additional libraries and includes\r\n\t\tinclude_once( CRB_THEME_DIR . 'includes/admin-login.php' );\r\n\t\tinclude_once( CRB_THEME_DIR . 'includes/blocks.php' );\r\n\t\tinclude_once( CRB_THEME_DIR . 'includes/boot-blocks.php' );\r\n\t\tinclude_once( CRB_THEME_DIR . 'includes/comments.php' );\r\n\t\tinclude_once( CRB_THEME_DIR . 'includes/title.php' );\r\n\t\tinclude_once( CRB_THEME_DIR . 'includes/gravity-forms.php' );\r\n\t\tinclude_once( CRB_THEME_DIR . 'includes/helpers/utils-socials.php' );\r\n\r\n\t\t# Theme supports\r\n\t\tadd_theme_support( 'automatic-feed-links' );\r\n\t\tadd_theme_support( 'post-thumbnails' );\r\n\t\tadd_theme_support( 'title-tag' );\r\n\t\tadd_theme_support( 'menus' );\r\n\t\tadd_theme_support( 'html5', array( 'gallery' ) );\r\n\r\n\t\t// Add support for full and wide align images.\r\n\t\tadd_theme_support( 'align-wide' );\r\n\r\n\t\t// Add support for responsive embedded content.\r\n\t\tadd_theme_support( 'responsive-embeds' );\r\n\r\n\t\t# Manually select Post Formats to be supported - http://codex.wordpress.org/Post_Formats\r\n\t\t// add_theme_support( 'post-formats', array( 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat' ) );\r\n\r\n\t\t# Register Theme Menu Locations\r\n\t\tregister_nav_menus( array(\r\n\t\t\t'header-location' => __( 'Header location', 'crb' ),\r\n\t\t\t'footer-left-location' => __( 'Footer left location', 'crb' ),\r\n\t\t\t'footer-right-location' => __( 'Footer right location', 'crb' ),\r\n\t\t\t'footer-middle-location' => __( 'Footer middle location', 'crb' ),\r\n\t\t\t'footer-bottom-location' => __( 'Footer bottom location', 'crb' )\r\n\t\t) );\r\n\r\n\t\t# Attach custom widgets\r\n\t\tinclude_once( CRB_THEME_DIR . 'options/widgets.php' );\r\n\r\n\t\t# Attach custom shortcodes\r\n\t\tinclude_once( CRB_THEME_DIR . 'options/shortcodes.php' );\r\n\r\n\t\t# Add Actions\r\n\t\tadd_action( 'widgets_init', 'crb_widgets_init' );\r\n\t\tadd_action( 'carbon_fields_register_fields', 'crb_attach_theme_options' );\r\n\r\n\t\t# Add Filters\r\n\t\tadd_filter( 'excerpt_more', 'crb_excerpt_more' );\r\n\t\tadd_filter( 'excerpt_length', 'crb_excerpt_length', 999 );\r\n\t\tadd_filter( 'crb_theme_favicon_uri', function() {\r\n\t\t\treturn get_template_directory_uri() . '/dist/images/favicon.ico';\r\n\t\t} );\r\n\t\tadd_filter( 'carbon_fields_map_field_api_key', 'crb_get_google_maps_api_key' );\r\n\r\n\t\tadd_image_size( 'counter-image-size', 100, 100 );\r\n\t\tadd_image_size( 'loop-page-featured-image-size', 421, 421 );\r\n\t}",
"public function init_globals() {\n\t\t\t$current_theme = wp_get_theme();\n\t\t\t$this->theme_name = strtolower( preg_replace( '#[^a-zA-Z]#', '', $current_theme->get( 'Name' ) ) );\n\t\t\t$this->envato_username = apply_filters( $this->theme_name . '_theme_setup_wizard_username', 'purethemes' );\n\t\t\t$this->oauth_script = apply_filters( $this->theme_name . '_theme_setup_wizard_oauth_script', 'http://purethemes.net/envato/api/server-script.php' );\n\t\t\t$this->page_slug = apply_filters( $this->theme_name . '_theme_setup_wizard_page_slug', $this->theme_name . '-setup' );\n\t\t\t$this->parent_slug = apply_filters( $this->theme_name . '_theme_setup_wizard_parent_slug', '' );\n\n\t\t\t// create an images/styleX/ folder for each style here.\n\t\t\t/*$this->site_styles = array(\n 'style1' => 'Style 1',\n 'style2' => 'Style 2',\n );\n*/\n\t\t\t//If we have parent slug - set correct url\n\t\t\tif ( $this->parent_slug !== '' ) {\n\t\t\t\t$this->page_url = 'admin.php?page=' . $this->page_slug;\n\t\t\t} else {\n\t\t\t\t$this->page_url = 'themes.php?page=' . $this->page_slug;\n\t\t\t}\n\t\t\t$this->page_url = apply_filters( $this->theme_name . '_theme_setup_wizard_page_url', $this->page_url );\n\n\t\t\t//set relative plugin path url\n\t\t\t$this->plugin_path = trailingslashit( $this->cleanFilePath( dirname( __FILE__ ) ) );\n\t\t\t$relative_url = str_replace( $this->cleanFilePath( get_template_directory() ), '', $this->plugin_path );\n\t\t\t$this->plugin_url = trailingslashit( get_template_directory_uri().'/envato_setup/' );\n\t\t}",
"function callie_britt_skin_theme_setup3() {\n\t}",
"public function createTheme($name = NULL) {\n }",
"public function init_globals() {\n\t\t\t$current_theme = wp_get_theme();\n\t\t\t$this->theme_name = strtolower( preg_replace( '#[^a-zA-Z]#', '', $current_theme->get( 'Name' ) ) );\n\t\t\t$this->envato_username = apply_filters( $this->theme_name . '_theme_setup_wizard_username', 'dtbaker' );\n\t\t\t$this->oauth_script = apply_filters( $this->theme_name . '_theme_setup_wizard_oauth_script', 'http://dtbaker.net/files/envato/wptoken/server-script.php' );\n\t\t\t$this->page_slug = apply_filters( $this->theme_name . '_theme_setup_wizard_page_slug', $this->theme_name . '-setup' );\n\t\t\t$this->parent_slug = apply_filters( $this->theme_name . '_theme_setup_wizard_parent_slug', '' );\n\n\t\t\t// create an images/styleX/ folder for each style here.\n\t\t\t$this->site_styles = array(\n 'style1' => 'Style 1',\n 'style2' => 'Style 2',\n );\n\n\t\t\t//If we have parent slug - set correct url\n\t\t\tif ( $this->parent_slug !== '' ) {\n\t\t\t\t$this->page_url = 'admin.php?page=' . $this->page_slug;\n\t\t\t} else {\n\t\t\t\t$this->page_url = 'themes.php?page=' . $this->page_slug;\n\t\t\t}\n\t\t\t$this->page_url = apply_filters( $this->theme_name . '_theme_setup_wizard_page_url', $this->page_url );\n\n\t\t\t//set relative plugin path url\n\t\t\t$this->plugin_path = trailingslashit( $this->cleanFilePath( dirname( __FILE__ ) ) );\n\t\t\t$relative_url = str_replace( $this->cleanFilePath( get_template_directory() ), '', $this->plugin_path );\n\t\t\t$this->plugin_url = trailingslashit( get_template_directory_uri() . $relative_url );\n\t\t}",
"public function run()\n {\n $theme_names = [\n 'Cerulean',\n 'Cosmo',\n 'Cyborg',\n 'Darkly',\n 'Flatly',\n 'Journal',\n 'Litera',\n 'Lumen',\n 'LUX'\n ];\n $theme_urls = [\n 'https://stackpath.bootstrapcdn.com/bootswatch/4.3.1/cerulean/bootstrap.min.css',\n 'https://stackpath.bootstrapcdn.com/bootswatch/4.3.1/cosmo/bootstrap.min.css',\n 'https://stackpath.bootstrapcdn.com/bootswatch/4.3.1/cyborg/bootstrap.min.css',\n 'https://stackpath.bootstrapcdn.com/bootswatch/4.3.1/darkly/bootstrap.min.css',\n 'https://stackpath.bootstrapcdn.com/bootswatch/4.3.1/flatly/bootstrap.min.css',\n 'https://stackpath.bootstrapcdn.com/bootswatch/4.3.1/journal/bootstrap.min.css',\n 'https://stackpath.bootstrapcdn.com/bootswatch/4.3.1/litera/bootstrap.min.css'.\n 'https://stackpath.bootstrapcdn.com/bootswatch/4.3.1/lumen/bootstrap.min.css',\n 'https://stackpath.bootstrapcdn.com/bootswatch/4.3.1/lux/bootstrap.min.css'\n ];\n $theme_descriptions = [\n 'A calm blue sky',\n 'An ode to Metro',\n 'Jet black and electric blue',\n 'Flatly in night mode',\n 'Flat and modern',\n 'Crisp like a new sheet of paper',\n 'The medium is the message',\n 'Light and shadow',\n 'A touch of class'\n ];\n\n for ($i =0; $i < 8; $i++){\n if ($i == 0){\n DB::table('themes')->insert([\n 'name' => $theme_names[$i],\n 'url' => $theme_urls[$i],\n 'description' => $theme_descriptions[$i],\n 'is_default' => 1\n ]);\n }\n else {\n DB::table('themes')->insert([\n 'name' => $theme_names[$i],\n 'url' => $theme_urls[$i],\n 'description' => $theme_descriptions[$i]\n ]);\n }\n }\n }",
"function create_prebuilt_layouts($layouts){\n $layouts['home-agency'] = array(\n 'name' => __('Home: Agency', 'create'), \n 'description' => __('Layout for demo Home: Agency page.', 'create'),\n 'widgets' => \n\t\t array (\n\t\t 0 => \n\t\t array (\n\t\t 'title' => '',\n\t\t 'text' => '[rev_slider alias=\"home-slider-agency\"]',\n\t\t 'filter' => false,\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'WP_Widget_Text',\n\t\t 'raw' => false,\n\t\t 'grid' => 0,\n\t\t 'cell' => 0,\n\t\t 'id' => 0,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 1 => \n\t\t array (\n\t\t 'type' => 'visual',\n\t\t 'title' => '',\n\t\t 'text' => '<h1 style=\"text-align: center;\"><span style=\"color: #bb9f7c;\">Create</span> is a multi-purpose WordPress theme that gives you the power to create many different styles of websites. </h1>',\n\t\t 'filter' => '1',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t 'raw' => false,\n\t\t 'grid' => 1,\n\t\t 'cell' => 1,\n\t\t 'id' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'widget_css' => 'line-height: 3.8em !important;',\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 2 => \n\t\t array (\n\t\t 'title' => '',\n\t\t 'show_filter' => 'no',\n\t\t 'filter_alignment' => 'center',\n\t\t 'count' => '4',\n\t\t 'thumb_proportions' => 'landscape',\n\t\t 'layout' => 'masonry without gutter',\n\t\t 'columns' => '4',\n\t\t 'skills' => \n\t\t array (\n\t\t 'illustration' => '',\n\t\t 'mobile' => '',\n\t\t 'motion' => '',\n\t\t 'photography' => '',\n\t\t 'web' => '',\n\t\t ),\n\t\t 'orderby' => 'date',\n\t\t 'order' => 'DESC',\n\t\t 'hover_effect' => 'effect-1',\n\t\t 'hover_color' => '#1aafaf',\n\t\t 'hover_text_color' => '',\n\t\t 'show_skills' => 'yes',\n\t\t 'show_load_more' => 'no',\n\t\t 'enable_lightbox' => 'no',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'TTrust_Portfolio',\n\t\t 'raw' => false,\n\t\t 'grid' => 2,\n\t\t 'cell' => 0,\n\t\t 'id' => 2,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 3 => \n\t\t array (\n\t\t 'features' => \n\t\t array (\n\t\t 0 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'fontawesome-list-alt',\n\t\t 'icon_color' => '#bb9f7c',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Page Builder',\n\t\t 'text' => 'Create comes with a page builder that allows you to create pages exactly how you want. ',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t 1 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'fontawesome-tablet',\n\t\t 'icon_color' => '#bb9f7c',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Responsive Layout',\n\t\t 'text' => 'Create is a responsive theme. Its layout adjusts to look great on any screen size or device.',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t 2 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'fontawesome-eye',\n\t\t 'icon_color' => '#bb9f7c',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Retina Ready',\n\t\t 'text' => 'Built with the latest technology in mind, rest assured that your site will look crisp on retina displays.',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t 3 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'fontawesome-tasks',\n\t\t 'icon_color' => '#bb9f7c',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Multiple Headers',\n\t\t 'text' => 'Packed with 5 different header layouts, you can use this theme to create many different styles of websites.',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t 4 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'fontawesome-cog',\n\t\t 'icon_color' => '#bb9f7c',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Powerful Options',\n\t\t 'text' => 'Create comes with tons of options built right into the WordPress Customizer. So you can give your site a unique look.',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t 5 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'fontawesome-th-list',\n\t\t 'icon_color' => '#bb9f7c',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Built-in Mega Menu',\n\t\t 'text' => 'There is a mega menu built in for those sites that have a lot of pages. You can easily add icons to menu items.',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t ),\n\t\t 'container_shape' => 'round',\n\t\t 'container_size' => 25,\n\t\t 'icon_size' => 25,\n\t\t 'per_row' => 3,\n\t\t 'responsive' => true,\n\t\t 'title_link' => false,\n\t\t 'icon_link' => false,\n\t\t 'new_window' => false,\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'SiteOrigin_Widget_Features_Widget',\n\t\t 'raw' => false,\n\t\t 'grid' => 3,\n\t\t 'cell' => 0,\n\t\t 'id' => 3,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 4 => \n\t\t array (\n\t\t 'type' => 'visual',\n\t\t 'title' => '',\n\t\t 'text' => '<h1>Our <span style=\"color: #ffffff;\">customers\\'</span> happiness is what matters to us.</h1>',\n\t\t 'filter' => '1',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t 'raw' => false,\n\t\t 'grid' => 4,\n\t\t 'cell' => 0,\n\t\t 'id' => 4,\n\t\t 'style' => \n\t\t array (\n\t\t 'class' => 'v-center',\n\t\t 'padding' => '50px',\n\t\t 'background' => '#232323',\n\t\t 'background_display' => 'tile',\n\t\t 'font_color' => '#9e9e9e',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 5 => \n\t\t array (\n\t\t 'title' => '',\n\t\t 'count' => '4',\n\t\t 'layout' => 'carousel',\n\t\t 'columns' => '1',\n\t\t 'alignment' => 'center',\n\t\t 'order' => 'rand',\n\t\t 'carousel-nav-color' => '#ffffff',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'TTrust_Testimonials',\n\t\t 'raw' => false,\n\t\t 'grid' => 4,\n\t\t 'cell' => 1,\n\t\t 'id' => 5,\n\t\t 'style' => \n\t\t array (\n\t\t 'padding' => '50px',\n\t\t 'background' => '#1aafaf',\n\t\t 'background_display' => 'tile',\n\t\t 'font_color' => '#ffffff',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 6 => \n\t\t array (\n\t\t 'type' => 'visual',\n\t\t 'title' => '',\n\t\t 'text' => '<h1 style=\"text-align: center;\">We\\'ve been known to <span style=\"color: #000000;\">share</span> our thoughts.</h1>',\n\t\t 'filter' => '1',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t 'raw' => false,\n\t\t 'grid' => 5,\n\t\t 'cell' => 0,\n\t\t 'id' => 6,\n\t\t 'style' => \n\t\t array (\n\t\t 'class' => 'v-center',\n\t\t 'padding' => '0px',\n\t\t 'background' => '#ffffff',\n\t\t 'background_display' => 'tile',\n\t\t 'font_color' => '#878787',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 7 => \n\t\t array (\n\t\t 'title' => '',\n\t\t 'count' => '9',\n\t\t 'layout' => 'carousel',\n\t\t 'columns' => '3',\n\t\t 'alignment' => 'left',\n\t\t 'orderby' => 'date',\n\t\t 'order' => 'DESC',\n\t\t 'show_excerpt' => 'no',\n\t\t 'carousel-nav-color' => '#1aafaf',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'TTrust_Blog',\n\t\t 'raw' => false,\n\t\t 'grid' => 6,\n\t\t 'cell' => 0,\n\t\t 'id' => 7,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 8 => \n\t\t array (\n\t\t 'type' => 'html',\n\t\t 'title' => '',\n\t\t 'text' => '<h3 style=\"text-align: center;\">Unlimited Parallax Sections</h3>\n\t\t<p style=\"text-align: center;\">Create unlimited parallax sections for your pages. It\\'s as easy as adding a new page builder row, uploading an image, and choosing \"parallax from the drop down.</p>',\n\t\t 'filter' => '1',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t 'raw' => false,\n\t\t 'grid' => 7,\n\t\t 'cell' => 1,\n\t\t 'id' => 8,\n\t\t 'style' => \n\t\t array (\n\t\t 'padding' => '0px',\n\t\t 'background_display' => 'tile',\n\t\t 'font_color' => '#ffffff',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 9 => \n\t\t array (\n\t\t 'text' => 'LEARN MORE',\n\t\t 'url' => '#',\n\t\t 'new_window' => false,\n\t\t 'button_icon' => \n\t\t array (\n\t\t 'icon_selected' => '',\n\t\t 'icon_color' => '',\n\t\t 'icon' => '0',\n\t\t ),\n\t\t 'design' => \n\t\t array (\n\t\t 'align' => 'center',\n\t\t 'theme' => 'flat',\n\t\t 'button_color' => '#bb9f7c',\n\t\t 'text_color' => '#ffffff',\n\t\t 'hover' => true,\n\t\t 'font_size' => '1',\n\t\t 'rounding' => '0.25',\n\t\t 'padding' => '1',\n\t\t ),\n\t\t 'attributes' => \n\t\t array (\n\t\t 'id' => '',\n\t\t 'title' => '',\n\t\t 'onclick' => '',\n\t\t ),\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'SiteOrigin_Widget_Button_Widget',\n\t\t 'raw' => false,\n\t\t 'grid' => 7,\n\t\t 'cell' => 1,\n\t\t 'id' => 9,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 10 => \n\t\t array (\n\t\t 'title' => 'Use Create to build your next site.',\n\t\t 'sub_title' => false,\n\t\t 'design' => \n\t\t array (\n\t\t 'background_color' => '#1aafaf',\n\t\t 'border_color' => '',\n\t\t 'button_align' => 'right',\n\t\t ),\n\t\t 'button' => \n\t\t array (\n\t\t 'text' => 'BUY CREATE NOW',\n\t\t 'url' => 'http://themetrust.com/themes/create',\n\t\t 'button_icon' => \n\t\t array (\n\t\t 'icon_selected' => '',\n\t\t 'icon_color' => '',\n\t\t 'icon' => '0',\n\t\t ),\n\t\t 'design' => \n\t\t array (\n\t\t 'theme' => 'wire',\n\t\t 'button_color' => '#ffffff',\n\t\t 'text_color' => '#1aafaf',\n\t\t 'hover' => true,\n\t\t 'font_size' => '1',\n\t\t 'rounding' => '0.25',\n\t\t 'padding' => '1',\n\t\t ),\n\t\t 'attributes' => \n\t\t array (\n\t\t 'id' => '',\n\t\t 'title' => '',\n\t\t 'onclick' => '',\n\t\t ),\n\t\t ),\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'SiteOrigin_Widget_Cta_Widget',\n\t\t 'raw' => false,\n\t\t 'grid' => 8,\n\t\t 'cell' => 0,\n\t\t 'id' => 10,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_display' => 'tile',\n\t\t 'font_color' => '#ffffff',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 'grids' => \n\t\t array (\n\t\t 0 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'row_stretch' => 'full-stretched',\n\t\t 'equal_column_height' => 'no',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 1 => \n\t\t array (\n\t\t 'cells' => 3,\n\t\t 'style' => \n\t\t array (\n\t\t 'row_stretch' => 'full',\n\t\t 'equal_column_height' => 'no',\n\t\t 'padding_top' => '70px',\n\t\t 'padding_bottom' => '70px',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 2 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'bottom_margin' => '0px',\n\t\t 'row_stretch' => 'full-stretched',\n\t\t 'background' => '#f9f8f4',\n\t\t 'equal_column_height' => 'no',\n\t\t 'padding_top' => '0px',\n\t\t 'padding_bottom' => '0px',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 3 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'bottom_margin' => '0px',\n\t\t 'equal_column_height' => 'no',\n\t\t 'padding_top' => '70px',\n\t\t 'padding_bottom' => '60px',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 4 => \n\t\t array (\n\t\t 'cells' => 2,\n\t\t 'style' => \n\t\t array (\n\t\t 'bottom_margin' => '0px',\n\t\t 'gutter' => '0px',\n\t\t 'row_stretch' => 'full-stretched',\n\t\t 'equal_column_height' => 'yes',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 5 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'bottom_margin' => '0px',\n\t\t 'gutter' => '0px',\n\t\t 'row_stretch' => 'full',\n\t\t 'equal_column_height' => 'no',\n\t\t 'padding_top' => '50px',\n\t\t 'padding_bottom' => '50px',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 6 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'bottom_margin' => '0px',\n\t\t 'gutter' => '0px',\n\t\t 'row_stretch' => 'full',\n\t\t 'equal_column_height' => 'no',\n\t\t 'padding_top' => '0px',\n\t\t 'padding_bottom' => '50px',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 7 => \n\t\t array (\n\t\t 'cells' => 3,\n\t\t 'style' => \n\t\t array (\n\t\t 'bottom_margin' => '0px',\n\t\t 'row_stretch' => 'full',\n\t\t 'equal_column_height' => 'no',\n\t\t 'padding_top' => '140px',\n\t\t 'padding_bottom' => '140px',\n\t\t 'background_image' => 957,\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'parallax',\n\t\t ),\n\t\t ),\n\t\t 8 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'bottom_margin' => '0px',\n\t\t 'row_stretch' => 'full',\n\t\t 'background' => '#1aafaf',\n\t\t 'equal_column_height' => 'no',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 'grid_cells' => \n\t\t array (\n\t\t 0 => \n\t\t array (\n\t\t 'grid' => 0,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t 1 => \n\t\t array (\n\t\t 'grid' => 1,\n\t\t 'weight' => 0.10471092077087999772100346262959646992385387420654296875,\n\t\t ),\n\t\t 2 => \n\t\t array (\n\t\t 'grid' => 1,\n\t\t 'weight' => 0.7745182012847899866159195880754850804805755615234375,\n\t\t ),\n\t\t 3 => \n\t\t array (\n\t\t 'grid' => 1,\n\t\t 'weight' => 0.120770877944330001785289141480461694300174713134765625,\n\t\t ),\n\t\t 4 => \n\t\t array (\n\t\t 'grid' => 2,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t 5 => \n\t\t array (\n\t\t 'grid' => 3,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t 6 => \n\t\t array (\n\t\t 'grid' => 4,\n\t\t 'weight' => 0.58580182951797998835985481491661630570888519287109375,\n\t\t ),\n\t\t 7 => \n\t\t array (\n\t\t 'grid' => 4,\n\t\t 'weight' => 0.41419817048202001164014518508338369429111480712890625,\n\t\t ),\n\t\t 8 => \n\t\t array (\n\t\t 'grid' => 5,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t 9 => \n\t\t array (\n\t\t 'grid' => 6,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t 10 => \n\t\t array (\n\t\t 'grid' => 7,\n\t\t 'weight' => 0.204186413902050001301091697314404882490634918212890625,\n\t\t ),\n\t\t 11 => \n\t\t array (\n\t\t 'grid' => 7,\n\t\t 'weight' => 0.59162717219589999739781660537119023501873016357421875,\n\t\t ),\n\t\t 12 => \n\t\t array (\n\t\t 'grid' => 7,\n\t\t 'weight' => 0.204186413902050001301091697314404882490634918212890625,\n\t\t ),\n\t\t 13 => \n\t\t array (\n\t\t 'grid' => 8,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t ),\n );\n\n\t$layouts['home-pro'] = array(\n\t\t'name' => __('Home: Professional', 'create'),\n\t\t'description' => __('Layout for demo Home: Professional page.', 'create'),\n 'widgets' => \n\t\t array (\n\t\t 0 => \n\t\t array (\n\t\t 'title' => '',\n\t\t 'text' => '[rev_slider alias=\"home_slider_pro\"]',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'WP_Widget_Text',\n\t\t 'grid' => 0,\n\t\t 'cell' => 0,\n\t\t 'id' => 0,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_image_attachment' => false,\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t 'filter' => false,\n\t\t ),\n\t\t 1 => \n\t\t array (\n\t\t 'type' => 'visual',\n\t\t 'title' => '',\n\t\t 'text' => '<h3 style=\"text-align: center;\"><span style=\"color: #242424;\">THE ONLY THEME YOU NEED</span></h3><p style=\"text-align: center;\">Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p>',\n\t\t 'filter' => '1',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t 'raw' => false,\n\t\t 'grid' => 1,\n\t\t 'cell' => 0,\n\t\t 'id' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'class' => 'v-center',\n\t\t 'widget_css' => '\t',\n\t\t 'padding' => '70px',\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 2 => \n\t\t array (\n\t\t 'type' => 'visual',\n\t\t 'title' => '',\n\t\t 'text' => '<p><img class=\"alignright size-full wp-image-520\" src=\"http://create.themetrust.com/wp-content/uploads/2015/07/macbook-pro-cropped-right.jpg\" alt=\"macbook-pro-cropped-right\" width=\"1293\" height=\"951\" /></p>',\n\t\t 'filter' => '1',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t 'raw' => false,\n\t\t 'grid' => 1,\n\t\t 'cell' => 1,\n\t\t 'id' => 2,\n\t\t 'style' => \n\t\t array (\n\t\t 'class' => 'v-center',\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 3 => \n\t\t array (\n\t\t 'features' => \n\t\t array (\n\t\t 0 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'elegantline-layers',\n\t\t 'icon_color' => '#ffffff',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Page Builder',\n\t\t 'text' => 'Create comes with a page builder that allows you to create pages exactly how you want. ',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t 1 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'elegantline-mobile',\n\t\t 'icon_color' => '#ffffff',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Responsive Layout',\n\t\t 'text' => 'Create is a responsive theme. Its layout adjusts to look great on any screen size or device.',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t 2 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'elegantline-laptop',\n\t\t 'icon_color' => '#ffffff',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Retina Ready',\n\t\t 'text' => 'Built with the latest technology in mind, rest assured that your site will look crisp on retina displays.',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t 3 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'elegantline-browser',\n\t\t 'icon_color' => '#ffffff',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Multiple Headers',\n\t\t 'text' => 'Packed with 5 different header layouts, you can use this theme to create many different styles of websites.',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t 4 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'elegantline-gears',\n\t\t 'icon_color' => '#ffffff',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Powerful Options',\n\t\t 'text' => 'Create comes with tons of options built right into the WordPress Customizer. So you can give your site a unique look.',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t 5 => \n\t\t array (\n\t\t 'container_color' => '',\n\t\t 'icon' => 'elegantline-genius',\n\t\t 'icon_color' => '#ffffff',\n\t\t 'icon_image' => '0',\n\t\t 'title' => 'Built-in Mega Menu',\n\t\t 'text' => 'There is a mega menu built in for those sites that have a lot of pages. You can easily add icons to menu items.',\n\t\t 'more_text' => '',\n\t\t 'more_url' => '',\n\t\t ),\n\t\t ),\n\t\t 'container_shape' => 'round',\n\t\t 'container_size' => 25,\n\t\t 'icon_size' => 25,\n\t\t 'per_row' => 3,\n\t\t 'responsive' => true,\n\t\t 'title_link' => false,\n\t\t 'icon_link' => false,\n\t\t 'new_window' => false,\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'SiteOrigin_Widget_Features_Widget',\n\t\t 'raw' => false,\n\t\t 'grid' => 2,\n\t\t 'cell' => 0,\n\t\t 'id' => 3,\n\t\t 'style' => \n\t\t array (\n\t\t 'class' => 'left',\n\t\t 'widget_css' => 'p{opacity: .5}',\n\t\t 'padding' => '50px',\n\t\t 'background_display' => 'tile',\n\t\t 'font_color' => '#ffffff',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 4 => \n\t\t array (\n\t\t 'title' => 'Some of our latest work.',\n\t\t 'sub_title' => '',\n\t\t 'design' => \n\t\t array (\n\t\t 'background_color' => '#ba9e78',\n\t\t 'border_color' => false,\n\t\t 'button_align' => 'right',\n\t\t ),\n\t\t 'button' => \n\t\t array (\n\t\t 'text' => 'View More',\n\t\t 'url' => '',\n\t\t 'button_icon' => \n\t\t array (\n\t\t 'icon_selected' => '',\n\t\t 'icon_color' => false,\n\t\t 'icon' => 0,\n\t\t ),\n\t\t 'design' => \n\t\t array (\n\t\t 'theme' => 'flat',\n\t\t 'button_color' => '#ffffff',\n\t\t 'text_color' => '#ba9e78',\n\t\t 'hover' => true,\n\t\t 'font_size' => '1',\n\t\t 'rounding' => '0.25',\n\t\t 'padding' => '1',\n\t\t 'align' => 'center',\n\t\t ),\n\t\t 'attributes' => \n\t\t array (\n\t\t 'id' => '',\n\t\t 'title' => '',\n\t\t 'onclick' => '',\n\t\t ),\n\t\t 'new_window' => false,\n\t\t ),\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'SiteOrigin_Widget_Cta_Widget',\n\t\t 'raw' => false,\n\t\t 'grid' => 3,\n\t\t 'cell' => 0,\n\t\t 'id' => 4,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_display' => 'tile',\n\t\t 'font_color' => '#ffffff',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 5 => \n\t\t array (\n\t\t 'title' => '',\n\t\t 'show_filter' => 'no',\n\t\t 'filter_alignment' => 'center',\n\t\t 'count' => '3',\n\t\t 'thumb_proportions' => 'landscape',\n\t\t 'layout' => 'rows without gutter',\n\t\t 'columns' => '3',\n\t\t 'orderby' => 'date',\n\t\t 'order' => 'DESC',\n\t\t 'hover_effect' => 'effect-1',\n\t\t 'hover_color' => '',\n\t\t 'hover_text_color' => '',\n\t\t 'show_skills' => 'yes',\n\t\t 'show_load_more' => 'no',\n\t\t 'enable_lightbox' => 'no',\n\t\t 'skills' => \n\t\t array (\n\t\t ),\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'TTrust_Portfolio',\n\t\t 'raw' => false,\n\t\t 'grid' => 4,\n\t\t 'cell' => 0,\n\t\t 'id' => 5,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 6 => \n\t\t array (\n\t\t 'type' => 'visual',\n\t\t 'title' => '',\n\t\t 'text' => '<h3 style=\"text-align: center;\"><span style=\"color: #242424;\">FROM THE BLOG</span></h3><p style=\"text-align: center;\">This is a blog widget that you can add anywhere. Display recent posts as a grid or carousel.</p>',\n\t\t 'filter' => '1',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t 'raw' => false,\n\t\t 'grid' => 5,\n\t\t 'cell' => 0,\n\t\t 'id' => 6,\n\t\t 'style' => \n\t\t array (\n\t\t 'padding' => '50px',\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 7 => \n\t\t array (\n\t\t 'title' => '',\n\t\t 'count' => '3',\n\t\t 'layout' => 'grid',\n\t\t 'columns' => '3',\n\t\t 'alignment' => 'left',\n\t\t 'orderby' => 'date',\n\t\t 'order' => 'DESC',\n\t\t 'show_excerpt' => 'yes',\n\t\t 'carousel-nav-color' => '',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'TTrust_Blog',\n\t\t 'raw' => false,\n\t\t 'grid' => 5,\n\t\t 'cell' => 0,\n\t\t 'id' => 7,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 8 => \n\t\t array (\n\t\t 'type' => 'visual',\n\t\t 'title' => '',\n\t\t 'text' => '<h3 style=\"text-align: center;\">OUR CUSTOMERS <span style=\"color: #ba9e78;\"><strong>LOVE</strong></span> US</h3>',\n\t\t 'filter' => '1',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t 'raw' => false,\n\t\t 'grid' => 6,\n\t\t 'cell' => 1,\n\t\t 'id' => 8,\n\t\t 'style' => \n\t\t array (\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 9 => \n\t\t array (\n\t\t 'title' => '',\n\t\t 'count' => '3',\n\t\t 'layout' => 'carousel',\n\t\t 'columns' => '1',\n\t\t 'alignment' => 'center',\n\t\t 'order' => 'menu_order',\n\t\t 'carousel-nav-color' => '#ba9e78',\n\t\t 'panels_info' => \n\t\t array (\n\t\t 'class' => 'TTrust_Testimonials',\n\t\t 'raw' => false,\n\t\t 'grid' => 6,\n\t\t 'cell' => 1,\n\t\t 'id' => 9,\n\t\t 'style' => \n\t\t array (\n\t\t 'padding' => '30pxpx',\n\t\t 'background_display' => 'tile',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 'grids' => \n\t\t array (\n\t\t 0 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'row_stretch' => 'full-stretched',\n\t\t 'equal_column_height' => 'no',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 1 => \n\t\t array (\n\t\t 'cells' => 2,\n\t\t 'style' => \n\t\t array (\n\t\t 'gutter' => '0px',\n\t\t 'row_stretch' => 'full-stretched',\n\t\t 'equal_column_height' => 'yes',\n\t\t 'padding_top' => '60px',\n\t\t 'padding_bottom' => '60px',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 2 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'bottom_margin' => '0px',\n\t\t 'row_stretch' => 'full',\n\t\t 'equal_column_height' => 'no',\n\t\t 'padding_top' => '140px',\n\t\t 'padding_bottom' => '140px',\n\t\t 'background_image' => 544,\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'parallax',\n\t\t ),\n\t\t ),\n\t\t 3 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'bottom_margin' => '0px',\n\t\t 'row_stretch' => 'full',\n\t\t 'background' => '#ba9e78',\n\t\t 'equal_column_height' => 'no',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 4 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'bottom_margin' => '0px',\n\t\t 'row_stretch' => 'full-stretched',\n\t\t 'background' => '#f9f8f4',\n\t\t 'equal_column_height' => 'no',\n\t\t 'padding_top' => '0px',\n\t\t 'padding_bottom' => '0px',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 5 => \n\t\t array (\n\t\t 'cells' => 1,\n\t\t 'style' => \n\t\t array (\n\t\t 'equal_column_height' => 'no',\n\t\t 'padding_top' => '40px',\n\t\t 'padding_bottom' => '40px',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'cover',\n\t\t ),\n\t\t ),\n\t\t 6 => \n\t\t array (\n\t\t 'cells' => 3,\n\t\t 'style' => \n\t\t array (\n\t\t 'row_stretch' => 'full',\n\t\t 'background' => '#f4f4f4',\n\t\t 'equal_column_height' => 'no',\n\t\t 'padding_top' => '100px',\n\t\t 'padding_bottom' => '100px',\n\t\t 'background_image_position' => 'left top',\n\t\t 'background_image_style' => 'parallax',\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 'grid_cells' => \n\t\t array (\n\t\t 0 => \n\t\t array (\n\t\t 'grid' => 0,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t 1 => \n\t\t array (\n\t\t 'grid' => 1,\n\t\t 'weight' => 0.5,\n\t\t ),\n\t\t 2 => \n\t\t array (\n\t\t 'grid' => 1,\n\t\t 'weight' => 0.5,\n\t\t ),\n\t\t 3 => \n\t\t array (\n\t\t 'grid' => 2,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t 4 => \n\t\t array (\n\t\t 'grid' => 3,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t 5 => \n\t\t array (\n\t\t 'grid' => 4,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t 6 => \n\t\t array (\n\t\t 'grid' => 5,\n\t\t 'weight' => 1,\n\t\t ),\n\t\t 7 => \n\t\t array (\n\t\t 'grid' => 6,\n\t\t 'weight' => 0.278206541712607224869913125075981952250003814697265625,\n\t\t ),\n\t\t 8 => \n\t\t array (\n\t\t 'grid' => 6,\n\t\t 'weight' => 0.44358691657478555026017374984803609549999237060546875,\n\t\t ),\n\t\t 9 => \n\t\t array (\n\t\t 'grid' => 6,\n\t\t 'weight' => 0.278206541712607224869913125075981952250003814697265625,\n\t\t ),\n\t\t ),\n\t\t);\n\t\t\n\t\t$layouts['home-full'] = array(\n\t\t\t'name' => __('Home: Fullscreen Slider', 'create'),\n\t\t\t'description' => __('Layout for demo Home: Fullscreen Slider page.', 'create'),\n\t 'widgets' => \n\t\t\t array (\n\t\t\t 0 => \n\t\t\t array (\n\t\t\t 'title' => '',\n\t\t\t 'text' => '[rev_slider alias=\"full-screen\"]',\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'WP_Widget_Text',\n\t\t\t 'grid' => 0,\n\t\t\t 'cell' => 0,\n\t\t\t 'id' => 0,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'background_image_attachment' => false,\n\t\t\t 'background_display' => 'tile',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 'filter' => false,\n\t\t\t ),\n\t\t\t 1 => \n\t\t\t array (\n\t\t\t 'features' => \n\t\t\t array (\n\t\t\t 0 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'elegantline-layers',\n\t\t\t 'icon_color' => '#98643c',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'Page Builder',\n\t\t\t 'text' => 'Create comes with a page builder that allows you to create pages exactly how you want. ',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t 1 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'elegantline-mobile',\n\t\t\t 'icon_color' => '#98643c',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'Responsive Layout',\n\t\t\t 'text' => 'Create is a responsive theme. Its layout adjusts to look great on any screen size or device.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t 2 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'elegantline-laptop',\n\t\t\t 'icon_color' => '#98643c',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'Retina Ready',\n\t\t\t 'text' => 'Built with the latest technology in mind, rest assured that your site will look crisp on retina displays.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 'container_shape' => 'round',\n\t\t\t 'container_size' => 25,\n\t\t\t 'icon_size' => 25,\n\t\t\t 'per_row' => 1,\n\t\t\t 'responsive' => true,\n\t\t\t 'title_link' => false,\n\t\t\t 'icon_link' => false,\n\t\t\t 'new_window' => false,\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'SiteOrigin_Widget_Features_Widget',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 1,\n\t\t\t 'cell' => 0,\n\t\t\t 'id' => 1,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'class' => 'right v-center',\n\t\t\t 'background_display' => 'tile',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 2 => \n\t\t\t array (\n\t\t\t 'image_fallback' => '',\n\t\t\t 'image' => 159,\n\t\t\t 'size' => 'full',\n\t\t\t 'title' => '',\n\t\t\t 'alt' => '',\n\t\t\t 'url' => '',\n\t\t\t 'bound' => true,\n\t\t\t 'new_window' => false,\n\t\t\t 'full_width' => false,\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'SiteOrigin_Widget_Image_Widget',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 1,\n\t\t\t 'cell' => 1,\n\t\t\t 'id' => 2,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'class' => 'v-center',\n\t\t\t 'background_display' => 'tile',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 3 => \n\t\t\t array (\n\t\t\t 'features' => \n\t\t\t array (\n\t\t\t 0 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'elegantline-browser',\n\t\t\t 'icon_color' => '#98643c',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'Multiple Headers',\n\t\t\t 'text' => 'Packed with 5 different header layouts, you can use this theme to create many different styles of websites.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t 1 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'elegantline-gears',\n\t\t\t 'icon_color' => '#98643c',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'Powerful Options',\n\t\t\t 'text' => 'Create comes with tons of options built right into the WordPress Customizer. So you can give your site a unique look.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t 2 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'elegantline-genius',\n\t\t\t 'icon_color' => '#98643c',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'Built-in Mega Menu',\n\t\t\t 'text' => 'There is a mega menu built in for those sites that have a lot of pages. You can easily add icons to menu items.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 'container_shape' => 'round',\n\t\t\t 'container_size' => 25,\n\t\t\t 'icon_size' => 25,\n\t\t\t 'per_row' => 1,\n\t\t\t 'responsive' => true,\n\t\t\t 'title_link' => false,\n\t\t\t 'icon_link' => false,\n\t\t\t 'new_window' => false,\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'SiteOrigin_Widget_Features_Widget',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 1,\n\t\t\t 'cell' => 2,\n\t\t\t 'id' => 3,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'class' => 'left v-center',\n\t\t\t 'background_display' => 'tile',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 4 => \n\t\t\t array (\n\t\t\t 'type' => 'visual',\n\t\t\t 'title' => '',\n\t\t\t 'text' => '<h3 style=\"text-align: center;\">Our Latest Work</h3><p style=\"text-align: center;\"><span style=\"color: #999999;\">Create unlimited parallax sections for your pages. It\\'s as easy as adding a new page build row, uploading and image, and choosing \"parallax from the drop down.</span></p>',\n\t\t\t 'filter' => '1',\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 2,\n\t\t\t 'cell' => 1,\n\t\t\t 'id' => 4,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'padding' => '0px',\n\t\t\t 'background_display' => 'tile',\n\t\t\t 'font_color' => '#ffffff',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 5 => \n\t\t\t array (\n\t\t\t 'text' => 'VIEW MORE',\n\t\t\t 'url' => '#',\n\t\t\t 'new_window' => false,\n\t\t\t 'button_icon' => \n\t\t\t array (\n\t\t\t 'icon_selected' => '',\n\t\t\t 'icon_color' => '',\n\t\t\t 'icon' => '0',\n\t\t\t ),\n\t\t\t 'design' => \n\t\t\t array (\n\t\t\t 'align' => 'center',\n\t\t\t 'theme' => 'flat',\n\t\t\t 'button_color' => '#bb9f7c',\n\t\t\t 'text_color' => '#ffffff',\n\t\t\t 'hover' => true,\n\t\t\t 'font_size' => '1',\n\t\t\t 'rounding' => '0.25',\n\t\t\t 'padding' => '1',\n\t\t\t ),\n\t\t\t 'attributes' => \n\t\t\t array (\n\t\t\t 'id' => '',\n\t\t\t 'title' => '',\n\t\t\t 'onclick' => '',\n\t\t\t ),\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'SiteOrigin_Widget_Button_Widget',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 2,\n\t\t\t 'cell' => 1,\n\t\t\t 'id' => 5,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'background_display' => 'tile',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 6 => \n\t\t\t array (\n\t\t\t 'title' => '',\n\t\t\t 'show_filter' => 'no',\n\t\t\t 'filter_alignment' => 'center',\n\t\t\t 'count' => '3',\n\t\t\t 'thumb_proportions' => 'square',\n\t\t\t 'layout' => 'rows without gutter',\n\t\t\t 'columns' => '3',\n\t\t\t 'orderby' => 'date',\n\t\t\t 'order' => 'DESC',\n\t\t\t 'hover_effect' => 'effect-1',\n\t\t\t 'hover_color' => '',\n\t\t\t 'hover_text_color' => '',\n\t\t\t 'show_skills' => 'no',\n\t\t\t 'show_load_more' => 'no',\n\t\t\t 'enable_lightbox' => 'no',\n\t\t\t 'skills' => \n\t\t\t array (\n\t\t\t ),\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'TTrust_Portfolio',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 3,\n\t\t\t 'cell' => 0,\n\t\t\t 'id' => 6,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'background_display' => 'tile',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 7 => \n\t\t\t array (\n\t\t\t 'headline' => \n\t\t\t array (\n\t\t\t 'text' => 'What People Are Saying',\n\t\t\t 'font' => 'default',\n\t\t\t 'color' => '#000000',\n\t\t\t 'align' => 'center',\n\t\t\t ),\n\t\t\t 'sub_headline' => \n\t\t\t array (\n\t\t\t 'text' => 'Display testimonials as a slider or grid.',\n\t\t\t 'font' => 'default',\n\t\t\t 'color' => '#aaaaaa',\n\t\t\t 'align' => 'center',\n\t\t\t ),\n\t\t\t 'divider' => \n\t\t\t array (\n\t\t\t 'style' => 'solid',\n\t\t\t 'weight' => 'thin',\n\t\t\t 'color' => '#bc9f7a',\n\t\t\t ),\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'SiteOrigin_Widget_Headline_Widget',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 4,\n\t\t\t 'cell' => 0,\n\t\t\t 'id' => 7,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'padding' => '20px',\n\t\t\t 'background_display' => 'tile',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 8 => \n\t\t\t array (\n\t\t\t 'title' => '',\n\t\t\t 'count' => '3',\n\t\t\t 'layout' => 'grid',\n\t\t\t 'columns' => '3',\n\t\t\t 'alignment' => 'center',\n\t\t\t 'order' => 'rand',\n\t\t\t 'carousel-nav-color' => '',\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'TTrust_Testimonials',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 4,\n\t\t\t 'cell' => 0,\n\t\t\t 'id' => 8,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'background_display' => 'tile',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 9 => \n\t\t\t array (\n\t\t\t 'features' => \n\t\t\t array (\n\t\t\t 0 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'fontawesome-list-alt',\n\t\t\t 'icon_color' => '#ffffff',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'Multiple Site Layouts',\n\t\t\t 'text' => 'Choose from full-width, boxed, side header, top header, and more.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t 1 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'fontawesome-desktop',\n\t\t\t 'icon_color' => '#ffffff',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'One-page Option',\n\t\t\t 'text' => 'Create a navigation that scrolls to different sections on a single page.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 'container_shape' => 'round',\n\t\t\t 'container_size' => 25,\n\t\t\t 'icon_size' => 25,\n\t\t\t 'per_row' => 1,\n\t\t\t 'responsive' => true,\n\t\t\t 'title_link' => false,\n\t\t\t 'icon_link' => false,\n\t\t\t 'new_window' => false,\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'SiteOrigin_Widget_Features_Widget',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 5,\n\t\t\t 'cell' => 0,\n\t\t\t 'id' => 9,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'class' => 'left',\n\t\t\t 'padding' => '20%',\n\t\t\t 'background' => '#ba9e78',\n\t\t\t 'background_display' => 'tile',\n\t\t\t 'font_color' => '#ffffff',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 10 => \n\t\t\t array (\n\t\t\t 'features' => \n\t\t\t array (\n\t\t\t 0 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'fontawesome-th',\n\t\t\t 'icon_color' => '#ffffff',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'Portfolio Options',\n\t\t\t 'text' => 'Packed with tons of portfolio options: masonry or grid layout, load more button, and more.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t 1 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'fontawesome-star-o',\n\t\t\t 'icon_color' => '#ffffff',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'Top-notch Support',\n\t\t\t 'text' => 'Read the documentation, but still have questions? We\\'re here to help.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 'container_shape' => 'round',\n\t\t\t 'container_size' => 25,\n\t\t\t 'icon_size' => 25,\n\t\t\t 'per_row' => 1,\n\t\t\t 'responsive' => true,\n\t\t\t 'title_link' => false,\n\t\t\t 'icon_link' => false,\n\t\t\t 'new_window' => false,\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'SiteOrigin_Widget_Features_Widget',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 5,\n\t\t\t 'cell' => 1,\n\t\t\t 'id' => 10,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'class' => 'left',\n\t\t\t 'padding' => '20%',\n\t\t\t 'background' => '#232323',\n\t\t\t 'background_image_attachment' => 200,\n\t\t\t 'background_display' => 'tile',\n\t\t\t 'font_color' => '#ffffff',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 11 => \n\t\t\t array (\n\t\t\t 'features' => \n\t\t\t array (\n\t\t\t 0 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'fontawesome-hand-o-up',\n\t\t\t 'icon_color' => '#ffffff',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'One-click Demo Install',\n\t\t\t 'text' => 'We make it easy for you to get started with all of the layouts you see here in the demo.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t 1 => \n\t\t\t array (\n\t\t\t 'container_color' => false,\n\t\t\t 'icon' => 'fontawesome-file-text',\n\t\t\t 'icon_color' => '#ffffff',\n\t\t\t 'icon_image' => 0,\n\t\t\t 'title' => 'Detailed Documentation',\n\t\t\t 'text' => 'Create has a lot features. We\\'ve taken the time to explain how to use them.',\n\t\t\t 'more_text' => '',\n\t\t\t 'more_url' => '',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 'container_shape' => 'round',\n\t\t\t 'container_size' => 25,\n\t\t\t 'icon_size' => 25,\n\t\t\t 'per_row' => 1,\n\t\t\t 'responsive' => true,\n\t\t\t 'title_link' => false,\n\t\t\t 'icon_link' => false,\n\t\t\t 'new_window' => false,\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'SiteOrigin_Widget_Features_Widget',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 5,\n\t\t\t 'cell' => 2,\n\t\t\t 'id' => 11,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'class' => 'left',\n\t\t\t 'padding' => '20%',\n\t\t\t 'background' => '#232323',\n\t\t\t 'background_display' => 'tile',\n\t\t\t 'font_color' => '#ffffff',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 12 => \n\t\t\t array (\n\t\t\t 'headline' => \n\t\t\t array (\n\t\t\t 'text' => 'Recent News',\n\t\t\t 'font' => 'default',\n\t\t\t 'color' => '#000000',\n\t\t\t 'align' => 'center',\n\t\t\t ),\n\t\t\t 'sub_headline' => \n\t\t\t array (\n\t\t\t 'text' => 'Display recent posts as a carousel or grid.',\n\t\t\t 'font' => 'default',\n\t\t\t 'color' => '#aaaaaa',\n\t\t\t 'align' => 'center',\n\t\t\t ),\n\t\t\t 'divider' => \n\t\t\t array (\n\t\t\t 'style' => 'solid',\n\t\t\t 'weight' => 'thin',\n\t\t\t 'color' => '#bc9f7a',\n\t\t\t ),\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'SiteOrigin_Widget_Headline_Widget',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 6,\n\t\t\t 'cell' => 0,\n\t\t\t 'id' => 12,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'padding' => '20px',\n\t\t\t 'background_display' => 'tile',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 13 => \n\t\t\t array (\n\t\t\t 'title' => '',\n\t\t\t 'count' => '7',\n\t\t\t 'layout' => 'carousel',\n\t\t\t 'columns' => '3',\n\t\t\t 'alignment' => 'left',\n\t\t\t 'orderby' => 'date',\n\t\t\t 'order' => 'DESC',\n\t\t\t 'show_excerpt' => 'yes',\n\t\t\t 'carousel-nav-color' => '',\n\t\t\t 'panels_info' => \n\t\t\t array (\n\t\t\t 'class' => 'TTrust_Blog',\n\t\t\t 'raw' => false,\n\t\t\t 'grid' => 6,\n\t\t\t 'cell' => 0,\n\t\t\t 'id' => 13,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'background_display' => 'tile',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 'grids' => \n\t\t\t array (\n\t\t\t 0 => \n\t\t\t array (\n\t\t\t 'cells' => 1,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t 'equal_column_height' => 'no',\n\t\t\t 'background_image_position' => 'left top',\n\t\t\t 'background_image_style' => 'cover',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 1 => \n\t\t\t array (\n\t\t\t 'cells' => 3,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'bottom_margin' => '0px',\n\t\t\t 'gutter' => '0px',\n\t\t\t 'equal_column_height' => 'yes',\n\t\t\t 'padding_top' => '60px',\n\t\t\t 'padding_bottom' => '50px',\n\t\t\t 'background_image_position' => 'left top',\n\t\t\t 'background_image_style' => 'cover',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 2 => \n\t\t\t array (\n\t\t\t 'cells' => 3,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'bottom_margin' => '0px',\n\t\t\t 'row_stretch' => 'full',\n\t\t\t 'equal_column_height' => 'no',\n\t\t\t 'padding_top' => '100px',\n\t\t\t 'padding_bottom' => '100px',\n\t\t\t 'background_image' => 118,\n\t\t\t 'background_image_position' => 'left top',\n\t\t\t 'background_image_style' => 'parallax',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 3 => \n\t\t\t array (\n\t\t\t 'cells' => 1,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'bottom_margin' => '0px',\n\t\t\t 'gutter' => '0px',\n\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t 'equal_column_height' => 'no',\n\t\t\t 'background_image_position' => 'left top',\n\t\t\t 'background_image_style' => 'cover',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 4 => \n\t\t\t array (\n\t\t\t 'cells' => 1,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'bottom_margin' => '0px',\n\t\t\t 'gutter' => '0px',\n\t\t\t 'equal_column_height' => 'no',\n\t\t\t 'padding_top' => '50px',\n\t\t\t 'padding_bottom' => '50px',\n\t\t\t 'background_image_position' => 'left top',\n\t\t\t 'background_image_style' => 'cover',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 5 => \n\t\t\t array (\n\t\t\t 'cells' => 3,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'bottom_margin' => '0px',\n\t\t\t 'gutter' => '0px',\n\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t 'background' => '#eaeaea',\n\t\t\t 'equal_column_height' => 'yes',\n\t\t\t 'padding_top' => '0px',\n\t\t\t 'padding_bottom' => '0px',\n\t\t\t 'padding_left' => '0px',\n\t\t\t 'padding_right' => '0px',\n\t\t\t 'background_image_position' => 'left top',\n\t\t\t 'background_image_style' => 'cover',\n\t\t\t ),\n\t\t\t ),\n\t\t\t 6 => \n\t\t\t array (\n\t\t\t 'cells' => 1,\n\t\t\t 'style' => \n\t\t\t array (\n\t\t\t 'equal_column_height' => 'no',\n\t\t\t 'padding_top' => '50px',\n\t\t\t 'padding_bottom' => '50px',\n\t\t\t 'background_image_position' => 'left top',\n\t\t\t 'background_image_style' => 'cover',\n\t\t\t ),\n\t\t\t ),\n\t\t\t ),\n\t\t\t 'grid_cells' => \n\t\t\t array (\n\t\t\t 0 => \n\t\t\t array (\n\t\t\t 'grid' => 0,\n\t\t\t 'weight' => 1,\n\t\t\t ),\n\t\t\t 1 => \n\t\t\t array (\n\t\t\t 'grid' => 1,\n\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t ),\n\t\t\t 2 => \n\t\t\t array (\n\t\t\t 'grid' => 1,\n\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t ),\n\t\t\t 3 => \n\t\t\t array (\n\t\t\t 'grid' => 1,\n\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t ),\n\t\t\t 4 => \n\t\t\t array (\n\t\t\t 'grid' => 2,\n\t\t\t 'weight' => 0.204186413902050001301091697314404882490634918212890625,\n\t\t\t ),\n\t\t\t 5 => \n\t\t\t array (\n\t\t\t 'grid' => 2,\n\t\t\t 'weight' => 0.59162717219589999739781660537119023501873016357421875,\n\t\t\t ),\n\t\t\t 6 => \n\t\t\t array (\n\t\t\t 'grid' => 2,\n\t\t\t 'weight' => 0.204186413902050001301091697314404882490634918212890625,\n\t\t\t ),\n\t\t\t 7 => \n\t\t\t array (\n\t\t\t 'grid' => 3,\n\t\t\t 'weight' => 1,\n\t\t\t ),\n\t\t\t 8 => \n\t\t\t array (\n\t\t\t 'grid' => 4,\n\t\t\t 'weight' => 1,\n\t\t\t ),\n\t\t\t 9 => \n\t\t\t array (\n\t\t\t 'grid' => 5,\n\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t ),\n\t\t\t 10 => \n\t\t\t array (\n\t\t\t 'grid' => 5,\n\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t ),\n\t\t\t 11 => \n\t\t\t array (\n\t\t\t 'grid' => 5,\n\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t ),\n\t\t\t 12 => \n\t\t\t array (\n\t\t\t 'grid' => 6,\n\t\t\t 'weight' => 1,\n\t\t\t ),\n\t\t\t ),\n\t\t\t);\n\t\t\t\n\t\t\t$layouts['home-one-page'] = array(\n\t\t\t\t'name' => __('Home: One Page', 'create'),\n\t\t\t\t'description' => __('Layout for demo Home: One Page page.', 'create'),\n\t\t 'widgets' => \n\t\t\t\t array (\n\t\t\t\t 0 => \n\t\t\t\t array (\n\t\t\t\t 'title' => '',\n\t\t\t\t 'text' => '[rev_slider alias=\"one-page-slider\"]',\n\t\t\t\t 'filter' => false,\n\t\t\t\t 'panels_info' => \n\t\t\t\t array (\n\t\t\t\t 'class' => 'WP_Widget_Text',\n\t\t\t\t 'raw' => false,\n\t\t\t\t 'grid' => 0,\n\t\t\t\t 'cell' => 0,\n\t\t\t\t 'id' => 0,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 1 => \n\t\t\t\t array (\n\t\t\t\t 'type' => 'visual',\n\t\t\t\t 'title' => '',\n\t\t\t\t 'text' => '<h2 style=\"text-align: center;\">MY <span style=\"color: #bb9f7c;\">WORK</span></h2>',\n\t\t\t\t 'filter' => '1',\n\t\t\t\t 'panels_info' => \n\t\t\t\t array (\n\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t 'raw' => false,\n\t\t\t\t 'grid' => 1,\n\t\t\t\t 'cell' => 0,\n\t\t\t\t 'id' => 1,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t 'font_color' => '#ffffff',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 2 => \n\t\t\t\t array (\n\t\t\t\t 'title' => '',\n\t\t\t\t 'show_filter' => 'yes',\n\t\t\t\t 'filter_alignment' => 'center',\n\t\t\t\t 'count' => '8',\n\t\t\t\t 'thumb_proportions' => 'square',\n\t\t\t\t 'layout' => 'rows with gutter',\n\t\t\t\t 'columns' => '4',\n\t\t\t\t 'skills' => \n\t\t\t\t array (\n\t\t\t\t 'illustration' => 'illustration',\n\t\t\t\t 'mobile' => 'mobile',\n\t\t\t\t 'motion' => '',\n\t\t\t\t 'photography' => 'photography',\n\t\t\t\t 'web' => 'web',\n\t\t\t\t ),\n\t\t\t\t 'orderby' => 'date',\n\t\t\t\t 'order' => 'DESC',\n\t\t\t\t 'hover_effect' => 'effect-1',\n\t\t\t\t 'hover_color' => '#bb9f7c',\n\t\t\t\t 'hover_text_color' => '',\n\t\t\t\t 'show_skills' => 'no',\n\t\t\t\t 'show_load_more' => 'no',\n\t\t\t\t 'enable_lightbox' => 'yes',\n\t\t\t\t 'panels_info' => \n\t\t\t\t array (\n\t\t\t\t 'class' => 'TTrust_Portfolio',\n\t\t\t\t 'raw' => false,\n\t\t\t\t 'grid' => 1,\n\t\t\t\t 'cell' => 0,\n\t\t\t\t 'id' => 2,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t 'font_color' => '#ffffff',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 3 => \n\t\t\t\t array (\n\t\t\t\t 'type' => 'visual',\n\t\t\t\t 'title' => '',\n\t\t\t\t 'text' => '<h2><span style=\"color: #1f1f1f;\">ABOUT <span style=\"color: #bb9f7c;\">ME</span></span></h2><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc malesuada lectus libero, ac sagittis nisi dapibus ac. Nunc dictum imperdiet lorem. Quisque vehicula nec arcu nec rutrum. Duis sit amet mattis magna. In felis dui, elementum in tortor dictum, eleifend commodo purus. Nulla eget turpis purus. In ultrices est a pellentesque rutrum. Suspendisse egestas pharetra eros a commodo. Aenean ac ante id odio cursus tempor. Vivamus sit amet ante massa.</p>',\n\t\t\t\t 'filter' => '1',\n\t\t\t\t 'panels_info' => \n\t\t\t\t array (\n\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t 'raw' => false,\n\t\t\t\t 'grid' => 2,\n\t\t\t\t 'cell' => 0,\n\t\t\t\t 'id' => 3,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'padding' => '0px',\n\t\t\t\t 'background_display' => 'center',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 4 => \n\t\t\t\t array (\n\t\t\t\t 'networks' => \n\t\t\t\t array (\n\t\t\t\t 0 => \n\t\t\t\t array (\n\t\t\t\t 'name' => 'twitter',\n\t\t\t\t 'url' => 'https://twitter.com/',\n\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t 'button_color' => '#78bdf1',\n\t\t\t\t ),\n\t\t\t\t 1 => \n\t\t\t\t array (\n\t\t\t\t 'name' => 'dribbble',\n\t\t\t\t 'url' => 'https://dribbble.com/',\n\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t 'button_color' => '#f26798',\n\t\t\t\t ),\n\t\t\t\t 2 => \n\t\t\t\t array (\n\t\t\t\t 'name' => 'envelope',\n\t\t\t\t 'url' => 'mailto:[email protected]',\n\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t 'button_color' => '#99c4e6',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 'design' => \n\t\t\t\t array (\n\t\t\t\t 'new_window' => true,\n\t\t\t\t 'theme' => 'wire',\n\t\t\t\t 'hover' => true,\n\t\t\t\t 'icon_size' => '1',\n\t\t\t\t 'rounding' => '0.5',\n\t\t\t\t 'padding' => '1',\n\t\t\t\t 'align' => 'left',\n\t\t\t\t 'margin' => '0.1',\n\t\t\t\t ),\n\t\t\t\t 'panels_info' => \n\t\t\t\t array (\n\t\t\t\t 'class' => 'SiteOrigin_Widget_SocialMediaButtons_Widget',\n\t\t\t\t 'raw' => false,\n\t\t\t\t 'grid' => 2,\n\t\t\t\t 'cell' => 0,\n\t\t\t\t 'id' => 4,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 5 => \n\t\t\t\t array (\n\t\t\t\t 'type' => 'visual',\n\t\t\t\t 'title' => '',\n\t\t\t\t 'text' => '<h2 style=\"text-align: center;\"><span style=\"color: #1f1f1f;\">MY <span style=\"color: #bb9f7c;\">CLIENTS</span></span></h2><p> </p>',\n\t\t\t\t 'filter' => '1',\n\t\t\t\t 'panels_info' => \n\t\t\t\t array (\n\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t 'raw' => false,\n\t\t\t\t 'grid' => 3,\n\t\t\t\t 'cell' => 0,\n\t\t\t\t 'id' => 5,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 6 => \n\t\t\t\t array (\n\t\t\t\t 'title' => '',\n\t\t\t\t 'count' => '3',\n\t\t\t\t 'layout' => 'grid',\n\t\t\t\t 'columns' => '3',\n\t\t\t\t 'alignment' => 'center',\n\t\t\t\t 'order' => 'rand',\n\t\t\t\t 'carousel-nav-color' => '',\n\t\t\t\t 'panels_info' => \n\t\t\t\t array (\n\t\t\t\t 'class' => 'TTrust_Testimonials',\n\t\t\t\t 'grid' => 3,\n\t\t\t\t 'cell' => 0,\n\t\t\t\t 'id' => 6,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'background_image_attachment' => false,\n\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 7 => \n\t\t\t\t array (\n\t\t\t\t 'type' => 'visual',\n\t\t\t\t 'title' => '',\n\t\t\t\t 'text' => '<p><img class=\"aligncenter size-full wp-image-998\" src=\"http://create.themetrust.com/wp-content/uploads/2015/08/company_logos.png\" alt=\"company_logos\" width=\"3000\" height=\"300\" /></p>',\n\t\t\t\t 'filter' => '',\n\t\t\t\t 'panels_info' => \n\t\t\t\t array (\n\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t 'raw' => false,\n\t\t\t\t 'grid' => 4,\n\t\t\t\t 'cell' => 0,\n\t\t\t\t 'id' => 7,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 8 => \n\t\t\t\t array (\n\t\t\t\t 'map_center' => '350 5th Ave, New York, NY 10118',\n\t\t\t\t 'settings' => \n\t\t\t\t array (\n\t\t\t\t 'map_type' => 'interactive',\n\t\t\t\t 'width' => '640',\n\t\t\t\t 'height' => '680',\n\t\t\t\t 'zoom' => 12,\n\t\t\t\t 'scroll_zoom' => true,\n\t\t\t\t 'draggable' => true,\n\t\t\t\t ),\n\t\t\t\t 'markers' => \n\t\t\t\t array (\n\t\t\t\t 'marker_at_center' => true,\n\t\t\t\t 'marker_icon' => 1063,\n\t\t\t\t ),\n\t\t\t\t 'styles' => \n\t\t\t\t array (\n\t\t\t\t 'style_method' => 'raw_json',\n\t\t\t\t 'styled_map_name' => '',\n\t\t\t\t 'raw_json_map_styles' => '[{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"hue\":\"#ededed\"},{\"saturation\":-100},{\"lightness\":36},{\"visibility\":\"on\"}]},{\"featureType\":\"road\",\"elementType\":\"labels\",\"stylers\":[{\"hue\":\"#000000\"},{\"saturation\":-100},{\"lightness\":-100},{\"visibility\":\"off\"}]},{\"featureType\":\"poi\",\"elementType\":\"all\",\"stylers\":[{\"hue\":\"#000000\"},{\"saturation\":-100},{\"lightness\":-100},{\"visibility\":\"off\"}]},{\"featureType\":\"road\",\"elementType\":\"geometry\",\"stylers\":[{\"hue\":\"#000000\"},{\"saturation\":-100},{\"lightness\":-100},{\"visibility\":\"simplified\"}]},{\"featureType\":\"administrative\",\"elementType\":\"labels\",\"stylers\":[{\"hue\":\"#000000\"},{\"saturation\":0},{\"lightness\":-100},{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"elementType\":\"geometry\",\"stylers\":[{\"hue\":\"#000000\"},{\"saturation\":0},{\"lightness\":-100},{\"visibility\":\"on\"}]},{\"featureType\":\"transit\",\"elementType\":\"labels\",\"stylers\":[{\"hue\":\"#000000\"},{\"saturation\":0},{\"lightness\":-100},{\"visibility\":\"off\"}]},{\"featureType\":\"water\",\"elementType\":\"labels\",\"stylers\":[{\"hue\":\"#000000\"},{\"saturation\":-100},{\"lightness\":-100},{\"visibility\":\"off\"}]},{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"hue\":\"#ffffff\"},{\"saturation\":-100},{\"lightness\":100},{\"visibility\":\"on\"}]},{\"featureType\":\"landscape.natural\",\"elementType\":\"all\",\"stylers\":[{\"hue\":\"#e0e0e0\"},{\"saturation\":-100},{\"lightness\":-8},{\"visibility\":\"off\"}]}]',\n\t\t\t\t ),\n\t\t\t\t 'directions' => \n\t\t\t\t array (\n\t\t\t\t 'origin' => '',\n\t\t\t\t 'destination' => '',\n\t\t\t\t 'travel_mode' => 'driving',\n\t\t\t\t ),\n\t\t\t\t 'api_key_section' => \n\t\t\t\t array (\n\t\t\t\t 'api_key' => '',\n\t\t\t\t ),\n\t\t\t\t 'panels_info' => \n\t\t\t\t array (\n\t\t\t\t 'class' => 'SiteOrigin_Widget_GoogleMap_Widget',\n\t\t\t\t 'raw' => false,\n\t\t\t\t 'grid' => 5,\n\t\t\t\t 'cell' => 0,\n\t\t\t\t 'id' => 8,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 9 => \n\t\t\t\t array (\n\t\t\t\t 'type' => 'visual',\n\t\t\t\t 'title' => '',\n\t\t\t\t 'text' => '<h2><span style=\"color: #ffffff;\">CONTACT</span><span style=\"color: #1f1f1f;\"> <span style=\"color: #bb9f7c;\">ME</span></span></h2><p>Interdum et malesuada fames ac ante ipsum primis in faucibus. Vestibulum viverra, eros nec luctus facilisis, nisi nisl tempus purus, vitae congue enim mi pulvinar orci. Quisque diam ex, faucibus sed tortor a, dignissim consequat risus.</p><p>1234 Main St.<br /> New York, NY 10021</p><p>T: 555-456-7892 <em>New York Office<br /> E: [email protected]</em></p>',\n\t\t\t\t 'filter' => '1',\n\t\t\t\t 'panels_info' => \n\t\t\t\t array (\n\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t 'raw' => false,\n\t\t\t\t 'grid' => 5,\n\t\t\t\t 'cell' => 1,\n\t\t\t\t 'id' => 9,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'padding' => '60px',\n\t\t\t\t 'background' => '#282828',\n\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t 'font_color' => '#bababa',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 'grids' => \n\t\t\t\t array (\n\t\t\t\t 0 => \n\t\t\t\t array (\n\t\t\t\t 'cells' => 1,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t\t 'custom_row_id' => 'hello',\n\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 1 => \n\t\t\t\t array (\n\t\t\t\t 'cells' => 1,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t 'background' => '#282828',\n\t\t\t\t 'custom_row_id' => 'my-work',\n\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t 'padding_top' => '70px',\n\t\t\t\t 'padding_bottom' => '70px',\n\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 2 => \n\t\t\t\t array (\n\t\t\t\t 'cells' => 2,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t 'custom_row_id' => 'about-me',\n\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t 'padding_top' => '150px',\n\t\t\t\t 'padding_bottom' => '150px',\n\t\t\t\t 'background_image' => 996,\n\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t 'background_image_style' => 'parallax',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 3 => \n\t\t\t\t array (\n\t\t\t\t 'cells' => 1,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t 'custom_row_id' => 'testimonials',\n\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t 'padding_top' => '60px',\n\t\t\t\t 'padding_bottom' => '50px',\n\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 4 => \n\t\t\t\t array (\n\t\t\t\t 'cells' => 1,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t 'background' => '#bb9f7c',\n\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t 'padding_top' => '40px',\n\t\t\t\t 'padding_bottom' => '10px',\n\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 5 => \n\t\t\t\t array (\n\t\t\t\t 'cells' => 2,\n\t\t\t\t 'style' => \n\t\t\t\t array (\n\t\t\t\t 'gutter' => '0px',\n\t\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t\t 'custom_row_id' => 'contact-me',\n\t\t\t\t 'equal_column_height' => 'yes',\n\t\t\t\t 'padding_top' => '0px',\n\t\t\t\t 'padding_bottom' => '0px',\n\t\t\t\t 'background_image_position' => 'center bottom',\n\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t 'grid_cells' => \n\t\t\t\t array (\n\t\t\t\t 0 => \n\t\t\t\t array (\n\t\t\t\t 'grid' => 0,\n\t\t\t\t 'weight' => 1,\n\t\t\t\t ),\n\t\t\t\t 1 => \n\t\t\t\t array (\n\t\t\t\t 'grid' => 1,\n\t\t\t\t 'weight' => 1,\n\t\t\t\t ),\n\t\t\t\t 2 => \n\t\t\t\t array (\n\t\t\t\t 'grid' => 2,\n\t\t\t\t 'weight' => 0.49622299651568002598622797449934296309947967529296875,\n\t\t\t\t ),\n\t\t\t\t 3 => \n\t\t\t\t array (\n\t\t\t\t 'grid' => 2,\n\t\t\t\t 'weight' => 0.50377700348431997401377202550065703690052032470703125,\n\t\t\t\t ),\n\t\t\t\t 4 => \n\t\t\t\t array (\n\t\t\t\t 'grid' => 3,\n\t\t\t\t 'weight' => 1,\n\t\t\t\t ),\n\t\t\t\t 5 => \n\t\t\t\t array (\n\t\t\t\t 'grid' => 4,\n\t\t\t\t 'weight' => 1,\n\t\t\t\t ),\n\t\t\t\t 6 => \n\t\t\t\t array (\n\t\t\t\t 'grid' => 5,\n\t\t\t\t 'weight' => 0.5,\n\t\t\t\t ),\n\t\t\t\t 7 => \n\t\t\t\t array (\n\t\t\t\t 'grid' => 5,\n\t\t\t\t 'weight' => 0.5,\n\t\t\t\t ),\n\t\t\t\t ),\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$layouts['home-portfolio'] = array(\n\t\t\t\t\t'name' => __('Home: Portfolio', 'create'),\n\t\t\t\t\t'description' => __('Layout for demo Home: Portfolio page.', 'create'),\n\t\t\t 'widgets' => \n\t\t\t\t\t array (\n\t\t\t\t\t 0 => \n\t\t\t\t\t array (\n\t\t\t\t\t 'title' => '',\n\t\t\t\t\t 'text' => '[rev_slider alias=\"home-portfolio\"]',\n\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t array (\n\t\t\t\t\t 'class' => 'WP_Widget_Text',\n\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t 'id' => 0,\n\t\t\t\t\t 'style' => \n\t\t\t\t\t array (\n\t\t\t\t\t 'background_image_attachment' => false,\n\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t ),\n\t\t\t\t\t ),\n\t\t\t\t\t 'filter' => false,\n\t\t\t\t\t ),\n\t\t\t\t\t 1 => \n\t\t\t\t\t array (\n\t\t\t\t\t 'title' => '',\n\t\t\t\t\t 'show_filter' => 'yes',\n\t\t\t\t\t 'filter_alignment' => 'center',\n\t\t\t\t\t 'count' => '9',\n\t\t\t\t\t 'thumb_proportions' => 'square',\n\t\t\t\t\t 'layout' => 'rows with gutter',\n\t\t\t\t\t 'columns' => '3',\n\t\t\t\t\t 'skills' => \n\t\t\t\t\t array (\n\t\t\t\t\t 'illustration' => '',\n\t\t\t\t\t 'mobile' => '',\n\t\t\t\t\t 'motion' => '',\n\t\t\t\t\t 'photography' => '',\n\t\t\t\t\t 'web' => '',\n\t\t\t\t\t ),\n\t\t\t\t\t 'orderby' => 'menu_order',\n\t\t\t\t\t 'order' => 'DESC',\n\t\t\t\t\t 'hover_effect' => 'effect-1',\n\t\t\t\t\t 'hover_color' => '',\n\t\t\t\t\t 'hover_text_color' => '',\n\t\t\t\t\t 'show_skills' => 'yes',\n\t\t\t\t\t 'show_load_more' => 'yes',\n\t\t\t\t\t 'enable_lightbox' => 'no',\n\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t array (\n\t\t\t\t\t 'class' => 'TTrust_Portfolio',\n\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t 'id' => 1,\n\t\t\t\t\t 'style' => \n\t\t\t\t\t array (\n\t\t\t\t\t 'background_display' => 'tile',\n\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 'grids' => \n\t\t\t\t\t array (\n\t\t\t\t\t 0 => \n\t\t\t\t\t array (\n\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t 'style' => \n\t\t\t\t\t array (\n\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t ),\n\t\t\t\t\t ),\n\t\t\t\t\t 1 => \n\t\t\t\t\t array (\n\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t 'style' => \n\t\t\t\t\t array (\n\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t 'padding_top' => '30px',\n\t\t\t\t\t 'padding_bottom' => '40px',\n\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t ),\n\t\t\t\t\t ),\n\t\t\t\t\t ),\n\t\t\t\t\t 'grid_cells' => \n\t\t\t\t\t array (\n\t\t\t\t\t 0 => \n\t\t\t\t\t array (\n\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t ),\n\t\t\t\t\t 1 => \n\t\t\t\t\t array (\n\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t 'weight' => 1,\n\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$layouts['home-shop'] = array(\n\t\t\t\t\t\t'name' => __('Home: Shop', 'create'),\n\t\t\t\t\t\t'description' => __('Layout for demo Home: Shop page.', 'create'),\n\t\t\t\t 'widgets' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t 'text' => '[rev_slider alias=\"shop-slider\"]',\n\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'class' => 'WP_Widget_Text',\n\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t 'id' => 0,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'background_image_attachment' => false,\n\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'filter' => false,\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'type' => 'html',\n\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t 'text' => '<span style=\"font-size: 36px;\"><strong>Watches</strong></span>\n\n\t\t\t\t\t\t<span style=\"color: #cccccc;\">Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet.</span>\n\n\t\t\t\t\t\t<a href=\\'http://create.themetrust.com/product-category/watches/\\' class=\\'tt-button\\' style=\"background: #bb9f7c;\">SHOP WATCHES</a>',\n\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t 'id' => 1,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'padding' => '50px',\n\t\t\t\t\t\t 'background' => '#a0a0a0',\n\t\t\t\t\t\t 'background_image_attachment' => 844,\n\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t 'font_color' => '#ffffff',\n\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 2 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'type' => 'html',\n\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t 'text' => '<span style=\"font-size: 36px;\"><strong>Bags</strong></span>\n\n\t\t\t\t\t\t<span style=\"color: #cccccc;\">Lorem ipsum dolor sit amet. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. </span>\n\n\t\t\t\t\t\t<a href=\\'http://create.themetrust.com/product-category/bags/\\' class=\\'tt-button\\' style=\"background: #bb9f7c;\">SHOP BAGS</a>',\n\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t 'id' => 2,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'padding' => '50px',\n\t\t\t\t\t\t 'background' => '#444444',\n\t\t\t\t\t\t 'background_image_attachment' => 842,\n\t\t\t\t\t\t 'background_display' => 'cover',\n\t\t\t\t\t\t 'font_color' => '#ffffff',\n\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 3 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t 'text' => '<p><span style=\"font-size: 36px;\"><strong>Shoes</strong></span></p><p><span style=\"color: #999999;\">Imperdiet doming id quod mazim placerat facer am liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. </span></p><p><a class=\"tt-button\" style=\"background: #bb9f7c;\" href=\"http://create.themetrust.com/product-category/shoes/\">SHOP SHOES</a></p>',\n\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t 'cell' => 2,\n\t\t\t\t\t\t 'id' => 3,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'padding' => '50px',\n\t\t\t\t\t\t 'background' => '#515151',\n\t\t\t\t\t\t 'background_image_attachment' => 840,\n\t\t\t\t\t\t 'background_display' => 'cover',\n\t\t\t\t\t\t 'font_color' => '#ffffff',\n\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 4 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'headline' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'text' => 'Featured Items from Our Shop',\n\t\t\t\t\t\t 'font' => 'default',\n\t\t\t\t\t\t 'color' => '#000000',\n\t\t\t\t\t\t 'align' => 'center',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'sub_headline' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'text' => 'Lorem ipsum dolor sit amet, consec tetuer adipis elit, aliquam eget nibh etlibura. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.',\n\t\t\t\t\t\t 'font' => 'default',\n\t\t\t\t\t\t 'color' => '#7c7c7c',\n\t\t\t\t\t\t 'align' => 'center',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'divider' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'style' => 'solid',\n\t\t\t\t\t\t 'weight' => 'thin',\n\t\t\t\t\t\t 'color' => '#bb9f7c',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_Headline_Widget',\n\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t 'id' => 4,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'background_display' => 'tile',\n\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 5 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t 'count' => '4',\n\t\t\t\t\t\t 'layout' => 'grid',\n\t\t\t\t\t\t 'columns' => '4',\n\t\t\t\t\t\t 'orderby' => 'date',\n\t\t\t\t\t\t 'order' => 'DESC',\n\t\t\t\t\t\t 'categories' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'bags' => '',\n\t\t\t\t\t\t 'jewelry' => '',\n\t\t\t\t\t\t 'notebooks' => '',\n\t\t\t\t\t\t 'shoes' => '',\n\t\t\t\t\t\t 'watches' => '',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'show_featured' => 'no',\n\t\t\t\t\t\t 'alignment' => 'left',\n\t\t\t\t\t\t 'carousel-nav-color' => '',\n\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'class' => 'TTrust_Products',\n\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t 'grid' => 3,\n\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t 'id' => 5,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'background_display' => 'tile',\n\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 6 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'title' => 'Newsletter',\n\t\t\t\t\t\t 'sub_title' => 'Lorem ipsum dolor sit amet, consec tetuer adipis elit, aliquam eget nibh etlibura.',\n\t\t\t\t\t\t 'design' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'background_color' => '#bb9f7c',\n\t\t\t\t\t\t 'border_color' => '',\n\t\t\t\t\t\t 'button_align' => 'right',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'button' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'text' => 'SIGN UP',\n\t\t\t\t\t\t 'url' => '#',\n\t\t\t\t\t\t 'new_window' => '',\n\t\t\t\t\t\t 'button_icon' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'icon_selected' => 'fontawesome-envelope-o',\n\t\t\t\t\t\t 'icon_color' => '#bb9f7c',\n\t\t\t\t\t\t 'icon' => '',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'design' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'theme' => 'flat',\n\t\t\t\t\t\t 'button_color' => '#ffffff',\n\t\t\t\t\t\t 'text_color' => '#bb9f7c',\n\t\t\t\t\t\t 'hover' => true,\n\t\t\t\t\t\t 'font_size' => '1',\n\t\t\t\t\t\t 'rounding' => '0.25',\n\t\t\t\t\t\t 'padding' => '1',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'attributes' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'id' => '',\n\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t 'onclick' => '',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_Cta_Widget',\n\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t 'id' => 6,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t 'font_color' => '#ffffff',\n\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 ),\n\t\t\t\t\t\t 'grids' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'bottom_margin' => '50px',\n\t\t\t\t\t\t 'gutter' => '30px',\n\t\t\t\t\t\t 'equal_column_height' => 'yes',\n\t\t\t\t\t\t 'padding_top' => '30px',\n\t\t\t\t\t\t 'padding_bottom' => '50px',\n\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'bottom_margin' => '60px',\n\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'bottom_margin' => '50px',\n\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 4 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'bottom_margin' => '80px',\n\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t 'padding_bottom' => '80px',\n\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t 'background_image_style' => 'cover',\n\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 'grid_cells' => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 4 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t 'weight' => 0.25020678246485006379629112416296266019344329833984375,\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 5 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t 'weight' => 0.50020678246484007178906949775409884750843048095703125,\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 6 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t 'weight' => 0.249586435070310030948093071856419555842876434326171875,\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 7 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'grid' => 3,\n\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 8 => \n\t\t\t\t\t\t array (\n\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t 'weight' => 1,\n\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\n\t\t\t\t\t\t$layouts['about-us'] = array(\n\t\t\t\t\t\t\t'name' => __('About Us', 'create'),\n\t\t\t\t\t\t\t'description' => __('Layout for demo About Us page.', 'create'),\n\t\t\t\t\t 'widgets' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t 'text' => '<h2 style=\"text-align: right;\">WE <span style=\"color: #ba9e78;\">CREATE</span> AMAZING THINGS</h2><p style=\"text-align: right;\"><span style=\"font-size: 21px; color: #737373;\">The Create WordPress theme will change the way you build websites.</span></p>',\n\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t 'id' => 0,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t 'font_color' => '#ffffff',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t 'text' => '<h3 style=\"text-align: center;\"><span style=\"color: #242424;\">ABOUT</span></h3>',\n\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t 'id' => 1,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t 'text' => '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec quis molestie leo, sed efficitur dui. Nulla cursus turpis quis mattis rutrum. Suspendisse lobortis pulvinar mauris eget placerat. Suspendisse in dolor vitae risus maximus feugiat quis nec nisi. Phasellus ut auctor ante, scelerisque scelerisque eros. Fusce vitae orci eu nisl pellentesque faucibus lacinia sed erat. Nunc consequat erat sit amet felis gravida venenatis. Duis in neque in mi consequat aliquet in id eros. Aliquam vel lorem ut tellus eleifend luctus.</p>',\n\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t 'id' => 2,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'features' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'container_color' => '#ffffff',\n\t\t\t\t\t\t\t 'icon' => 'fontawesome-desktop',\n\t\t\t\t\t\t\t 'icon_color' => '#a58c6a',\n\t\t\t\t\t\t\t 'icon_image' => 0,\n\t\t\t\t\t\t\t 'title' => 'Web Design',\n\t\t\t\t\t\t\t 'text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec quis molestie leo, sed efficitur dui. Nulla cursus turpis quis mattis rutrum. Suspendisse lobortis pulvinar mauris eget placerat.',\n\t\t\t\t\t\t\t 'more_text' => '',\n\t\t\t\t\t\t\t 'more_url' => '',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'container_color' => '#ffffff',\n\t\t\t\t\t\t\t 'icon' => 'fontawesome-tablet',\n\t\t\t\t\t\t\t 'icon_color' => '#a58c6a',\n\t\t\t\t\t\t\t 'icon_image' => 0,\n\t\t\t\t\t\t\t 'title' => 'Mobile',\n\t\t\t\t\t\t\t 'text' => 'Donec sed dolor maximus nunc sagittis vehicula. Phasellus at ornare arcu, eu elementum risus. Mauris varius semper purus, non eleifend quam convallis ac. Vivamus sodales justo id sapien aliquam tempus. ',\n\t\t\t\t\t\t\t 'more_text' => '',\n\t\t\t\t\t\t\t 'more_url' => '',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'container_color' => '#ffffff',\n\t\t\t\t\t\t\t 'icon' => 'fontawesome-camera',\n\t\t\t\t\t\t\t 'icon_color' => '#a58c6a',\n\t\t\t\t\t\t\t 'icon_image' => 0,\n\t\t\t\t\t\t\t 'title' => 'Photography',\n\t\t\t\t\t\t\t 'text' => 'Nam sit amet faucibus sapien. Vivamus quis mollis orci, eu sollicitudin urna. Donec turpis justo, iaculis sit amet lorem eu, rhoncus cursus ipsum. Ut laoreet accumsan arcu consequat consectetur.',\n\t\t\t\t\t\t\t 'more_text' => '',\n\t\t\t\t\t\t\t 'more_url' => '',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'container_shape' => 'rounded-hex',\n\t\t\t\t\t\t\t 'container_size' => 84,\n\t\t\t\t\t\t\t 'icon_size' => 24,\n\t\t\t\t\t\t\t 'per_row' => 3,\n\t\t\t\t\t\t\t 'responsive' => true,\n\t\t\t\t\t\t\t 'title_link' => false,\n\t\t\t\t\t\t\t 'icon_link' => false,\n\t\t\t\t\t\t\t 'new_window' => false,\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_Features_Widget',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t 'id' => 3,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t 'font_color' => '#ffffff',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 4 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t 'text' => '<h3 style=\"text-align: center;\"><span style=\"color: #242424;\">OUR TEAM</span></h3><p style=\"text-align: center;\">Donec quis molestie leo, sed efficitur dui. Nulla cursus turpis quis mattis rutrum. Suspendisse lobortis pulvinar mauris eget placerat. Suspendisse in dolor vitae risus maximus feugiat quis nec nisi.</p><p style=\"text-align: center;\"> </p>',\n\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 3,\n\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t 'id' => 4,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 5 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'image_fallback' => '',\n\t\t\t\t\t\t\t 'image' => 261,\n\t\t\t\t\t\t\t 'size' => 'full',\n\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t 'alt' => '',\n\t\t\t\t\t\t\t 'url' => '',\n\t\t\t\t\t\t\t 'bound' => true,\n\t\t\t\t\t\t\t 'new_window' => false,\n\t\t\t\t\t\t\t 'full_width' => false,\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_Image_Widget',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t 'id' => 5,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 6 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t 'text' => '<p class=\"member-role\"><span style=\"color: #242424;\"><strong>Frank Thompson</strong></span><br />CEO</p><p class=\"member-role\">Suspendisse lobortis pulvinar mauris eget placerat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec quis molestie leo, sed efficitur dui. Nulla cursus turpis quis mattis rutrum. </p>',\n\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t 'id' => 6,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 7 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'networks' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'twitter',\n\t\t\t\t\t\t\t 'url' => 'https://twitter.com/',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#78bdf1',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'linkedin',\n\t\t\t\t\t\t\t 'url' => 'https://www.linkedin.com/',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#0177b4',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'google-plus',\n\t\t\t\t\t\t\t 'url' => 'https://plus.google.com/',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#dd4b39',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'envelope',\n\t\t\t\t\t\t\t 'url' => 'mailto:',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#99c4e6',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'design' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'new_window' => true,\n\t\t\t\t\t\t\t 'theme' => 'flat',\n\t\t\t\t\t\t\t 'hover' => true,\n\t\t\t\t\t\t\t 'icon_size' => '1',\n\t\t\t\t\t\t\t 'rounding' => '0.25',\n\t\t\t\t\t\t\t 'padding' => '0.5',\n\t\t\t\t\t\t\t 'align' => 'left',\n\t\t\t\t\t\t\t 'margin' => '0.1',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_SocialMediaButtons_Widget',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t 'id' => 7,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'padding' => '0px',\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 8 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'image_fallback' => '',\n\t\t\t\t\t\t\t 'image' => 246,\n\t\t\t\t\t\t\t 'size' => 'full',\n\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t 'alt' => '',\n\t\t\t\t\t\t\t 'url' => '',\n\t\t\t\t\t\t\t 'bound' => true,\n\t\t\t\t\t\t\t 'new_window' => false,\n\t\t\t\t\t\t\t 'full_width' => false,\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_Image_Widget',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t 'id' => 8,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 9 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t 'text' => '<p class=\"member-role\"><span style=\"color: #242424;\"><strong>Abby Smith</strong></span><br />Lead Designer</p><p class=\"member-role\">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec quis molestie leo, sed efficitur dui. Nulla cursus turpis quis mattis rutrum. Suspendisse lobortis pulvinar mauris eget placerat.</p>',\n\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t 'id' => 9,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 10 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'networks' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'twitter',\n\t\t\t\t\t\t\t 'url' => 'https://twitter.com/',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#78bdf1',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'linkedin',\n\t\t\t\t\t\t\t 'url' => 'https://www.linkedin.com/',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#0177b4',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'google-plus',\n\t\t\t\t\t\t\t 'url' => 'https://plus.google.com/',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#dd4b39',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'envelope',\n\t\t\t\t\t\t\t 'url' => 'mailto:',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#99c4e6',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'design' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'new_window' => true,\n\t\t\t\t\t\t\t 'theme' => 'flat',\n\t\t\t\t\t\t\t 'hover' => true,\n\t\t\t\t\t\t\t 'icon_size' => '1',\n\t\t\t\t\t\t\t 'rounding' => '0.25',\n\t\t\t\t\t\t\t 'padding' => '0.5',\n\t\t\t\t\t\t\t 'align' => 'left',\n\t\t\t\t\t\t\t 'margin' => '0.1',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_SocialMediaButtons_Widget',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t 'id' => 10,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'padding' => '0px',\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 11 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'image_fallback' => '',\n\t\t\t\t\t\t\t 'image' => 262,\n\t\t\t\t\t\t\t 'size' => 'full',\n\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t 'alt' => '',\n\t\t\t\t\t\t\t 'url' => '',\n\t\t\t\t\t\t\t 'bound' => true,\n\t\t\t\t\t\t\t 'new_window' => false,\n\t\t\t\t\t\t\t 'full_width' => false,\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_Image_Widget',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'cell' => 2,\n\t\t\t\t\t\t\t 'id' => 11,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 12 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t 'text' => '<p class=\"member-role\"><span style=\"color: #242424;\"><strong>Brian Carson</strong></span><br />Lead Developer</p><p class=\"member-role\">Suspendisse in dolor vitae risus maximus feugiat quis nec nisi. Nulla cursus turpis quis mattis rutrum. Suspendisse lobortis pulvinar mauris eget placerat.</p>',\n\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'cell' => 2,\n\t\t\t\t\t\t\t 'id' => 12,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 13 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'networks' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'twitter',\n\t\t\t\t\t\t\t 'url' => 'https://twitter.com/',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#78bdf1',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'linkedin',\n\t\t\t\t\t\t\t 'url' => 'https://www.linkedin.com/',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#0177b4',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'google-plus',\n\t\t\t\t\t\t\t 'url' => 'https://plus.google.com/',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#dd4b39',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'name' => 'envelope',\n\t\t\t\t\t\t\t 'url' => 'mailto:',\n\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t 'button_color' => '#99c4e6',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'design' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'new_window' => true,\n\t\t\t\t\t\t\t 'theme' => 'flat',\n\t\t\t\t\t\t\t 'hover' => true,\n\t\t\t\t\t\t\t 'icon_size' => '1',\n\t\t\t\t\t\t\t 'rounding' => '0.25',\n\t\t\t\t\t\t\t 'padding' => '0.5',\n\t\t\t\t\t\t\t 'align' => 'left',\n\t\t\t\t\t\t\t 'margin' => '0.1',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_SocialMediaButtons_Widget',\n\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'cell' => 2,\n\t\t\t\t\t\t\t 'id' => 13,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'padding' => '0px',\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 14 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'map_center' => '350 5th Avenue, New York, NY 10118',\n\t\t\t\t\t\t\t 'settings' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'map_type' => 'interactive',\n\t\t\t\t\t\t\t 'width' => '640',\n\t\t\t\t\t\t\t 'height' => '480',\n\t\t\t\t\t\t\t 'zoom' => 12,\n\t\t\t\t\t\t\t 'scroll_zoom' => true,\n\t\t\t\t\t\t\t 'draggable' => true,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'markers' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'marker_at_center' => true,\n\t\t\t\t\t\t\t 'marker_icon' => 1063,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'styles' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'style_method' => 'raw_json',\n\t\t\t\t\t\t\t 'styled_map_name' => '',\n\t\t\t\t\t\t\t 'raw_json_map_styles' => '[{\"featureType\":\"all\",\"elementType\":\"all\",\"stylers\":[{\"hue\":\"#ffaa00\"},{\"saturation\":\"-33\"},{\"lightness\":\"10\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry\",\"stylers\":[{\"visibility\":\"simplified\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"labels.text\",\"stylers\":[{\"visibility\":\"on\"}]}]',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'directions' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'origin' => '',\n\t\t\t\t\t\t\t 'destination' => '',\n\t\t\t\t\t\t\t 'travel_mode' => 'driving',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'api_key_section' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'api_key' => '',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_GoogleMap_Widget',\n\t\t\t\t\t\t\t 'grid' => 5,\n\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t 'id' => 14,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'background_image_attachment' => false,\n\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'grids' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t 'padding_top' => '250px',\n\t\t\t\t\t\t\t 'padding_bottom' => '250px',\n\t\t\t\t\t\t\t 'background_image' => 264,\n\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t 'background_image_style' => 'parallax',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t\t\t 'background' => '#f4f4f4',\n\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t 'padding_top' => '60px',\n\t\t\t\t\t\t\t 'padding_bottom' => '50px',\n\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t 'padding_top' => '70px',\n\t\t\t\t\t\t\t 'padding_bottom' => '50px',\n\t\t\t\t\t\t\t 'background_image' => 302,\n\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t 'background_image_style' => 'parallax',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t 'padding_top' => '50px',\n\t\t\t\t\t\t\t 'padding_bottom' => '0px',\n\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 4 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'bottom_margin' => '50px',\n\t\t\t\t\t\t\t 'gutter' => '30px',\n\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t 'padding_top' => '0px',\n\t\t\t\t\t\t\t 'padding_bottom' => '0px',\n\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 5 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'grid_cells' => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t 'weight' => 0.2002534854245900108882239010199555195868015289306640625,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t 'weight' => 0.5994930291508200337347034292179159820079803466796875,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t 'weight' => 0.2002534854245900108882239010199555195868015289306640625,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 4 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 5 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 3,\n\t\t\t\t\t\t\t 'weight' => 0.2002534854245900108882239010199555195868015289306640625,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 6 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 3,\n\t\t\t\t\t\t\t 'weight' => 0.5994930291508200337347034292179159820079803466796875,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 7 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 3,\n\t\t\t\t\t\t\t 'weight' => 0.2002534854245900108882239010199555195868015289306640625,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 8 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 9 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 10 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 11 => \n\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t 'grid' => 5,\n\t\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$layouts['about-us-blocks'] = array(\n\t\t\t\t\t\t\t\t'name' => __('About Us Blocks', 'create'),\n\t\t\t\t\t\t\t\t'description' => __('Layout for demo About Us: Blocks page.', 'create'),\n\t\t\t\t\t\t 'widgets' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'text' => '<h1 style=\"text-align: center;\">ABOUT US</h1><p style=\"text-align: center;\"><span style=\"font-size: 21px; color: #737373;\">The Create WordPress theme will change the way you build websites.</span></p>',\n\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t 'id' => 0,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t 'font_color' => '#0a0a0a',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'text' => '<h3>HOW WE WORK</h3><p><span style=\"color: #808080;\">Donec sed dolor maximus nunc sagittis vehicula. Phasellus at ornare arcu, eu elementum risus. Mauris varius semper purus, non eleifend quam convallis ac. Vivamus sodales justo id sapien aliquam tempus.</span></p>',\n\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t 'id' => 1,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'padding' => '50px',\n\t\t\t\t\t\t\t\t 'background' => '#262626',\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t 'font_color' => '#ffffff',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'min_height' => '250',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'TTrust_Spacer',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t\t 'id' => 2,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_image_attachment' => 343,\n\t\t\t\t\t\t\t\t 'background_display' => 'cover',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'text' => '<h3>OUR PROCESS</h3><p><span style=\"color: #808080;\">Vivamus sodales justo id sapien aliquam tempus. Donec sed dolor maximus nunc sagittis vehicula. Phasellus at ornare arcu, eu elementum risus. Mauris varius semper purus, non eleifend quam convallis ac. </span></p>',\n\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t 'cell' => 2,\n\t\t\t\t\t\t\t\t 'id' => 3,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'padding' => '50px',\n\t\t\t\t\t\t\t\t 'background' => '#262626',\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t 'font_color' => '#ffffff',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 4 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'min_height' => '250',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'TTrust_Spacer',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t 'id' => 4,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_image_attachment' => 351,\n\t\t\t\t\t\t\t\t 'background_display' => 'cover',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 5 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'text' => '<h3>WHAT WE DO</h3><p><span style=\"color: #e5b89c;\">Donec sed dolor maximus nunc sagittis vehicula. Phasellus at ornare arcu, eu elementum risus. Mauris varius semper purus, non eleifend quam convallis ac. Vivamus sodales justo id sapien aliquam tempus.</span></p>',\n\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t\t 'id' => 5,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'padding' => '50px',\n\t\t\t\t\t\t\t\t 'background' => '#e56934',\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t 'font_color' => '#ffffff',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 6 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'min_height' => '250',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'TTrust_Spacer',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t\t\t 'cell' => 2,\n\t\t\t\t\t\t\t\t 'id' => 6,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_image_attachment' => 359,\n\t\t\t\t\t\t\t\t 'background_display' => 'cover',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 7 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'text' => '<h3 style=\"text-align: center;\"><span style=\"color: #242424;\">OUR SERVICES</span></h3><p style=\"text-align: center;\">Nulla cursus turpis quis mattis rutrum. Suspendisse lobortis pulvinar. </p>',\n\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 3,\n\t\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t\t 'id' => 7,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 8 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'features' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'container_color' => false,\n\t\t\t\t\t\t\t\t 'icon' => 'fontawesome-desktop',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ea6035',\n\t\t\t\t\t\t\t\t 'icon_image' => 0,\n\t\t\t\t\t\t\t\t 'title' => 'Web Design',\n\t\t\t\t\t\t\t\t 'text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec quis molestie leo, sed efficitur dui. Nulla cursus turpis quis mattis rutrum. Suspendisse lobortis pulvinar mauris eget placerat.',\n\t\t\t\t\t\t\t\t 'more_text' => '',\n\t\t\t\t\t\t\t\t 'more_url' => '',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'container_color' => false,\n\t\t\t\t\t\t\t\t 'icon' => 'fontawesome-tablet',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ea6035',\n\t\t\t\t\t\t\t\t 'icon_image' => 0,\n\t\t\t\t\t\t\t\t 'title' => 'Mobile',\n\t\t\t\t\t\t\t\t 'text' => 'Donec sed dolor maximus nunc sagittis vehicula. Phasellus at ornare arcu, eu elementum risus. Mauris varius semper purus, non eleifend quam convallis ac. Vivamus sodales justo id sapien aliquam tempus. ',\n\t\t\t\t\t\t\t\t 'more_text' => '',\n\t\t\t\t\t\t\t\t 'more_url' => '',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'container_color' => false,\n\t\t\t\t\t\t\t\t 'icon' => 'fontawesome-camera',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ea6035',\n\t\t\t\t\t\t\t\t 'icon_image' => 0,\n\t\t\t\t\t\t\t\t 'title' => 'Photography',\n\t\t\t\t\t\t\t\t 'text' => 'Nam sit amet faucibus sapien. Vivamus quis mollis orci, eu sollicitudin urna. Donec turpis justo, iaculis sit amet lorem eu, rhoncus cursus ipsum. Ut laoreet accumsan arcu consequat consectetur.',\n\t\t\t\t\t\t\t\t 'more_text' => '',\n\t\t\t\t\t\t\t\t 'more_url' => '',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 'container_shape' => 'round',\n\t\t\t\t\t\t\t\t 'container_size' => 30,\n\t\t\t\t\t\t\t\t 'icon_size' => 30,\n\t\t\t\t\t\t\t\t 'per_row' => 3,\n\t\t\t\t\t\t\t\t 'responsive' => true,\n\t\t\t\t\t\t\t\t 'title_link' => false,\n\t\t\t\t\t\t\t\t 'icon_link' => false,\n\t\t\t\t\t\t\t\t 'new_window' => false,\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_Features_Widget',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t 'id' => 8,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'padding' => '0px',\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t 'font_color' => '#242424',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 9 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'text' => '<h3 style=\"text-align: center;\"><span style=\"color: #242424;\">OUR TEAM</span></h3><p style=\"text-align: center;\">Donec quis molestie leo, sed efficitur dui. Nulla cursus turpis quis mattis rutrum. Suspendisse lobortis pulvinar mauris eget placerat. Suspendisse in dolor vitae risus maximus feugiat quis nec nisi.</p><p style=\"text-align: center;\"> </p>',\n\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 5,\n\t\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t\t 'id' => 9,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 10 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'image_fallback' => '',\n\t\t\t\t\t\t\t\t 'image' => 261,\n\t\t\t\t\t\t\t\t 'size' => 'full',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'alt' => '',\n\t\t\t\t\t\t\t\t 'url' => '',\n\t\t\t\t\t\t\t\t 'bound' => true,\n\t\t\t\t\t\t\t\t 'new_window' => false,\n\t\t\t\t\t\t\t\t 'full_width' => false,\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_Image_Widget',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t 'id' => 10,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 11 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'text' => '<p class=\"member-role\"><span style=\"color: #242424;\"><strong>Frank Thompson</strong></span><br />CEO</p><p class=\"member-role\">Suspendisse lobortis pulvinar mauris eget placerat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec quis molestie leo, sed efficitur dui. Nulla cursus turpis quis mattis rutrum. </p>',\n\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t 'id' => 11,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 12 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'networks' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'twitter',\n\t\t\t\t\t\t\t\t 'url' => 'https://twitter.com/',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'linkedin',\n\t\t\t\t\t\t\t\t 'url' => 'https://www.linkedin.com/',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'google-plus',\n\t\t\t\t\t\t\t\t 'url' => 'https://plus.google.com/',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'envelope',\n\t\t\t\t\t\t\t\t 'url' => 'mailto:',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 'design' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'new_window' => true,\n\t\t\t\t\t\t\t\t 'theme' => 'flat',\n\t\t\t\t\t\t\t\t 'hover' => true,\n\t\t\t\t\t\t\t\t 'icon_size' => '1',\n\t\t\t\t\t\t\t\t 'rounding' => '0.25',\n\t\t\t\t\t\t\t\t 'padding' => '0.5',\n\t\t\t\t\t\t\t\t 'align' => 'left',\n\t\t\t\t\t\t\t\t 'margin' => '0.1',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_SocialMediaButtons_Widget',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t 'id' => 12,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'padding' => '0px',\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 13 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'image_fallback' => '',\n\t\t\t\t\t\t\t\t 'image' => 246,\n\t\t\t\t\t\t\t\t 'size' => 'full',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'alt' => '',\n\t\t\t\t\t\t\t\t 'url' => '',\n\t\t\t\t\t\t\t\t 'bound' => true,\n\t\t\t\t\t\t\t\t 'new_window' => false,\n\t\t\t\t\t\t\t\t 'full_width' => false,\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_Image_Widget',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t\t 'id' => 13,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 14 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'text' => '<p class=\"member-role\"><span style=\"color: #242424;\"><strong>Abby Smith</strong></span><br />Lead Designer</p><p class=\"member-role\">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec quis molestie leo, sed efficitur dui. Nulla cursus turpis quis mattis rutrum. Suspendisse lobortis pulvinar mauris eget placerat.</p>',\n\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t\t 'id' => 14,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 15 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'networks' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'twitter',\n\t\t\t\t\t\t\t\t 'url' => 'https://twitter.com/',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'linkedin',\n\t\t\t\t\t\t\t\t 'url' => 'https://www.linkedin.com/',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'google-plus',\n\t\t\t\t\t\t\t\t 'url' => 'https://plus.google.com/',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'envelope',\n\t\t\t\t\t\t\t\t 'url' => 'mailto:',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 'design' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'new_window' => true,\n\t\t\t\t\t\t\t\t 'theme' => 'flat',\n\t\t\t\t\t\t\t\t 'hover' => true,\n\t\t\t\t\t\t\t\t 'icon_size' => '1',\n\t\t\t\t\t\t\t\t 'rounding' => '0.25',\n\t\t\t\t\t\t\t\t 'padding' => '0.5',\n\t\t\t\t\t\t\t\t 'align' => 'left',\n\t\t\t\t\t\t\t\t 'margin' => '0.1',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_SocialMediaButtons_Widget',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t\t 'id' => 15,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'padding' => '0px',\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 16 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'image_fallback' => '',\n\t\t\t\t\t\t\t\t 'image' => 262,\n\t\t\t\t\t\t\t\t 'size' => 'full',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'alt' => '',\n\t\t\t\t\t\t\t\t 'url' => '',\n\t\t\t\t\t\t\t\t 'bound' => true,\n\t\t\t\t\t\t\t\t 'new_window' => false,\n\t\t\t\t\t\t\t\t 'full_width' => false,\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_Image_Widget',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'cell' => 2,\n\t\t\t\t\t\t\t\t 'id' => 16,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 17 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t 'text' => '<p class=\"member-role\"><span style=\"color: #242424;\"><strong>Brian Carson</strong></span><br />Lead Developer</p><p class=\"member-role\">Suspendisse in dolor vitae risus maximus feugiat quis nec nisi. Nulla cursus turpis quis mattis rutrum. Suspendisse lobortis pulvinar mauris eget placerat.</p>',\n\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'cell' => 2,\n\t\t\t\t\t\t\t\t 'id' => 17,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 18 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'networks' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'twitter',\n\t\t\t\t\t\t\t\t 'url' => 'https://twitter.com/',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'linkedin',\n\t\t\t\t\t\t\t\t 'url' => 'https://www.linkedin.com/',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'google-plus',\n\t\t\t\t\t\t\t\t 'url' => 'https://plus.google.com/',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'name' => 'envelope',\n\t\t\t\t\t\t\t\t 'url' => 'mailto:',\n\t\t\t\t\t\t\t\t 'icon_color' => '#ffffff',\n\t\t\t\t\t\t\t\t 'button_color' => '#cccccc',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 'design' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'new_window' => true,\n\t\t\t\t\t\t\t\t 'theme' => 'flat',\n\t\t\t\t\t\t\t\t 'hover' => true,\n\t\t\t\t\t\t\t\t 'icon_size' => '1',\n\t\t\t\t\t\t\t\t 'rounding' => '0.25',\n\t\t\t\t\t\t\t\t 'padding' => '0.5',\n\t\t\t\t\t\t\t\t 'align' => 'left',\n\t\t\t\t\t\t\t\t 'margin' => '0.1',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_SocialMediaButtons_Widget',\n\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'cell' => 2,\n\t\t\t\t\t\t\t\t 'id' => 18,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'padding' => '0px',\n\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 'grids' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t 'padding_top' => '180px',\n\t\t\t\t\t\t\t\t 'padding_bottom' => '180px',\n\t\t\t\t\t\t\t\t 'background_image' => 340,\n\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t\t 'gutter' => '0px',\n\t\t\t\t\t\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t\t\t\t\t\t 'equal_column_height' => 'yes',\n\t\t\t\t\t\t\t\t 'padding_top' => '0px',\n\t\t\t\t\t\t\t\t 'padding_bottom' => '0px',\n\t\t\t\t\t\t\t\t 'padding_left' => '0px',\n\t\t\t\t\t\t\t\t 'padding_right' => '0px',\n\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t\t 'gutter' => '0px',\n\t\t\t\t\t\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t\t\t\t\t\t 'equal_column_height' => 'yes',\n\t\t\t\t\t\t\t\t 'padding_top' => '0px',\n\t\t\t\t\t\t\t\t 'padding_bottom' => '0px',\n\t\t\t\t\t\t\t\t 'padding_left' => '0px',\n\t\t\t\t\t\t\t\t 'padding_right' => '0px',\n\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t\t 'gutter' => '0px',\n\t\t\t\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t 'padding_top' => '50px',\n\t\t\t\t\t\t\t\t 'padding_bottom' => '0px',\n\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 4 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t\t 'gutter' => '0px',\n\t\t\t\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t 'padding_top' => '50px',\n\t\t\t\t\t\t\t\t 'padding_bottom' => '50px',\n\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t 'background_image_style' => 'parallax',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 5 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t\t\t\t 'background' => '#f2f2f2',\n\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t 'padding_top' => '50px',\n\t\t\t\t\t\t\t\t 'padding_bottom' => '0px',\n\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 6 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'bottom_margin' => '50px',\n\t\t\t\t\t\t\t\t 'gutter' => '30px',\n\t\t\t\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t\t\t\t 'background' => '#f2f2f2',\n\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t 'padding_top' => '0px',\n\t\t\t\t\t\t\t\t 'padding_bottom' => '50px',\n\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 'grid_cells' => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 4 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 5 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 6 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 2,\n\t\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 7 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 3,\n\t\t\t\t\t\t\t\t 'weight' => 0.2002534854245900108882239010199555195868015289306640625,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 8 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 3,\n\t\t\t\t\t\t\t\t 'weight' => 0.5994930291508200337347034292179159820079803466796875,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 9 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 3,\n\t\t\t\t\t\t\t\t 'weight' => 0.2002534854245900108882239010199555195868015289306640625,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 10 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 4,\n\t\t\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 11 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 5,\n\t\t\t\t\t\t\t\t 'weight' => 0.2002534854245900108882239010199555195868015289306640625,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 12 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 5,\n\t\t\t\t\t\t\t\t 'weight' => 0.5994930291508200337347034292179159820079803466796875,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 13 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 5,\n\t\t\t\t\t\t\t\t 'weight' => 0.2002534854245900108882239010199555195868015289306640625,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 14 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 15 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t 16 => \n\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t 'grid' => 6,\n\t\t\t\t\t\t\t\t 'weight' => 0.333333333333333314829616256247390992939472198486328125,\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$layouts['contact-us'] = array(\n\t\t\t\t\t\t\t\t\t'name' => __('Contact Us', 'create'),\n\t\t\t\t\t\t\t\t\t'description' => __('Layout for demo Contact Us page.', 'create'),\n\t\t\t\t\t\t\t 'widgets' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'map_center' => '350 5th Ave, New York, NY 10118',\n\t\t\t\t\t\t\t\t\t 'settings' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'map_type' => 'interactive',\n\t\t\t\t\t\t\t\t\t 'width' => '640',\n\t\t\t\t\t\t\t\t\t 'height' => '480',\n\t\t\t\t\t\t\t\t\t 'zoom' => 12,\n\t\t\t\t\t\t\t\t\t 'scroll_zoom' => true,\n\t\t\t\t\t\t\t\t\t 'draggable' => true,\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t 'markers' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'marker_at_center' => true,\n\t\t\t\t\t\t\t\t\t 'marker_icon' => 1065,\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t 'styles' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'style_method' => 'raw_json',\n\t\t\t\t\t\t\t\t\t 'styled_map_name' => '',\n\t\t\t\t\t\t\t\t\t 'raw_json_map_styles' => '[{\"featureType\":\"all\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"saturation\":36},{\"color\":\"#000000\"},{\"lightness\":40}]},{\"featureType\":\"all\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#000000\"},{\"lightness\":16}]},{\"featureType\":\"all\",\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":20}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":17},{\"weight\":1.2}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":20}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":21}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":17}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":29},{\"weight\":0.2}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":18}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":16}]},{\"featureType\":\"transit\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":19}]},{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":17}]}]',\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t 'directions' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'origin' => '',\n\t\t\t\t\t\t\t\t\t 'destination' => '',\n\t\t\t\t\t\t\t\t\t 'travel_mode' => 'driving',\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t 'api_key_section' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'api_key' => '',\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_GoogleMap_Widget',\n\t\t\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t\t 'id' => 0,\n\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'background_image_attachment' => false,\n\t\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\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\t ),\n\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t\t 'text' => '<h3><span style=\"color: #242424;\">Contact Us</span></h3><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus posuere interdum diam eget semper. Pellentesque purus turpis, vehicula et posuere ultrices, dictum vitae turpis. Cras porta enim justo, a tempus arcu ullamcorper in.</p><p>[contact-form-7 id=\"732\" title=\"Contact form 1\"]</p>',\n\t\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t\t 'id' => 1,\n\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\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\t ),\n\t\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t\t 'text' => '<h4><span style=\"color: #242424;\">Address</span></h4><p>1234 Main St.<br />New York, NY 10021</p><h4><span style=\"color: #242424;\">Phone</span></h4><p>555-456-7892 <em>New York Office<br /></em>555-376-4532 Los Angeles<em> Office</em></p><h4><span style=\"color: #242424;\">Email</span></h4><p>[email protected]</p>',\n\t\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t\t\t 'id' => 2,\n\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'padding' => '50px',\n\t\t\t\t\t\t\t\t\t 'background' => '#f7f7f7',\n\t\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\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\t ),\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t 'grids' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'bottom_margin' => '60px',\n\t\t\t\t\t\t\t\t\t 'row_stretch' => 'full-stretched',\n\t\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\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\t 1 => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'cells' => 2,\n\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'bottom_margin' => '60px',\n\t\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t\t 'padding_bottom' => '60px',\n\t\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\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\t ),\n\t\t\t\t\t\t\t\t\t 'grid_cells' => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t\t 'weight' => 0.63971539456661996592146124385180883109569549560546875,\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t\t 'weight' => 0.360284605433379978567387524890364147722721099853515625,\n\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\t);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$layouts['pricing'] = array(\n\t\t\t\t\t\t\t\t\t\t'name' => __('Pricing', 'create'),\n\t\t\t\t\t\t\t\t\t\t'description' => __('Layout for demo Pricing page.', 'create'),\n\t\t\t\t\t\t\t\t 'widgets' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'type' => 'visual',\n\t\t\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t\t\t 'text' => '<h2 style=\"text-align: center;\"><span style=\"color: #333333;\">We Give You the <span style=\"color: #bb9f7c;\">Best</span> Value</span></h2><p style=\"text-align: center;\"><span style=\"font-size: 21px;\">This is an example pricing page. It\\'s super easy to create beautiful pricing tables. You have options to set colors, features, icons and more.</span></p>',\n\t\t\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t\t\t\t 'cell' => 1,\n\t\t\t\t\t\t\t\t\t\t 'id' => 0,\n\t\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'title' => false,\n\t\t\t\t\t\t\t\t\t\t 'columns' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'featured' => '',\n\t\t\t\t\t\t\t\t\t\t 'title' => 'Silver',\n\t\t\t\t\t\t\t\t\t\t 'subtitle' => 'Budget Plan',\n\t\t\t\t\t\t\t\t\t\t 'image' => '',\n\t\t\t\t\t\t\t\t\t\t 'price' => '$59',\n\t\t\t\t\t\t\t\t\t\t 'per' => 'per month',\n\t\t\t\t\t\t\t\t\t\t 'button' => 'BUY NOW',\n\t\t\t\t\t\t\t\t\t\t 'url' => '#',\n\t\t\t\t\t\t\t\t\t\t 'features' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '1 GB Storage',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-database',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '2 Domain Names',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-globe',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '3 FTP Users',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-user',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '100 GB Bandwidth',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-exchange',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'featured' => 'on',\n\t\t\t\t\t\t\t\t\t\t 'title' => 'Gold',\n\t\t\t\t\t\t\t\t\t\t 'subtitle' => 'Best Value',\n\t\t\t\t\t\t\t\t\t\t 'image' => '',\n\t\t\t\t\t\t\t\t\t\t 'price' => '$99',\n\t\t\t\t\t\t\t\t\t\t 'per' => 'per month',\n\t\t\t\t\t\t\t\t\t\t 'button' => 'BUY NOW',\n\t\t\t\t\t\t\t\t\t\t 'url' => '#',\n\t\t\t\t\t\t\t\t\t\t 'features' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '3 GB Storage',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-database',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '5 Domain Names',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-globe',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '5 FTP Users',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-user',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '1000 GB Bandwidth',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-exchange',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'featured' => '',\n\t\t\t\t\t\t\t\t\t\t 'title' => 'Platinum',\n\t\t\t\t\t\t\t\t\t\t 'subtitle' => 'Business & Enterpise',\n\t\t\t\t\t\t\t\t\t\t 'image' => '',\n\t\t\t\t\t\t\t\t\t\t 'price' => '$129',\n\t\t\t\t\t\t\t\t\t\t 'per' => 'per month',\n\t\t\t\t\t\t\t\t\t\t 'button' => 'BUY NOW',\n\t\t\t\t\t\t\t\t\t\t 'url' => '#',\n\t\t\t\t\t\t\t\t\t\t 'features' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '10 GB Storage',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-database',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '10 Domain Names',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-globe',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '10 FTP Users',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-user',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'text' => '50000 GB Bandwidth',\n\t\t\t\t\t\t\t\t\t\t 'hover' => '',\n\t\t\t\t\t\t\t\t\t\t 'icon_new' => 'fontawesome-exchange',\n\t\t\t\t\t\t\t\t\t\t 'icon_color' => '',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\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 'theme' => 'flat',\n\t\t\t\t\t\t\t\t\t\t 'header_color' => '#5e5e5e',\n\t\t\t\t\t\t\t\t\t\t 'featured_header_color' => '#bb9f7c',\n\t\t\t\t\t\t\t\t\t\t 'button_color' => '#bb9f7c',\n\t\t\t\t\t\t\t\t\t\t 'featured_button_color' => '#bb9f7c',\n\t\t\t\t\t\t\t\t\t\t 'button_new_window' => false,\n\t\t\t\t\t\t\t\t\t\t 'panels_info' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'class' => 'SiteOrigin_Widget_PriceTable_Widget',\n\t\t\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t\t\t 'id' => 1,\n\t\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\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 'grids' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'cells' => 3,\n\t\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t\t\t 'padding_top' => '70px',\n\t\t\t\t\t\t\t\t\t\t 'padding_bottom' => '0px',\n\t\t\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'cells' => 1,\n\t\t\t\t\t\t\t\t\t\t 'style' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t\t\t 'padding_top' => '20px',\n\t\t\t\t\t\t\t\t\t\t 'padding_bottom' => '60px',\n\t\t\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 'grid_cells' => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 0 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t\t\t\t 'weight' => 0.14912461852642000526003585036960430443286895751953125,\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 1 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t\t\t\t 'weight' => 0.69952473554990002302389484611921943724155426025390625,\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 2 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t\t\t\t 'weight' => 0.1513506459236799994716449191400897689163684844970703125,\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t 3 => \n\t\t\t\t\t\t\t\t\t\t array (\n\t\t\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\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$layouts['testimonials'] = array(\n\t\t\t\t\t\t\t\t\t\t\t'name' => __('Testimonials', 'create'),\n\t\t\t\t\t\t\t\t\t\t\t'description' => __('Layout for demo Testimonials page.', 'create'),\n\t\t\t\t\t\t\t\t\t 'widgets' => \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 0 => \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 'type' => 'visual',\n\t\t\t\t\t\t\t\t\t\t\t 'title' => '',\n\t\t\t\t\t\t\t\t\t\t\t 'text' => '<h2 style=\"text-align: center;\">TESTIMONIALS</h2><p style=\"text-align: center;\"><span style=\"color: #82acb8;\"><span style=\"font-size: 21px; line-height: 31.5px;\">Read what our customers have to say about us.</span></span></p>',\n\t\t\t\t\t\t\t\t\t\t\t 'filter' => '1',\n\t\t\t\t\t\t\t\t\t\t\t 'panels_info' => \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 'class' => 'WP_Widget_Black_Studio_TinyMCE',\n\t\t\t\t\t\t\t\t\t\t\t 'grid' => 0,\n\t\t\t\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t\t\t\t 'id' => 0,\n\t\t\t\t\t\t\t\t\t\t\t 'style' => \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 'background_image_attachment' => false,\n\t\t\t\t\t\t\t\t\t\t\t 'background_display' => 'tile',\n\t\t\t\t\t\t\t\t\t\t\t 'font_color' => '#ffffff',\n\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\t ),\n\t\t\t\t\t\t\t\t\t\t\t 1 => \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 'title' => '',\n\t\t\t\t\t\t\t\t\t\t\t 'count' => '9',\n\t\t\t\t\t\t\t\t\t\t\t 'layout' => 'grid',\n\t\t\t\t\t\t\t\t\t\t\t 'columns' => '3',\n\t\t\t\t\t\t\t\t\t\t\t 'alignment' => 'center',\n\t\t\t\t\t\t\t\t\t\t\t 'order' => 'rand',\n\t\t\t\t\t\t\t\t\t\t\t 'carousel-nav-color' => '',\n\t\t\t\t\t\t\t\t\t\t\t 'panels_info' => \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 'class' => 'TTrust_Testimonials',\n\t\t\t\t\t\t\t\t\t\t\t 'raw' => false,\n\t\t\t\t\t\t\t\t\t\t\t 'grid' => 1,\n\t\t\t\t\t\t\t\t\t\t\t 'cell' => 0,\n\t\t\t\t\t\t\t\t\t\t\t 'id' => 1,\n\t\t\t\t\t\t\t\t\t\t\t 'style' => \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 'background_display' => 'tile',\n\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\t ),\n\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t 'grids' => \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 0 => \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 'cells' => 1,\n\t\t\t\t\t\t\t\t\t\t\t 'style' => \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 'bottom_margin' => '0px',\n\t\t\t\t\t\t\t\t\t\t\t 'row_stretch' => 'full',\n\t\t\t\t\t\t\t\t\t\t\t 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t\t\t\t 'padding_top' => '250px',\n\t\t\t\t\t\t\t\t\t\t\t 'padding_bottom' => '250px',\n\t\t\t\t\t\t\t\t\t\t\t 'background_image' => 1098,\n\t\t\t\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t\t\t\t 'background_image_style' => 'parallax',\n\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\t 1 => \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 'cells' => 1,\n\t\t\t\t\t\t\t\t\t\t\t 'style' => \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 'equal_column_height' => 'no',\n\t\t\t\t\t\t\t\t\t\t\t 'padding_top' => '60px',\n\t\t\t\t\t\t\t\t\t\t\t 'padding_bottom' => '60px',\n\t\t\t\t\t\t\t\t\t\t\t 'background_image_position' => 'left top',\n\t\t\t\t\t\t\t\t\t\t\t 'background_image_style' => 'cover',\n\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\t ),\n\t\t\t\t\t\t\t\t\t\t\t 'grid_cells' => \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 0 => \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 'grid' => 0,\n\t\t\t\t\t\t\t\t\t\t\t 'weight' => 1,\n\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t 1 => \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 'grid' => 1,\n\t\t\t\t\t\t\t\t\t\t\t 'weight' => 1,\n\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\t);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\n return $layouts;\n\n}",
"function fa_theme_details( $defaults ){\n\t\n\t$description = \"Full background image theme, suitable for video and image slider. Comes with various layour variations that allow different displays of the same theme. Video enabled and responsive.\";\n\t\n\t$defaults = array(\n\t\t'author' \t\t=> 'CodeFlavors',\n\t\t'author_uri' \t=> 'http://www.codeflavors.com',\n\t\t'copyright' \t=> 'author',\n\t\t'compatibility' => '3.0',\n\t\t'version'\t\t=> '1.0',\n\t\t'name'\t\t\t=> 'Cristal',\n\t\t'fields'\t\t=> array(\n\t\t\t'content-author-show'\t=> false,\n\t\t\t'content-author-link'\t=> false,\n\t\t\t'js-position-in' \t=> false,\n\t\t\t'js-position-out'\t=> false,\n\t\t\t'js-distance-in' \t=> false,\n\t\t\t'js-distance-out'\t=> false,\n\t\t\t'layout-show-title'\t=> false\n\t\t),\n\t\t// the main slider can have different extra CSS classes that can slide the layout in a different way\n\t\t// all the variations are specified here as css_class => message\n\t\t'classes' => array(\n\t\t\t'content-top background' \t\t=> __('Content displayed top with background', 'fapro'),\n\t\t\t'content-bottom background' \t=> __('Content displayed bottom with background', 'fapro'),\n\t\t\t'content-left background'\t\t=> __('Content on the left side with background', 'fapro'),\n\t\t\t't-up-c-down background'\t\t=> __('Title up right, content bottom', 'fapro'),\t\t\t\n\t\t\t'background'\t\t\t\t\t=> __('Content centered, full height with background', 'fapro'),\n\t\t),\n\t\t'colors' => array(\n\t\t\t'dark'\n\t\t),\n\t\t'stylesheets' => array(\n\t\t\t'font-awesome' => true,\n\t\t\t'jquery-ui-dialog' => true\n\t\t),\n\t\t'scripts' => array(\n\t\t\t'jquery-ui-dialog' => true\n\t\t),\n\t\t'message' => 'Video enabled and responsive.',\n\t\t'description' => $description\n\t);\n\n\treturn $defaults;\t\n}",
"function sporadic_init(&$App) {\n\n App::$theme_info['extends'] = 'redbasic';\n\n\n}",
"public function theme_registration_vars() {\n\t\t?>\n <script id=\"kalium-theme-register-form-data\" type=\"text/template\"><?php echo wp_json_encode( [\n\t\t\t\t// Request product registration\n\t\t\t\t'action' => 'register-theme',\n\n\t\t\t\t// This theme\n\t\t\t\t'theme_id' => 'kalium',\n\n\t\t\t\t// Laborator API site url to go for activation\n\t\t\t\t'api' => $this->api_server,\n\n\t\t\t\t// Theme version\n\t\t\t\t'version' => kalium()->get_version(),\n\n\t\t\t\t// URL for the site to create license\n\t\t\t\t'url' => $this->convert_idn_to_ascii( home_url() ),\n\n\t\t\t\t// Laborator API will send back to this URL to verify license\n\t\t\t\t'ref_url' => admin_url( sprintf( 'admin.php?page=%s&tab=%s', $this->admin_page, kalium()->request->query( 'tab' ) ) ),\n\t\t\t] ); ?></script>\n\t\t<?php\n\t}",
"public function SA_theme_setting()\n {\n }",
"public function run()\n {\n $technology = Theme::create([\n 'name' => 'Technology'\n ]);\n $education = Theme::create([\n 'name' => 'Education'\n ]);\n }",
"function et_setup_theme() {\n\tshow_admin_bar( false );\n\n\t/**\n\t * Setup text domain\n\t */\n\tload_theme_textdomain( 'edge-template' );\n\n\t/**\n\t * Enqueue assets\n\t */\n\tadd_action( 'wp_enqueue_scripts', 'et_enqueue_styles' );\n\tadd_action( 'wp_head', 'et_enqueue_admin_bar_styles' );\n\n\tadd_action( 'wp_enqueue_scripts', 'et_enqueue_scripts' );\n\n\tif ( et_theme_requires_google_map() && et_page_has_google_map() ) {\n\t\tadd_action( 'wp_enqueue_scripts', 'et_enqueue_google_map_library' );\n\t}\n\n\t/**\n\t * Add custom image sizes\n\t */\n\tforeach ( et_get_theme_image_sizes() as $crop_name => $crop_values) {\n\t\tadd_image_size( $crop_name, $crop_values['width'], $crop_values['height'], $crop_values['hard_crop'] );\n\t}\n\n}",
"public function provideThemes() : Generator {\n\t\tforeach ( ThemeRegistry::THEMES as $theme => $styles ) {\n\t\t\tyield $theme => [ $theme, $styles ];\n\t\t}\n\n\t\tyield 'Not a theme' => [ 'Not a theme', [] ];\n\t}",
"public function generate(Request $request) {\n // 1. Setup elements needed.\n $files = []; // Files that will be created for this theme.\n $functions = []; // Theme functions to be included.\n $plugin_definitions = $this->type->getDefinitions();\n $original_theme = $request->request->get('theme');\n $new_theme = $request->request->get('new_theme');\n $uri = drupal_get_path('theme', $original_theme) . \"/{$original_theme}.info.yml\";\n\n // 2. Load our templates\n $query = \\Drupal::entityQuery('template');\n $entity_ids = $query->execute();\n $templates = \\Drupal::entityTypeManager()->getStorage('template')->loadMultiple($entity_ids);\n\n // Next sort by weight.\n usort($plugin_definitions, function($a, $b) {\n return $a['weight'] < $b['weight'];\n });\n\n $data = [];\n\n foreach($plugin_definitions as $id => $definition) {\n $plugin = $this->manager->createInstance($id, [ ]);\n $data[] = $plugin->generate($templates);\n }\n\n // 3. Generate the theme, for now just download - zip.\n foreach($data as $row) {\n // 3. a. create the files.\n\n\n }\n\n\n $theme_info = \\Symfony\\Component\\Yaml\\Yaml::parse(file_get_contents($uri));\n $libraries_info = \\Symfony\\Component\\Yaml\\Yaml::parse(file_get_contents(drupal_get_path('theme', $original_theme) . \"/{$original_theme}.libraries.yml\"));\n\n $theme_info['name'] = $new_theme;\n $theme_info['base theme'] = $original_theme;\n $theme_info['description'] = \"A {$original_theme} based theme built by Dragon Drupal.\";\n $theme_info['dragon_built'] = 'Yes';\n\n $theme_info['libraries']= [\n \"{$new_theme}/global\"\n ];\n\n $theme_uri = drupal_get_path('theme', $original_theme);\n $theme_parts = explode('/', $theme_uri);\n $theme_parts[count($theme_parts)-1] = $new_theme;\n\n if ($key = array_search('contrib', $theme_parts)) {\n $theme_parts[$key] = 'custom';\n }\n\n $theme_uri = implode('/', $theme_parts);\n if (!file_exists($theme_uri)) {\n mkdir($theme_uri, 0777, true);\n mkdir($theme_uri . '/dragon/css', 0777, true);\n mkdir($theme_uri . '/templates/system', 0777, true);\n }\n\n // Store the theme info.\n $info_yaml['libraries'] = [\n $new_theme . '/global'\n ];\n $info_yaml = \\Symfony\\Component\\Yaml\\Yaml::dump($theme_info);\n $files[] = [\n 'filename' => \"{$new_theme}/{$new_theme}.info.yml\",\n 'contents' => $info_yaml\n ];\n\n // @todo find out how do do this via Yaml dump..\n $files[] = [\n 'filename' => \"{$new_theme}/{$new_theme}.libraries.yml\",\n 'contents' =>\n \"global:\n css:\n theme:\n dragon/css/style.css: {}\"\n ];\n\n // 2. Load all templates that are associated for the target theme from the database.\n $query = \\Drupal::entityQuery('template');\n $entity_ids = $query->execute();\n $templates = \\Drupal::entityTypeManager()->getStorage('template')->loadMultiple($entity_ids);\n\n // 3. Update the current physical templates.\n $libraries= [];\n $style_css ='';\n foreach($templates as $id => $template) {\n if ($template->get('id') == $original_theme. '-' . $template->get('template')) {\n $id = $template->get('id');\n $data = $template->get('layout');\n\n $template_path = \"{$new_theme}/templates/system/\" . $template->get('template');\n $css_content .= \"\\n\\r\" . $data['gjs-css'];\n $files[] = [\n 'filename' => $template_path,\n 'contents' => $data['gjs-html']\n ];\n $style_css .= $css_content . \"\\n\\r\";\n }\n }\n\n $files[] = [\n 'filename' => \"{$new_theme}/dragon/css/style.css\",\n 'contents' => $style_css,\n ];\n\n // 8. Create the zip file for the theme.\n $zip = new \\ZipArchive();\n $filepath = drupal_realpath('public://') . \"/{$new_theme}.zip\";\n if (file_exists($filepath)) {\n unlink($filepath);\n }\n if ($zip->open($filepath, \\ZipArchive::CREATE)!==TRUE) {\n \\Drupal::logger('dragon')->notice(\"Could not open:\" . $filepath);\n return new JsonResponse([\n 'success' => 0\n ]);\n }\n\n // Add all of our required files to the theme.\n foreach($files as $file) {\n $zip->addFromString($file['filename'], $file['contents']);\n }\n $zip->close();\n\n return new JsonResponse([\n 'success' => 1,\n 'uri' => file_create_url(\"public://{$new_theme}.zip\"),\n ]);\n }"
] | [
"0.64193773",
"0.6293411",
"0.6274908",
"0.62208694",
"0.6216694",
"0.61175835",
"0.6099882",
"0.60856235",
"0.6021872",
"0.5957582",
"0.59278744",
"0.59274566",
"0.5901148",
"0.589919",
"0.58829796",
"0.58735305",
"0.58499056",
"0.5847077",
"0.58466244",
"0.5834316",
"0.5824957",
"0.58191967",
"0.58031297",
"0.5768033",
"0.5766239",
"0.5762683",
"0.5759324",
"0.5748725",
"0.5746913",
"0.5739465"
] | 0.69934434 | 0 |
Increment any shelfends < this book's original position and right of its new position | public function update_shelfend_left_move($position,$destination) // param is position of book that is moving left
{
Shelfend::where('position', '<', $position)->where('position', '>', $destination)->increment('position',1);
// Decrememnt any shelfend >= book's original position
Shelfend::where('position', '>', $position)->increment('position',1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function update_shelfend_right_move($position,$destination) // param is position of book that is moving right\n\n {\n Shelfend::where('position', '>', $destination)->increment('position',1);\n\n // Decrememnt any shelfend right of this book's original position AND left of its new position\n Shelfend::where('position', '>', $position)->where('position', '<', $destination)->decrement('position',1);\n\n }",
"function incrementPosition();",
"public function moveRight() {\n\t\t$this->data['positionOld'] = $this->data['position'];\n\t\t$this->data['position']['x']++;\n\t\t$this->move();\n\t}",
"public function recountIndexes()\n {\n\n // total profit\n $profit = 0;\n\n $bn = $this->getInitialBalance();\n $bt = $this->getBalance('rub');\n\n if ($bn == 0) {\n $profit = 0;\n } else {\n $profit = ($bt / $bn - 1) * 100;\n }\n\n $this->profit = $profit;\n\n\n // total growth\n $growth = 0;\n\n $this->growth = $growth;\n\n // update balance\n $this->balance = [\n 'rub' => $this->getBalance('rub'),\n 'usd' => $this->getBalance('usd'),\n 'btc' => $this->getBalance(),\n ];\n\n\n $this->save();\n\n }",
"function Snorlax(){\r\n $this->NewData += array('sversion'=>$this->OldData['sversion']+1);\r\n }",
"public function increaseQuantity()\n {\n $this->setQuantity($this->getQuantity() + 1);\n $this->save();\n }",
"function decrementPosition();",
"function roll(int $pins){\n $this->pins -= $pins;\n if($this->pins < 0){\n throw new Exception(\"someone is cheating ?\");\n }\n $this->roll --;\n $this->score[$this->_parent->cur_roll] = $pins;\n }",
"protected function incrementCounter()\n {\n $carry = 1;\n for ($i = $this->blockSize - 1; $i >= 0; $i--) {\n // chr() takes care of overflows automatically.\n $this->counter[$i] = chr(ord($this->counter[$i]) + $carry);\n $carry &= (\"\\x00\" === $this->counter[$i]);\n }\n }",
"public function testIncreaseStock()\n {\n $stock = $this->em->getRepository('TransactionBundle:Stock')->find(2);\n //Check the identity of the stock\n $this->assertEquals($stock->getName(), 'JUS TOP 1.5 L_B');\n //Get the initial value\n $stockInitValue = $stock->getValue();\n $this->assertEquals($stockInitValue, 5);\n \n //case of 1 incrementation\n $stock->decreaseValue(1);\n $this->assertEquals($stock->getValue(), 4);\n //Don't forget to initialize the value before test again\n $stock->setValue($stockInitValue);\n \n //case of 1 incrementation\n $stock->decreaseValue(2);\n $this->assertEquals($stock->getValue(), 3);\n //Don't forget to initialize the value before test again\n $stock->setValue($stockInitValue);\n \n //case of 1 incrementation\n $stock->decreaseValue(3);\n $this->assertEquals($stock->getValue(), 2);\n //Don't forget to initialize the value before test again\n $stock->setValue($stockInitValue);\n \n //case of 1 incrementation\n $stock->decreaseValue(5);\n $this->assertEquals($stock->getValue(), 0);\n //Don't forget to initialize the value before test again\n $stock->setValue($stockInitValue);\n \n //case of 1 incrementation\n $stock->decreaseValue(6);\n $this->assertEquals($stock->getValue(), -1);\n //Don't forget to initialize the value before test again\n $stock->setValue($stockInitValue);\n \n //case of 1 incrementation\n $stock->decreaseValue(100);\n $this->assertEquals($stock->getValue(), -95);\n //Don't forget to initialize the value before test again\n $stock->setValue($stockInitValue);\n \n }",
"public function move_is_shelfend()\n\n {\n }",
"public function lendBook($book);",
"public function incrementSales() {\n $this->sales = ($this->getSales() + 1);\n }",
"public function increase() {\n\t\t$this->niveau_actuel++;\n\t}",
"public function incrementHits()\r\n {\r\n $this->hits += 1;\r\n $this->modified = true;\r\n }",
"public function strikeBonus(int $roll): int\n {\n return $this->pinCount($roll + 1 ) + $this->pinCount($roll + 2);\n// return $this->defaultFrameScore($roll + 1);\n// return $this->rolls[$roll + 1] + $this->rolls[$roll + 2];\n }",
"function sodium_increment(string &$string): void {}",
"public function incrTreasure($increment) {\n $this->setTreasure($this->getTreasure() + $increment);\n }",
"function lvlUp(){\n $this->setLevel($this->getLevel() + \n 1);\n $this->setAttaque($this->getAttaque() + 2);\n $this->setArmure($this->getArmure() + 1);\n }",
"private function _advanceBracket() {\r\n\r\n\t\t\t$rounds = Round::getCurrentRounds($this->id, true);\r\n\t\t\tif (count($rounds) > 1) {\r\n\t\t\t\tfor ($i = 0, $count = count($rounds); $i < $count; $i += 2) {\r\n\r\n\t\t\t\t\t// Get the round winners\r\n\t\t\t\t\t$winner1 = $rounds[$i]->getWinner();\r\n\t\t\t\t\t$winner2 = $rounds[$i + 1]->getWinner();\r\n\r\n\t\t\t\t\t// Create the round for the next tier\r\n\t\t\t\t\t$newRound = new Round();\r\n\t\t\t\t\t$newRound->bracketId = $this->id;\r\n\t\t\t\t\t$newRound->tier = $rounds[$i]->tier + 1;\r\n\t\t\t\t\t$newRound->group = $rounds[$i]->group;\r\n\t\t\t\t\t$newRound->order = $i / 2;\r\n\t\t\t\t\t$newRound->character1Id = $winner1->id;\r\n\t\t\t\t\t$newRound->character2Id = $winner2->id;\r\n\t\t\t\t\t$newRound->sync();\r\n\r\n\t\t\t\t\t// Finalize the current tier\r\n\t\t\t\t\t$rounds[$i]->final = true;\r\n\t\t\t\t\t$rounds[$i]->sync();\r\n\t\t\t\t\t$rounds[$i + 1]->final = true;\r\n\t\t\t\t\t$rounds[$i + 1]->sync();\r\n\r\n\t\t\t\t}\r\n\t\t\t} else if (count($rounds) === 1) {\r\n\t\t\t\t$round = $rounds[0];\r\n\t\t\t\t$round->final = true;\r\n\t\t\t\t$round->sync();\r\n\r\n\t\t\t\t$this->winner = $round->getWinner();\r\n\t\t\t\t$this->winnerCharacterId = $this->winner->id;\r\n\t\t\t\t$this->state = BS_FINAL;\r\n\t\t\t\t$this->sync();\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t}",
"public function increment(): int;",
"private function shifListstLeft($board, $pos){ \n foreach($board->lists()->get() as $list){\n if($list->position <= $pos){\n $list->position = $list->position - 1;\n $list->save();\n }\n }\n }",
"function addBackordered($sku, $qty) {\n global $credentials;\n\n $backordered = getBackordered($sku);\n $backordered += $qty;\n\n // Open DB Connection\n $conn = new mysqli($credentials['ServerName'], $credentials['Username'], $credentials['Password'], $credentials['Database']);\n\n // Check connection\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n\n // update DB with new totalSold\n $sql = \"UPDATE tbl_product SET backordered='\" . $backordered . \"' WHERE sku='\" . $sku . \"'\";\n\n // Query DB\n $result = $conn->query($sql);\n\n // Free resources and close DB Connection\n $conn->close();\n }",
"function incrementCount() {\n $x = 1 + getCount();\n saveCount($x);\n }",
"public function incr($key, $by = 1) {}",
"public function incrementRender();",
"public function increaseValue()\n {\n if (!$this->value) {\n $this->value = 1;\n } else {\n ++$this->value;\n }\n $this->callTrigger();\n }",
"function MoveWheels(){\n\n\t\t \t\t $this->wheels = 2;\n\n\t\t \t}",
"private function advance()\n {\n $hash = self::hash($this->state ^ $this->counter);\n \n $this->state ^= self::hash($this->state);\n \n $this->counter++;\n if ($this->counter > 0xFFFFFFF)\n {\n $this->counter = 0;\n }\n \n return $hash;\n }",
"function MoveWheels(){\n\n\t\t \t\t $this->wheels = 4;\n\n\t\t \t}"
] | [
"0.6646704",
"0.60317826",
"0.54242456",
"0.5364608",
"0.53470176",
"0.5158858",
"0.5090162",
"0.5061285",
"0.49988943",
"0.4990419",
"0.49860302",
"0.49835554",
"0.49379393",
"0.48841417",
"0.48815286",
"0.48324758",
"0.48164612",
"0.4805628",
"0.47960293",
"0.4772292",
"0.4768072",
"0.47650915",
"0.4707317",
"0.4698894",
"0.4692054",
"0.46818691",
"0.4676846",
"0.46746427",
"0.46451244",
"0.46449077"
] | 0.67317516 | 0 |
Special case if book to be moved is shelfend and moving to new shelf | public function move_is_shelfend()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function update_shelfend_left_move($position,$destination) // param is position of book that is moving left\n\n {\n Shelfend::where('position', '<', $position)->where('position', '>', $destination)->increment('position',1);\n\n // Decrememnt any shelfend >= book's original position\n Shelfend::where('position', '>', $position)->increment('position',1);\n }",
"public function update_shelfend_right_move($position,$destination) // param is position of book that is moving right\n\n {\n Shelfend::where('position', '>', $destination)->increment('position',1);\n\n // Decrememnt any shelfend right of this book's original position AND left of its new position\n Shelfend::where('position', '>', $position)->where('position', '<', $destination)->decrement('position',1);\n\n }",
"function addBook($shelf_id,$book_id){\n if ($shelf_id > 3){\n error_log(\"Invalid shelf id \" . (string)($shelf_id));\n echo \"Invalid shelf id \" . (string)($shelf_id);\n }\n // Fetch # books already in shelf\n if ($this->countBooksInShelf($shelf_id) > 20){\n error_log(\"Too many books in Shelf\");\n echo \"Too many books in Shelf\";\n }\n // TODO: Check if book already exists! (No constraints set in DB)\n else{\n $sql = \"INSERT INTO shelves (ShelfId, ShelfName, BookId) VALUES (%d,'%s',%d);\";\n $sql = sprintf($sql,$shelf_id,$this->shelves[$shelf_id],$book_id);\n $this->db_handle->run($sql);\n }\n }",
"function MoveStock($ITD,$LID1,$LID2,$quantity){\n\t$REM=RemoveStock($ITD,$LID1,$quantity);\n\t$AID=getID();\n\t$name=getAgentName($AID);\n\taddToStockLog($LID1,$LID2,$quantity,\"$name Attempted to move items between Stockpiles\",$ITD);\n\tif($REM=\"DONE\"){\n\t\tAddtoStock($ITD,$LID2,$quantity);\n\t\t\n\t}\n\t\n}",
"public function actionAddtoshelf() {\n $id = $_GET['id'];\n $pkot_items = Productionkotitems::model()->findByPk($id);\n $shelf = Shelfitems::model()->findByPk($pkot_items->menu_item_id);\n $item = Purchaseitem::model()->findByPk($shelf->item_id);\n $qty = $item->low_qty + $pkot_items->qty;\n $item->low_qty = $qty;\n if ($item->update()) {\n $pkot_items->is_added_to_shelf = 1;\n $pkot_items->added_date = date(\"Y-m-d\");\n if ($pkot_items->update()) {\n $items = Productionkotitems::model()->findBySql(\"select * from production_kot_items where production_kot_id=$pkot_items->production_kot_id order by id desc limit 1\");\n if ($items->is_added_to_shelf == 1) {\n $pkot = Productionkot::model()->findByPk($pkot_items->production_kot_id);\n $pkot->is_added_to_shelf = 1;\n $pkot->update();\n }\n }\n }\n $this->redirect(array('view', 'id' => $pkot_items->production_kot_id));\n }",
"function move($direction) {\n\t\t$row =& JTable::getInstance('EventBooking', 'Event');\n\t\t$row->load($this->_id);\t\t\n\t\tif (!$row->move( $direction, ' published >= 0 ' )) {\n\t\t\t$this->setError($this->_db->getErrorMsg());\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public function testMove2()\n {\n // put\n $this->assertTrue($this->object->put('/b1/bingo1', 'wow1'));\n $this->assertTrue($this->object->put('/b1/b2/bingo2', 'wow2'));\n //$this->assertTrue($this->object->put('/b3', 'wow3'));\n\n // move, directory overwrite file is NOT ok\n $this->assertTrue($this->object->move('/b1', '/b3'));\n sleep(1);\n\n $this->assertFalse($this->object->has('/b1/bingo1'));\n $this->assertFalse($this->object->has('/b1/b2/bingo2'));\n\n $this->assertEquals('wow1', $this->object->get('/b3/bingo1'));\n $this->assertEquals('wow2', $this->object->get('/b3/b2/bingo2'));\n\n // clear\n $this->assertTrue($this->object->del('/'));\n }",
"public function deleteShelfBook($id){\n\t\t$shelves = Shelf::where('user_id', Auth::id())->where('book_id',$id)->get();\n\t\t$book = Book::find($id);\n\t\t$shelfId = -1;\n\t\t\n\t\tforeach($shelves as $shelf){\n\t\t\tif($shelf->book_id == $id){\n\t\t\t\t$shelfId = $shelf->id;\n\t\t\t}\n\t\t}\n\t\tif($shelfId != -1){\n\t\t\t$user = Auth::user();\n\t\t\t$shelf = Shelf::find($shelfId);\n\t\t\t$shelf->delete();\n\t\t\t//send a notification\n\t\t\t$user->notify(new ShelfUpdated($user, $book, \"Book removed from the shelf\"));\n\t\t\techo \"Success\";\n\t\t}\t\n\t}",
"private function step_super_stickies()\n {\n }",
"public function setShelf($shelf)\n {\n $this->values['is_shelf'] = $shelf;\n }",
"function checkContainerShelf($shelfid, $isAShelf = true) {\n\tif ($isAShelf) $name = \"shelf\";\n\telse $name = \"item's shelf\";\n\t$checkStatement = \"SELECT items.type, locations.freezer from locations left join items on locations.id_container = items.id WHERE locations.id_item = '$shelfid' and locations.date_moved is null\";\n\t$checkResult = mysql_query($checkStatement);\n\tif (mysql_affected_rows() == 0) {\n\t\techo \"<div class=\\\"alert-error\\\">Warning: This $name is not scanned into a freezer.</div>\";\n\t\treturn false;\n\t} else {\n\t\t$checkRow = mysql_fetch_array($checkResult);\n\t\tif (strlen($checkRow['freezer']) == 0) echo \"<div class=\\\"alert\\\">Error: This $name is not scanned into a freezer.</div>\";\n\t\techo \"<br/>Freezer: \" . $checkRow['freezer'];\n\t\treturn true;\n\t}\n}",
"public function move(Request $request, string $bookSlug, string $chapterSlug)\n {\n $chapter = $this->chapterRepo->getBySlug($bookSlug, $chapterSlug);\n $this->checkOwnablePermission('chapter-update', $chapter);\n $this->checkOwnablePermission('chapter-delete', $chapter);\n\n $entitySelection = $request->get('entity_selection', null);\n if ($entitySelection === null || $entitySelection === '') {\n return redirect($chapter->getUrl());\n }\n\n try {\n $newBook = $this->chapterRepo->move($chapter, $entitySelection);\n } catch (PermissionsException $exception) {\n $this->showPermissionError();\n } catch (MoveOperationException $exception) {\n $this->showErrorNotification(trans('errors.selected_book_not_found'));\n\n return redirect()->back();\n }\n\n return redirect($chapter->getUrl());\n }",
"public function lendBook($book);",
"public function movegoods($amount,$from,$to) {\n $this->db->trans_begin();\n $sql = sprintf(\"update warehouses_goods set quantity = quantity - %s where quantity-locked >= %s and id_warehouse = %s and id_good = %s\",\n $amount,$amount,$from->id_whouse,$from->id_good);\n $this->db->query($sql);\n if ($this->db->affected_rows() != 1) {\n $this->db->trans_rollback();\n return false;\n }\n $sql = sprintf(\"update warehouses_goods set quantity = quantity + %s where id_warehouse = %s and id_good = %s\",\n $amount,$to->id_whouse,$from->id_good);\n $this->db->query($sql);\n if ($this->db->affected_rows() != 1) {\n //try to insert\n $data = array(\"id_warehouse\"=>$to->id_whouse, \"id_good\"=>$from->id_good, \"quantity\"=>$amount);\n $this->db->insert(\"warehouses_goods\",$data);\n if ($this->db->affected_rows() != 1) {\n $this->db->trans_rollback();\n return false;\n }\n }\n //cleanups ... quantities that reach 0 for some reason\n $this->db->query(\"delete from warehouses_goods where quantity = 0\");\n $this->db->trans_commit();\n return true;\n }",
"public function testMove1()\n {\n // put\n $this->assertTrue($this->object->put('/bingo', 'wow'));\n $this->assertTrue($this->object->put('/bingo2', 'wow2'));\n\n // move\n $this->assertTrue($this->object->move('/bingo', '/bb/bingo2'));\n $this->assertFalse($this->object->has('/bingo'));\n $this->assertEquals('wow', $this->object->get('/bb/bingo2'));\n\n // overwrite move\n $this->assertTrue($this->object->move('/bingo2', '/bb/bingo2'));\n $this->assertFalse($this->object->has('/bingo2'));\n $this->assertEquals('wow2', $this->object->get('/bb/bingo2'));\n\n // clear\n $this->assertTrue($this->object->del('/bb'));\n }",
"public function shiftSiblingsForRestore();",
"function _checkBook($_book)\n\t{\n\t\t$_newid = false;\n\t\t$this->tree->books = $this->rfDB->getProjects(true);\n\t\tforeach ($this->tree->books as $_b) {\n\t\t\tif ($_b->_name==$_book) {\n\t\t\t\t$this->book = $_b; \n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!$_newid) $_newid = $_b;\n\t\t}\n\t\tif ($_book) $this->error(\"Book Id not found\");\n\t\t$this->book = $_newid;\n\t}",
"private function set_moving ($store) {\n $this->moving = true;\n $this->moving_to = $store->tag;\n $this->mover_pid = getmypid();\n $this->flags->moving = true;\n $this->flags->locked = true;\n return;\n }",
"public function testMove6()\n {\n // put in '/'\n $this->assertTrue($this->object->put('/b1', 'wow1'));\n $this->assertTrue($this->object->put('/b2/bingo2', 'wow2'));\n\n // recursive move failed\n $this->assertFalse($this->object->move('/', '/b3'));\n $this->assertTrue($this->object->has('/b1'));\n $this->assertTrue($this->object->has('/b2/bingo2'));\n\n $this->assertFalse($this->object->has('/b3'));\n\n // try sub\n $this->assertFalse($this->object->move('/b2', '/b2/new'));\n\n // clear\n $this->assertTrue($this->object->del('/'));\n }",
"private function step_stickies()\n {\n }",
"public function testExplicitMove()\n {\n $page1 = $this->createPage('Foobar');\n $page2 = $this->createPage('Barfoo', $page1);\n $page3 = $this->createPage('BarBar');\n\n $this->getEntityManager()->move($page3->getPath(), $page2->getPath() . '/BarBar');\n $this->assertEquals('/Foobar/Barfoo/BarBar', $page3->getPath());\n\n $persistedEntry = $this->getStorage()->getByUuid($page3->getUuid());\n $this->assertEquals(\n '/BarBar', \n $persistedEntry->getPath(),\n 'Path change has not been persisted'\n );\n\n $this->getEntityManager()->flush();\n\n $persistedEntry = $this->getStorage()->getByUuid($page3->getUuid());\n $this->assertEquals(\n '/Foobar/Barfoo/BarBar', \n $persistedEntry->getPath(),\n 'Path change has been persisted after flush'\n );\n }",
"public static function onSpecialMovepageAfterMove( $movePage, &$oldTitle, &$newTitle ) {\n\t\t$pageId = $newTitle->getArticleID();\n\n\t\t// Delete cache for record if it's in pagetriage queue\n\t\t$articleMetadata = new ArticleMetadata( [ $pageId ] );\n\t\t$articleMetadata->flushMetadataFromCache();\n\n\t\t// Delete user status cache\n\t\tself::flushUserStatusCache( $oldTitle );\n\t\tself::flushUserStatusCache( $newTitle );\n\n\t\t$oldNamespace = $oldTitle->getNamespace();\n\t\t$newNamespace = $newTitle->getNamespace();\n\t\t// Do nothing further on if\n\t\t// 1. the page move is within the same namespace or\n\t\t// 2. the new page is not in article (main) namespace\n\t\tif ( $oldNamespace === $newNamespace || $newNamespace !== NS_MAIN ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tglobal $wgUser;\n\t\t// New record to pagetriage queue, compile metadata\n\t\tif ( self::addToPageTriageQueue( $pageId, $newTitle, $wgUser ) ) {\n\t\t\t$acp = ArticleCompileProcessor::newFromPageId( [ $pageId ] );\n\t\t\tif ( $acp ) {\n\t\t\t\t// safe to use slave db for data compilation for the\n\t\t\t\t// following components, BasicData is accessing pagetriage_page,\n\t\t\t\t// which is not safe to use slave db\n\t\t\t\t$config = [\n\t\t\t\t\t\t'LinkCount' => DB_SLAVE,\n\t\t\t\t\t\t'CategoryCount' => DB_SLAVE,\n\t\t\t\t\t\t'Snippet' => DB_SLAVE,\n\t\t\t\t\t\t'UserData' => DB_SLAVE,\n\t\t\t\t\t\t'DeletionTag' => DB_SLAVE\n\t\t\t\t];\n\t\t\t\t$acp->configComponentDb( $config );\n\t\t\t\t$acp->compileMetadata();\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"public function moveVolume($shelf, $volumeId, $volumePosition, $optParams = array())\n {\n $params = array('shelf' => $shelf, 'volumeId' => $volumeId, 'volumePosition' => $volumePosition);\n $params = array_merge($params, $optParams);\n return $this->call('moveVolume', array($params));\n }",
"public function moveVolume($shelf, $volumeId, $volumePosition, $optParams = array())\n {\n $params = array('shelf' => $shelf, 'volumeId' => $volumeId, 'volumePosition' => $volumePosition);\n $params = array_merge($params, $optParams);\n return $this->call('moveVolume', array($params));\n }",
"function sales_assign_isbn_new_source($distributor,$source_B,$isbn,$required_quantity_A){\n $source_has_book = sales_check_source_has_book($source_B,$isbn);\n \n if(!empty($source_has_book)){\n //B has $isbn already assigned to him, Update A to B which has same ISBN\\\n sales_update_source($distributor,$source_B,$isbn);\n }else{\n //B dosenot have any qty of $isbn , Update A to B which has same ISBN\n sales_update_source($distributor,$source_B,$isbn);\n }\n return true;\n}",
"function move($direction) {\n $row = & $this->getTable();\n if (!$row->load($this->_id)) {\n $this->setError($this->_db->getErrorMsg());\n return false;\n }\n\n if (!$row->move($direction, ' study_id = ' . (int) $row->study_id . ' AND published >= 0 ')) {\n $this->setError($this->_db->getErrorMsg());\n return false;\n }\n\n return true;\n }",
"function shelf($shelf_name, $sort=null) {\n $shelf_rss_link = $this->rss_link . '?shelf=' . $shelf_name . (!empty($sort) ?'&sort=' . $sort : $sort);\n $rss = new DOMDocument();\n $rss->load($shelf_rss_link);\n\n $shelf = array();\n foreach ($rss->getElementsByTagName('item') as $book_info) {\n // Gather each book's attributes\n // Attributes may contain tags\n $book_title = $book_info->getElementsByTagName('title')->item(0)->nodeValue;\n $desc = $book_info->getElementsByTagName('book_description')->item(0)->nodeValue;\n $author = $book_info->getElementsByTagName('author_name')->item(0)->nodeValue ;\n $link = $book_info->getElementsByTagName('link')->item(0)->nodeValue ;\n $s_cover = $book_info->getElementsByTagName('book_small_image_url')->item(0)->nodeValue;\n $m_cover = $book_info->getElementsByTagName('book_medium_image_url')->item(0)->nodeValue;\n $l_cover = $book_info->getElementsByTagName('book_large_image_url')->item(0)->nodeValue;\n $pages = $book_info->getElementsByTagName('num_pages')->item(0)->nodeValue;\n $isbn = $book_info->getElementsByTagName('isbn')->item(0)->nodeValue;\n $published = $book_info->getElementsByTagName('book_published')->item(0)->nodeValue;\n $avg_rating = $book_info->getElementsByTagName('average_rating')->item(0)->nodeValue;\n $user_rating = $book_info->getElementsByTagName('user_rating')->item(0)->nodeValue;\n $user_review = $book_info->getElementsByTagName('user_review')->item(0)->nodeValue;\n \n // Attributes not included: guid, pubDate, book_id, read at, language\n $book = array(\n 'Title' => $book_title,\n 'Description' => $desc,\n 'Author' => $author,\n 'Link' => $link,\n 'Small Cover' => $s_cover,\n 'Medium Cover' => $m_cover,\n 'Large Cover' => $l_cover,\n 'Pages' => $pages,\n 'ISBN' => $isbn,\n 'Published' => $published,\n 'Average Rating' => $avg_rating,\n 'User Rating' => $user_rating,\n 'User Review' => $user_review\n );\n\n array_push($shelf, $book);\n }\n return $shelf;\n }",
"function moveObject($uid, $new_share)\n {\n return $this->_storage->moveObject($uid, $new_share);\n }",
"function moveTo($board_id) {\n\n\t\t// start transaction\n\t\t$this->StartTrans();\n\n\t\t// create a new comment letting people know it has beem moved\n\t\t$lcom = new LibertyComment();\n\t\t$lcom_hash['edit']=\"The comments from: {$this->mInfo['title']} ({$this->mRootId}) have been is_moved to $board_id\";\n\t\t$lcom_hash['title']=$this->mInfo['title'];\n\t\t$lcom_hash['parent_id']=$this->mInfo['th_root_id'];\n\t\t$lcom_hash['root_id']=$this->mInfo['th_root_id'];\n\t\t$lcom_hash['created']=$this->mInfo['flc_created'];\n\t\t$lcom_hash['last_modified']=$this->mInfo['flc_last_modified'];\n\t\t$lcom->storeComment($lcom_hash);\n\n\t\t// map the move to the topic table\n\t\t$data = array();\n\t\t$data['parent_id']=$lcom->mContentId;\n\t\t$data['is_moved']=$this->mRootId;\n\t\t$this->mDb->associateInsert( BIT_DB_PREFIX.\"boards_topics\", $data );\n\n\t\t// move the comment we want to move to the target board\n\t\t$query = \"UPDATE `\".BIT_DB_PREFIX.\"liberty_comments` SET `root_id` = ?, `parent_id` = ?\n\t\t\t\t WHERE `thread_forward_sequence` LIKE '\".sprintf(\"%09d.\", $this->mRootId).\"%' AND `root_id`=`parent_id`\";\n\t\t$result = $this->mDb->query( $query, array( $board_id, $board_id ) );\n\n\t\t$query = \"UPDATE `\".BIT_DB_PREFIX.\"liberty_comments` SET `root_id` = ?\n\t\t\t\t WHERE `thread_forward_sequence` LIKE '\".sprintf(\"%09d.\", $this->mRootId).\"%'\";\n\t\t$result = $this->mDb->query( $query, array( $board_id ) );\n\n\t\t// end transaction\n\t\t$this->CompleteTrans();\n\n\t\treturn TRUE;\n\t}",
"public function move(BookRequest $request, \\App\\Book $book)\n {\n $move = $request->input('move', false);\n\n if($move === false) {\n \\App::abort(400, 'No Direction is set (e2588)');\n }\n\n $movementAmount = $move * 10; \n $movementAmount += ($move < 0) ? -1 : 1;\n\n $book->sort_order += $movementAmount;\n $book->save();\n\n // Cleanup\n \\App\\Book::setSortOrder(Auth::user()->id);\n\n return response()->json($book);\n }"
] | [
"0.65638304",
"0.63072306",
"0.5831313",
"0.54973346",
"0.54860747",
"0.54450464",
"0.52380335",
"0.52212167",
"0.5187745",
"0.51702183",
"0.50914645",
"0.50631946",
"0.49910268",
"0.49885473",
"0.49689224",
"0.49527007",
"0.49499378",
"0.49443638",
"0.48840168",
"0.48788992",
"0.48641285",
"0.4839912",
"0.48154488",
"0.48154488",
"0.48033544",
"0.4782031",
"0.47398517",
"0.4736566",
"0.47203505",
"0.47186357"
] | 0.7638149 | 0 |
Find which shelf a book is on count the number of shelf ends <= to position | public function get_shelf_number($position)
{
// Works for current position and destination position
return \DB::table('shelfends')
->select('id')
->where('position', '<', $position)
->where('user_id',\Auth::id())
->count();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function update_shelfend_left_move($position,$destination) // param is position of book that is moving left\n\n {\n Shelfend::where('position', '<', $position)->where('position', '>', $destination)->increment('position',1);\n\n // Decrememnt any shelfend >= book's original position\n Shelfend::where('position', '>', $position)->increment('position',1);\n }",
"public function update_shelfend_right_move($position,$destination) // param is position of book that is moving right\n\n {\n Shelfend::where('position', '>', $destination)->increment('position',1);\n\n // Decrememnt any shelfend right of this book's original position AND left of its new position\n Shelfend::where('position', '>', $position)->where('position', '<', $destination)->decrement('position',1);\n\n }",
"public function move_is_shelfend()\n\n {\n }",
"function findleaf(){\n\t\tif($this->hasfood == false && $this->drainstamina() && !is_array($this->world->findenemy($this->posx, $this->posy, $this->type))){\n\t\t\t$foods = array();\n\t\t\tforeach($this->world->food as $key => $food){\n\t\t\t\t$foods[$key][] = $this->world->food[$key]->posx();\n\t\t\t\t$foods[$key][] = $this->world->food[$key]->posy();\n\t\t\t\t$foods[$key][] = $this->world->food[$key]->quality();\n\t\t\t\t$foods[$key][] = $key;\n\t\t\t\t$foods[$key][] = $this->world->food[$key]->name();\n\t\t\t}\n\t\t\t$tilesaway = 100;\n\t\t\t$order = array();\n\t\t\tforeach($foods as $key => $item){\n\t\t\t\t$xtest = abs($item[0] - $this->posx);\n\t\t\t\t$ytest = abs($item[1] - $this->posy);\n\t\t\t\t$testvalue = floor(($xtest + $ytest) / 2);\n\t\t\t\tif( $testvalue < $tilesaway ){\n\t\t\t\t\t$tilesaway = $testvalue;\n\t\t\t\t\tarray_unshift($order, $item[0], $item[1], $item[2], $item[3], $item[4]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//print_r($order);\n\t\t\tif($order[0] < $this->posx && $order[1] > $this->posy){\n\t\t\t\tif($this->world->checklocation($this->posx + 1, $this->posy - 1)){\n\t\t\t\t\t$this->posy++;\n\t\t\t\t\t$this->posx--;\n\t\t\t\t} elseif($this->world->checklocation($this->posx - 1, $this->posy)){\n\t\t\t\t\t$this->posx++;\n\t\t\t\t} elseif($this->world->checklocation($this->posx, $this->posy + 1)){\n\t\t\t\t\t$this->posy--;\n\t\t\t\t}\n\t\t\t} elseif($order[0] < $this->posx && $order[1] < $this->posy){\n\t\t\t\tif($this->world->checklocation($this->posx + 1, $this->posy + 1)){\n\t\t\t\t\t$this->posy--;\n\t\t\t\t\t$this->posx--;\n\t\t\t\t} elseif($this->world->checklocation($this->posx + 1, $this->posy)){\n\t\t\t\t\t$this->posx--;\n\t\t\t\t} elseif($this->world->checklocation($this->posx, $this->posy + 1)){\n\t\t\t\t\t$this->posy--;\n\t\t\t\t}\n\t\t\t} elseif($order[0] > $this->posx && $order[1] > $this->posy){\n\t\t\t\tif($this->world->checklocation($this->posx - 1, $this->posy - 1)){\n\t\t\t\t\t$this->posy++;\n\t\t\t\t\t$this->posx++;\n\t\t\t\t} elseif($this->world->checklocation($this->posx - 1, $this->posy)){\n\t\t\t\t\t$this->posx++;\n\t\t\t\t} elseif($this->world->checklocation($this->posx, $this->posy - 1)){\n\t\t\t\t\t$this->posy++;\n\t\t\t\t}\n\t\t\t} elseif($order[0] > $this->posx && $order[1] < $this->posy){\n\t\t\t\tif($this->world->checklocation($this->posx - 1, $this->posy + 1)){\n\t\t\t\t\t$this->posy--;\n\t\t\t\t\t$this->posx++;\n\t\t\t\t} elseif($this->world->checklocation($this->posx - 1, $this->posy)){\n\t\t\t\t\t$this->posx++;\n\t\t\t\t} elseif($this->world->checklocation($this->posx, $this->posy - 1)){\n\t\t\t\t\t$this->posy--;\n\t\t\t\t}\n\t\t\t}elseif($order[0] > $this->posx){\n\t\t\t\tif($this->world->checklocation($this->posx + 1, $this->posy)){\n\t\t\t\t\t$this->posx++;\n\t\t\t\t}\n\t\t\t} elseif($order[0] < $this->posx){\n\t\t\t\tif($this->world->checklocation($this->posx - 1, $this->posy)){\n\t\t\t\t\t$this->posx--;\n\t\t\t\t}\n\t\t\t} elseif($order[1] > $this->posy){\n\t\t\t\tif($this->world->checklocation($this->posx, $this->posy + 1)){\n\t\t\t\t\t$this->posy++;\n\t\t\t\t}\n\t\t\t} elseif($order[1] < $this->posy){\n\t\t\t\tif($this->world->checklocation($this->posx, $this->posy - 1)){\n\t\t\t\t\t$this->posy--;\n\t\t\t\t}\n\t\t\t} \n\t\t\t$this->appendtoturn(\"<b>\" . $this->type . \"</b>(\" . $this->stamina . \") ant moved to \" . $order[4] . \" at \" . $order[0] . \"-\" . $order[1]);\n\t\t\tif($order[0] == $this->posx && $order[1] == $this->posy && $this->world->food[$order[3]]->used == 0){\n\t\t\t\t$this->booststamina();\n\t\t\t\t$this->hasfood = true;\n\t\t\t\t$this->quality = $order[2];\n\t\t\t\t//echo \"<br>Order 2:\" . $order[2] . \"<br>Quality:\" . $this->quality . \"<br>\";\n\t\t\t\t$this->world->food[($order[3])]->editused(1);\n\t\t\t\t$this->brain->setstate(\"gohome\");\n\t\t\t\t$this->appendtoturn(\"<b>\" . $this->type . \"</b>(\" . $this->stamina . \") ant picked up \" . $order[4] . \" at \" . $order[0] . \"-\" . $order[1]);\n\t\t\t}\n\t\t\tif($this->lastpos == $this->posx . $this->posy){\n\t\t\t\t$this->checkifsameloc();\n\t\t\t}\n\t\t} elseif(is_array($this->world->findenemy($this->posx, $this->posy, $this->type))){\n\t\t\t$this->brain->setstate(\"attack\");\n\t\t\t$this->update();\n\t\t}else{\n\t\t\t$this->brain->setstate(\"gohome\");\n\t\t}\n\t}",
"public function hasNext()\n {\n if ($this->index < $this->bookShelf->getLength()) {\n return true;\n } else {\n return false;\n }\n }",
"public function get($shelf, $optParams = array())\n {\n $params = array('shelf' => $shelf);\n $params = array_merge($params, $optParams);\n return $this->call('get', array($params), 'Google\\Service\\Books\\Bookshelf');\n }",
"public function get($shelf, $optParams = array())\n {\n $params = array('shelf' => $shelf);\n $params = array_merge($params, $optParams);\n return $this->call('get', array($params), \"Books_Bookshelf\");\n }",
"function get_lowest_ndx($position)\r\n{\r\n\tglobal $db;\r\n\r\n\t$sql = \"SELECT ndx\r\n\t\tFROM \" . K_BLOCKS_TABLE . \"\r\n\t\tWHERE position = '\" . $position . \"'\r\n\t\tORDER BY ndx ASC LIMIT 1\";\r\n\r\n\t$result = $db->sql_query($sql);\r\n\t$index_start = (int) $db->sql_fetchfield('ndx');\r\n\t$db->sql_freeresult($result);\r\n\t\r\n\treturn ($index_start);\r\n}",
"public function checkGameStarter()\n {\n $topIndex = 0;\n $topValue = 0;\n for ($index = 0; $index < $this->nrOfPlayers; $index++) {\n $tempTopValue = $this->players[$index]->topDice();\n if ($tempTopValue > $topValue) {\n $topValue = $tempTopValue;\n $topIndex = $index;\n }\n }\n $this->currentPlayerIndex = $topIndex;\n return $topIndex;\n }",
"public function getShelves();",
"function shelf($shelf_name, $sort=null) {\n $shelf_rss_link = $this->rss_link . '?shelf=' . $shelf_name . (!empty($sort) ?'&sort=' . $sort : $sort);\n $rss = new DOMDocument();\n $rss->load($shelf_rss_link);\n\n $shelf = array();\n foreach ($rss->getElementsByTagName('item') as $book_info) {\n // Gather each book's attributes\n // Attributes may contain tags\n $book_title = $book_info->getElementsByTagName('title')->item(0)->nodeValue;\n $desc = $book_info->getElementsByTagName('book_description')->item(0)->nodeValue;\n $author = $book_info->getElementsByTagName('author_name')->item(0)->nodeValue ;\n $link = $book_info->getElementsByTagName('link')->item(0)->nodeValue ;\n $s_cover = $book_info->getElementsByTagName('book_small_image_url')->item(0)->nodeValue;\n $m_cover = $book_info->getElementsByTagName('book_medium_image_url')->item(0)->nodeValue;\n $l_cover = $book_info->getElementsByTagName('book_large_image_url')->item(0)->nodeValue;\n $pages = $book_info->getElementsByTagName('num_pages')->item(0)->nodeValue;\n $isbn = $book_info->getElementsByTagName('isbn')->item(0)->nodeValue;\n $published = $book_info->getElementsByTagName('book_published')->item(0)->nodeValue;\n $avg_rating = $book_info->getElementsByTagName('average_rating')->item(0)->nodeValue;\n $user_rating = $book_info->getElementsByTagName('user_rating')->item(0)->nodeValue;\n $user_review = $book_info->getElementsByTagName('user_review')->item(0)->nodeValue;\n \n // Attributes not included: guid, pubDate, book_id, read at, language\n $book = array(\n 'Title' => $book_title,\n 'Description' => $desc,\n 'Author' => $author,\n 'Link' => $link,\n 'Small Cover' => $s_cover,\n 'Medium Cover' => $m_cover,\n 'Large Cover' => $l_cover,\n 'Pages' => $pages,\n 'ISBN' => $isbn,\n 'Published' => $published,\n 'Average Rating' => $avg_rating,\n 'User Rating' => $user_rating,\n 'User Review' => $user_review\n );\n\n array_push($shelf, $book);\n }\n return $shelf;\n }",
"function nGreaterThan($position) {\n\n $lt = 0;\n $size = $this->vectorMinSizeComp($position); //size of the smallest vector\n\n for ($i = 0; $i < $size; $i++) {\n\n if ($this->greaterThan($this->mPosition[$i], $position->mPosition[$i])) {\n $lt = 1;\n }\n }//end for\n\n if ($lt == 0) {\n if ($this->size() > $position->size()) {\n $lt = 1;\n }\n }\n return $lt;\n }",
"public function searchRange($key) {\n $low = 0;\n $high = count($this->items) - 1;\n while ($low <= $high) {\n $mid = (int)(($low + $high) / 2);\n $cmp = $this->compare($this->items[$mid]->key, $key);\n switch ($cmp) {\n case 1: {\n $high = $mid - 1;\n break;\n }\n case -1: {\n $low = $mid + 1;\n break;\n }\n default : {\n // bottom boundary\n $high1 = $low1 = $mid;\n while ($low <= $high1) {\n $mid = (int)(($low + $high1) / 2);\n $cmp = $this->compare($this->items[$mid]->key, $key);\n if ($cmp === 0) {\n $high1 = $mid - 1;\n } else {\n $low = $mid + 1;\n }\n }\n\n // upper boundary\n while ($low1 <= $high) {\n $mid = (int)(($low1 + $high) / 2);\n $cmp = $this->compare($this->items[$mid]->key, $key);\n if ($cmp === 0) {\n $low1 = $mid + 1;\n } else {\n $high = $mid - 1;\n }\n }\n\n return [$low, $high];\n }\n }\n }\n return null; // key not found.\n }",
"function Show_Shelf($cur_title,$shelf_arr)\n\t\t{\n\t\t\tglobal $ecom_siteid,$db,$ecom_hostname,$Settings_arr,$ecom_themeid,$default_layout,$Captions_arr,$inlineSiteComponents,$shelf_for_inner,$ecom_allpricewithtax,$PriceSettings_arr;\n\t\t\tif (count($shelf_arr))\n\t\t\t{\n\t\t\t\t$shelfsort_by\t\t\t= $Settings_arr['product_orderfield_shelf'];\n\t\t\t\t$prodperpage\t\t\t= $Settings_arr['product_maxcntperpage_shelf'];// product per page\n\t\t\t\n\t\t\t\tswitch ($shelfsort_by)\n\t\t\t\t{\n\t\t\t\t\tcase 'custom': // case of order by customer fiekd\n\t\t\t\t\t$shelfsort_by\t\t= 'b.product_order';\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'product_name': // case of order by product name\n\t\t\t\t\t$shelfsort_by\t\t= 'a.product_name';\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'price': // case of order by price\n\t\t\t\t\t$shelfsort_by\t\t= 'a.product_webprice';\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'product_id': // case of order by price\n\t\t\t\t\t$prodsort_by\t\t= 'a.product_id';\n\t\t\t\t\tbreak;\t\n\t\t\t\t\tdefault: // by default order by product name\n\t\t\t\t\t$shelfsort_by\t\t= 'a.product_name';\n\t\t\t\t\tbreak;\n\t\t\t\t};\n\t\t\t\t$shelfsort_order\t\t= $Settings_arr['product_orderby_shelf'];\n\t\t\t\t$prev_shelf\t\t\t\t= 0;\n\t\t\t\t$show_max =0;\n\t\t\t\t\n\t\t\t\t//Iterating through the shelf array to fetch the product to be shown.\n\t\t\t\tforeach ($shelf_arr as $k=>$shelfData)\n\t\t\t\t{ \n\t\t\t\t\t// Check whether shelf_activateperiodchange is set to 1\n\t\t\t\t\t$active \t= $shelfData['shelf_activateperiodchange'];\n\t\t\t\t\tif($active==1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$proceed\t= validate_component_dates($shelfData['shelf_displaystartdate'],$shelfData['shelf_displayenddate']);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$proceed\t= true;\t\n\t\t\t\t\tif ($proceed)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($_REQUEST['req']!='') // If coming to show the details in middle area other than from the home page then show the details in normal shelf style\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($shelf_for_inner==true) /* Case if call is to display shelf at the bottom on inner pages*/\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($shelfData['shelf_currentstyle']!='gallery')\n\t\t\t\t\t\t\t\t\t$shelfData['shelf_currentstyle']='nor';\n\t\t\t\t\t\t\t\t\t$shelfData['shelf_currentstyle']='gallery';\n\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$shelfData['shelf_currentstyle']='nor';\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t// Get the total number of product in current shelf\n\t\t\t\t\t\t$sql_totprod = \"SELECT count(b.products_product_id) \n\t\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\tproducts a,product_shelf_product b \n\t\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\t\tb.product_shelf_shelf_id = \".$shelfData['shelf_id'].\" \n\t\t\t\t\t\t\t\t\t\tAND a.product_id = b.products_product_id \n\t\t\t\t\t\t\t\t\t\tAND a.product_hide = 'N' \";\n\t\t\t\t\t\t$ret_totprod \t= $db->query($sql_totprod);\n\t\t\t\t\t\tlist($tot_cnt) \t= $db->fetch_array($ret_totprod); \n\t\t\t\t\t\t\n\t\t\t\t\t\t// Call the function which prepares variables to implement paging\n\t\t\t\t\t\t$ret_arr \t\t= array();\n\t\t\t\t\t\t$pg_variable\t= 'shelf_'.$shelfData['shelf_id'].'_pg';\n\t\t\t\t\t\tif ($_REQUEST['req']!='')// LIMIT for products is applied only if not displayed in home page\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$start_var \t\t= prepare_paging($_REQUEST[$pg_variable],$prodperpage,$tot_cnt);\n\t\t\t\t\t\t\t$Limit\t\t\t= \" LIMIT \".$start_var['startrec'].\", \".$prodperpage;\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t// Get the list of products to be shown in current shelf\n\t\t\t\t\t\t $sql_prod = \"SELECT a.product_id,a.product_name,a.product_variablestock_allowed,a.product_show_cartlink,\n\t\t\t\t\t\t\t\t\t\t\ta.product_preorder_allowed,a.product_show_enquirelink,a.product_webstock,a.product_webprice,\n\t\t\t\t\t\t\t\t\t\t\ta.product_discount,a.product_discount_enteredasval,a.product_bulkdiscount_allowed,\n\t\t\t\t\t\t\t\t\t\t\tproduct_total_preorder_allowed,a.product_applytax,a.product_shortdesc,a.product_bonuspoints,\n\t\t\t\t\t\t\t\t\t\t\ta.product_stock_notification_required,a.product_alloworder_notinstock,a.product_variables_exists,a.product_variablesaddonprice_exists,\n\t\t\t\t\t\t\t\t\t\t\ta.product_variablecomboprice_allowed,a.product_variablecombocommon_image_allowed,a.default_comb_id,\n\t\t\t\t\t\t\t\t\t\t\ta.price_normalprefix,a.price_normalsuffix, a.price_fromprefix, a.price_fromsuffix,a.price_specialofferprefix, a.price_specialoffersuffix, \n\t\t\t\t\t\t\t\t\t\t\ta.price_discountprefix, a.price_discountsuffix, a.price_yousaveprefix, a.price_yousavesuffix,a.price_noprice,\n\t\t\t\t\t\t\t\t\t\t\ta.product_averagerating,a.product_saleicon_show,a.product_saleicon_text,a.product_newicon_show,a.product_newicon_text,\n\t\t\t\t\t\t\t\t\t\t\ta.product_freedelivery,a.product_actualstock \n\t\t\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\t\tproducts a,product_shelf_product b \n\t\t\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\t\t\tb.product_shelf_shelf_id = \".$shelfData['shelf_id'].\" \n\t\t\t\t\t\t\t\t\t\t\tAND a.product_id = b.products_product_id \n\t\t\t\t\t\t\t\t\t\t\tAND a.product_hide = 'N' \n\t\t\t\t\t\t\t\t\t\tORDER BY \n\t\t\t\t\t\t\t\t\t\t\ta.product_webstock DESC,a.product_webprice ASC \n\t\t\t\t\t\t\t\t\t\t$Limit\t\";\n\t\t\t\t\t\t$ret_prod = $db->query($sql_prod);\n\t\t\t\t\t\tif ($db->num_rows($ret_prod))\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t$comp_active = isProductCompareEnabled();\n\t\t\t\t\t\t\t$pass_type = 'image_bigpath';\n\t\t\t\t\t\t\t// Number of result to display on the page, will be in the LIMIT of the sql query also\n\t\t\t\t\t\t\t$querystring = \"\"; // if any additional query string required specify it over here\n\t\t\t\t\t\t\t$HTML_comptitle = $HTML_maindesc = $HTML_paging = $HTML_showall = '';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//if ($_REQUEST['req']=='')// LIMIT for products is applied only if not displayed in home page\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($tot_cnt>0 and ($_REQUEST['req']!='') and $tot_cnt>$prodperpage)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$paging \t\t= paging_footer_advanced($path,$query_string,$tot_cnt,$start_var['pg'],$start_var['pages'],'',$pg_variable,'Products',$pageclass_arr);\n\t\t\t\t\t\t\t\t\t$HTML_paging \t='\n\t\t\t\t\t\t\t\t\t<div class=\"subcat_nav_pdt_no_shelf\"><span>'.$paging['total_cnt'].'</span></div></td></tr>\n<tr>\n<td class=\"pagingtd\" colspan=\"2\">\n<div class=\"page_nav_content\"><ul>';//.'';\n\t\t\t\t\t\t\t\t\t$HTML_paging \t.= $paging['navigation']['start_nav'].$paging['navigation']['page_no'].$paging['navigation']['end_nav'];\n\t\t\t\t\t\t\t\t\t$HTML_paging \t.= ' \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ul></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif($_REQUEST['req']=='' and $tot_cnt>0) // case of show all link\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t $HTML_showall = \"\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t <div class='normal_mid_showall'><a href='\".url_shelf_all($shelfData['shelf_id'],$shelfData['shelf_name'],1).\"' title=''>\".$Captions_arr['COMMON']['SHOW_ALL'].\"</a></div>\n\t\t\t\t\t\t\t\t \";\n\t\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\tif($shelfData['shelf_currentstyle']=='nor')\n\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\tif($_REQUEST['req']=='')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t $cont_cls = 'container';\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t $cont_cls = 'row';\n\t\t\t\t\t\t\t\t if($_REQUEST['req']=='')\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t $cls_title = \"titlehead\";\n\t\t\t\t\t\t\t\t $cls_home = \"homeshelfcls\";\n\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t\t\t else\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t $cls_title = \"titlehead_new\";\n\t\t\t\t\t\t\t\t $cls_home =\"\";\n\t\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t\t?>\n\t\t\t<div class=\"<?php echo $cont_cls;?>\">\n\t<div class=\"recent-title\"><?php echo utf8_encode($cur_title);?></div>\n\t\t\t\t\t\t\t\t<div class=\"panel-group <?php echo $cls_home ?>\" id=\"accordion\">\n\n\t<?php \n\t$rwCnt\t=\t1;\n\t$HTML_price = '';\n\t$HTML_title = '';\n\t\t\t\t\t while($row_prod = $db->fetch_array($ret_prod))\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$HTML_title = '<a href=\"'.url_product($row_prod['product_id'],$row_prod['product_name'],1).'\" title=\"'.stripslash_normal($row_prod['product_name']).'\">'.stripslash_normal($row_prod['product_name']).'</a> ';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<div class=\"<?php echo $cls_title ?>\"><?php echo utf8_encode($HTML_title);?></div>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div class=\"img-container\">\n\t\t\t\t\t\t\t<div class=\"newicons_container_outer\">\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($row_prod['product_actualstock']==0)\n\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\t\n\t\t\t\t\t\t\t\t\t<div class=\"nowlet_cls_newcls\"><?php echo $Captions_arr['COMMON']['NOW_LET']?></div>\n\t\t\t\t\t\t\t\t<?php\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$availability_msg = '';\n\t\t\t\t\t\t\t\tif($row_prod['product_actualstock']>0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$availability_msg = '<div class=\"red_availableA_newcls\">'.$Captions_arr['COMMON']['PRODDET_AVAIL_1_YEAR'].'</div>';\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$availability_msg = '<div class=\"red_availableA_newcls\">'.$Captions_arr['COMMON']['PRODDET_AVAIL_2_YEAR'].'</div>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif($availability_msg)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\techo $availability_msg;\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</div>\t\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\tif($row_prod['product_actualstock']==0)\n\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\t<div class=\"nowlet_cls_inner\"><img src=\"<?php echo url_site_image('nowLet.png',1) ?>\" alt=\"Now Let\"></div>\n\t\t\t\t\t\t\t<?php\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t*/ \n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<div class=\"single-products\">\n\t\t\t\t\t\t\t<div class=\"productinfo-homeA text-center \">\n\t\t\t\t\t\t\t\t<?php\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$pass_type\t=\t'image_bigpath';\n\t\t\t\t\t\t\t\t\t$img_arr\t=\tget_imagelist('prod',$row_prod['product_id'],$pass_type,0,0,1);\n\t\t\t\t\t\t\t\t\t//$tabimg_arr\t=\tget_imagelist('prod',$row_prod['product_id'],'image_bigpath',0,0,1);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$HTML_image ='<a href=\"'.url_product($row_prod['product_id'],$row_prod['product_name'],1).'\" title=\"'.stripslash_normal($row_prod['product_name']).'\" class=\"image_linkA\">';\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t/*if($row_prod['product_actualstock']==0)\n\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\t$HTML_image .='<div class=\"nowlet_cls_innerA\"><img src=\"'.url_site_image('nowLet.png',1).'\" alt=\"Now Let\"></div>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t/*if($row_prod['product_actualstock']>0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t$availability_msg = '<span class=\"red_availableA\">'.$Captions_arr['COMMON']['PRODDET_AVAIL_1_YEAR'].'</span>';\n\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t$availability_msg = '<span class=\"red_availableA\">'.$Captions_arr['COMMON']['PRODDET_AVAIL_2_YEAR'].'</span>';\n\t\t\t\t\t\t\t\t\t\t\t\t //$availability_msg;\t\n\t\t\t\t\t\t\t\t\t\t\t\t$HTML_image .= $availability_msg;*/\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t$curimgid = $shelfData['shelf_id'].'_'.$row_prod['product_id'];\n\t\t\t\t\t\t\t\t\tglobal $def_mainimg_id;\n\t\t\t\t\t\t\t\t\t$def_mainimg_id = $curimgid;\n\t\t\t\t\t\t\t\t\t// Calling the function to get the image to be shown\n\t\t\t\t\t\t\t\t\tif(count($img_arr))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t//$HTML_image .= show_image(url_root_image($img_arr[0][$pass_type],1),$row_prod['product_name'],$row_prod['product_name'],'','',1);\n\t\t\t\t\t\t\t\t\t\t$HTML_image .= '<img src=\"'.url_root_image($img_arr[0][$pass_type],1).'\" id=\"'.$curimgid.'\" alt=\"'.$row_prod['product_name'].'\">';\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// calling the function to get the default image\n\t\t\t\t\t\t\t\t\t\t$no_img = get_noimage('prod',$pass_type); \n\t\t\t\t\t\t\t\t\t\tif ($no_img)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$HTML_image .= show_image($no_img,$row_prod['product_name'],$row_prod['product_name'],'','',1);\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\t$HTML_image .= '</a>';\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\techo $HTML_image;\n\t\t\t\t\t\t\t\t\t$price_arr = show_Price($row_prod,array(),'compshelf',false,3);\n\t\t\t\t\t\t\t\t\tif($price_arr['discounted_price'])\n\t\t\t\t\t\t\t\t\t\t$HTML_price = $price_arr['discounted_price'];\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t$HTML_price = $price_arr['base_price'];\n\t\t\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\tif($row_prod['product_actualstock']>0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t$availability_msg = '<span class=\"green_available\">'.$Captions_arr['COMMON']['PRODDET_AVAIL_1_YEAR'].'</span>';\n\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t$availability_msg = '<span class=\"red_available\">'.$Captions_arr['COMMON']['PRODDET_AVAIL_2_YEAR'].'</span>';\n\t\t\t\t\t\t\t\t\t\t\t\techo $availability_msg;\t\n\t\t\t\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</div>\n\t\t\t\t\t\t\t<?php \n\t\t\t\t\t\t\tif($HTML_price!='')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<p class=\"rent-title\"><?php echo utf8_encode($HTML_price);?></p>\n <?php \n } ?> \n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t if($_REQUEST['req']=='')\n\t\t\t\t\t\t\t\t $mod['source'] = \"shelf\";\n\t\t\t\t\t\t\t\t else\n\t\t\t\t\t\t\t\t $mod['source'] = \"list\";\n\t\t\t\t\t\t\t\t show_ProductLabels_Unipad($row_prod['product_id'],$mod); ?>\n\t\t\t\t\t\t\t<?php \n\t\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t\t\tif($row_prod['product_actualstock']>0)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<a href=\"<?php echo url_product($row_prod['product_id'],$row_prod['product_name'],1)?>\" title=\"<?php echo stripslash_normal($row_prod['product_name'])?>\" class=\"mainbtn btn-default book-now\"><i class=\"fa fa-shopping-cart\"></i>book now</a>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t else\n\t\t\t\t\t\t\t\t\t */ \n\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t <a href=\"<?php url_product($row_prod['product_id'],$row_prod['product_name'],-1)?>\" title=\"<?php echo stripslashes($row_prod['product_name'])?>\" class=\"btn btn-default add-to-cart\">More Info</a>\n\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$rwCnt++;\n\t\t\t\t\t\t\techo \"<div class='sep_div'></div>\";\n\t\t\t\t\t }?>\n\t\t\t\t\t </div>\n\n\t\t\t\t\t </div>\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if($shelfData['shelf_currentstyle']=='gallery')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo \"<link href=\\\"\".url_head_link(\"images/\".$ecom_hostname.\"/mobile_photoswype/css/photoswipe.css\",1).\"\\\" media=\\\"screen\\\" type=\\\"text/css\\\" rel=\\\"stylesheet\\\" />\";\n\t\t\t\t\t\t\techo \"<script type=\\\"text/javascript\\\" src=\\\"\".url_head_link(\"images/\".$ecom_hostname.\"/mobile_photoswype/js/klass.min.js\",1).\"\\\"></script>\";\n\t\t\t\t\t\t\techo \"<script type=\\\"text/javascript\\\" src=\\\"\".url_head_link(\"images/\".$ecom_hostname.\"/mobile_photoswype/js/code.photoswipe-3.0.5.min.js\",1).\"\\\"></script>\";\n\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$prev_id = 0;\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t$imghold_arr = array();\n\t\t\t\t\t\t\t\t\t\t\t$cnt_cls = 0 ;\n\t\t\t\t\t\t\t\t\t\t\t$js_repeatfunction ='var myPhotoSwipe;';\n\t\t\t\t\t\t\t\t\t\t\twhile($row_prod = $db->fetch_array($ret_prod))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$cnt_cls++;\n\t\t\t\t\t\t\t\t\t\t\t\t//$pass_type ='image_bigpath';\n\t\t\t\t\t\t\t\t\t\t\t\t$pass_type ='image_bigpath';\n\t\t\t\t\t\t\t\t\t\t\t\t$img_arr = get_imagelist('prod',$row_prod['product_id'],$pass_type,0,0,0);\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\tif(count($img_arr))\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\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"gallery_propertyouter\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"gallery_propertyname\"><a href=\"<?php echo url_product($row_prod['product_id'],$row_prod['product_name'],1)?>\"><?php echo stripslashes($row_prod['product_name'])?></a></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ul id=\"Gallery<?php echo $row_prod['product_id'];?>\" class=\"Gallery\" >\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor($im_i=0;$im_i<count($img_arr);$im_i++)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ \n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li><div class=\"det_thumbimg_pdt\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"det_thumbimg_image\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"<?php url_root_image($img_arr[$im_i]['image_bigpath'])?>\" title=\"<?=$title?>\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tshow_image(url_root_image($img_arr[$im_i][$pass_type],1),$row_prod['product_name'],$row_prod['product_name'],'','',0);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t\t\t\t$js_repeatfunction .= \"myPhotoSwipe = Code.PhotoSwipe.attach( window.document.querySelectorAll('#Gallery\".$row_prod['product_id'].\" a'), { enableMouseWheel: false , enableKeyboard: false } );\";\n\t\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\t?>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\t\t\t// Set up PhotoSwipe with all anchor tags in the Gallery container\n\t\t\t\t\t\t\t\tdocument.addEventListener('DOMContentLoaded', function(){\n\t\t\t\t\t\t\t\t<?php echo $js_repeatfunction ;?>\n\n\t\t\t\t\t\t\t\t}, false);\n\t\t\t\t\t\t\t\t</script>\n\t <?php /*\n\t\t\t\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\t\t\t$(document).ready(function(){ \n\t$('li img').on('click',function(){\n\t\t\n\t\telm = $(this).parent('li');\n\t\t\n\t\tpar = elm.parent('ul').attr('class');\n\t\t\n\t\tvar src = $(this).attr('src');\n\t\tvar img = '<img src=\"' + src + '\" class=\"img-responsive\"/>';\n\t\t\n\t\t//start of new code new code\n\t\tvar index = $(this).parent('li').index(); \n\t\t\n\t\tvar tot = ($('ul.'+par+' li').length);\n\t\t\n\t\tvar html = '';\n\t\thtml += img; \n\t\tvar nextdisp = prevdisp = '';\n\t\thtml += '<div style=\"height:25px;clear:both;display:block;\">';\n\t\tif(tot>1)\n\t\t{\n\t\t\tif(tot==(index+1))\n\t\t\t{\n\t\t\t\tnextdisp = 'style = \"display:none\"';\n\t\t\t\t/*html += '<a class=\"controls next\" href=\"'+ (index+2) + '\" data-row=\"'+par+'\" style=\"display:none\">next »</a>';\n\t\t\t\thtml += '<a class=\"controls previous\" href=\"' + (index) + '\" data-row=\"'+par+'\">« prev</a>';*//*\n\t\t\t}\n\t\t\telse if(index==0)\n\t\t\t{\n\t\t\t\tprevdisp = 'style = \"display:none\"';\n\t\t\t\t/*html += '<a class=\"controls next\" href=\"'+ (index+2) + '\" data-row=\"'+par+'\">next »</a>';\n\t\t\t\thtml += '<a class=\"controls previous\" href=\"' + (index) + '\" data-row=\"'+par+'\" style=\"display:none\">« prev</a>';*//*\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/*html += '<a class=\"controls next\" href=\"'+ (index+2) + '\" data-row=\"'+par+'\">next »</a>';\n\t\t\t\thtml += '<a class=\"controls previous\" href=\"' + (index) + '\" data-row=\"'+par+'\">« prev</a>';\t*//*\n\t\t\t}\t\n\t\t\thtml += '<a class=\"controls next\" href=\"'+ (index+2) + '\" data-row=\"'+par+'\" '+nextdisp+'>next »</a>';\n\t\t\thtml += '<a class=\"controls previous\" href=\"' + (index) + '\" data-row=\"'+par+'\"'+prevdisp+'>« prev</a>';\n\t\t\t\n\t\t}\t\n\t\thtml += '</div>';\n\t\t\n\t\t$('#myModal').modal();\n\t\t$('#myModal').on('shown.bs.modal', function(){\n\t\t\t$('#myModal .modal-body').html(html);\n\t\t\t//new code\n\t\t\t$('a.controls').trigger('click');\n\t\t})\n\t\t$('#myModal').on('hidden.bs.modal', function(){\n\t\t\t$('#myModal .modal-body').html('');\n\t\t});\n\t\t\n\t\t\n\t\t\n\t\t\n });\t\n})\n \n \n$(document).on('click', 'a.controls', function(){\n\t\n\tvar index = $(this).attr('href');\n\tvar rowname = $(this).attr('data-row');\n\tvar src = $('ul.'+rowname+' li:nth-child('+ index +') img').attr('src'); \n\t\t\t\n\t$('.modal-body img').attr('src', src);\n\t\n\tvar newPrevIndex = parseInt(index) - 1; \n\tvar newNextIndex = parseInt(newPrevIndex) + 2; \n\t\n\tif($(this).hasClass('previous')){ \n\t\t$(this).attr('href', newPrevIndex); \n\t\t$('a.next').attr('href', newNextIndex);\n\t}else{\n\t\t$(this).attr('href', newNextIndex); \n\t\t$('a.previous').attr('href', newPrevIndex);\n\t}\n\t\n\tvar total = $('ul.'+rowname+' li').length + 1; \n\t//hide next button\n\t\n\tif(total === newNextIndex){\n\t\t$('a.next').hide();\n\t}else{\n\t\t$('a.next').show()\n\t} \n\t//hide previous button\n\tif(newPrevIndex === 0){\n\t\t$('a.previous').hide();\n\t}else{\n\t\t$('a.previous').show()\n\t}\n\t\n\t\n\treturn false;\n});\n\t\t\t\t\t\t\t\t</script>\n\t\t\t\t\t\t\t\t*/ ?> \n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t}",
"function findCandles($Arr) {\n\t\t$ar = array(1, 2, 3, 4,4);\n\t\t//$count= count($ar);\n\t\t$maxar= max($ar);\n\t\t$c = count($ar);\n$Arr = 0;\n$count = 0;\nfor($i=0;$i<$c;$i++){\n if($Arr<$ar[$i]){\n $Arr = $ar[$i];\n \n }\n}\nfor($j=0;$j<$c;$j++){\n if($Arr == $ar[$j]){\n $count+=1;\n }\n}\nreturn $count;\n\t}",
"public function get_section_number($position)\n\n {\n \t// Works for current position and destination position\n\n \treturn \\DB::table('sections')\n \t->select('id')\n \t->where('position', '<', $position)\n \t->where('user_id',\\Auth::id())\n \t->count();\n\n }",
"public function get($userId, $shelf, $optParams = array())\n {\n $params = array('userId' => $userId, 'shelf' => $shelf);\n $params = array_merge($params, $optParams);\n return $this->call('get', array($params), \"Books_Bookshelf\");\n }",
"function interpolationSearch($arr, $x, $n) \n{\n $low = 0; \n $high = $n - 1; \n \n // Since array is sorted, an element present in array must be in range defined by corner \n while ($low <= $high and $x >= $arr[$low] and $x <= $arr[$high]) { \n if ($low == $high) { \n if ($arr[$low] == $x) return $low; \n return -1; \n } \n // Probing the position with keeping uniform distribution in mind\n $m = intval($low + (($x - $arr[$low]) * ($high - $low) / ($arr[$high] - $arr[$low]))); \n \n // Condition of target found \n if ($arr[$m] == $x) \n { \n return $m; \n } \n \n // If x is larger, x is in upper part \n elseif ($arr[$m] < $x) \n { \n $low = $m + 1; \n } \n \n // If x is smaller, x is in the lower part \n else\n { \n $high = $m - 1; \n } \n } \n \n return -1; \n}",
"public function hasQuantityFor($book);",
"function addBook($shelf_id,$book_id){\n if ($shelf_id > 3){\n error_log(\"Invalid shelf id \" . (string)($shelf_id));\n echo \"Invalid shelf id \" . (string)($shelf_id);\n }\n // Fetch # books already in shelf\n if ($this->countBooksInShelf($shelf_id) > 20){\n error_log(\"Too many books in Shelf\");\n echo \"Too many books in Shelf\";\n }\n // TODO: Check if book already exists! (No constraints set in DB)\n else{\n $sql = \"INSERT INTO shelves (ShelfId, ShelfName, BookId) VALUES (%d,'%s',%d);\";\n $sql = sprintf($sql,$shelf_id,$this->shelves[$shelf_id],$book_id);\n $this->db_handle->run($sql);\n }\n }",
"protected function getLastUnit() {\n $efq = new \\EntityFieldQuery();\n $efq->entityCondition('entity_type', 'rooms_unit')\n ->entityOrderBy('entity_id', 'DESC')\n ->range(0, 1);\n $result = $efq->execute();\n if (isset($result['rooms_unit'])) {\n $return = key($result['rooms_unit']);\n return $return;\n }\n else {\n throw new \\RuntimeException('Unable to find the last booking');\n }\n }",
"public function lendBook($book);",
"public function hasSellCount(){\n return $this->_has(11);\n }",
"public function search($key) {\n $low = 0;\n $high = count($this->items) - 1;\n while ($low <= $high) {\n $mid = (int)(($low + $high) / 2);\n $midVal = $this->items[$mid]->key;\n\n switch ($this->compare($midVal, $key)) {\n case 1: {\n $high = $mid - 1;\n break;\n }\n case -1: {\n $low = $mid + 1;\n break;\n }\n default : {\n return $mid; // key found\n }\n }\n }\n return -($low + 1); // key not found.\n }",
"function findIt($seq)\n{ \n $seq_value_count = array_count_values($seq);\n foreach ($seq_value_count as $key => $value) {\n if($value % 2 == 1) return $key;\n }\n}",
"function nrOfOccupiedSeatsAdjacentTo(&$seats, $row, $col){\n $ret = 0;\n\n if($seats[$row-1][$col-1] == '#')\n ++$ret;\n if($seats[$row-1][$col] == '#')\n ++$ret;\n if($seats[$row-1][$col+1] == '#')\n ++$ret;\n if($seats[$row][$col-1] == '#')\n ++$ret;\n if($seats[$row][$col+1] == '#')\n ++$ret;\n if($seats[$row+1][$col-1] == '#')\n ++$ret;\n if($seats[$row+1][$col] == '#')\n ++$ret;\n if($seats[$row+1][$col+1] == '#')\n ++$ret;\n\n return $ret;\n}",
"function jumpSearch($arr, $x, $n) \n{ \n // Finding block size to be jumped \n $step = sqrt($n); \n \n // Finding the block where element is \n // present (if it is present) \n $prev = 0; \n while ($arr[min($step, $n)-1] < $x) \n { \n $prev = $step; \n $step += sqrt($n); \n if ($prev >= $n) \n return -1; \n } \n \n // Doing a linear search for x in block \n // beginning with prev. \n while ($arr[$prev] < $x) \n { \n $prev++; \n \n // If we reached next block or end of \n // array, element is not present. \n if ($prev == min($step, $n)) \n return -1; \n } \n // If element is found \n if ($arr[$prev] == $x) \n return $prev; \n \n return -1; \n}",
"private function getLastIndex(){\n \t$query = (new Stage)->newQuery();\n \t$query = $query->orderBy('position','desc');\n \t$obj = $query->first();\n \tif (is_null($obj)){\n \t\treturn 0;\n\t }\n\t return ($obj->position * 1);\n }",
"function get_number_shirts($sort, $search) {\r\n $conn = get_db_conn();\r\n \r\n $query = 'SELECT count(*) FROM `shirts` where `ID` > 0 ';\r\n \r\n\tif ($search != '') {\r\n\t\t$query .= sprintf(' AND `name` like \\'%%%s%%\\' ', mysql_real_escape_string($search, $conn));\r\n\t}\r\n\r\n $res = mysql_query($query, $conn);\r\n $row = mysql_fetch_assoc($res);\r\n \r\n return $row['count(*)'];\r\n }",
"function em_bookings_get_pending_spaces($count, $EM_Bookings) {\n\t\tforeach ($EM_Bookings->bookings as $EM_Booking) {\n\t\t\tif ($EM_Booking->booking_status == $this->status && $this->uses_gateway($EM_Booking)) {\n\t\t\t\t$count += $EM_Booking->get_spaces();\n\t\t\t}\n\t\t}\n\t\treturn $count;\n\t}"
] | [
"0.5467085",
"0.51276666",
"0.5070199",
"0.48783106",
"0.4868541",
"0.48066103",
"0.47550365",
"0.46963227",
"0.46644",
"0.46599177",
"0.46454614",
"0.46220595",
"0.45321718",
"0.45181885",
"0.4495091",
"0.44495022",
"0.4413599",
"0.44093496",
"0.4401973",
"0.43919292",
"0.4387363",
"0.4363937",
"0.43548962",
"0.43518054",
"0.43320245",
"0.43200055",
"0.42995995",
"0.42960075",
"0.42931482",
"0.42555976"
] | 0.64569664 | 0 |
A stateful generator WebSocket frame parser. | private function parser(): \Generator {
// @TODO add minimum average frame size rate threshold to prevent tiny-frame DoS
$maxFrameSize = $this->options->getMaximumFrameSize();
$maxMsgSize = $this->options->getMaximumMessageSize();
$textOnly = $this->options->isTextOnly();
$doUtf8Validation = $validateUtf8 = $this->options->isValidateUtf8();
$dataMsgBytesRecd = 0;
$savedBuffer = '';
$buffer = yield;
$offset = 0;
$bufferSize = \strlen($buffer);
$frames = 0;
while (1) {
if ($bufferSize < 2) {
$buffer = \substr($buffer, $offset);
$offset = 0;
do {
$buffer .= yield $frames;
$bufferSize = \strlen($buffer);
$frames = 0;
} while ($bufferSize < 2);
}
$firstByte = \ord($buffer[$offset]);
$secondByte = \ord($buffer[$offset + 1]);
$offset += 2;
$bufferSize -= 2;
$fin = (bool) ($firstByte & 0b10000000);
$rsv = ($firstByte & 0b01110000) >> 4;
$opcode = $firstByte & 0b00001111;
$isMasked = (bool) ($secondByte & 0b10000000);
$maskingKey = null;
$frameLength = $secondByte & 0b01111111;
if ($rsv !== 0) {
$this->onParsedError(Code::PROTOCOL_ERROR, 'RSV must be 0 if no extensions are negotiated');
}
if ($opcode >= 3 && $opcode <= 7) {
$this->onParsedError(Code::PROTOCOL_ERROR, 'Use of reserved non-control frame opcode');
}
if ($opcode >= 11 && $opcode <= 15) {
$this->onParsedError(Code::PROTOCOL_ERROR, 'Use of reserved control frame opcode');
}
$isControlFrame = $opcode >= 0x08;
if ($validateUtf8 && $opcode !== self::OP_CONT && !$isControlFrame) {
$doUtf8Validation = $opcode === self::OP_TEXT;
}
if ($frameLength === 0x7E) {
if ($bufferSize < 2) {
$buffer = \substr($buffer, $offset);
$offset = 0;
do {
$buffer .= yield $frames;
$bufferSize = \strlen($buffer);
$frames = 0;
} while ($bufferSize < 2);
}
$frameLength = \unpack('n', $buffer[$offset] . $buffer[$offset + 1])[1];
$offset += 2;
$bufferSize -= 2;
} elseif ($frameLength === 0x7F) {
if ($bufferSize < 8) {
$buffer = \substr($buffer, $offset);
$offset = 0;
do {
$buffer .= yield $frames;
$bufferSize = \strlen($buffer);
$frames = 0;
} while ($bufferSize < 8);
}
$lengthLong32Pair = \unpack('N2', \substr($buffer, $offset, 8));
$offset += 8;
$bufferSize -= 8;
if (PHP_INT_MAX === 0x7fffffff) {
if ($lengthLong32Pair[1] !== 0 || $lengthLong32Pair[2] < 0) {
$this->onParsedError(
Code::MESSAGE_TOO_LARGE,
'Received payload exceeds maximum allowable size'
);
return;
}
$frameLength = $lengthLong32Pair[2];
} else {
$frameLength = ($lengthLong32Pair[1] << 32) | $lengthLong32Pair[2];
if ($frameLength < 0) {
$this->onParsedError(
Code::PROTOCOL_ERROR,
'Most significant bit of 64-bit length field set'
);
return;
}
}
}
if ($isMasked) {
$this->onParsedError(
Code::PROTOCOL_ERROR,
'Payload must not be masked to client'
);
return;
}
if ($isControlFrame) {
if (!$fin) {
$this->onParsedError(
Code::PROTOCOL_ERROR,
'Illegal control frame fragmentation'
);
return;
}
if ($frameLength > 125) {
$this->onParsedError(
Code::PROTOCOL_ERROR,
'Control frame payload must be of maximum 125 bytes or less'
);
return;
}
}
if ($maxFrameSize && $frameLength > $maxFrameSize) {
$this->onParsedError(
Code::MESSAGE_TOO_LARGE,
'Received payload exceeds maximum allowable size'
);
return;
}
if ($maxMsgSize && ($frameLength + $dataMsgBytesRecd) > $maxMsgSize) {
$this->onParsedError(
Code::MESSAGE_TOO_LARGE,
'Received payload exceeds maximum allowable size'
);
return;
}
if ($textOnly && $opcode === 0x02) {
$this->onParsedError(
Code::UNACCEPTABLE_TYPE,
'BINARY opcodes (0x02) not accepted'
);
return;
}
while ($bufferSize < $frameLength) {
$chunk = yield $frames;
$buffer .= $chunk;
$bufferSize += \strlen($chunk);
$frames = 0;
}
if (!$isControlFrame) {
$dataMsgBytesRecd += $frameLength;
}
$payload = \substr($buffer, $offset, $frameLength);
$offset += $frameLength;
$bufferSize -= $frameLength;
if ($isControlFrame) {
$this->onParsedControlFrame($opcode, $payload);
} else {
if ($savedBuffer !== '') {
$payload = $savedBuffer . $payload;
$savedBuffer = '';
}
if ($doUtf8Validation) {
if ($fin) {
$i = \preg_match('//u', $payload) ? 0 : 8;
} else {
$string = $payload;
for ($i = 0; !\preg_match('//u', $payload) && $i < 8; $i++) {
$payload = \substr($payload, 0, -1);
}
if ($i > 0) {
$savedBuffer = \substr($string, -$i);
}
}
if ($i === 8) {
$this->onParsedError(
Code::INCONSISTENT_FRAME_DATA_TYPE,
'Invalid TEXT data; UTF-8 required'
);
return;
}
}
if ($fin) {
$dataMsgBytesRecd = 0;
}
$this->onParsedData($opcode, $payload, $fin);
if ($this->parseError) {
return;
}
}
$frames++;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function parseFrame();",
"public function parse()\n {\n $offset = 0;\n $len = strlen($this->buffer);\n while (($offset < $len) && (($frameEnd = $this->getFrameEnd($offset)) !== false)) {\n $frameSource = substr($this->buffer, $offset, $frameEnd - $offset);\n $offset = $frameEnd + strlen(self::FRAME_END);\n $this->frames[] = $this->parseToFrame($frameSource);\n }\n if ($offset > 0) {\n $this->buffer = substr($this->buffer, $offset);\n }\n return $offset > 0;\n }",
"protected function receive_fragment() {\n $data = $this->read(2);\n\n // Is this the final fragment? // Bit 0 in byte 0\n /// @todo Handle huge payloads with multiple fragments.\n $final = (boolean) (ord($data[0]) & 1 << 7);\n\n // Should be unused, and must be false… // Bits 1, 2, & 3\n $rsv1 = (boolean) (ord($data[0]) & 1 << 6);\n $rsv2 = (boolean) (ord($data[0]) & 1 << 5);\n $rsv3 = (boolean) (ord($data[0]) & 1 << 4);\n\n // Parse opcode\n $opcode_int = ord($data[0]) & 31; // Bits 4-7\n $opcode_ints = array_flip(self::$opcodes);\n if (!array_key_exists($opcode_int, $opcode_ints)) {\n throw new ConnectionException(\"Bad opcode in websocket frame: $opcode_int\");\n }\n $opcode = $opcode_ints[$opcode_int];\n\n // record the opcode if we are not receiving a continutation fragment\n if ($opcode !== 'continuation') {\n $this->last_opcode = $opcode;\n }\n\n // Masking?\n $mask = (boolean) (ord($data[1]) >> 7); // Bit 0 in byte 1\n\n $payload = '';\n\n // Payload length\n $payload_length = (integer) ord($data[1]) & 127; // Bits 1-7 in byte 1\n if ($payload_length > 125) {\n if ($payload_length === 126) $data = $this->read(2); // 126: Payload is a 16-bit unsigned int\n else $data = $this->read(8); // 127: Payload is a 64-bit unsigned int\n $payload_length = bindec(self::sprintB($data));\n }\n\n // Get masking key.\n if ($mask) $masking_key = $this->read(4);\n\n // Get the actual payload, if any (might not be for e.g. close frames.\n if ($payload_length > 0) {\n $data = $this->read($payload_length);\n\n if ($mask) {\n // Unmask payload.\n for ($i = 0; $i < $payload_length; $i++) $payload .= ($data[$i] ^ $masking_key[$i % 4]);\n }\n else $payload = $data;\n }\n\n if ($opcode === 'close') {\n // Get the close status.\n if ($payload_length >= 2) {\n $status_bin = $payload[0] . $payload[1];\n $status = bindec(sprintf(\"%08b%08b\", ord($payload[0]), ord($payload[1])));\n $this->close_status = $status;\n $payload = substr($payload, 2);\n\n if (!$this->is_closing) $this->send($status_bin . 'Close acknowledged: ' . $status, 'close', true); // Respond.\n }\n\n if ($this->is_closing) $this->is_closing = false; // A close response, all done.\n\n // And close the socket.\n fclose($this->socket);\n $this->is_connected = false;\n }\n\n // if this is not the last fragment, then we need to save the payload\n if (!$final) {\n $this->huge_payload .= $payload;\n return null;\n }\n // this is the last fragment, and we are processing a huge_payload\n else if ($this->huge_payload) {\n // sp we need to retreive the whole payload\n $payload = $this->huge_payload .= $payload;\n $this->huge_payload = null;\n }\n\n return $payload;\n }",
"function mWS(){\n try {\n $_type = t018llstarLexer::T_WS;\n $_channel = t018llstarLexer::DEFAULT_TOKEN_CHANNEL;\n // runtime/Php/test/Antlr/Tests/grammers/t018llstar.g\n // runtime/Php/test/Antlr/Tests/grammers/t018llstar.g\n {\n // runtime/Php/test/Antlr/Tests/grammers/t018llstar.g\n $cnt3=0;\n //loop3:\n do {\n $alt3=2;\n $LA3_0 = $this->input->LA(1);\n\n if ( (($LA3_0>=$this->getToken('9') && $LA3_0<=$this->getToken('10'))||$LA3_0==$this->getToken('13')||$LA3_0==$this->getToken('32')) ) {\n $alt3=1;\n }\n\n\n switch ($alt3) {\n \tcase 1 :\n \t // runtime/Php/test/Antlr/Tests/grammers/t018llstar.g\n \t {\n \t if ( ($this->input->LA(1)>=$this->getToken('9') && $this->input->LA(1)<=$this->getToken('10'))||$this->input->LA(1)==$this->getToken('13')||$this->input->LA(1)==$this->getToken('32') ) {\n \t $this->input->consume();\n\n \t } else {\n \t $mse = new MismatchedSetException(null,$this->input);\n \t $this->recover($mse);\n \t throw $mse;}\n\n\n \t }\n \t break;\n\n \tdefault :\n \t if ( $cnt3 >= 1 ) break 2;//loop3;\n $eee =\n new EarlyExitException(3, $this->input);\n throw $eee;\n }\n $cnt3++;\n } while (true);\n\n $_channel=self::$HIDDEN;\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"function mWS(){\r\n try {\r\n $_type = PolyLexer::$WS;\r\n $_channel = PolyLexer::$DEFAULT_TOKEN_CHANNEL;\r\n // Poly.g:25:4: ( ( ' ' | '\\\\t' | '\\\\r' | '\\\\n' )+ ) \r\n // Poly.g:25:6: ( ' ' | '\\\\t' | '\\\\r' | '\\\\n' )+ \r\n {\r\n // Poly.g:25:6: ( ' ' | '\\\\t' | '\\\\r' | '\\\\n' )+ \r\n $cnt3=0;\r\n //loop3:\r\n do {\r\n $alt3=2;\r\n $LA3_0 = $this->input->LA(1);\r\n\r\n if ( (($LA3_0>=$this->getToken('9') && $LA3_0<=$this->getToken('10'))||$LA3_0==$this->getToken('13')||$LA3_0==$this->getToken('32')) ) {\r\n $alt3=1;\r\n }\r\n\r\n\r\n switch ($alt3) {\r\n \tcase 1 :\r\n \t // Poly.g: \r\n \t {\r\n \t if ( ($this->input->LA(1)>=$this->getToken('9') && $this->input->LA(1)<=$this->getToken('10'))||$this->input->LA(1)==13||$this->input->LA(1)==32 ) {\r\n \t $this->input->consume();\r\n\r\n \t }\r\n \t else {\r\n \t $mse = new MismatchedSetException(null,$this->input);\r\n \t $this->recover($mse);\r\n \t throw $mse;}\r\n\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t if ( $cnt3 >= 1 ) break 2;//loop3;\r\n $eee =\r\n new EarlyExitException(3, $this->input);\r\n throw $eee;\r\n }\r\n $cnt3++;\r\n } while (true);\r\n\r\n skip();\r\n\r\n }\r\n\r\n $this->state->type = $_type;\r\n $this->state->channel = $_channel;\r\n }\r\n catch(Exception $e){\r\n throw $e;\r\n }\r\n }",
"public function getEvents()\n {\n /* initialize empty buffer */\n $buffer = '';\n\n /* bring body of response */\n $body = $this->response->getBody();\n\n /* infinte loop */\n while (true) {\n /* if server close connection - try to reconnect */\n if ($body->eof()) {\n /* wait retry period before reconnection */\n sleep($this->retry / 1000);\n\n /* reconnect */\n $this->connect();\n\n /* clear buffer since there is no sense in partial message */\n $buffer = '';\n }\n /* start read into stream */\n $buffer .= $body->read(1);\n\n if (preg_match(self::END_OF_MESSAGE, $buffer)) {\n $parts = preg_split(self::END_OF_MESSAGE, $buffer, 2);\n\n $rawMessage = $parts[0];\n $remaining = $parts[1];\n\n $buffer = $remaining;\n\n /**\n * Save event into StreamEvent\n *\n * @var StreamEvent $event\n */\n $event = StreamEvent::parse($rawMessage);\n\n yield $event;\n }\n }\n }",
"protected function receiveFragment(): array\n {\n $data = $this->read(2);\n list ($byte_1, $byte_2) = array_values(unpack('C*', $data));\n\n $final = (bool)($byte_1 & 0b10000000); // Final fragment marker.\n $rsv = $byte_1 & 0b01110000; // Unused bits, ignore\n\n // Parse opcode\n $opcode_int = $byte_1 & 0b00001111;\n $opcode_ints = array_flip(self::$opcodes);\n if (!array_key_exists($opcode_int, $opcode_ints)) {\n $warning = \"Bad opcode in websocket frame: {$opcode_int}\";\n $this->logger->warning($warning);\n throw new ConnectionException($warning, ConnectionException::BAD_OPCODE);\n }\n $opcode = $opcode_ints[$opcode_int];\n\n // Masking bit\n $mask = (bool)($byte_2 & 0b10000000);\n\n $payload = '';\n\n // Payload length\n $payload_length = $byte_2 & 0b01111111;\n\n if ($payload_length > 125) {\n if ($payload_length === 126) {\n $data = $this->read(2); // 126: Payload is a 16-bit unsigned int\n $payload_length = current(unpack('n', $data));\n } else {\n $data = $this->read(8); // 127: Payload is a 64-bit unsigned int\n $payload_length = current(unpack('J', $data));\n }\n }\n\n // Get masking key.\n if ($mask) {\n $masking_key = $this->read(4);\n }\n\n // Get the actual payload, if any (might not be for e.g. close frames.\n if ($payload_length > 0) {\n $data = $this->read($payload_length);\n\n if ($mask) {\n // Unmask payload.\n for ($i = 0; $i < $payload_length; $i++) {\n $payload .= ($data[$i] ^ $masking_key[$i % 4]);\n }\n } else {\n $payload = $data;\n }\n }\n\n $this->logger->debug(\"Read '{opcode}' frame\", [\n 'opcode' => $opcode,\n 'final' => $final,\n 'content-length' => strlen($payload),\n ]);\n\n // if we received a ping, send a pong and wait for the next message\n if ($opcode === 'ping') {\n $this->logger->debug(\"Received 'ping', sending 'pong'.\");\n $this->send($payload, 'pong', true);\n return [$payload, true, $opcode];\n }\n\n // if we received a pong, wait for the next message\n if ($opcode === 'pong') {\n $this->logger->debug(\"Received 'pong'.\");\n return [$payload, true, $opcode];\n }\n\n if ($opcode === 'close') {\n $status_bin = '';\n $status = '';\n // Get the close status.\n $status_bin = '';\n $status = '';\n if ($payload_length > 0) {\n $status_bin = $payload[0] . $payload[1];\n $status = current(unpack('n', $payload));\n $this->close_status = $status;\n }\n // Get additional close message\n if ($payload_length >= 2) {\n $payload = substr($payload, 2);\n }\n\n $this->logger->debug(\"Received 'close', status: {$this->close_status}.\");\n\n if ($this->is_closing) {\n $this->is_closing = false; // A close response, all done.\n } else {\n $this->send($status_bin . 'Close acknowledged: ' . $status, 'close', true); // Respond.\n }\n\n // Close the socket.\n fclose($this->socket);\n\n // Closing should not return message.\n return [$payload, true, $opcode];\n }\n\n return [$payload, $final, $opcode];\n }",
"function parse() {\n\n\t\t$first_lele = strpos($this->data, $this->LE.$this->LE);\n\t\t$header_block = trim(substr($this->data, 0, $first_lele));\n\t\t$body_block = trim(substr($this->data, $first_lele));\n\n\t\t$this->readHeaders($header_block);\n\t\t$this->readBody($body_block);\n\t}",
"abstract protected function decodeFramePayloadFromBuffer(): void;",
"function getFrame() {\n\t\tif (@feof($this->socket)) die('Couldn\\'t get frame - closed by remote server');\n\n\t\t// Read the 4 first bytes (reply length)\n\t\t$hdr = fread($this->socket, 4);\n\n\t\tif (empty($hdr) && feof($this->socket)) {\n\n\t\t\tdie('Couldn\\'t get HDR - connection closed by remote server');\n\n\t\t} elseif (empty($hdr)) {\n\n\t\t\tdie('Error reading from server - connection closed.');\n\n\t\t} else {\n\n\t\t\t$unpacked = unpack('N', $hdr);\n\t\t\t$length = $unpacked[1];\n\t\t\tif ($length < 5) {\n\t\t\t\tdie(sprintf('Got a bad frame header length of %d bytes from server', $length));\n\t\t\t} else {\n\t\t\t\t// Read everything except the 4 bytes we read before.\n\t\t\t\t$xml = fread($this->socket, ($length - 4));\n\t\t\t\t$this->latest = $xml; // Store the latest XML\n\t\t\t\t$this->_logframe($xml); // And then log the frame.\n $dom = new DOMDocument;\n $dom->preserveWhiteSpace = false;\n $dom->formatOutput = true;\n $dom->loadXML($xml);\n\n file_put_contents('com_output.xml', $dom->saveXML()\n, FILE_APPEND);\n //return \n \n return $xml;\n\t\t\t}\n\n\t\t}\n\t}",
"private function parseToFrame($source)\n {\n list ($header, $body) = explode(\"\\n\\n\", ltrim($source), 2);\n $header = explode(\"\\n\", $header);\n $headers = array();\n $command = null;\n foreach ($header as $v) {\n if (isset($command)) {\n list ($name, $value) = explode(':', $v, 2);\n $headers[$name] = $value;\n } else {\n $command = $v;\n }\n }\n $frame = new Frame($command, $headers, trim($body));\n if (isset($frame->headers['transformation']) && $frame->headers['transformation'] == 'jms-map-json') {\n return new Map($frame);\n }\n\n return $frame;\n }",
"public\n function readFrame() {\n $this->logger->debug('readFrame begin');\n /**\n * If the buffer is empty, we might have a frame in the socket. Check\n * the buffer first because if we have a buffered message we don't\n * want to waste CPU on the socket read timeout.\n */\n if (!$this->_bufferContainsMessage() && !$this->hasFrameToRead()) {\n return false;\n }\n\n $rb = $this->_tcp_buffer_size;\n $end = false;\n\n do {\n $this->logger->debug('do {');\n $data = '';\n // Only read from the socket if we don't have a complete message in the buffer.\n if (!$this->_bufferContainsMessage()) {\n $this->logger->debug('!$this->_bufferContainsMessage()');\n $read = fread($this->_socket, $rb);\n\n if ($read === false || ($read === \"\" && feof($this->_socket))) {\n $this->_reconnect();\n\n return $this->readFrame();\n }\n $this->_appendToBuffer($read);\n }\n\n // If we have a complete message, pull the first whole message out.\n // Leave remaining partial or whole messages in the buffer.\n if ($this->_bufferContainsMessage()) {\n $end = true;\n $data = $this->_extractNextMessage();\n }\n $len = mb_strlen($data, '8bit');\n } while ($len < 2 || $end == false);\n\n $this->logger->debug(\"Read frame\", ['frame' => $data]);\n\n\n list ($header, $body) = explode(\"\\n\\n\", $data, 2);\n $header = explode(\"\\n\", $header);\n $headers = [];\n $command = null;\n foreach ($header as $v) {\n\n if (isset($command)) {\n list ($name, $value) = explode(':', $v, 2);\n $headers[$name] = $value;\n }\n else {\n $command = $v;\n }\n }\n $frame = new Frame($command, $headers, $body);\n\n if (isset($frame->headers['transformation']) &&\n ($frame->headers['transformation'] == 'jms-map-xml' ||\n $frame->headers['transformation'] == 'jms-map-json')\n ) {\n return new Message\\Map($frame, $headers);\n }\n\n return $frame;\n }",
"private function parseFrameData()\n {\n $this->frameSources[$this->frameNumber][\"disposal_method\"] = $this->getImageDataBit(\"ext\", 3, 3, 3);\n $this->frameSources[$this->frameNumber][\"user_input_flag\"] = $this->getImageDataBit(\"ext\", 3, 6, 1);\n $this->frameSources[$this->frameNumber][\"transparent_color_flag\"] = $this->getImageDataBit(\"ext\", 3, 7, 1);\n $this->frameSources[$this->frameNumber][\"delay_time\"] = $this->dualByteVal($this->getImageDataByte(\"ext\", 4, 2));\n $this->totalDuration += (int) $this->frameSources[$this->frameNumber][\"delay_time\"];\n $this->frameSources[$this->frameNumber][\"transparent_color_index\"] = ord($this->getImageDataByte(\"ext\", 6, 1));\n $this->frameSources[$this->frameNumber][\"offset_left\"] = $this->dualByteVal($this->getImageDataByte(\"dat\", 1, 2));\n $this->frameSources[$this->frameNumber][\"offset_top\"] = $this->dualByteVal($this->getImageDataByte(\"dat\", 3, 2));\n $this->frameSources[$this->frameNumber][\"width\"] = $this->dualByteVal($this->getImageDataByte(\"dat\", 5, 2));\n $this->frameSources[$this->frameNumber][\"height\"] = $this->dualByteVal($this->getImageDataByte(\"dat\", 7, 2));\n $this->frameSources[$this->frameNumber][\"local_color_table_flag\"] = $this->getImageDataBit(\"dat\", 9, 0, 1);\n $this->frameSources[$this->frameNumber][\"interlace_flag\"] = $this->getImageDataBit(\"dat\", 9, 1, 1);\n $this->frameSources[$this->frameNumber][\"sort_flag\"] = $this->getImageDataBit(\"dat\", 9, 2, 1);\n $this->frameSources[$this->frameNumber][\"color_table_size\"] = pow(2, $this->getImageDataBit(\"dat\", 9, 5, 3) + 1) * 3;\n $this->frameSources[$this->frameNumber][\"color_table\"] = substr($this->frameSources[$this->frameNumber][\"imagedata\"], 10, $this->frameSources[$this->frameNumber][\"color_table_size\"]);\n $this->frameSources[$this->frameNumber][\"lzw_code_size\"] = ord($this->getImageDataByte(\"dat\", 10, 1));\n\n $this->framePositions[$this->frameNumber] = array(\n 'x' => $this->frameSources[$this->frameNumber][\"offset_left\"],\n 'y' => $this->frameSources[$this->frameNumber][\"offset_top\"],\n );\n\n $this->frameDimensions[$this->frameNumber] = array(\n 'width' => $this->frameSources[$this->frameNumber][\"width\"],\n 'height' => $this->frameSources[$this->frameNumber][\"height\"],\n );\n\n // Decoding\n $this->orgvars[$this->frameNumber][\"transparent_color_flag\"] = $this->frameSources[$this->frameNumber][\"transparent_color_flag\"];\n $this->orgvars[$this->frameNumber][\"transparent_color_index\"] = $this->frameSources[$this->frameNumber][\"transparent_color_index\"];\n $this->orgvars[$this->frameNumber][\"delay_time\"] = $this->frameSources[$this->frameNumber][\"delay_time\"];\n $this->orgvars[$this->frameNumber][\"disposal_method\"] = $this->frameSources[$this->frameNumber][\"disposal_method\"];\n $this->orgvars[$this->frameNumber][\"offset_left\"] = $this->frameSources[$this->frameNumber][\"offset_left\"];\n $this->orgvars[$this->frameNumber][\"offset_top\"] = $this->frameSources[$this->frameNumber][\"offset_top\"];\n\n // Updating the max width\n if ($this->gifMaxWidth < $this->frameSources[$this->frameNumber][\"width\"]) {\n\n $this->gifMaxWidth = $this->frameSources[$this->frameNumber][\"width\"];\n }\n\n // Updating the max height\n if ($this->gifMaxHeight < $this->frameSources[$this->frameNumber][\"height\"]) {\n\n $this->gifMaxHeight = $this->frameSources[$this->frameNumber][\"height\"];\n }\n }",
"function SAXY_Parser() {\r\n\t\t$this->SAXY_Parser_Base();\r\n\t\t$this->state = SAXY_STATE_PROLOG_NONE;\r\n\t}",
"public function initParsing() {\n\t\t$fName = __METHOD__;\n\t\t$this->profileIn($fName);\n\t\tglobal $w2lTags;\n\t\tglobal $w2lParserFunctions;\n\t\tglobal $w2lConfig;\n\n\t\tif ($this->initiated == true ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\twfRunHooks('w2lInitParser', array(&$this));\n\t\t\n\t\t$this->unique = $this->uniqueString();\n\t\t\n\t\tforeach($w2lTags as $key => $value) {\n\t\t\t$this->addTagCallback($key, $value);\n\t\t}\n\n\t\tforeach($w2lParserFunctions as $key => $value) {\n\t\t\t$this->addParserFunction($key, $value);\n\t\t}\n\n\t\tforeach($w2lConfig as $key => $value) {\n\t\t\t$this->setVal($key, $value);\n\t\t}\n\n\t\t//$this->addCoreParserFunction();\n\t\t$this->addCoreParserFunction( 'int', array( 'CoreParserFunctions', 'intFunction' ) );\n\t\t$this->addCoreParserFunction( 'ns', array( 'CoreParserFunctions', 'ns' ) );\n\t\t$this->addCoreParserFunction( 'urlencode', array( 'CoreParserFunctions', 'urlencode' ) );\n\t\t$this->addCoreParserFunction( 'lcfirst', array( 'CoreParserFunctions', 'lcfirst' ) );\n\t\t$this->addCoreParserFunction( 'ucfirst', array( 'CoreParserFunctions', 'ucfirst' ) );\n\t\t$this->addCoreParserFunction( 'lc', array( 'CoreParserFunctions', 'lc' ) );\n\t\t$this->addCoreParserFunction( 'uc', array( 'CoreParserFunctions', 'uc' ) );\n\t\t$this->addCoreParserFunction( 'localurl', array( 'CoreParserFunctions', 'localurl' ) );\n\t\t$this->addCoreParserFunction( 'localurle', array( 'CoreParserFunctions', 'localurle' ) );\n\t\t$this->addCoreParserFunction( 'fullurl', array( 'CoreParserFunctions', 'fullurl' ) );\n\t\t$this->addCoreParserFunction( 'fullurle', array( 'CoreParserFunctions', 'fullurle' ) );\n\t\t//$this->addCoreParserFunction( 'formatnum', array( 'CoreParserFunctions', 'formatnum' ) );\n\t\t//$this->addCoreParserFunction( 'grammar', array( 'CoreParserFunctions', 'grammar' ) );\n\t\t//$this->addCoreParserFunction( 'plural', array( 'CoreParserFunctions', 'plural' ) );\n\t\t$this->addCoreParserFunction( 'numberofpages', array( 'CoreParserFunctions', 'numberofpages' ) );\n\t\t$this->addCoreParserFunction( 'numberofusers', array( 'CoreParserFunctions', 'numberofusers' ) );\n\t\t$this->addCoreParserFunction( 'numberofarticles', array( 'CoreParserFunctions', 'numberofarticles' ) );\n\t\t$this->addCoreParserFunction( 'numberoffiles', array( 'CoreParserFunctions', 'numberoffiles' ) );\n\t\t$this->addCoreParserFunction( 'numberofadmins', array( 'CoreParserFunctions', 'numberofadmins' ) );\n\t\t$this->addCoreParserFunction( 'language', array( 'CoreParserFunctions', 'language' ) );\n\t\t$this->addCoreParserFunction( 'padleft', array( 'CoreParserFunctions', 'padleft' ) );\n\t\t$this->addCoreParserFunction( 'padright', array( 'CoreParserFunctions', 'padright' ) );\n\t\t$this->addCoreParserFunction( 'anchorencode', array( 'CoreParserFunctions', 'anchorencode' ) );\n\t\t$this->addCoreParserFunction( 'special', array( 'CoreParserFunctions', 'special' ) );\n\t\t//$this->addCoreParserFunction( 'defaultsort', array( 'CoreParserFunctions', 'defaultsort' ) );\n\t\t$this->addCoreParserFunction( 'pagesinnamespace', array( 'CoreParserFunctions', 'pagesinnamespace' ) );\n\n\t\t// And here we add some replace-rules\n\t\t$this->addSimpleReplace(\" - \",\" -- \");\n\t\t$this->addSimpleReplace(\" -\\n\",\" --\\n\");\n\t\t$this->addSimpleReplace(\"\\n- \", \"\\n-- \");\n\n\t\t$this->addSimpleReplace(\"...\",\"{\\dots}\");\n\n\t\t\n\t\tinclude('w2lChars.php');\n\t\tinclude('w2lQuotes.php');\n\t\t\n\t\twfRunHooks('w2lInitParserFinish', array(&$this));\n\n\t\t$this->initiated = true;\n\t\t$this->profileOut($fName);\n\t\treturn;\n\t}",
"abstract public function parse($buffer);",
"abstract protected function generatePayload();",
"protected function parse($src) {\n return (new Parser())->parse(new Lexer($src, '<string:'.$this->name.'>'))->declaration->body;\n }",
"function frame_decode($payload) \n {\n\tif (!isset($payload))\n\t\treturn null; //empty data return nothing\n\n $length = ord($payload[1]) & 127;\n\n if($length == 126) {\n $masks = substr($payload, 4, 4);\n $data = substr($payload, 8);\n }\n elseif($length == 127) {\n $masks = substr($payload, 10, 4);\n $data = substr($payload, 14);\n }\n else {\n $masks = substr($payload, 2, 4);\n $data = substr($payload, 6);\n }\n\n\tfor ($i = 0; $i < strlen($masks); ++$i) {\n\t $this->say(\"header[\".$i.\"] =\". ord($masks[$i]). \" \\n\");\n\t}\n\t //$this->say(\" data:$data \\n\");\n\t \n\t //did we just get a PING frame\n\t if (strlen($masks)==4 && strlen($data)==0) \n\t {\n\t return \"ping\";\n\t }\n\t\n $text = '';\n for ($i = 0; $i < strlen($data); ++$i) {\n $text .= $data[$i] ^ $masks[$i%4];\n }\n return $text;\n}",
"function new_frame(){\n $this->cur_frame++;\n $frame = false;\n if($this->cur_frame < 10){\n $frame = new Frame($this);\n }elseif($this->cur_frame == 10){ # we need a specific set of rules for the 10th frame\n $frame = new TenthFrame($this);\n }\n if($frame){\n $this->frames[$this->cur_frame] = $frame;\n }\n }",
"protected function _parseMessage()\n {\n }",
"function interpretState(TeletypeF $r)\n{\n return matchPatterns([\n PutStrLn::class => function (PutStrLn $a) {\n return State::of(function (Listt $state) use ($a) {\n return [\n $a->next,\n f\\append($state, f\\fromValue('PutStrLn'))\n ];\n });\n },\n GetLine::class => function (GetLine $a) {\n return State::of(function (Listt $state) use ($a) {\n return [\n ($a->processor)('demo'),\n f\\append($state, f\\fromValue('GetLine'))\n ];\n });\n },\n ExitSuccess::class => function (ExitSuccess $a) {\n return State::of(function (Listt $state) use ($a) {\n return [\n ff\\Pure::of('exit'),\n f\\append($state, f\\fromValue('ExitSuccess'))\n ];\n });\n },\n ], $r);\n}",
"private function respond(Request $request): \\Generator\n {\n \\assert($this->logger !== null && $this->errorHandler !== null);\n\n /** @var Response $response */\n if ($request->getMethod() !== 'GET') {\n $response = yield $this->errorHandler->handleError(Status::METHOD_NOT_ALLOWED, null, $request);\n $response->setHeader('allow', 'GET');\n return $response;\n }\n\n if ($request->getProtocolVersion() !== '1.1') {\n $response = yield $this->errorHandler->handleError(Status::HTTP_VERSION_NOT_SUPPORTED, null, $request);\n $response->setHeader('upgrade', 'websocket');\n return $response;\n }\n\n if ('' !== yield $request->getBody()->buffer()) {\n return yield $this->errorHandler->handleError(Status::BAD_REQUEST, null, $request);\n }\n\n $hasUpgradeWebsocket = false;\n foreach ($request->getHeaderArray('upgrade') as $value) {\n if (\\strcasecmp($value, 'websocket') === 0) {\n $hasUpgradeWebsocket = true;\n break;\n }\n }\n if (!$hasUpgradeWebsocket) {\n $response = yield $this->errorHandler->handleError(Status::UPGRADE_REQUIRED, null, $request);\n $response->setHeader('upgrade', 'websocket');\n return $response;\n }\n\n $hasConnectionUpgrade = false;\n foreach ($request->getHeaderArray('connection') as $value) {\n $values = \\array_map('trim', \\explode(',', $value));\n\n foreach ($values as $token) {\n if (\\strcasecmp($token, 'upgrade') === 0) {\n $hasConnectionUpgrade = true;\n break;\n }\n }\n }\n\n if (!$hasConnectionUpgrade) {\n $reason = 'Bad Request: \"Connection: Upgrade\" header required';\n $response = yield $this->errorHandler->handleError(Status::UPGRADE_REQUIRED, $reason, $request);\n $response->setHeader('upgrade', 'websocket');\n return $response;\n }\n\n if (!$acceptKey = $request->getHeader('sec-websocket-key')) {\n $reason = 'Bad Request: \"Sec-Websocket-Key\" header required';\n return yield $this->errorHandler->handleError(Status::BAD_REQUEST, $reason, $request);\n }\n\n if (!\\in_array('13', $request->getHeaderArray('sec-websocket-version'), true)) {\n $reason = 'Bad Request: Requested Websocket version unavailable';\n $response = yield $this->errorHandler->handleError(Status::BAD_REQUEST, $reason, $request);\n $response->setHeader('sec-websocket-version', '13');\n return $response;\n }\n\n $response = new Response(Status::SWITCHING_PROTOCOLS, [\n 'connection' => 'upgrade',\n 'upgrade' => 'websocket',\n 'sec-websocket-accept' => generateAcceptFromKey($acceptKey),\n ]);\n\n $response = yield $this->clientHandler->handleHandshake($this, $request, $response);\n\n /**\n * @psalm-suppress DocblockTypeContradiction $response is set by ClientHandler::handleHandshake() resolution\n * and may not be the correct type.\n */\n if (!$response instanceof Response) {\n throw new \\Error(\\sprintf(\n 'The promise returned by %s::handleHandshake() must resolve to an instance of %s, %s returned',\n \\str_replace(\"\\0\", '@', \\get_class($this)), // replace NUL-byte in anonymous class name\n Response::class,\n \\is_object($response) ? 'instance of ' . \\get_class($response) : \\gettype($response)\n ));\n }\n\n if ($response->getStatus() !== Status::SWITCHING_PROTOCOLS) {\n $response->removeHeader('connection');\n $response->removeHeader('upgrade');\n $response->removeHeader('sec-websocket-accept');\n return $response;\n }\n\n $compressionContext = null;\n if ($this->options->isCompressionEnabled()) {\n $extensions = \\array_map('trim', \\explode(',', (string) $request->getHeader('sec-websocket-extensions')));\n\n foreach ($extensions as $extension) {\n if ($compressionContext = $this->compressionFactory->fromClientHeader($extension, $headerLine)) {\n /** @psalm-suppress PossiblyNullArgument */\n $response->setHeader('sec-websocket-extensions', $headerLine);\n break;\n }\n }\n }\n\n $response->upgrade(function (UpgradedSocket $socket) use ($request, $response, $compressionContext): Promise {\n return $this->reapClient($socket, $request, $response, $compressionContext);\n });\n\n return $response;\n }",
"public function decode(string $data)\n {\n // a frame cannot be less than 8bytes\n if( mb_strlen($data, '8bit') < 8 ){\n $this->isComplete = false;\n\t\t\treturn $data;\n\t\t}\n \n $decoded = unpack('H2', $data);\n $position = 1; // track what byte we are decoding\n\n\t\t// get FIN bit\n\t\t$this->finBit = ($decoded[$position][0]==8)?1:0;\n\n\t\t// set reserved bits\n\t\t$this->rsvBit1 = 0;\n\t\t$this->rsvBit2 = 0;\n $this->rsvBit3 = 0;\n \n\t\t// get opcode (operation code)\n\t\t$this->opcode = intval($decoded[$position][1], 16);\n\t\tswitch($this->opcode){\n case \\obray\\WebSocketFrame::CLOSE: \n case \\obray\\WebSocketFrame::PING:\n case \\obray\\WebSocketFrame::PONG:\n return '';\n case \\obray\\WebSocketFrame::RSVCTRL1:\n case \\obray\\WebSocketFrame::RSVCTRL2:\n case \\obray\\WebSocketFrame::RSVCTRL3:\n case \\obray\\WebSocketFrame::RSVCTRL4:\n case \\obray\\WebSocketFrame::RSVCTRL5:\n case \\obray\\WebSocketFrame::RSVCTRLB:\n case \\obray\\WebSocketFrame::RSVCTRLC:\n case \\obray\\WebSocketFrame::RSVCTRLD:\n case \\obray\\WebSocketFrame::RSVCTRLE:\n case \\obray\\WebSocketFrame::RSVCTRLF:\t\t\t\t\n print_r(\"Invalid opcode (\".$this->opcode.\")\");\n exit();\n return '';\n }\n \n\t\t// get mask bit and length\n\t\t$this->mask = 0;\n $this->payloadLength = intval(unpack(\"H2length\", $data, $position)['length'], 16);\n\t\tif($this->payloadLength > 0x80){\n\t\t\t$this->payloadLength = $this->payloadLength - 0x80;\n\t\t\t$this->mask = 1;\n\t\t}\n ++$position; // we've now decoded our second byte\n\n\t\t// handle medium and large length payloads (16 & 64 bit)\n\t\tif( $this->payloadLength === 126 ){\n $this->payloadLength = intval(unpack(\"H4length\", $data, $position)['length'], 16);\n $position += 2; // length is and addition 4 bytes\n\t\t} else if( $this->payloadLength === 127 ){\n $this->payloadLength = intval(unpack(\"H16length\", $data, $position)['length'], 16);\n $position += 6; // length is and addition 4 bytes\n }\n \n // get mask key so we can unmask our payload\n $this->maskingKey = [ord($data[$position]), ord($data[++$position]), ord($data[++$position]), ord($data[++$position])];\n ++$position;\n \n // if payload length > the length of our remaining data, kick the data back out to be combined with \n // additional data from our socket stream\n\t\tif($this->payloadLength > (mb_strlen($data, '8bit')-$position)) {\n //print_r(\"Not a complete frame return\\n\");\n $this->isComplete = false;\n\t\t\treturn $data;\n }\n\n // unmask payload data\n\t\tfor($i=($position);$i<($this->payloadLength+$position);++$i){\n\t\t\t$char = chr(ord($data[$i]) ^ $this->maskingKey[($i-$position)%4]);\n\t\t\t$this->payload .= $char;\n\t\t}\n \n // return remaining data to be processed or fales\n $remaining = mb_strcut($data, $this->payloadLength+$position, NULL, '8bit');\n $this->isComplete = true;\n if(empty($remaining)){\n return false;\n } else {\n return $remaining;\n }\n }",
"function mWS(){\n try {\n $_type = GroupLexer::T_WS;\n $_channel = GroupLexer::DEFAULT_TOKEN_CHANNEL;\n // ./src/php/Antlr/StringTemplate/Language/Group.g\n // ./src/php/Antlr/StringTemplate/Language/Group.g\n {\n if ( ($this->input->LA(1)>=$this->getToken('9') && $this->input->LA(1)<=$this->getToken('10'))||$this->input->LA(1)==$this->getToken('13')||$this->input->LA(1)==$this->getToken('32') ) {\n $this->input->consume();\n\n } else {\n $mse = new MismatchedSetException(null,$this->input);\n $this->recover($mse);\n throw $mse;}\n\n $this->skip();\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"public function parse() {\n\t\t$this->run();\n\t\treturn $this->endOfStream();\n\t}",
"function parse(PEG_IContext $context)\n\t{\n\t\t/**\n\t\t * http://tools.ietf.org/html/rfc3629\n\t\t *\n\t\t * UTF8-octets = *( UTF8-char )\n\t\t * UTF8-char = UTF8-1 / UTF8-2 / UTF8-3 / UTF8-4\n\t\t * UTF8-1 = %x00-7F\n\t\t * UTF8-2 = %xC2-DF UTF8-tail\n\t\t * UTF8-3 = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2( UTF8-tail ) /\n\t\t * %xED %x80-9F UTF8-tail / %xEE-EF 2( UTF8-tail )\n\t\t * UTF8-4 = %xF0 %x90-BF 2( UTF8-tail ) / %xF1-F3 3( UTF8-tail ) /\n\t\t * %xF4 %x80-8F 2( UTF8-tail )\n\t\t * UTF8-tail = %x80-BF\n\t\t *\n\t\t * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\t\t *\n\t\t * Surrogates are not allowed. (U+D800 - U+DFFF)\n\t\t *\n\t\t * [\\x00-\\x7f] U+0000 - U+007F\n\t\t * [\\xc2-\\xdf] [\\x80-\\xbf] U+0080 - U+07FF\n\t\t * \\xe0 [\\xa0-\\xbf] [\\x80-\\xbf] U+0800 - U+0FFF\n\t\t * [\\xe1-\\xec] [\\x80-\\xbf] [\\x80-\\xbf] U+1000 - U+CFFF\n\t\t * \\xed [\\x80-\\x9f] [\\x80-\\xbf] U+D000 - U+D7FF\n\t\t * [\\xee-\\xef] [\\x80-\\xbf] [\\x80-\\xbf] U+E000 - U+FFFF\n\t\t * \\xf0 [\\x90-\\xbf] [\\x80-\\xbf] [\\x80-\\xbf] U+10000 - U+3FFFF\n\t\t * [\\xf1-\\xf3] [\\x80-\\xbf] [\\x80-\\xbf] [\\x80-\\xbf] U+40000 - U+FFFFF\n\t\t * \\xf4 [\\x80-\\x8f] [\\x80-\\xbf] [\\x80-\\xbf] U+100000 - U+10FFFF\n\t\t */\n\t\t$offset = $context->tell();\n\t\t$byte1 = $context->readElement();\n\n\t\t// ascii\n\t\t// [\\x00-\\x7f] U+0000 - U+007F\n\t\tif ($byte1 <= \"\\x7F\") return PEG::failure();\n\n\t\t// byte1 invalid code\n\t\t// -\\xc1][\\xf5-\n\t\tif ($byte1 <= \"\\xc1\" || $byte1 >= \"\\xf5\") return PEG::failure();\n\n\t\t// 2byte char\n\t\t// [\\xc2-\\xdf] [\\x80-\\xbf] U+0080 - U+07FF\n\t\t$byte2 = $context->readElement();\n\t\tif ( ($byte1 >= \"\\xc2\" && $byte1 <= \"\\xdf\")\n\t\t\t&& ($byte2 >= \"\\x80\" && $byte2 <= \"\\xbf\")\n\t\t) return $byte1.$byte2;\n\n\t\t// 3byte char\n\t\t// \\xe0 [\\xa0-\\xbf] [\\x80-\\xbf] U+0800 - U+0FFF\n\t\t// [\\xe1-\\xec] [\\x80-\\xbf] [\\x80-\\xbf] U+1000 - U+CFFF\n\t\t// \\xed [\\x80-\\x9f] [\\x80-\\xbf] U+D000 - U+D7FF\n\t\t// [\\xee-\\xef] [\\x80-\\xbf] [\\x80-\\xbf] U+E000 - U+FFFF\n\t\t$byte3 = $context->readElement();\n\t\t$isBype3 = $byte3 >= \"\\x80\" && $byte3 <= \"\\xbf\" ? true : false;\n\n\t\t// \\xe0 [\\xa0-\\xbf] [\\x80-\\xbf] U+0800 - U+0FFF\n\t\tif ($byte1 === \"\\xe0\"\n\t\t\t&& ($byte2 >= \"\\xa0\" && $byte2 <= \"\\xbf\")\n\t\t\t&& $isBype3 === true\n\t\t) return $byte1.$byte2.$byte3;\n\n\t\t// [\\xe1-\\xec] [\\x80-\\xbf] [\\x80-\\xbf] U+1000 - U+CFFF\n\t\t// [\\xee-\\xef] [\\x80-\\xbf] [\\x80-\\xbf] U+E000 - U+FFFF\n\t\tif ((($byte1 >= \"\\xe1\" && $byte1 <= \"\\xec\")\n\t\t\t|| ($byte1 >= \"\\xee\" && $byte1 <= \"\\xef\"))\n\t\t\t&& ($byte2 >= \"\\x80\" && $byte2 <= \"\\xbf\")\n\t\t\t&& $isBype3 === true\n\t\t) return $byte1.$byte2.$byte3;\n\n\t\t// \\xed [\\x80-\\x9f] [\\x80-\\xbf] U+D000 - U+D7FF\n\t\tif ($byte1 === \"\\xed\"\n\t\t\t&& ($byte2 >= \"\\x80\" && $byte2 <= \"\\x9f\")\n\t\t\t&& $isBype3 === true\n\t\t) return $byte1.$byte2.$byte3;\n\n\t\t$context->seek($offset);\n\n\t\treturn PEG::failure();\n\t}",
"function _parse($state = StateInterface::STATE_START) : void\n {\n do {\n $state = $this->State[$state]->parse($this);\n } while ($state != StateInterface::STATE_STOP &&\n $this->position < $this->length);\n }",
"public function next_token()\n {\n $matches = null;\n\n /*\n * aye the magic\n * we're using a single RegExp to tokenize the block comment delimiters\n * we're also using a trick here because the only difference between a\n * block opener and a block closer is the leading `/` before `wp:` (and\n * a closer has no attributes). we can trap them both and process the\n * match back in PHP to see which one it was.\n */\n $has_match = preg_match(\n '/<!--\\s+(?P<closer>\\/)?wp:(?P<namespace>[a-z][a-z0-9_-]*\\/)?(?P<name>[a-z][a-z0-9_-]*)\\s+(?P<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\\s+\\/?-->).)*+)?}\\s+)?(?P<void>\\/)?-->/s',\n $this->document,\n $matches,\n PREG_OFFSET_CAPTURE,\n $this->offset\n );\n\n // if we get here we probably have catastrophic backtracking or out-of-memory in the PCRE.\n if (false === $has_match) {\n return ['no-more-tokens', null, null, null, null];\n }\n\n // we have no more tokens.\n if (0 === $has_match) {\n return ['no-more-tokens', null, null, null, null];\n }\n\n list($match, $started_at) = $matches[0];\n\n $length = strlen($match);\n $is_closer = isset($matches['closer']) && -1 !== $matches['closer'][1];\n $is_void = isset($matches['void']) && -1 !== $matches['void'][1];\n $namespace = $matches['namespace'];\n $namespace = (isset($namespace) && -1 !== $namespace[1]) ? $namespace[0] : 'core/';\n $name = $namespace.$matches['name'][0];\n $has_attrs = isset($matches['attrs']) && -1 !== $matches['attrs'][1];\n\n /*\n * Fun fact! It's not trivial in PHP to create \"an empty associative array\" since all arrays\n * are associative arrays. If we use `array()` we get a JSON `[]`\n */\n $attrs = $has_attrs\n ? json_decode($matches['attrs'][0], /* as-associative */ true)\n : $this->empty_attrs;\n\n /*\n * This state isn't allowed\n * This is an error\n */\n if ($is_closer && ($is_void || $has_attrs)) {\n // we can ignore them since they don't hurt anything.\n }\n\n if ($is_void) {\n return ['void-block', $name, $attrs, $started_at, $length];\n }\n\n if ($is_closer) {\n return ['block-closer', $name, null, $started_at, $length];\n }\n\n return ['block-opener', $name, $attrs, $started_at, $length];\n }",
"function Process() {\n\t\tif($this->sendFrame()) {\n //$xml=$this->getFrame();\n //$cools=simplexml_load_string($xml);\n\t\t\treturn $this->getFrame();\n // return $this->xml_array($xml);\n \n\t\t}\n\n\t\treturn false;\n\t}"
] | [
"0.6120851",
"0.5596288",
"0.53517693",
"0.511812",
"0.50008506",
"0.48914057",
"0.48858988",
"0.48661244",
"0.48606342",
"0.48571497",
"0.4840345",
"0.48394123",
"0.47364178",
"0.4652147",
"0.46506488",
"0.45978248",
"0.4582425",
"0.4576114",
"0.45648777",
"0.4564523",
"0.45579153",
"0.4523996",
"0.451148",
"0.45058578",
"0.4477915",
"0.44757482",
"0.44681612",
"0.44490507",
"0.44329643",
"0.4402168"
] | 0.7134051 | 0 |
Find Expense by ID | public function find($id): ExpenseRepositoryInterface
{
$expenses = Expense::where('user_id', '=', $id)->get();
$total = 0;
foreach ($expenses as $expense) {
$total = $total + $expense->value;
}
$this->obj = (object) ['expenses' => $expenses, 'total' => $total];
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show($id)\n {\n return Expense::with('expensesType', 'payments')->whereHas('expensesEntry', function($q) use ($id){\n $q->where('id', $id);\n })->get();\n }",
"public function getUserExpenses($id){\n $user = User::where('id', $id);\n\n if($user->exists()){\n //$expense = $user->get()[0]->expenses->toJson(JSON_PRETTY_PRINT);\n $expense = User::find($id)->expenses;\n $result = ExpenseResource::collection($expense);\n $content = $result->toJson(JSON_PRETTY_PRINT);\n return response($content, 200, ['Content-Type'=>'application/json' ]);\n\n\n }else{\n return response()->json([\n \"message\" => \"No user expense\"\n ], 404);\n }\n\n }",
"public function get_expense( $expense_id, $of_user = '' ) {\n\t\t\t$request = $this->base_uri . '/expenses?output=' . static::$output;\n\t\t\treturn $this->fetch( $request );\n\t\t}",
"public function get($id)\n {\n if(! MounirApiAccess::$user->rights->expensereport->lire) {\n throw new RestException(401);\n }\n\n $result = $this->expensereport->fetch($id);\n if( ! $result ) {\n throw new RestException(404, 'Expense report not found');\n }\n\n if( ! MounirApi::_checkAccessToResource('expensereport', $this->expensereport->id)) {\n throw new RestException(401, 'Access not allowed for login '.MounirApiAccess::$user->login);\n }\n\n $this->expensereport->fetchObjectLinked();\n return $this->_cleanObjectDatas($this->expensereport);\n }",
"public function show($id)\n {\n $expense = $this->expense->with(['category', 'tags'])->findOrFail($id);\n\n return $this->sendResponse($expense, 'Expense Details');\n }",
"public function show($id)\n\t{\n\t\treturn IncomeCategory::lists('expense','id');\n\t}",
"protected function expenseModalList($period, $id) {\n\t\t$sql = (\"SELECT ex.id, pm.id payId, pm.name payName, ex.amount, ex.date_of_expense date, ex.expense_comment comment FROM expenses ex \n\t\tINNER JOIN payment_methods_assigned_to_users pm\n\t\tWHERE ex.expense_category_assigned_to_user_id = :id\n\t\tAND (ex.date_of_expense BETWEEN :start AND :end)\n\t\tAND ex.payment_method_assigned_to_user_id = pm.id\n\t\tORDER BY ex.id DESC\");\n\t\treturn Data::dbQuery($sql, $id, $period);\n\t}",
"public function show($id)\n {\n return $this->expenseReportService->show($id);\n }",
"public function show($id)\n {\n $expense = Expense::find($id);\n\n return view('expenses.show',compact('expense'));\n }",
"public function findWithId($id) {\n return $this->query(\"SELECT * FROM \".$this->table.\" WHERE idExpo = ?\", [$id], null, true);\n }",
"public function getExpenseId()\n\t{\n\t\t$user_id = $_SESSION['user_id'];\n\t\t$income_category = $_SESSION['category'];\n\t\t\n\t\t$sql = 'SELECT id FROM expenses_category_assigned_to_users WHERE user_id = :id AND name = :name';\n\n $db = static::getDB();\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':id', $user_id, PDO::PARAM_INT);\n $stmt->bindValue(':name', $income_category, PDO::PARAM_STR);\n\t\t\n $stmt->setFetchMode(PDO::FETCH_CLASS, get_called_class());\n\n $stmt->execute();\n\t\t\n\t\t$row = $stmt->fetch();\n\t\t\n\t\treturn $row->id;\n\t}",
"public function leaseExpense($id, Request $request){\n try{\n $lease = Lease::query()->whereIn('business_account_id', getDependentUserIds())\n ->where('id', '=', $id)\n ->firstOrFail();\n\n $asset = $lease->assets()->first(); //there will only be a single lease asset for each lease...\n\n $lease_expense_annexure = LeaseExpenseAnnexure::query()->where('asset_id', '=', $asset->id)->get();\n $lease_payments = LeaseExpenseAnnexure::query()->where('asset_id', '=', $asset->id)->first();\n\n return view('leasevaluation.lease_expense_annexure', compact(\n 'lease',\n 'asset',\n 'lease_expense_annexure',\n 'lease_payments'\n ));\n } catch (\\Exception $e) {\n abort(404);\n }\n }",
"public function show($id)\n {\n $expense = Expenses::find($id);\n return view('expenses.show')->with('expense', $expense);\n }",
"public function show($id)\n {\n $content = PriceStructureHasStaffExpense::find($id);\n $return['status'] = 1;\n $return['title'] = 'Get PriceStructureHasStaffExpense';\n $return['content'] = $content;\n return $return;\n }",
"public function expense()\n {\n return $this->belongsTo(Expense::class);\n }",
"public function findByID($id);",
"function getExpenses($event_id, $db) {\n\tif ($expense = $db->query(\"SELECT SUM(amount) AS cost FROM expenses\n\tWHERE event_id = $event_id\")) {\n\t\treturn $expense->fetch_assoc()[\"cost\"];\n\t}\n\telse {\n\t\techo \"<p>AN ERROR OCCURED<p>\\n\";\n\t}\n}",
"public static function getById($id){\n $abuse = Doctrine_Query::create()\n ->from('InvitationAbuse i')\n ->where('i.id= ?',$id)\n ->fetchOne();\n return $abuse;\n }",
"protected function detail($id)\n {\n $model = new Expense();\n $show = new Show($model->findOrFail($id));\n\n $columns = $model->getTableColumns();\n foreach ($columns as $column) {\n $show->field($column, __($column));\n }\n\n return $show;\n }",
"public function find ($id);",
"public function find($id){}",
"public function edit($id)\n {\n return ErpPayAllowance::with(['allowances','pays','libilities','deductions'])->find($id);\n }",
"public function edit($id)\n {\n $expense = Expense::find($id);\n $companies = Company::all()->pluck('name' , 'id');\n\n\n return view('pages.expenses.edit')->withExpense($expense)->withCompanies($companies);\n }",
"public function show(Expense $expense)\n {\n //\n return $expense;\n }",
"public function edit($id)\n\t{\n $expense = $this->expense->getById($id);\n return view('expenses.edit', compact('expense'));\n\t}",
"public function find(int $id);",
"public function edit($id)\n {\n $expense = Expense::find($id);\n $users=User::whereHas('roles', function($q){$q->whereIn('roles.name', ['customer']);})->get();\n\n return view('expenses.edit',compact('expense','users'));\n }",
"public function edit($id)\n {\n $edit = Expense::find($id);\n return view('backend.pages.expense.edit', compact('edit'));\n }",
"public static function findById($id);",
"static function find($id);"
] | [
"0.7101553",
"0.6537543",
"0.63567173",
"0.63157445",
"0.6277405",
"0.6248885",
"0.62288564",
"0.62218696",
"0.620233",
"0.61922234",
"0.6035361",
"0.60316116",
"0.6012197",
"0.6011531",
"0.59708315",
"0.59524846",
"0.59489614",
"0.5947924",
"0.59255195",
"0.59068894",
"0.5898331",
"0.58759844",
"0.5875852",
"0.5875091",
"0.5870078",
"0.5866247",
"0.5859288",
"0.5833519",
"0.5831447",
"0.5829068"
] | 0.7130167 | 0 |
Get the link text/title | public function getLinkText()
{
return trim($this->getParsedValue()->Text ?? '');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLinktext()\r\n\t{\r\n\t\treturn $this->{Model_Bookmark_Table::F_LINKTEXT};\r\n\t}",
"public function getLink();",
"public function link() {\n\t\treturn $this->link_content;\n\t}",
"function ui_get_link_text( $instance, $context = 'display' ) {\n\t\treturn $instance->link_text;\n\t}",
"public function getLink() {\n return $this->get('link')[0];\n }",
"public function getShowLinkText()\n {\n return $this->showLinkText;\n }",
"private function getLink()\n {\n $this->link = $this->item->find('a')->attr('href');\n return $this->link;\n }",
"public function getLink() {\n return $this->get(self::LINK);\n }",
"public function getLink() {\n\t\treturn sprintf(\n\t\t\t'<a href=\"%s\">%s</a>',\n\t\t\t$this->getUrl(),\n\t\t\t$this->getTitle()\t\t\t\n\t\t);\n\t}",
"public function getInternalLinkContent();",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function retrieveUrl()\n {\n preg_match('/(.*)\\<a href\\=\\\"(.*)\\\"\\>\\[link\\]\\<\\/a\\>/i', $this->itemContent, $matches);\n if (count($matches) != 3) {\n return $url;\n }\n\n return $matches[2];\n }",
"public function getLinkNameAttribute()\n\t{\n\t\treturn $this->attributes['title'];\n\t}",
"public function link() {\n\t\treturn $this->bookmark->link_url;\n\t}",
"public function get_book_linked_title() : string {\n\t\t$tmpl = '<p><a href=\"%s\">%s</a></p>';\n\n\t\treturn sprintf(\n\t\t\t$tmpl,\n\t\t\tesc_url( $this->link ),\n\t\t\tesc_html( $this->title )\n\t\t);\n\t}",
"public function getLinkDescription()\n {\n return $this->getParsedValue()->Description;\n }",
"private function getLink(){\n\t\treturn $this->_link;\n\t}",
"protected function _getLinkTitle()\n {\n // load the link title for the actual store ID\n return $this->_getLink()->getLinkTitle(\n Mage::app()->getStore()->getId()\n );\n }",
"public function getLink() {\n\t\treturn $this->link;\n\t}",
"public function url_title()\n\t\t\t {\n\t\t\t \treturn ($this->title !== NULL) ? $this->title->url_title : '';\n\t\t\t }",
"public function filter_wp_seo_get_bc_title($link_text, $link_id){\n\t\t \n\t\t\treturn $link_text;\n\t\t}",
"public function getLink() {\n\t\t\treturn $this->link;\n\t\t}",
"public function getLink() {\n\n\t\treturn $this->link;\n\t}"
] | [
"0.7735983",
"0.7515761",
"0.73990023",
"0.733033",
"0.72433245",
"0.7211207",
"0.71785074",
"0.7105572",
"0.7059716",
"0.6939692",
"0.68940157",
"0.68940157",
"0.68940157",
"0.68940157",
"0.68940157",
"0.68940157",
"0.68940157",
"0.68940157",
"0.68887186",
"0.6873831",
"0.68702275",
"0.68250084",
"0.6807482",
"0.6751357",
"0.6718149",
"0.6702568",
"0.6682278",
"0.6667081",
"0.66553754",
"0.6648409"
] | 0.7665673 | 1 |
Get the link "description", used for titles or alt text | public function getLinkDescription()
{
return $this->getParsedValue()->Description;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_description();",
"abstract public function get_description();",
"function getDescription() {\n\t\treturn __('plugins.generic.htmlArticleGalley.description');\n\t}",
"public function description()\n\t{\n\t\t$txt = array();\n\t\t$txt['wiki'] = 'Embeds a RSS Feed into the Page';\n\t\t$txt['html'] = '<p>Embeds a RSS feed into the page.</p>\n\t\t\t\t\t\t<p>Examples:</p>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t<li><code>[[Feed(http://rss.cnn.com/rss/cnn_topstories.rss)]]</code></li>\n\t\t\t\t\t\t\t<li><code>[[Feed(http://rss.cnn.com/rss/cnn_topstories.rss, 3)]] - show 3 feed items</code></li>\n\t\t\t\t\t\t\t<li><code>[[Feed(http://rss.cnn.com/rss/cnn_topstories.rss, class=cnn_feed)]] - feed with class \"cnn_feed\"</code></li>\n\t\t\t\t\t\t</ul>';\n\n\t\treturn $txt['html'];\n\t}",
"private function get_description() {\n $description = get_field('recipe__desc', $this->recipe_id);\n\n if (!$description) {\n return;\n }\n\n return $description;\n }",
"public function getDescription() {\n $dom = $this->dom;\n $this->verifyHeaderElements(array('description'));\n $cnodes = $dom->getElementsByTagName('meta');\n $cnode = NULL;\n foreach ($cnodes as $cnode) {\n if ($cnode->getAttribute('name') == 'description') {\n break;\n }\n }\n $textContent = is_object($cnode) ? $cnode->getAttribute('content') : '';\n return htmlspecialchars_decode($textContent);\n }",
"public function getDescription() {\r\n return tx_newspaper::formatDescription($this->getAttribute('title'), $this->getAttribute('bodytext'), $this->getAttribute('short_description'));\r\n }",
"public function getDescription() {\r\n return tx_newspaper::formatDescription($this->getAttribute('title'), '', $this->getAttribute('short_description'));\r\n }",
"function _rex488_the_meta_description()\r\n{\r\n if(_rex488_is_article())\r\n {\r\n return htmlspecialchars(_rex488_FrontendMetadataArticle::get_article_description());\r\n }\r\n else if(_rex488_is_category())\r\n {\r\n return htmlspecialchars(_rex488_FrontendMetadataCategory::get_category_description());\r\n }\r\n else\r\n {\r\n return htmlspecialchars(_rex488_FrontendMetadata::get_blog_description());\r\n }\r\n}",
"public function getInternalLinkContent();",
"public static function getDescription()\n\t{\n\t\tself::metadata();\n\t\treturn(static::$metadata->description);\n\t}",
"public function getOGDescription()\r\n {\r\n if (Controller::curr()->article) {\r\n return Convert::html2raw(Controller::curr()->article->Lead);\r\n }\r\n\r\n return Convert::html2raw($this->Content);\r\n }",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();"
] | [
"0.7579151",
"0.7419029",
"0.7312635",
"0.7294469",
"0.7249937",
"0.72444075",
"0.7179033",
"0.71777433",
"0.7173249",
"0.7099",
"0.7090335",
"0.706711",
"0.70669717",
"0.70669717",
"0.70669717",
"0.70669717",
"0.70669717",
"0.70669717",
"0.70669717",
"0.70669717",
"0.70669717",
"0.70669717",
"0.70669717",
"0.70669717",
"0.70669717",
"0.70669717",
"0.70669717",
"0.70669717",
"0.70669717",
"0.70669717"
] | 0.85294145 | 0 |
Get whether to display the link text field | public function getShowLinkText()
{
return $this->showLinkText;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function LinkPreview()\n {\n return false;\n }",
"public function isLink(): bool;",
"public function is_link_text_editable() {\n\t\treturn false;\n\t}",
"public function hasLink()\n {\n return (bool)$this->link;\n }",
"function showLinkHelp()\n\t{\n\t\tglobal $ilUser, $ilCtrl;\n\t\t\n\t\t// filter link types\n\t\tif (!$this->filter_white_list)\n\t\t{\n\t\t\tforeach($this->filter_link_types as $link_type)\n\t\t\t{\n\t\t\t\tunset($this->ltypes[$link_type]);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ltypes = array();\n\t\t\tforeach($this->ltypes as $k => $l)\n\t\t\t{\n\t\t\t\tif (in_array($k, $this->filter_link_types))\n\t\t\t\t{\n\t\t\t\t\t$ltypes[$k] = $l;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->ltypes = $ltypes;\n\t\t}\n\n\n\t\t// determine link type and target\n\t\t$this->determineLinkType();\n\n\t\t$ltype = ($this->link_target != \"\")\n\t\t\t? $this->link_type.\"_\".$this->link_target\n\t\t\t: $this->link_type;\n\n\t\t$def_type = ilObject::_lookupType($this->default_obj, true);\n\n\t\t// determine content object id\n\t\tswitch($this->link_type)\n\t\t{\n\t\t\tcase \"PageObject\":\n\t\t\tcase \"StructureObject\":\n\t\t\t\tif (empty($_SESSION[\"il_link_cont_obj\"]) &&\n\t\t\t\t\t($def_type != \"mep\" && $def_type != \"glo\"))\n\t\t\t\t{\n\t\t\t\t\t$_SESSION[\"il_link_cont_obj\"] = $this->default_obj;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"GlossaryItem\":\n\t\t\t\tif (empty($_SESSION[\"il_link_glossary\"]) && $def_type == \"glo\")\n\t\t\t\t{\n\t\t\t\t\t$_SESSION[\"il_link_glossary\"] = $this->default_obj;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"Media\":\n\t\t\t\tif (empty($_SESSION[\"il_link_mep\"]) && $def_type == \"mep\")\n\t\t\t\t{\n\t\t\t\t\t$_SESSION[\"il_link_mep\"] = $this->default_obj;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"WikiPage\":\n\t\t\t\tif (empty($_SESSION[\"il_link_wiki\"]) && $def_type == \"wiki\")\n\t\t\t\t{\n\t\t\t\t\t$_SESSION[\"il_link_wiki\"] = $this->default_obj;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\t/*\n\t\t$target_str = ($link_target == \"\")\n\t\t\t? \"\"\n\t\t\t: \" target=\\\"\".$link_target.\"\\\" \";*/\n\n\t\t\n\t\t\n\t\t$target_str = ($this->link_target == \"\")\n\t\t\t? \"\"\n\t\t\t: \" target=\\\"\".$this->link_target.\"\\\"\";\n//echo \"-\".$this->link_type.\"-\";\n\t\tif(($this->link_type == \"GlossaryItem\") &&\n\t\t\t(empty($_SESSION[\"il_link_glossary\"]) ||\n\t\t\t!in_array(ilObject::_lookupType($_SESSION[\"il_link_glossary\"], true),\n\t\t\t\tarray(\"glo\"))))\n\t\t{\n\t\t\t$this->changeTargetObject(\"glo\");\n\t\t}\n\t\tif(($this->link_type == \"WikiPage\") &&\n\t\t\t(empty($_SESSION[\"il_link_wiki\"]) ||\n\t\t\t!in_array(ilObject::_lookupType($_SESSION[\"il_link_wiki\"], true),\n\t\t\t\tarray(\"wiki\"))))\n\t\t{\n\t\t\t$this->changeTargetObject(\"wiki\");\n\t\t}\n\t\tif(($this->link_type == \"PageObject\" || $this->link_type == \"StructureObject\") &&\n\t\t\t(empty($_SESSION[\"il_link_cont_obj\"]) ||\n\t\t\t!in_array(ilObject::_lookupType($_SESSION[\"il_link_cont_obj\"], true),\n\t\t\t\tarray(\"lm\", \"dbk\"))))\n\t\t{\n\t\t\t$this->changeTargetObject(\"cont_obj\");\n\t\t}\n\t\tif ($ilCtrl->isAsynch())\n\t\t{\n\t\t\t$tpl = new ilTemplate(\"tpl.link_help_asynch.html\", true, true, \"Services/Link\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tpl =& new ilTemplate(\"tpl.link_help.html\", true, true, \"Services/Link\");\n\t\t\t$tpl->setVariable(\"LOCATION_STYLESHEET\", ilUtil::getStyleSheetLocation());\n\t\t}\n\n\t\tswitch($this->link_type)\n\t\t{\n\t\t\tcase \"GlossaryItem\":\n\t\t\t\t$this->ctrl->setParameter($this, \"target_type\", \"glo\");\n\t\t\t\tbreak;\n\n\t\t\tcase \"PageObject\":\n\t\t\tcase \"StructureObject\":\n\t\t\t\t$this->ctrl->setParameter($this, \"target_type\", \"cont_obj\");\n\t\t\t\tbreak;\n\n\t\t\tcase \"Media\":\n\t\t\t\t$this->ctrl->setParameter($this, \"target_type\", \"mep\");\n\t\t\t\tbreak;\n\n\t\t\tcase \"WikiPage\":\n\t\t\t\t$this->ctrl->setParameter($this, \"target_type\", \"wiki\");\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n//echo \"<br><br>:\".$this->ctrl->getFormAction($this).\":\";\n//echo \"<br>link_type:\".$this->link_type;\n//echo \"<br>cont_obj:\".$_SESSION[\"il_link_cont_obj\"];\n//echo \"<br>link_mep\".$_SESSION[\"il_link_mep\"];\n\t\t$tpl->setVariable(\"FORMACTION\", $this->ctrl->getFormAction($this, \"changeLinkType\", \"\", true));\n\t\t$tpl->setVariable(\"FORMACTION2\", $this->ctrl->getFormAction($this));\n\t\t$tpl->setVariable(\"TXT_HELP_HEADER\", $this->lng->txt(\"cont_link_select\"));\n\t\t$tpl->setVariable(\"TXT_TYPE\", $this->lng->txt(\"cont_link_type\"));\n\n\n//echo \"<br><br>\".$ltype;\n\n\t\t$select_ltype = ilUtil::formSelect ($ltype,\n\t\t\t\"ltype\", $this->ltypes, false, true, \"0\", \"\", array(\"id\" => \"ilIntLinkTypeSelector\"));\n\t\t$tpl->setVariable(\"SELECT_TYPE\", $select_ltype);\n\t\t$tpl->setVariable(\"CMD_CHANGETYPE\", \"changeLinkType\");\n\t\t$tpl->setVariable(\"BTN_CHANGETYPE\", $this->lng->txt(\"cont_change_type\"));\n\t\t\n/*\t\tif ($this->isEnabledJavaScript())\n\t\t{\n\t\t\t$tpl->setVariable(\"BTN_CLOSE_JS\", $this->lng->txt(\"close\"));\n\t\t}\n\t\telse \n\t\t{*/\n\t\t\t$tpl->setVariable(\"CMD_CLOSE\", \"closeLinkHelp\");\n\t\t\t$tpl->setVariable(\"BTN_CLOSE\", $this->lng->txt(\"close\"));\n//\t\t}\n\n\t\t$chapterRowBlock = \"chapter_row\";\n\t\t$anchor_row_block = \"anchor_link\";\n\t\tif ($this->isEnabledJavaScript())\n\t\t{\n\t\t\t$chapterRowBlock .= \"_js\";\n\t\t\t$anchor_row_block .= \"_js\";\n\t\t}\n\n\t\t$obj_id = ilObject::_lookupObjId($_SESSION[\"il_link_cont_obj\"]);\n\t\t$type = ilObject::_lookupType($obj_id);\n\t\t\n\t\t// switch link type\n\t\tswitch($this->link_type)\n\t\t{\n\t\t\t// page link\n\t\t\tcase \"PageObject\":\n\t\t\t\trequire_once(\"./Modules/LearningModule/classes/class.ilObjLearningModule.php\");\n\t\t\t\tinclude_once(\"./Modules/LearningModule/classes/class.ilLMPage.php\");\n\t\t\t\t\n\t\t\t\t$cont_obj = new ilObjLearningModule($_SESSION[\"il_link_cont_obj\"], true);\n\n\t\t\t\t// get all chapters\n\t\t\t\t$ctree = $cont_obj->getLMTree();\n\t\t\t\t$nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));\n\t\t\t\t$tpl->setCurrentBlock(\"chapter_list\");\n\t\t\t\t$tpl->setVariable(\"TXT_CONTENT_OBJECT\", $this->lng->txt(\"obj_lm\"));\n\t\t\t\t$tpl->setVariable(\"TXT_CONT_TITLE\", $cont_obj->getTitle());\n\t\t\t\t$tpl->setVariable(\"THEAD\", $this->lng->txt(\"pages\"));\n\n\n\t\t\t\t$tpl->setCurrentBlock(\"change_cont_obj\");\n\t\t\t\t$tpl->setVariable(\"CMD_CHANGE_CONT_OBJ\", \"changeTargetObject\");\n\t\t\t\t$tpl->setVariable(\"BTN_CHANGE_CONT_OBJ\", $this->lng->txt(\"change\"));\n\t\t\t\t$tpl->parseCurrentBlock();\n\n\t\t\t\tforeach($nodes as $node)\n\t\t\t\t{\n\t\t\t\t\tif($node[\"type\"] == \"st\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$tpl->setCurrentBlock(\"chapter_row\");\n\t\t\t\t\t\t$tpl->setVariable(\"TXT_CHAPTER\", $node[\"title\"]);\n\t\t\t\t\t\t$tpl->setVariable(\"ROWCLASS\", \"tblrow1\");\n\t\t\t\t\t\t//$tpl->setVariable(\"LINK_CHAPTER\",\n\t\t\t\t\t\t//\t\"[iln chap=\\\"\".$node[\"obj_id\"].\"\\\"\".$target_str.\"] [/iln]\");\n\t\t\t\t\t\t$tpl->parseCurrentBlock();\n\t\t\t\t\t\t$tpl->setCurrentBlock(\"row\");\n\t\t\t\t\t\t$tpl->parseCurrentBlock();\n\t\t\t\t\t}\n\n\t\t\t\t\tif($node[\"type\"] == \"pg\")\n\t\t\t\t\t{\n\t\t\t\t\t\tinclude_once(\"./Services/COPage/classes/class.ilPCParagraph.php\");\n\t\t\t\t\t\t$this->renderLink($tpl, $node[\"title\"], $node[\"obj_id\"],\n\t\t\t\t\t\t\t\"PageObject\", \"pg\", \"page\",\n\t\t\t\t\t\t\tilPCParagraph::_readAnchors($type, $node[\"obj_id\"], \"\"));\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// get all free pages\n\t\t\t\t$pages = ilLMPageObject::getPageList($cont_obj->getId());\n\t\t\t\t$free_pages = array();\n\t\t\t\tforeach ($pages as $page)\n\t\t\t\t{\n\t\t\t\t\tif (!$ctree->isInTree($page[\"obj_id\"]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$free_pages[] = $page;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(count($free_pages) > 0)\n\t\t\t\t{\n\t\t\t\t\t$tpl->setCurrentBlock(str_replace(\"_js\",\"\",$chapterRowBlock));\n\t\t\t\t\t$tpl->setVariable(\"TXT_CHAPTER\", $this->lng->txt(\"cont_free_pages\"));\n\t\t\t\t\t$tpl->setVariable(\"ROWCLASS\", \"tblrow1\");\n\t\t\t\t\t$tpl->parseCurrentBlock();\n\n\t\t\t\t\tforeach ($free_pages as $node)\n\t\t\t\t\t{\n\t\t\t\t\t\tinclude_once(\"./Services/COPage/classes/class.ilPCParagraph.php\");\n\t\t\t\t\t\t$this->renderLink($tpl, $node[\"title\"], $node[\"obj_id\"],\n\t\t\t\t\t\t\t\"PageObject\", \"pg\", \"page\",\n\t\t\t\t\t\t\tilPCParagraph::_readAnchors($type, $node[\"obj_id\"], \"\"));\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$tpl->setCurrentBlock(\"chapter_list\");\n\t\t\t\t$tpl->parseCurrentBlock();\n\n\t\t\t\tbreak;\n\n\t\t\t// chapter link\n\t\t\tcase \"StructureObject\":\n\t\t\t\n\t\t\t\t// check whether current object matchs to type\n\t\t\t\tif (!in_array(ilObject::_lookupType($_SESSION[\"il_link_cont_obj\"], true),\n\t\t\t\t\tarray(\"lm\", \"dbk\")))\n\t\t\t\t{\n\t\t\t\t\t$this->changeTargetObject(\"lm\");\n\t\t\t\t}\n\n\t\t\t\tif ($type == \"lm\")\n\t\t\t\t{\n\t\t\t\t\trequire_once(\"./Modules/LearningModule/classes/class.ilObjLearningModule.php\");\n\t\t\t\t\t$cont_obj = new ilObjLearningModule($_SESSION[\"il_link_cont_obj\"], true);\n\t\t\t\t}\n\t\t\t\telse if ($type == \"dbk\")\n\t\t\t\t{\n\t\t\t\t\trequire_once(\"./Modules/LearningModule/classes/class.ilObjDlBook.php\");\n\t\t\t\t\t$cont_obj = new ilObjDlBook($_SESSION[\"il_link_cont_obj\"], true);\n\t\t\t\t}\n\n\t\t\t\t// get all chapters\n\t\t\t\t$ctree =& $cont_obj->getLMTree();\n\t\t\t\t$nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));\n\t\t\t\t$tpl->setCurrentBlock(\"chapter_list\");\n\t\t\t\t$tpl->setVariable(\"TXT_CONTENT_OBJECT\", $this->lng->txt(\"obj_lm\"));\n\t\t\t\t$tpl->setVariable(\"TXT_CONT_TITLE\", $cont_obj->getTitle());\n\t\t\t\t$tpl->setVariable(\"THEAD\", $this->lng->txt(\"link_chapters\"));\n\t\t\t\t$tpl->setCurrentBlock(\"change_cont_obj\");\n\t\t\t\t$tpl->setVariable(\"CMD_CHANGE_CONT_OBJ\", \"changeTargetObject\");\n\t\t\t\t$tpl->setVariable(\"BTN_CHANGE_CONT_OBJ\", $this->lng->txt(\"change\"));\n\t\t\t\t$tpl->parseCurrentBlock();\n\n\t\t\t\tforeach($nodes as $node)\n\t\t\t\t{\n\t\t\t\t\tif($node[\"type\"] == \"st\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->renderLink($tpl, $node[\"title\"], $node[\"obj_id\"],\n\t\t\t\t\t\t\t\"StructureObject\", \"st\", \"chap\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$tpl->setCurrentBlock(\"chapter_list\");\n\t\t\t\t$tpl->parseCurrentBlock();\n\t\t\t\tbreak;\n\n\t\t\t// glossary item link\n\t\t\tcase \"GlossaryItem\":\n\t\t\t\trequire_once(\"./Modules/Glossary/classes/class.ilObjGlossary.php\");\n\t\t\t\t$glossary =& new ilObjGlossary($_SESSION[\"il_link_glossary\"], true);\n\n\t\t\t\t// get all glossary items\n\t\t\t\t$terms = $glossary->getTermList();\n\t\t\t\t$tpl->setCurrentBlock(\"chapter_list\");\n\t\t\t\t$tpl->setVariable(\"TXT_CONTENT_OBJECT\", $this->lng->txt(\"glossary\"));\n\t\t\t\t$tpl->setVariable(\"TXT_CONT_TITLE\", $glossary->getTitle());\n\t\t\t\t$tpl->setVariable(\"THEAD\", $this->lng->txt(\"link_terms\"));\n\t\t\t\t$tpl->setCurrentBlock(\"change_cont_obj\");\n\t\t\t\t$tpl->setVariable(\"CMD_CHANGE_CONT_OBJ\", \"changeTargetObject\");\n\t\t\t\t$tpl->setVariable(\"BTN_CHANGE_CONT_OBJ\", $this->lng->txt(\"change\"));\n\t\t\t\t$tpl->parseCurrentBlock();\n\n\t\t\t\tforeach($terms as $term)\n\t\t\t\t{\n\t\t\t\t\t$this->renderLink($tpl, $term[\"term\"], $term[\"id\"],\n\t\t\t\t\t\t\"GlossaryItem\", \"git\", \"term\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$tpl->setCurrentBlock(\"chapter_list\");\n\t\t\t\t$tpl->parseCurrentBlock();\n\t\t\t\tbreak;\n\n\t\t\t// media object\n\t\t\tcase \"Media\":\n\t\t\t\tinclude_once(\"./Modules/MediaPool/classes/class.ilMediaPoolItem.php\");\n\t\t\t\t//$tpl->setVariable(\"TARGET2\", \" target=\\\"content\\\" \");\n\t\t\t\t// content object id = 0 --> get clipboard objects\n\t\t\t\tif ($_SESSION[\"il_link_mep\"] == 0)\n\t\t\t\t{\n\t\t\t\t\t$tpl->setCurrentBlock(\"change_cont_obj\");\n\t\t\t\t\t$tpl->setVariable(\"CMD_CHANGE_CONT_OBJ\", \"changeTargetObject\");\n\t\t\t\t\t$tpl->setVariable(\"BTN_CHANGE_CONT_OBJ\", $this->lng->txt(\"change\"));\n\t\t\t\t\t$tpl->parseCurrentBlock();\n\t\t\t\t\t$mobjs = $ilUser->getClipboardObjects(\"mob\");\n\t\t\t\t\t// sort by name\n\t\t\t\t\t$objs = array();\n\t\t\t\t\tforeach ($mobjs as $obj)\n\t\t\t\t\t{\n\t\t\t\t\t\t$objs[$obj[\"title\"].\":\".$obj[\"id\"]] = $obj;\n\t\t\t\t\t}\n\t\t\t\t\tksort($objs);\n\t\t\t\t\t$tpl->setCurrentBlock(\"chapter_list\");\n\t\t\t\t\t$tpl->setVariable(\"TXT_CONTENT_OBJECT\", $this->lng->txt(\"cont_media_source\"));\n\t\t\t\t\t$tpl->setVariable(\"TXT_CONT_TITLE\", $this->lng->txt(\"cont_personal_clipboard\"));\n\t\t\t\t\t$tpl->setVariable(\"THEAD\", $this->lng->txt(\"link_mobs\"));\n\t\t\t\t\t$tpl->setVariable(\"COLSPAN\", \"2\");\n\n\t\t\t\t\tforeach($objs as $obj)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->renderLink($tpl, $obj[\"title\"], $obj[\"id\"],\n\t\t\t\t\t\t\t\"MediaObject\", \"mob\", \"media\");\n\t\t\t\t\t}\n\t\t\t\t\t$tpl->setCurrentBlock(\"chapter_list\");\n\t\t\t\t\t$tpl->parseCurrentBlock();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\trequire_once(\"./Modules/MediaPool/classes/class.ilObjMediaPool.php\");\n\t\t\t\t\t$med_pool =& new ilObjMediaPool($_SESSION[\"il_link_mep\"], true);\n\t\t\t\t\t// get current folders\n\t\t\t\t\t$fobjs = $med_pool->getChilds($_SESSION[\"il_link_mep_obj\"], \"fold\");\n\t\t\t\t\t$f2objs = array();\n\t\t\t\t\tforeach ($fobjs as $obj)\n\t\t\t\t\t{\n\t\t\t\t\t\t$f2objs[$obj[\"title\"].\":\".$obj[\"child\"]] = $obj;\n\t\t\t\t\t}\n\t\t\t\t\tksort($f2objs);\n\t\t\t\t\t// get current media objects\n\t\t\t\t\t$mobjs = $med_pool->getChilds($_SESSION[\"il_link_mep_obj\"], \"mob\");\n\t\t\t\t\t$m2objs = array();\n\t\t\t\t\tforeach ($mobjs as $obj)\n\t\t\t\t\t{\n\t\t\t\t\t\t$m2objs[$obj[\"title\"].\":\".$obj[\"child\"]] = $obj;\n\t\t\t\t\t}\n\t\t\t\t\tksort($m2objs);\n\t\t\t\t\t\n\t\t\t\t\t// merge everything together\n\t\t\t\t\t$objs = array_merge($f2objs, $m2objs);\n\t\t\t\t\n\t\t\t\t\t$tpl->setCurrentBlock(\"chapter_list\");\n\t\t\t\t\t$tpl->setVariable(\"TXT_CONTENT_OBJECT\", $this->lng->txt(\"mep\"));\n\t\t\t\t\t$tpl->setVariable(\"TXT_CONT_TITLE\", $med_pool->getTitle());\n\t\t\t\t\t$tpl->setVariable(\"THEAD\", $this->lng->txt(\"link_mobs\"));\n\t\t\t\t\t$tpl->setCurrentBlock(\"change_cont_obj\");\n\t\t\t\t\t$tpl->setVariable(\"CMD_CHANGE_CONT_OBJ\", \"changeTargetObject\");\n\t\t\t\t\t$tpl->setVariable(\"BTN_CHANGE_CONT_OBJ\", $this->lng->txt(\"change\"));\n\t\t\t\t\t$tpl->setVariable(\"COLSPAN\", \"2\");\n\t\t\t\t\t$tpl->parseCurrentBlock();\n\t\t\t\t\tif ($parent_id = $med_pool->getParentId($_SESSION[\"il_link_mep_obj\"]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$css_row = \"tblrow1\";\n\t\t\t\t\t\t$tpl->setCurrentBlock(\"icon\");\n\t\t\t\t\t\t$tpl->setVariable(\"ICON_SRC\", ilUtil::getImagePath(\"icon_fold.svg\"));\n\t\t\t\t\t\t$tpl->parseCurrentBlock();\n\t\t\t\t\t\t$tpl->setCurrentBlock(\"link_row\");\n\t\t\t\t\t\t$tpl->setVariable(\"ROWCLASS\", $css_row);\n\t\t\t\t\t\t$tpl->setVariable(\"TXT_CHAPTER\", \"..\");\n\t\t\t\t\t\t$this->ctrl->setParameter($this, \"mep_fold\", $parent_id);\n\t\t\t\t\t\tif ($ilCtrl->isAsynch())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$tpl->setVariable(\"LINK\", \"#\");\n\t\t\t\t\t\t\t$tpl->setVariable(\"LR_ONCLICK\",\n\t\t\t\t\t\t\t\t\" onclick=\\\"return il.IntLink.setMepPoolFolder('\".$parent_id.\"');\\\" \");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$tpl->setVariable(\"LINK\",\n\t\t\t\t\t\t\t\t$this->ctrl->getLinkTarget($this, \"setMedPoolFolder\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$tpl->parseCurrentBlock();\n\t\t\t\t\t\t$tpl->setCurrentBlock(\"row\");\n\t\t\t\t\t\t$tpl->parseCurrentBlock();\n\t\t\t\t\t}\n\t\t\t\t\tforeach($objs as $obj)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($obj[\"type\"] == \"fold\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$css_row = ($css_row == \"tblrow2\")\n\t\t\t\t\t\t\t\t? \"tblrow1\"\n\t\t\t\t\t\t\t\t: \"tblrow2\";\n\t\t\t\t\t\t\t$tpl->setCurrentBlock(\"icon\");\n\t\t\t\t\t\t\t$tpl->setVariable(\"ICON_SRC\", ilUtil::getImagePath(\"icon_fold.svg\"));\n\t\t\t\t\t\t\t$tpl->parseCurrentBlock();\n\t\t\t\t\t\t\t$tpl->setCurrentBlock(\"link_row\");\n\t\t\t\t\t\t\t$tpl->setVariable(\"ROWCLASS\", $css_row);\n\t\t\t\t\t\t\t$tpl->setVariable(\"TXT_CHAPTER\", $obj[\"title\"]);\n\t\t\t\t\t\t\t$this->ctrl->setParameter($this, \"mep_fold\", $obj[\"child\"]);\n\t\t\t\t\t\t\tif ($ilCtrl->isAsynch())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$tpl->setVariable(\"LINK\", \"#\");\n\t\t\t\t\t\t\t\t$tpl->setVariable(\"LR_ONCLICK\",\n\t\t\t\t\t\t\t\t\t\" onclick=\\\"return il.IntLink.setMepPoolFolder('\".$obj[\"child\"].\"');\\\" \");\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$tpl->setVariable(\"LINK\",\n\t\t\t\t\t\t\t\t\t$this->ctrl->getLinkTarget($this, \"setMedPoolFolder\"));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$tpl->parseCurrentBlock();\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$fid = ilMediaPoolItem::lookupForeignId($obj[\"child\"]);\n\t\t\t\t\t\t\tif (ilObject::_lookupType($fid) == \"mob\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->renderLink($tpl, $obj[\"title\"], $fid,\n\t\t\t\t\t\t\t\t\t\"MediaObject\", \"mob\", \"media\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$tpl->setCurrentBlock(\"row\");\n\t\t\t\t\t\t$tpl->parseCurrentBlock();\n\t\t\t\t\t}\n\t\t\t\t\t$tpl->setCurrentBlock(\"chapter_list\");\n\t\t\t\t\t$tpl->parseCurrentBlock();\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// glossary item link\n\t\t\tcase \"WikiPage\":\n\t\t\t\t$wiki_id = ilObject::_lookupObjId($_SESSION[\"il_link_wiki\"]);\n\t\t\t\trequire_once(\"./Modules/Wiki/classes/class.ilWikiPage.php\");\n\t\t\t\t$wpages = ilWikiPage::getAllPages($wiki_id);\n\n\t\t\t\t// get all glossary items\n\t\t\t\t$tpl->setCurrentBlock(\"chapter_list\");\n\t\t\t\t$tpl->setVariable(\"TXT_CONTENT_OBJECT\", $this->lng->txt(\"obj_wiki\"));\n\t\t\t\t$tpl->setVariable(\"TXT_CONT_TITLE\", ilObject::_lookupTitle($wiki_id));\n\t\t\t\t$tpl->setVariable(\"THEAD\", $this->lng->txt(\"link_wpages\"));\n\t\t\t\t$tpl->setCurrentBlock(\"change_cont_obj\");\n\t\t\t\t$tpl->setVariable(\"CMD_CHANGE_CONT_OBJ\", \"changeTargetObject\");\n\t\t\t\t$tpl->setVariable(\"BTN_CHANGE_CONT_OBJ\", $this->lng->txt(\"change\"));\n\t\t\t\t$tpl->parseCurrentBlock();\n\n\t\t\t\tforeach($wpages as $wpage)\n\t\t\t\t{\n\t\t\t\t\t$this->renderLink($tpl, $wpage[\"title\"], $wpage[\"id\"],\n\t\t\t\t\t\t\"WikiPage\", \"wpage\", \"wpage\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$tpl->setCurrentBlock(\"chapter_list\");\n\t\t\t\t$tpl->parseCurrentBlock();\n\t\t\t\tbreak;\n\n\t\t\t// repository item\n\t\t\tcase \"RepositoryItem\":\n\t\t\t\t$tpl->setVariable(\"LINK_HELP_CONTENT\", $this->selectRepositoryItem());\n\t\t\t\tbreak;\n\n\t\t\t// file download link\n\t\t\tcase \"File\":\n\t\t\t\tif (!is_object($this->uploaded_file))\n\t\t\t\t{\n\t\t\t\t\t$tpl->setVariable(\"LINK_HELP_CONTENT\", $this->getFileLinkHTML());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo $this->getFileLinkHTML();\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t}\n\n\t\tif ($ilCtrl->isAsynch())\n\t\t{\n\t\t\techo $tpl->get();\n\t\t\texit;\n\t\t}\n\t\t\n\t\texit;\n\t}",
"public function displayLinks()\n {\n return (bool)$this->_scopeConfig->getValue(\n 'dnbbrand/brand_view/nextprev/enabled',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"protected function useEditLink() {\n return $this->pluginDefinition['_has_forms'] && $this->configuration['edit_link'] && !empty($this->configuration['edit_id']);\n }",
"public function getLinkTargetBlank()\n {\n return (bool) $this->getParsedValue()->TargetBlank;\n }",
"public function isLinkable(){\n\t\treturn 'guest' == $this->getRole() ? false : true;\n\t}",
"public function isLinkingEnabled()\n {\n return $this->dataHelper->isLinkingEnabled();\n }",
"function show_text()\n\t{\n\t\tif($this->edit)\n\t\t{\n\t\t\tif($this->required)\n\t\t\t\t$style = \"width:98%;border-color:red;border-style:solid\";\n\t\t\telse\n\t\t\t\t$style = \"width:98%;\";\n\n\t\t\techo \"<input style=\\\"\" . $style . \"\\\" type=\\\"text\\\" name=\\\"ldap_attribute_\"\n\t\t\t\t. $this->attribute . \"\\\" value=\\\"\"\n\t\t\t\t. htmlentities($this->value,ENT_COMPAT,\"UTF-8\")\n\t\t\t\t. \"\\\" title=\\\"\" . $this->display_name . \"\\\" placeholder=\\\"\"\n\t\t\t\t. $this->display_name . \"\\\">\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($this->show_embedded_links)\n\t\t\t\techo urls_to_links(htmlentities($this->value,ENT_COMPAT,\"UTF-8\"));\n\t\t\telse\n\t\t\t\techo htmlentities($this->value,ENT_COMPAT,\"UTF-8\");\n\t\t}\n\t}",
"public function getLinkRequired()\n {\n return $this->link_required;\n }",
"function qode_news_blog_item_has_link() {\n\t\t$is_link = ( is_single() && ( get_the_ID() === bridge_qode_get_page_id() ) ) ? false : true;\n\n\t\treturn $is_link;\n\t}",
"public function getLinktext()\r\n\t{\r\n\t\treturn $this->{Model_Bookmark_Table::F_LINKTEXT};\r\n\t}",
"public function isLinked()\n {\n return (bool) $this->get_default_property(self::PROPERTY_LINKED);\n }",
"public function isMediaLinkEntry()\n {\n return $this->_isMediaLinkEntry;\n }",
"public function isExternalLink() {\n\t\treturn $this->libraryType == self::TYPE_LINK;\n\t}",
"private function _categoryDisplayLink($category, $fields = false)\n {\n if ($fields === false) {\n //OLD WAY: Just check if it is enabled!\n\n $userGroup = (int)geoUser::getData(geoSession::getInstance()->getUserId(), 'group_id');\n $category = (int)$category;\n\n $fields = geoFields::getInstance($userGroup, $category);\n $return = (bool)$fields->addon_storefront_display_link->is_enabled;\n } else {\n $return = (isset($fields['addon_storefront_display_link']) && $fields['addon_storefront_display_link']);\n }\n return $return;\n }",
"public function mydoit_get(&$l_text, &$l_link)\n {\n return false;\n }",
"public function isDisplayable()\n {\n return $this->getDisplay() && $this->getLabel();\n }",
"function link($image,$text=\"\",$uri,$help=\"\",$helpfree=\"\",$name=\"\")\r\n {\r\n if (right::field_view($help))\r\n {\r\n $retString = \"\";\r\n if ($name) $retString .= \"<a name='anchor$name'></a>\"; // insert anchor\r\n \r\n if (right::field_edit($help)) // editable: enable edit\r\n {\r\n $retString .= \"<a href='$uri'\";\r\n \t\t if ($help or $helpfree) $retString .= help::show($help,$helpfree);\r\n $retString .= \">\";\r\n \r\n if ($image) $retString .= grafik::disp($image,$text,20);\r\n else $retString .= $text;\r\n $retString .= \"</a>\";\r\n }\r\n else\r\n {\r\n $retString .= $text;\r\n }\r\n }\r\n return ($retString);\r\n }",
"function rds_link() {\n?>\n\t<input type=\"checkbox\" name=\"clean_up_rsd_link\" id=\"clean_up_rsd_link\" value=\"1\" <?php checked( (bool) get_option( 'clean_up_rsd_link' ) ); ?>\" />\n\t<label for=\"clean_up_rsd_link\" class=\"small\">RSD - Really Simple Discovery, is the discover mechanism used by XML-RPC clients.</label>\n<?php\n\t}",
"public function hasLinktarget()\n {\n return $this->linktarget !== null;\n }",
"public function getUsedDefault()\n {\n return $this->getProduct()->getAttributeDefaultValue('links_title') === false;\n }",
"function textbutton($linkText,$linkURL){\n\t$internalVar = '';\n\tif($linkURL != '') $internalVar .= '<a href=\"'.$linkURL.'\" class=\"HTML_button\"> ';\n\t$internalVar .= stripslashes($linkText);\n\tif($linkURL != '') $internalVar .= ' </a>';\n\treturn $internalVar;\n}",
"public function getIsSetExternalLinkAttribute()\n {\n $id = $this->attributes['id'];\n $ext_links = DB::table('admin_external_links')\n ->where('rel_id', $id)\n ->where('type', 'orden')\n ->get();\n\n if (count($ext_links) > 0)\n {\n return true;\n } else {\n return false;\n }\n }",
"abstract public function linkModelField();",
"function plugin_cclabel_links2()\n{\n global $_CONF, $LANG_LINKS;\n\n if (SEC_hasRights ('links.edit')) {\n return array ($LANG_LINKS[14],\n $_CONF['site_admin_url'] . '/plugins/links/index.php',\n plugin_geticon_links ());\n }\n\n return false;\n}",
"function display_blog_element()\n{\n\t?>\n\t\t<input type=\"text\" name=\"blog_link\" id=\"blog_link\" value=\"<?php echo get_option('blog_link'); ?>\" size=\"50\"/>\n \t\n <?php\n}",
"public function validate_link(){\n \n \n if($this->syllabus_m->validate_link()){\n \n return true;\n }\n else{\n $this->form_validation->set_message('validate_link','Youtube link is already in use'); //setting the message for the function form_validation\n return false;\n }\n }"
] | [
"0.708308",
"0.69187635",
"0.6885833",
"0.6559277",
"0.64864194",
"0.6453789",
"0.6437686",
"0.62480074",
"0.6238691",
"0.62172437",
"0.61680675",
"0.6101511",
"0.6091056",
"0.6080908",
"0.6068884",
"0.6052252",
"0.6024369",
"0.60162336",
"0.59843314",
"0.5979276",
"0.59727967",
"0.59567714",
"0.59529465",
"0.5927818",
"0.5914821",
"0.591278",
"0.5912055",
"0.5911358",
"0.58702046",
"0.5844357"
] | 0.7096258 | 0 |
Loads some XML from a string, appends a child, and then saves the XML | function loadXMLappendElementdAndSave()
{
$strXML =
'<?xml version="1.0" encoding="utf-8"?>
<eZREST function="This is the functionName"/>
<eZREST function="This is the functionName2"/>
';
$domDocument = $this->createDocument();
$domDocument->loadXML( $strXML );
$rootElement =& $domDocument->createElement( 'eZREST2' );
$rootElement->setAttribute( 'function', 'This is the functionName added 2' );
$domDocument->appendChild( $rootElement );
return $domDocument->saveXML();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function appendXML($data);",
"function addXmlString($string, $xpath = null)\r\n {\r\n $this->doXmlString2Xml($string, $xpath);\r\n }",
"public function add_xml($id = \"\"){\n\n\t\t$before = true;\n\t\t$position = 1;\n\t\t\n\t\t$this->dom->loadXML($this->xml->asXML());\n\t\t$xpath = new DOMXpath($this->dom);\n\t\t$has_node = false;\n\t\t\n\t\t// Get position to insert element into\n\t\tif(isset($this->sectionParameters['pubDate']))\n\t\t\t$date = $this->sectionParameters['pubDate']['value'];\n\t\telse\n\t\t\t$date = date('r');\n\t\t$position = $this->find_node_by_date(strtotime($date));\n\t\t\n\t\t// get total count of elements\n\t\t$count = $xpath->query(\"//item\")->length;\n\t\tif($count < $position || $count == 0)\n\t\t{\n\t\t\t// we will be inserting the element last (after)\n\t\t\t$before = false;\n\t\t\t\n\t\t\t// the position to find is the last element in the list\n\t\t\t$position = $count;\n\t\t}\n\n\t\tif(empty($id))\n\t\t\t$id = $this->getNewId();\n\t\t\n\t\tif($before)\n\t\t{\n\t\t\t$nodes = $xpath->query(\"//item[\".$position.\"]\");\n\t\t\tforeach($nodes as $node){\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$contents = $this->createNode($id);\n\t\t\t\t}catch(Exception $e){\n\t\t\t\t\tthrow $e;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// append new 'item' to dom\n\t\t\t\t$node->parentNode->insertBefore($contents, $node);\n\t\t\t\t$has_node = true;\n\t\t\t}\n\t\t}\n\t\n\t\t// =========================================\n\t\t//\tIF THERE ARE NO ITEMS TO START WITH\n\t\t// =========================================\n\t\tif(!$has_node)\n\t\t{\n\t\t\t$nodes = $xpath->query(\"//channel\");\n\t\t\tforeach($nodes as $node){\n\n\t\t\t\t$contents = $this->createNode($id);\n\t\t\t\t\n\t\t\t\t// append new 'item' to dom\n\t\t\t\t$node->appendChild($contents);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// transfer back to simpleXML\n\t\tif(!$this->xml = simplexml_import_dom($this->dom))\n\t\t\tthrow new Exception(\"Error loading XML.\");\n\n\t\tif($this->debugging)\n\t\t\t$this->printDebug($this->xml, 'Added Section');\n\n\t\treturn true;\n\t}",
"abstract public function saveXml();",
"public function loadXml($xml_string);",
"function add_book ($xmlDoc,$subNode,$nameInput,$pagesInput,$authorInput){\n\n $book=$xmlDoc->createElement('book');\n $subNode->appendChild($book);\n \n $name =$xmlDoc->createElement('name',$nameInput);\n $book->appendChild($name);\n \n $pages=$xmlDoc->createElement('pages',$pagesInput);\n $book->appendChild($pages);\n \n $author =$xmlDoc->createElement('auther',$authorInput);\n $book->appendChild($author);\n \n}",
"public function loadString($string) {\n\t\t\t$dom = @simplexml_load_string($string);\n\t\t\tif ($dom instanceof \\SimpleXMLElement) {\n\t\t\t\t$this->node = $dom;\n\n\t\t\t\treturn $dom;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new XmlParseException('', $string);\n\t\t\t}\n\t\t}",
"public static function load_xml($string='') {\n $xml = simplexml_load_string($string);\n //echo \"<p>xml:<pre>\"; print_r($xml); echo \"</pre></p>\";\n return $xml;\n }",
"public function append(&$xml)\n {\n foreach($xml->children() as $simplexml_child)\n {\n $simplexml_temp = $this->addChild($simplexml_child->getName(), (string)$simplexml_child);\n\n foreach($simplexml_child->attributes() as $attr_key => $attr_value)\n {\n $simplexml_temp->addAttribute($attr_key, $attr_value);\n }\n\n $this->append($simplexml_child);\n }\n }",
"protected function insertElement(/*string*/ $xml)\n\t{\n\t\t// Add the url element\n\t\t$xml\t= '<url>' . $xml . ($this->bMobile ? '<mobile:mobile/>' : '') . '</url>';\n\n\t\t// What is the total size of the XML?\n\t\t$iSize\t= strlen($xml);\n\n\t\t// Is the size of the header plus the items is above the max, or the\n\t\t//\tmax number of items has already been met\n\t\t$iTotal = $iSize + $this->aCurrSitemap['size'] + $this->aCurrSitemap['head']['size'];\n\t\tif($iTotal > self::MAX_SIZE ||\n\t\t\tcount($this->aCurrSitemap['items']) >= self::MAX_ITEMS)\n\t\t{\n\t\t\t// This will close the existing sitemap and open a new one for\n\t\t\t//\tthe new item\n\t\t\t$this->extendSitemap();\n\t\t}\n\n\t\t// Add the XML to the items\n\t\t$this->aCurrSitemap['items'][]\t= $xml;\n\t\t$this->aCurrSitemap['size']\t\t+= $iSize;\n\t}",
"function _addXMLchild( & $parent, $name, $type, $content, $params=array()) {\r\n static $fmtYmd = '%04d-%02d-%02d';\r\n static $fmtYmdHis = '%04d-%02d-%02dT%02d:%02d:%02d';\r\n /** create new child node */\r\n $name = strtolower( $name );\r\n $child = $parent->addChild( $name );\r\n if( !empty( $params )) {\r\n $parameters = $child->addChild( 'parameters' );\r\n foreach( $params as $param => $parVal ) {\r\n if( 'VALUE' == $param )\r\n continue;\r\n $param = strtolower( $param );\r\n if( 'x-' == substr( $param, 0, 2 )) {\r\n $p1 = $parameters->addChild( $param );\r\n $p2 = $p1->addChild( 'unknown', htmlspecialchars( $parVal ));\r\n }\r\n else {\r\n $p1 = $parameters->addChild( $param );\r\n switch( $param ) {\r\n case 'altrep':\r\n case 'dir': $ptype = 'uri'; break;\r\n case 'delegated-from':\r\n case 'delegated-to':\r\n case 'member':\r\n case 'sent-by': $ptype = 'cal-address'; break;\r\n case 'rsvp': $ptype = 'boolean'; break ;\r\n default: $ptype = 'text'; break;\r\n }\r\n if( is_array( $parVal )) {\r\n foreach( $parVal as $pV )\r\n $p2 = $p1->addChild( $ptype, htmlspecialchars( $pV ));\r\n }\r\n else\r\n $p2 = $p1->addChild( $ptype, htmlspecialchars( $parVal ));\r\n }\r\n }\r\n } // end if( !empty( $params ))\r\n if(( empty( $content ) && ( '0' != $content )) || ( !is_array( $content) && ( '-' != substr( $content, 0, 1 ) && ( 0 > $content ))))\r\n return;\r\n /** store content */\r\n switch( $type ) {\r\n case 'binary':\r\n $v = $child->addChild( $type, $content );\r\n break;\r\n case 'boolean':\r\n break;\r\n case 'cal-address':\r\n $v = $child->addChild( $type, $content );\r\n break;\r\n case 'date':\r\n if( array_key_exists( 'year', $content ))\r\n $content = array( $content );\r\n foreach( $content as $date ) {\r\n $str = sprintf( $fmtYmd, (int) $date['year'], (int) $date['month'], (int) $date['day'] );\r\n $v = $child->addChild( $type, $str );\r\n }\r\n break;\r\n case 'date-time':\r\n if( array_key_exists( 'year', $content ))\r\n $content = array( $content );\r\n foreach( $content as $dt ) {\r\n if( !isset( $dt['hour'] )) $dt['hour'] = 0;\r\n if( !isset( $dt['min'] )) $dt['min'] = 0;\r\n if( !isset( $dt['sec'] )) $dt['sec'] = 0;\r\n $str = sprintf( $fmtYmdHis, (int) $dt['year'], (int) $dt['month'], (int) $dt['day'], (int) $dt['hour'], (int) $dt['min'], (int) $dt['sec'] );\r\n if( isset( $dt['tz'] ) && ( 'Z' == $dt['tz'] ))\r\n $str .= 'Z';\r\n $v = $child->addChild( $type, $str );\r\n }\r\n break;\r\n case 'duration':\r\n $output = (( 'trigger' == $name ) && ( FALSE !== $content['before'] )) ? '-' : '';\r\n $v = $child->addChild( $type, $output.iCalUtilityFunctions::_duration2str( $content ) );\r\n break;\r\n case 'geo':\r\n if( !empty( $content )) {\r\n $v1 = $child->addChild( 'latitude', iCalUtilityFunctions::_geo2str2( $content['latitude'], iCalUtilityFunctions::$geoLatFmt ));\r\n $v1 = $child->addChild( 'longitude', iCalUtilityFunctions::_geo2str2( $content['longitude'], iCalUtilityFunctions::$geoLongFmt ));\r\n }\r\n break;\r\n case 'integer':\r\n $v = $child->addChild( $type, (string) $content );\r\n break;\r\n case 'period':\r\n if( !is_array( $content ))\r\n break;\r\n foreach( $content as $period ) {\r\n $v1 = $child->addChild( $type );\r\n $str = sprintf( $fmtYmdHis, (int) $period[0]['year'], (int) $period[0]['month'], (int) $period[0]['day'], (int) $period[0]['hour'], (int) $period[0]['min'], (int) $period[0]['sec'] );\r\n if( isset( $period[0]['tz'] ) && ( 'Z' == $period[0]['tz'] ))\r\n $str .= 'Z';\r\n $v2 = $v1->addChild( 'start', $str );\r\n if( array_key_exists( 'year', $period[1] )) {\r\n $str = sprintf( $fmtYmdHis, (int) $period[1]['year'], (int) $period[1]['month'], (int) $period[1]['day'], (int) $period[1]['hour'], (int) $period[1]['min'], (int) $period[1]['sec'] );\r\n if( isset($period[1]['tz'] ) && ( 'Z' == $period[1]['tz'] ))\r\n $str .= 'Z';\r\n $v2 = $v1->addChild( 'end', $str );\r\n }\r\n else\r\n $v2 = $v1->addChild( 'duration', iCalUtilityFunctions::_duration2str( $period[1] ));\r\n }\r\n break;\r\n case 'recur':\r\n $content = array_change_key_case( $content );\r\n foreach( $content as $rulelabel => $rulevalue ) {\r\n switch( $rulelabel ) {\r\n case 'until':\r\n if( isset( $rulevalue['hour'] ))\r\n $str = sprintf( $fmtYmdHis, (int) $rulevalue['year'], (int) $rulevalue['month'], (int) $rulevalue['day'], (int) $rulevalue['hour'], (int) $rulevalue['min'], (int) $rulevalue['sec'] ).'Z';\r\n else\r\n $str = sprintf( $fmtYmd, (int) $rulevalue['year'], (int) $rulevalue['month'], (int) $rulevalue['day'] );\r\n $v = $child->addChild( $rulelabel, $str );\r\n break;\r\n case 'bysecond':\r\n case 'byminute':\r\n case 'byhour':\r\n case 'bymonthday':\r\n case 'byyearday':\r\n case 'byweekno':\r\n case 'bymonth':\r\n case 'bysetpos': {\r\n if( is_array( $rulevalue )) {\r\n foreach( $rulevalue as $vix => $valuePart )\r\n $v = $child->addChild( $rulelabel, $valuePart );\r\n }\r\n else\r\n $v = $child->addChild( $rulelabel, $rulevalue );\r\n break;\r\n }\r\n case 'byday': {\r\n if( isset( $rulevalue['DAY'] )) {\r\n $str = ( isset( $rulevalue[0] )) ? $rulevalue[0] : '';\r\n $str .= $rulevalue['DAY'];\r\n $p = $child->addChild( $rulelabel, $str );\r\n }\r\n else {\r\n foreach( $rulevalue as $valuePart ) {\r\n if( isset( $valuePart['DAY'] )) {\r\n $str = ( isset( $valuePart[0] )) ? $valuePart[0] : '';\r\n $str .= $valuePart['DAY'];\r\n $p = $child->addChild( $rulelabel, $str );\r\n }\r\n else\r\n $p = $child->addChild( $rulelabel, $valuePart );\r\n }\r\n }\r\n break;\r\n }\r\n case 'freq':\r\n case 'count':\r\n case 'interval':\r\n case 'wkst':\r\n default:\r\n $p = $child->addChild( $rulelabel, $rulevalue );\r\n break;\r\n } // end switch( $rulelabel )\r\n } // end foreach( $content as $rulelabel => $rulevalue )\r\n break;\r\n case 'rstatus':\r\n $v = $child->addChild( 'code', number_format( (float) $content['statcode'], 2, '.', ''));\r\n $v = $child->addChild( 'description', htmlspecialchars( $content['text'] ));\r\n if( isset( $content['extdata'] ))\r\n $v = $child->addChild( 'data', htmlspecialchars( $content['extdata'] ));\r\n break;\r\n case 'text':\r\n if( !is_array( $content ))\r\n $content = array( $content );\r\n foreach( $content as $part )\r\n $v = $child->addChild( $type, htmlspecialchars( $part ));\r\n break;\r\n case 'time':\r\n break;\r\n case 'uri':\r\n $v = $child->addChild( $type, $content );\r\n break;\r\n case 'utc-offset':\r\n if( in_array( substr( $content, 0, 1 ), array( '-', '+' ))) {\r\n $str = substr( $content, 0, 1 );\r\n $content = substr( $content, 1 );\r\n }\r\n else\r\n $str = '+';\r\n $str .= substr( $content, 0, 2 ).':'.substr( $content, 2, 2 );\r\n if( 4 < strlen( $content ))\r\n $str .= ':'.substr( $content, 4 );\r\n $v = $child->addChild( $type, $str );\r\n break;\r\n case 'unknown':\r\n default:\r\n if( is_array( $content ))\r\n $content = implode( '', $content );\r\n $v = $child->addChild( 'unknown', htmlspecialchars( $content ));\r\n break;\r\n }\r\n}",
"private function _addNewElement($xml){\r\n \r\n $xmldoc = App::get(XmlElements::class);\r\n \r\n if($xmldoc->loadXMLFile('map.xml', PROJECT_PATH, TRUE)){\r\n \r\n //create folder list\r\n $folder['model'] = $xml['model_folder'];\r\n $folder['controller'] = $xml['controller_folder'];\r\n $folder['view'] = $xml['views_folder'];\r\n $folder['schema'] = $xml['schema_folder'];\r\n \r\n //create element attributes\r\n $attrs['name'] = $xml['element'];\r\n $attrs['path'] = $xml['mappath'];\r\n $attrs['acl'] = 0;\r\n $attrs['visibility'] = 'public';\r\n \r\n $xmldoc->addElement($xml['element'], $folder, $attrs);\r\n }\r\n }",
"function doXmlString2Xml ($string,$xpath = null)\r\n {\r\n $MainXmlString = $this->xmldoc->dumpmem();\r\n $string = preg_replace(\"/<\\?xml.*\\?>/\",\"\",$string);\r\n\r\n $MainXmlString = preg_replace(\"/<\".$this->xmlroot->{$this->tagname}.\"\\/>/\",\"<\".$this->xmlroot->{$this->tagname}.\"></\".$this->xmlroot->{$this->tagname}.\">\",$MainXmlString);\r\n $MainXmlString = preg_replace(\"/<\\/\".$this->xmlroot->{$this->tagname}.\">/\",$string.\"</\".$this->xmlroot->{$this->tagname}.\">\",$MainXmlString);\r\n\r\n $this->xmldoc = xmldoc($MainXmlString);\r\n $this->xmlroot = $this->xmldoc->root();\r\n }",
"public function merge(string $xml): void\n {\n $dom = $this->initDom($xml);\n $this->mergeNode($dom->documentElement, '');\n }",
"function archaeoML_update($xmlString){\n\t\n\t$archaeoML = false;\n\t$xmlString = $this->archaeoml_fix($xmlString);\n\t$xmlString = $this->namespace_fix($xmlString);\n\t@$spatialItem = simplexml_load_string($xmlString);\n\tif($spatialItem){\n\t //valid XML, OK to add to database\n\t $spatialItem->registerXPathNamespace(\"oc\", self::OC_namespaceURI);\n\t $spatialItem->registerXPathNamespace(\"arch\", OpenContext_OCConfig::get_namespace(\"arch\", \"spatial\"));\n\t $spatialItem->registerXPathNamespace(\"dc\", OpenContext_OCConfig::get_namespace(\"dc\"));\n\t $spatialItem = $this->obsNumber_Add($spatialItem);\n\t $spatialItem = $this->propLinks_Add($spatialItem);\n\t $spatialItem = $this->spaceLinks_Add($spatialItem);\n\t $spatialItem = $this->mediaLinks_Add($spatialItem);\n\t $spatialItem = $this->documentLinks_Add($spatialItem);\n\t $spatialItem = $this->personLinks_Add($spatialItem);\n\t $spatialItem = $this->parentLinks_Add($spatialItem);\n\t $spatialItem = $this->childLinks_Add($spatialItem);\n\t $spatialItem = $this->metaLinks_Add($spatialItem);\n\t $spatialItem = $this->geoUpdate($spatialItem);\n\t $spatialItem = $this->chronoUpdate($spatialItem);\n\t \n\t //if no database item, add it\n\t if(!$this->itemFound){\n\t\t$this->database_add($spatialItem);\n\t }\n\t \n\t $archaeoML = $spatialItem->asXML();\n\t \n\t $archaeoML = str_replace('<?xml version=\"1.0\"?>', '', $archaeoML);\n\t $doc = new DOMDocument('1.0', 'UTF-8');\n\t $doc->loadXML($archaeoML);\n\t $doc->formatOutput = true;\n\t $archaeoML = $doc->saveXML();\n\t \n\t $this->newArchaeoML = $archaeoML;\n\t unset($spatialItem);\n\t $this->committ_update_archaeoML();\n\t}\n\t\n\treturn $archaeoML;\n }",
"public function MySimpleXml_inser_xmlNode_by_contents($appendContents, $appendToTagName){\n $contentQueue = new myQueue();\n $handle = fopen($this->file, \"r\");\n $newFileHandle = fopen(\"new_test.xml\",\"w\");\n $contents = '';\n $message = '';\n $CommentStart = false;\n $linenum = 1;\n\n while (!feof($handle))\n {\n $contents = fread($handle, 1);\n if($contents==\"\\r\")\n {\n $contents = fread($handle, 1);\n if($contents==\"\\n\");\n {\n $linenum++;\n continue;\n }\n }\n $message = '';\n //echo $contents;\n if($contents==\"<\")\n {\n if(!$CommentStart)\n {\n $LessThanSymbolAppear = true;\n while(!$contentQueue->isQueueEmpty())\n {\n $message.= $contentQueue->dequeue();\n }\n }\n //echo $message;\n $contentQueue->enqueue($contents);\n }\n else if ($contents==\">\")\n {\n $contentQueue->enqueue($contents);\n if($LessThanSymbolAppear) //dequeue all contents\n { \n while(!$contentQueue->isQueueEmpty())\n {\n $message.= $contentQueue->dequeue();\n }\n $LessThanSymbolAppear = false;\n }\n else if($CommentStart&&$HyphenSymbolCnt>=4)\n { \n while(!$contentQueue->isQueueEmpty())\n {\n $message.= $contentQueue->dequeue();\n }\n $CommentStart = false;\n $HyphenSymbolCnt = 0;\n }\n //echo $message;\n }\n else if($contents=='-'&&$CommentStart)\n {\n $HyphenSymbolCnt++;\n $contentQueue->enqueue($contents);\n }\n else\n {\n $contentQueue->enqueue($contents);\n if($contents=='!'&&$LessThanSymbolAppear)\n {\n $LessThanSymbolAppear = false;\n $CommentStart = true;\n }\n }\n $message = trim ($message, \"\\t\\n\\r\\0\\x0B\");\n if($message==\"</\".$appendToTagName.\">\")\n {\n fwrite($newFileHandle, $appendContents, strlen($appendContents));\n }\n fwrite($newFileHandle, $message, strlen($message));\n }\n fclose($handle);\n fclose($newFileHandle);\n \n //It needs to take an action to save the new xml file back to the old one\n if (!copy(\"new_test.xml\", \"test\"))\n {\n echo \"failed to copy xml file ...\\n\";\n }\n }",
"public function appendXML( ExtendedSimpleXMLElement $append)\n {\n if ($append) {\n if (strlen(trim((string)$append)) == 0) {\n $xml = $this->addChild($append->getName());\n } else {\n $xml = $this->addChild($append->getName(), (string)$append);\n }\n\n foreach ($append->children() as $child) {\n $xml->appendXML($child);\n }\n\n foreach ($append->attributes() as $n => $v) {\n $xml->addAttribute($n, $v);\n }\n }\n }",
"function appendChild(&$child) {\n \n // Set child's parentNode\n $child->parentNode = & $this;\n \n // Add child to list of childNodes\n $this->childNodes[] = & $child;\n \n // Is child of type node?\n if ($child->nodeType == XML_TYPE_NODE) {\n \n // Set child's previousSibling\n $child->previousSibling = & $this->lastChild;\n }\n \n // Is this node of type node?\n if ($this->nodeType != null && $this->nodeType == XML_TYPE_NODE) {\n \n // Set current lastChild's nextSibling to this child\n if (!is_null($this->lastChild)) {\n $this->lastChild->nextSibling = & $child;\n }\n \n // Now (re)set firstChild and lastChild\n $this->firstChild = & $this->childNodes[0];\n $this->lastChild = & $child;\n }\n \n }",
"private function save_dom( $dom ) {\n\t\t$all_node = $dom->childNodes->item( 0 );\n\t\t$output = $dom->SaveXML( $all_node );\n\t\t$global_tag_length = strlen( self::$global_tag );\n\t\t// + 2 is for the < and > symbols\n\t\t$this->content = substr( $output, $global_tag_length + 2, strlen( $output ) -2* $global_tag_length - 5 );\n\t}",
"function load_from_str($str) {\n\t\t$this->feed = simplexml_load_string($str);\n\t\treturn $this->feed;\n\t}",
"function add($clg)\n{\n\t$file = (string)($clg.\".xml\");\n\n\t$doc = new DOMDocument();\n\t//$doc->load(\"write.xml\");\n\t$doc->formatOutput = true;\n\n\t$r = $doc->createElement(\"campus\");\n\t$doc->appendChild($r);\n\n\t$b = $doc->createElement(\"new\");\n\t$name = $doc->createElement(\"n1\");\n\t$name->appendChild(\n\t $doc->createTextNode(\"Add New Events\")\n\t );\n\t$b->appendChild($name);\n\t$r->appendChild($b);\n\n\t$b = $doc->createElement(\"story\");\n\t$name = $doc->createElement(\"s1\");\n\t$name->appendChild(\n\t $doc->createTextNode(\"Add Stories\")\n\t );\n\t$b->appendChild($name);\n\t$r->appendChild($b);\n\n\n\t$b = $doc->createElement(\"events\");\n\t$name = $doc->createElement(\"e1\");\n\t$name->appendChild(\n\t $doc->createTextNode(\"Add Events\")\n\t );\n\t$b->appendChild($name);\n\t$r->appendChild($b);\n\n\t$b = $doc->createElement(\"photos\");\n\t$name = $doc->createElement(\"p1\");\n\t$name->appendChild(\n\t $doc->createTextNode(\"No Photos\")\n\t );\n\t$b->appendChild($name);\n\t$r->appendChild($b);\n\n\t$b = $doc->createElement(\"other\");\n\t$name = $doc->createElement(\"o1\");\n\t$name->appendChild(\n\t $doc->createTextNode(\"Other Items\")\n\t );\n\t$b->appendChild($name);\n\t$r->appendChild($b);\n\n\t//echo $doc->saveXML();\n\t $doc->save($file);\n }",
"public function addChild($element) {\n if($element && $element instanceof XMLCreator) {\n array_push($this->children, $element);\n }\n }",
"function appendChild (Node $child)\n\t{\n\t\t//Attributes can be inserted\n\t\tif ($child instanceof Attr) {\n\t\t\tthrow new DomException(\"Node cannot be inserted at the specified point in the hierarchy\");\n\t\t}\n\t\t//If the node to add is a document fragment insert its child nodes \n\t\t//instead of it and remove them from the fragment\n\t\tif ($child->nodeType === 11) {\n\t\t\t$i = $child->childNodes->length;\n\t\t\twhile ($i) {\n\t\t\t\t$removed = $child->removeChild($child->childNodes[0]);\n\t\t\t\t$this->appendChild($removed);\n\t\t\t\t$i--;\n\t\t\t}\n\t\t\treturn $child;\n\t\t}\n\t\t//Remove the child from its parent node before continue\n\t\tif ($child->parentNode) {\n\t\t\t$child->parentNode->removeChild($child);\n\t\t}\n\t\t$child->parentNode = $this;\n\t\t$this->childNodes->_appendNode($child);\n\t\treturn $child;\n\t}",
"function saveXML() {\n $result = '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>'.\"\\n\";\n $result .= '<feed xmlns=\"http://www.w3.org/2005/Atom\">'.\"\\n\";\n $result .= '<updated>'.gmdate('Y-m-d\\\\TH:i:s\\\\Z', $this->updated).'</updated>'.\"\\n\";\n $result .= $this->id->saveXML('id');\n $result .= $this->title->saveXML('title');\n $result .= $this->subtitle->saveXML('subtitle');\n if (!empty($this->icon)) {\n $result .= '<icon>'.htmlspecialchars($this->icon).'</icon>'.\"\\n\";\n }\n if (!empty($this->logo)) {\n $result .= '<logo>'.htmlspecialchars($this->logo).'</logo>'.\"\\n\";\n }\n $result .= $this->generator->saveXML('generator');\n $result .= $this->authors->saveXML('author');\n $result .= $this->contributors->saveXML('contributor');\n $result .= $this->categories->saveXML('category');\n $result .= $this->links->saveXML('link');\n $result .= $this->entries->saveXML('entry');\n $result .= '</feed>';\n return $result;\n }",
"public function testAppendChild()\n {\n $root = new Node('<b>Test 1</b>');\n $element = new Node('<b>Test 2</b>');\n $root->appendChild($element);\n $this->assertEquals('<b>Test 1</b><b>Test 2</b>', $root->outerHtml());\n }",
"function SimpleXMLElement_append($key, $value) {\n // check class\n if ((get_class($key) == 'SimpleXMLElement')\n && (get_class($value) == 'SimpleXMLElement')) {\n // check if the value is string value / data\n if (trim((string) $value) == '') {\n // add element and attributes\n $element = $key->addChild($value->getName());\n foreach ($value->attributes() as $attKey => $attValue) {\n $element->addAttribute($attKey, $attValue);\n }\n // add children\n foreach ($value->children() as $child) {\n SimpleXMLElement_append($element, $child);\n }\n } else {\n // set the value of this item\n $element = $key->addChild($value->getName(), trim((string) $value));\n }\n } else {\n // throw an error\n throw new Exception('Wrong type: expected SimpleXMLElement');\n }\n}",
"function mergeXML(&$base, $add) { \n\t\tif ($add->count() != 0)\n\t\t\t$new = $base->addChild($add->getName());\n\t\telse \n\t\t\t$new = $base->addChild($add->getName(), $add);\n\t\tforeach ($add->attributes() as $a => $b)\n\t\t\t$new->addAttribute($a, $b);\n\t\tif ($add->count() != 0) { \n\t\t\tforeach ($add->children() as $child) \n\t\t\t mergeXML($new, $child);\n\t\t} \n\t}",
"function xml_adopt2($root, $new, $namespace = null) {\n // NOTE: addChild does NOT escape \"&\" ampersands in (string)$new !!!\n // replace them or use htmlspecialchars(). see addchild docs comments.\n $node = $root->addChild($new->getName(), (string) $new, $namespace);\n // add any attributes for the new node\n foreach($new->attributes() as $attr => $value) {\n $node->addAttribute($attr, $value);\n }\n // get all namespaces, include a blank one\n $namespaces = array_merge(array(null), $new->getNameSpaces(true));\n // add any child nodes, including optional namespace\n foreach($namespaces as $space) {\n foreach ($new->children($space) as $child) {\n xml_adopt($node, $child, $space);\n }\n }\n}",
"protected function takeChildFromDOM( $child ) {\n $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;\n switch ( $absoluteNodeName ) {\n case $this->lookupNamespace( 'atom' ) . ':' . 'content':\n \t$content = new Webready_Gdata_Extension_Content( );\n $content->transferFromDOM( $child );\n $this->_mapContent = $content;\n break;\n default:\n parent::takeChildFromDOM( $child );\n break;\n }\n }",
"function parseXML($xmlString, $level, $dataPath) {\n\t\tif ($xmlString == null) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$currType = $xmlString->getName();\n\t\t$currID = $xmlString[\"id\"];\n\t\t$currIDToDisplay = $xmlString[\"name\"];\n\t\t$currRequires = $xmlString[\"requires\"];\n\t\t$currText = $xmlString[\"text\"];\n\t\tif ($dataPath != '') {\n\t\t\t$dataPath = $dataPath . \",\" . \"\\\"\" . $currID . \"\\\"\";\n\t\t} else {\n\t\t\t$dataPath = \"\\\"\" . $currID . \"\\\"\";\n\t\t}\n\t\t$indentation = -30;\n\t\t\n\t\tfor ($i=0;$i<$level;$i++) {\n\t\t\t$indentation += 30;\n\t\t}\n\t\n\t\techo '<div class=\"preview\" id=\"'.$currID.'\" style=\"left:'. $indentation .'px;width:'.(832-$indentation).'px;\">\n\t\t\t\t\t<div class=\"preview-content\">';\n\t\t\t\t\t\t\t\n\n\t\t// Process video/activity child elements first\n\t\tforeach($xmlString->children() as $child) {\n\t\t\t$childType = $child->getName();\n\t\t\t$childID = $child[\"id\"];\n\t\t\n\t\t\tif ($childType == 'video' || $childType == 'activity') {\n\t\t\t\t$currName = $child;\t\n\t\t\t} else {\n\t\t\t\t//$currName = ucfirst(strtolower(str_replace(\"_\", \" \", $childID)));\n\t\t\t\t$currName = $child['name'];\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\techo '<div data-id=\"'.$childID.'\" data-path=\\'['.$dataPath.']\\' class=\"preview-item preview-' . $childType . '-item transition-all\">\n\t\t\t\t\t\t<h6>' . $childType . '</h6>\n\t\t\t\t\t\t<p>' . $currName . '</p>\n\t\t\t\t </div>';\n\t\t\t\n\t\t}\n\t\t\n\t\techo '\t\t<div id=\"\" data-parent=\\'' . $currID .'\\' data-path=\\'['.$dataPath.']\\' class=\"preview-item preview-add-item transition-all\">\n\t\t\t\t\t\t<h6>+ Add New Item</h6>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<span class=\"preview-identifier\">' . $currIDToDisplay .'</span>\n\t\t\t</div>';\n\t\t\n\t\t// Process submenu items\n\t\tforeach($xmlString->children() as $child) {\n\t\t\tif ($child->getName() == 'menu') {\n\t\t\t\tparseXML($child, $level + 1, $dataPath);\n\t\t\t}\n\t\t}\n\t\t\n\t}"
] | [
"0.5923174",
"0.58158535",
"0.5668745",
"0.5635098",
"0.56199133",
"0.5595971",
"0.5508267",
"0.54327726",
"0.5393895",
"0.5332603",
"0.5329044",
"0.5282981",
"0.5267332",
"0.5257229",
"0.520801",
"0.5170033",
"0.5113785",
"0.51075584",
"0.5104719",
"0.50631213",
"0.5046716",
"0.5030326",
"0.5028936",
"0.5007127",
"0.49945736",
"0.49781042",
"0.49767545",
"0.49754757",
"0.49718255",
"0.4968477"
] | 0.7052406 | 0 |
Creates a DOMDocument with a few nodes, and then imports these nodes into another document | function importNode()
{
// Create document with nodes
$doc = $this->createDocument();
/*
$domElement = $doc->createElement( 'Error' );
$domElement->appendChild( $doc->createTextNode( "Error message" ) );
$doc->appendChild( $domElement );
// $domElement = $doc->createElement( 'Error2' );
// $domElement->appendChild( $doc->createTextNode( "Error message2" ) );
// $doc->appendChild( $domElement );
// Create a new document, and import the nodes retrived by DOMDocument->childNodes under a new root node
$result = $doc->childNodes;
$doc = $this->createDocument();
$rootElement = $doc->createElement( 'eZREST' );
$rootElement->setAttribute( 'function', 'MYeZRestFunction' );
$doc->appendChild( $rootElement );
// - Import nodes under the root node
$resultElement = $result->item( 0 );
// var_dump( $resultElement );
$resultElement = $doc->importNode( $resultElement, true );
// $doc->appendChild( $resultElement );
// echo $doc->eZDOMDocument->toString();
// die();
*/
// Create document with nodes
$domDocument = $this->createDocument();
$domElement =& $domDocument->createElement( 'Error' );
$domElement->appendChild( $domDocument->createTextNode( "Error message" ) );
$domDocument->appendChild( $domElement );
$domElement =& $domDocument->createElement( 'Error2' );
$domElement->appendChild( $domDocument->createTextNode( "Error message2" ) );
$domDocument->appendChild( $domElement );
// Create a new document, and import the nodes retrived by DOMDocument->childNodes under a new root node
$domDocument2 = $this->createDocument();
$rootElement =& $domDocument2->createElement( 'eZREST' );
$rootElement->setAttribute( 'function', "sitecount" );
$domDocument2->appendChild( $rootElement );
// - Import start
$result = $domDocument->childNodes;
$resultElement =& $result->item( 0 );
$resultElement = $domDocument2->importNode( $resultElement, true );
$rootElement->appendChild( $resultElement );
$resultElement =& $result->item( 1 );
$resultElement = $domDocument2->importNode( $resultElement, true );
$rootElement->appendChild( $resultElement );
// Add sub-element
$domElement =& $domDocument2->createElement( 'Sub-Error' );
$domElement->setAttribute( 'function', "sitecount" );
//$domElement->appendChild( $domDocument->createTextNode( "sub Error message" ) );
$rootElement->appendChild( $domElement );
return $domDocument2->saveXML();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function run()\n {\n $test = new DOMDocumentTest();\n $DOMDocument = $this->createDocument();\n\n // Tests\n //echo $test->createElement();\n //echo $test->createElements();\n //echo $test->createDocumentAndSave();\n echo $test->loadXMLappendElementdAndSave();\n //echo $test->createMultipleRootElements();\n\n //echo $test->importNode();\n //echo $test->subElements();\n //echo $test->childNodes();\n}",
"private function domNodes() {\n $this->xmlHtml = $this->dom->getElementsByTagName('html')->item(0);\n $this->xmlHead = $this->dom->getElementsByTagName('head')->item(0);\n $this->xmlBody = $this->dom->getElementsByTagName('body')->item(0);\n }",
"protected function domNodes() {\n $this->xmlHtml = $this->dom->getElementsByTagName('html')->item(0);\n $this->xmlHead = $this->dom->getElementsByTagName('head')->item(0);\n $this->xmlBody = $this->dom->getElementsByTagName('body')->item(0);\n }",
"function doc_append(&$doc1, $doc2) {\n // $data = $doc1->getElementsByTagName('Data')->item(0);\n\n // iterate over 'item' elements of document 2\n $records = $doc2->getElementsByTagName('Record');\n for ($i = 0; $i < $records->length; $i ++) {\n $record = $records->item($i);\n\n // import/copy item from document 2 to document 1\n $temp = $doc1->importNode($record, true);\n\n // append imported item to document 1 'res' element\n $doc1->getElementsByTagName('Data')->item(0)->appendChild($temp);\n }\n}",
"private function _setupDOMDocument()\n\t{\n\t\t// If the html is already wrapped, remove it\n\t\t$this->html = $this->_returnBodyText($this->html);\n\n\t\t// Set up processing details\n\t\t$this->doc = new \\DOMDocument();\n\t\t$this->doc->preserveWhiteSpace = false;\n\t\t$this->doc->encoding = 'UTF-8';\n\n\t\t// Do what we can to ensure this is processed as UTF-8\n\t\t$this->doc->loadHTML('<?xml encoding=\"UTF-8\"><html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>' . $this->html . '</body></html>');\n\t}",
"protected function loadDomDocument()\n {\n $this->doc = new DomDocument();\n $this->doc->formatOutput = true;\n $this->doc->loadHtml(\n mb_convert_encoding($this->html, 'HTML-ENTITIES', 'UTF-8'),\n LIBXML_HTML_NODEFDTD\n );\n }",
"public function importNodesAsChildren ($nodes, $deep = TRUE) {\n $this->node->appendChild($this->ownerDocument->importNode($nodes, $deep));\n }",
"public function transformToDoc (DOMNode $doc) {}",
"public function setDocument(\\DOMDocument $document);",
"function addDescriptionsFromNodelist($nodeList) {\n foreach ($nodeList as $domElement) {\n $dom_node = $this->dom_doc->importNode($domElement, TRUE);\n $this->root->appendChild($dom_node);\n }\n }",
"public function execute(DOMDocument $domDocument): DOMDocument;",
"public function createXML()\r\n {\r\n $this->_dom = new DOMDocument() ;\r\n $this->_dom->formatOutput = true ;\r\n /***\r\n $xslt = $this->_dom->createProcessingInstruction( \r\n 'xml-stylesheet', \r\n 'type=\"text/xsl\" href=\"/lib/job.xsl\"' );\r\n $this->_dom->appendChild( $xslt );\r\n ***/\r\n $this->_root = $this->_dom->createElement( \"formulas\" );\r\n // Create root with no attributes\r\n $this->_dom->appendChild( $this->_root );\r\n }",
"public function process(DOMDocument $xml);",
"public function getDom(string $filename): DOMDocument;",
"function createDocument()\n {\n $DOMDocumentClassName = $this->DOMDocumentClassName;\n\n $DOMDocument = new $DOMDocumentClassName( '1.0', 'utf-8' );\n return $DOMDocument;\n }",
"function modify(\\DOMDocument $doc);",
"function loadHTMLasDOM($filename)\n\t{\n\t\t$doc = new DOMDocument();\n\t\t$doc->loadHTMLFile($filename);\n\t\treturn $doc;\n\t}",
"function xml_adopt2($root, $new, $namespace = null) {\n // NOTE: addChild does NOT escape \"&\" ampersands in (string)$new !!!\n // replace them or use htmlspecialchars(). see addchild docs comments.\n $node = $root->addChild($new->getName(), (string) $new, $namespace);\n // add any attributes for the new node\n foreach($new->attributes() as $attr => $value) {\n $node->addAttribute($attr, $value);\n }\n // get all namespaces, include a blank one\n $namespaces = array_merge(array(null), $new->getNameSpaces(true));\n // add any child nodes, including optional namespace\n foreach($namespaces as $space) {\n foreach ($new->children($space) as $child) {\n xml_adopt($node, $child, $space);\n }\n }\n}",
"public function import_pages_xml()\n {\n $this->bbtohtml = new bbcode();\n $this->bbCodeParser = new BBCodeParser();\n set_time_limit(0);\n $this->importUsers = $_REQUEST['importUsers'];\n if ($this->importUsers) {\n $importUsers = new ImportUsers();\n $importUsers->run();\n }\n $this->txt = $this->app->make('helper/text');\n $this->uir = Core::make('Concrete\\Core\\User\\UserInfoRepository');\n $this->xml = simplexml_load_file($_FILES['xml']['tmp_name'], \\SimpleXMLElement::class, LIBXML_NOCDATA | LIBXML_NOBLANKS);\n $this->forumPage = Page::getByID($_REQUEST['forumPage']);\n $this->ct = CollectionType::getByID($_REQUEST['ctID']);\n $this->pt = PageTemplate::getByHandle($_REQUEST['ptID']);\n $this->area = $_REQUEST['area'];\n if (!empty($this->xml->pages->page)) {\n foreach ($this->xml->pages->page as $page) {\n // create new page for post\n $this->createNewPost($page);\n }\n }\n }",
"private function buildHTMLTreeFromNode(DOMDocument $document, Node $node, array $options) {\n\t\t//Set optional values\n\t\t$this->fillOptionalOptions($options);\n\t\t\n\t\t//Create the first wrapping DOMElement.\n\t\t$domElementA = $this->buildElement($document, $options[self::MAIN_TAG_KEY][0]);\n\t\t\n\t\t//Merge font size and font family to add inside the second wrapping DOMElement.\n\t\tif($options[self::MAIN_TAG_MERGE_STYLE]) {\n\t\t\t$options[self::MAIN_TAG_KEY][1][self::ATTRIBUTES_KEY] = array_merge(\n\t\t\t\t$options[self::MAIN_TAG_KEY][1][self::ATTRIBUTES_KEY], \n\t\t\t\t[\n\t\t\t\t\t'style' => 'color:'.$node->getColor().';'.\n\t\t\t\t\t\t\t ($node->getFontName() ? 'font-family:'.$node->getFontName().';' : '').\n\t\t\t\t\t\t\t ($node->getFontSize() ? 'font-size:'.$node->getFontSize().';' : ''),\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\t\t\n\t\t//Add the node document id to the attributes.\n\t\t$options[self::MAIN_TAG_KEY][1][self::ATTRIBUTES_KEY] = array_merge($options[self::MAIN_TAG_KEY][1][self::ATTRIBUTES_KEY], ['id' => $node->getId()]);\n\t\t\n\t\t//Create the second wrapping DOMElement whom will be append to the first one\n\t\t$domElementB = $this->buildElement($document, $options[self::MAIN_TAG_KEY][1]);\n\t\t\n\t\t//Set the icon in an img tag whom will be wrapped in the second DOMElement.\n\t\tif(!empty($node->getIcon()) && $options[self::MAIN_ICON_KEY][self::DISPLAY_ICON_KEY]) {\n\t\t\t$icon = $node->getIcon();\n\t\t\t$domElementImg = $document->createElement('img');\n\t\t\t\n\t\t\t$iconUri = $icon->getShortUri();\n\t\t\tif(array_key_exists(self::PATH_ICON_KEY, $options[self::MAIN_ICON_KEY])) {\n\t\t\t\tif(!is_callable($callback = $options[self::MAIN_ICON_KEY][self::PATH_ICON_KEY][self::CALLBACK_PATH_ICON_KEY])) {\n\t\t\t\t\tthrow new InvalidArgumentException('The argument with the key \"'.self::CALLBACK_PATH_ICON_KEY.'\" (self::CALLBACK_PATH_ICON_KEY) must be a valid callback.');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$callBackoptions = array_key_exists(self::OPTIONS_PATH_ICON_KEY, $options[self::MAIN_ICON_KEY][self::PATH_ICON_KEY]) ?\n\t\t\t\t\t$options[self::MAIN_ICON_KEY][self::PATH_ICON_KEY][self::OPTIONS_PATH_ICON_KEY] :\n\t\t\t\t\tnull;\n\t\t\t\t\n\t\t\t\t$iconUri = $callback($icon->getFullName(), $callBackoptions);\n\t\t\t}\n\t\t\t\n\t\t\t$domElementImg->setAttribute('src', $iconUri);\n\t\t\t$domElementImg->setAttribute('alt', $icon->getName());\n\t\t\t$domElementB->appendChild($domElementImg);\n\t\t}\n\t\t\n\t\t//Define the TextNode to append to the current wrapping elements.\n\t\t$text = $document->createTextNode($node->getText());\n\t\t\n\t\t//Bold an italic in old HTML way in order not to spread it to all children.\n\t\tif($options[self::MAIN_TAG_MERGE_DECORATION]) {\n\t\t\tif($node->isBold()) {\n\t\t\t\t$bTag = $document->createElement('b');\n\t\t\t\t$bTag->appendChild($text);\n\t\t\t\t$text = $bTag;\n\t\t\t}\n\t\t\tif($node->isItalic()) {\n\t\t\t\t$iTag = $document->createElement('i');\n\t\t\t\t$iTag->appendChild($text);\n\t\t\t\t$text = $iTag;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Append text node (real one or the one already wrapped inside <b> and/or <i> tags)\n\t\tif(isset($options[self::MAIN_TAG_KEY][2])) {\n\t\t\t$domElementC = $this->buildElement($document, $options[self::MAIN_TAG_KEY][2]);\n\t\t\t$domElementC->appendChild($text);\n\t\t\t$domElementB->appendChild($domElementC);\n\t\t} else {\n\t\t\t$domElementB->appendChild($text);\n\t\t}\n\t\t\n\t\t$domElementA->appendChild($domElementB);\n\t\t\n\t\tforeach($node->getChildren() as $child) {\n\t\t\t$domElementB->appendChild($this->buildHTMLTreeFromNode($document, $child, $options));\n\t\t}\n\t\t\n\t\treturn $domElementA;\n\t}",
"public function toDOM(){\n \t// create the new document\n \t$doc = new \\DOMDocument();\n\n // create the xliff root element\n $xliff = $this->toDOMElement($doc);\n\n $xliff->setAttribute('xmlns', self::NS . $this->version);\n // add the xliff version\n $xliff->setAttribute('version',$this->version);\n\n $doc->appendChild($xliff);\n return $doc;\n \n }",
"protected function convertFromDocumentInstance(Document $document, array $options) {\n\t\t$domDocument = new DOMDocument();\n\t\t\n\t\t$domDocument->appendChild($this->buildHTMLTreeFromNode($domDocument, $document->getRootNode(), $options));\n\t\t\n\t\treturn $domDocument;\n\t}",
"public static function toggle_dom_parser() {\n self::$dom = new DOMDocument;\n }",
"public function __construct()\n {\n $this->doc = new DOMDocument(\"1.0\", \"UTF-8\");\n $this->doc->formatOutput = true;\n }",
"public function __construct()\n {\n $this->document = new DOMDocument( '1.0' );\n $this->document->formatOutput = true;\n\n $this->svg = $this->document->createElementNS( 'http://www.w3.org/2000/svg', 'svg' );\n $this->svg = $this->document->appendChild( $this->svg );\n\n $this->svg->setAttribute( 'version', '1.2' );\n $this->svg->setAttribute( 'streamable', 'true' );\n\n $this->pages = $this->document->createElement( 'g' );\n $this->pages = $this->svg->appendChild( $this->pages );\n $this->pages->setAttribute( 'id', 'pages' );\n\n $metadata = $this->document->createElement( 'metadata' );\n $metadata = $this->svg->appendChild( $metadata );\n\n $rdfNs = 'http://www.w3.org/1999/02/22-rdf-syntax-ns';\n $rdf = $this->document->createElementNS( $rdfNs, 'rdf:RDF' );\n $metadata->appendChild( $rdf );\n\n $this->metadata = $this->document->createElementNS( $rdfNs, 'rdf:Description' );\n $this->metadata = $rdf->appendChild( $this->metadata );\n $this->setMetaData( 'creator', 'eZ Components - Document 1.3' );\n }",
"public function getXML(DOMDocument $xml);",
"protected static function mergeNode(SimpleXMLElement $source, SimpleXMLElement $new)\n\t{\n\t\t// Update the attributes of the child node.\n\t\tforeach ($new->attributes() as $name => $value)\n\t\t{\n\t\t\tif (isset($source[$name]))\n\t\t\t{\n\t\t\t\t$source[$name] = (string) $value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$source->addAttribute($name, $value);\n\t\t\t}\n\t\t}\n\n\t\t// What to do with child elements?\n\t}",
"public static function unitedDOM(DOMDocument $xmlDOM, DOMDocument $repXMLDOM /*replace*/)\n {\n if (is_null($repXMLDOM))\n return $xmlDOM;\n \n if (is_null($xmlDOM))\n return $repXMLDOM;\n \n $result = clone $repXMLDOM;\n \n $childs = $xmlDOM->documentElement->childNodes;\n foreach($childs as $item)\n {\n $repChilds = $repXMLDOM->documentElement->childNodes;\n foreach($repChilds as $repItem)\n {\n if ($item->nodeName != $repItem->nodeName)\n $result->documentElement->appendChild($result->importNode($item, true));\n }\n }\n \n return $result;\n }",
"function parse_dom($html) { \n return get_dom_tree($html); //domparser.php\n}",
"private function generate()\n {\n // Create the DOM\n $dom = new \\DOMDocument(\"1.0\", \"utf-8\");\n\n // Create the <rss>\n $rss = $dom->createElement(\"rss\");\n $rss->setAttribute(\"xmlns:itunes\", \"http://www.itunes.com/dtds/podcast-1.0.dtd\");\n $rss->setAttribute(\"version\", \"2.0\");\n $rss->setAttribute(\"xmlns:content\",\"http://purl.org/rss/1.0/modules/content/\");\n $rss->setAttribute(\"xmlns:atom\", \"http://www.w3.org/2005/Atom\");\n $rss->setAttribute(\"xmlns:spotify\",\"http://www.spotify.com/ns/rss\");\n $dom->appendChild($rss);\n\n // Create the <channel>\n $channel = $dom->createElement(\"channel\");\n $rss->appendChild($channel);\n\n // Add atom:link for interoperability\n $atom = $dom->createElement(\"atom:link\");\n $atom->setAttribute(\"href\", $this->atom_link);\n $atom->setAttribute(\"rel\", \"self\");\n $atom->setAttribute(\"type\", \"application/rss+xml\");\n $channel->appendChild($atom);\n\n // Create the <title>\n $title = $dom->createElement(\"title\", $this->title);\n $channel->appendChild($title);\n\n // Create the <itunes:subtitle>\n if ($this->subtitle != null) {\n $itune_subtitle = $dom->createElement(\"itunes:subtitle\", $this->subtitle);\n $channel->appendChild($itune_subtitle);\n }\n\n // Create the <itunes:type>\n if (!empty($this->feed_type)\n && ($this->feed_type == 'serial'\n OR $this->feed_type == 'episodic')) {\n $itune_type = $dom->createElement(\"itunes:type\", $this->feed_type);\n $channel->appendChild($itune_type);\n }\n\n // Create the <link>\n $link = $dom->createElement(\"link\", $this->link);\n $channel->appendChild($link);\n\n $spotify_limit = $dom->createElement(\"spotify:limit\");\n $spotify_limit->setAttribute(\"recentCount\", \"200\");\n $channel->appendChild($spotify_limit);\n\n $countries = array('ar','cl','co','es','mx','pe','us');\n foreach($countries as $k => $v) {\n if($v == strtolower($this->main_country)) {\n unset($countries[$k]);\n }\n }\n $spotify_country = $dom->createElement(\n \"spotify:countryOfOrigin\",\n strtolower($this->main_country).' '.implode(' ',$countries)\n );\n $channel->appendChild($spotify_country);\n\n // Create the <description>\n $description = $dom->createElement(\"description\");\n $description->appendChild($dom->createCDATASection($this->description));\n $channel->appendChild($description);\n\n // Create the <itunes:summary>\n $itune_summary = $dom->createElement(\"itunes:summary\", $this->summary);\n $channel->appendChild($itune_summary);\n\n // Create the <image>\n $image = $dom->createElement(\"image\");\n $image->appendChild($title->cloneNode(true));\n $image->appendChild($link->cloneNode(true));\n $channel->appendChild($image);\n $image_url = $dom->createElement(\"url\", $this->image);\n $image->appendChild($image_url);\n\n // Create the <itunes:image>\n $itune_image = $dom->createElement(\"itunes:image\");\n $itune_image->setAttribute(\"href\", $this->image);\n $channel->appendChild($itune_image);\n\n // Create the <itunes:author>\n $itune_author = $dom->createElement(\"itunes:author\", $this->author);\n $channel->appendChild($itune_author);\n\n // Create the <itunes:owner>\n $itune_owner = $dom->createElement(\"itunes:owner\");\n $itune_owner_name = $dom->createElement(\"itunes:name\", $this->author);\n $itune_owner->appendChild($itune_owner_name);\n if ($this->email != null) {\n $itune_owner_email = $dom->createElement(\"itunes:email\", $this->email);\n $itune_owner->appendChild($itune_owner_email);\n }\n $channel->appendChild($itune_owner);\n\n // Create the <itunes:category>\n foreach ($this->categories as $category => $subcategories) {\n $node = $channel->appendChild($dom->createElement('itunes:category'));\n $node->setAttribute(\"text\", $category);\n\n foreach ($subcategories as $subcategory => $subcategories) {\n if(is_array($subcategories)) {\n $subnode = $node->appendChild($dom->createElement('itunes:category'));\n $subnode->setAttribute(\"text\", $subcategory);\n\n foreach($subcategories as $subsubcategory) {\n $subsubnode = $subnode->appendChild($dom->createElement('itunes:category'));\n $subsubnode->setAttribute(\"text\", $subsubcategory);\n }\n } else {\n $subnode = $node->appendChild($dom->createElement('itunes:category'));\n $subnode->setAttribute(\"text\", $subcategories);\n }\n }\n\n $channel->appendChild($node);\n }\n\n // Create the <itunes:explicit>\n if ($this->explicit !== null) {\n $explicit = $dom->createElement(\"itunes:explicit\", $this->explicit);\n $channel->appendChild($explicit);\n }\n\n // Create the <language>\n if ($this->language !== null) {\n $language = $dom->createElement(\"language\", $this->language);\n $channel->appendChild($language);\n }\n\n // Create the <copyright>\n if ($this->copyright !== null) {\n $copyright = $dom->createElement(\"copyright\", $this->copyright);\n $channel->appendChild($copyright);\n }\n\n // Create the <pubDate>\n if ($this->pubDate == null) {\n $this->pubDate = new DateTime();\n }\n if (is_string($this->pubDate)) {\n $this->pubDate = new DateTime($this->pubDate);\n }\n\n $pubDate = $dom->createElement(\"pubDate\", $this->pubDate->format(DATE_RFC2822));\n $channel->appendChild($pubDate);\n $lastBuildDate = $dom->createElement(\"lastBuildDate\", $this->pubDate->format(DATE_RFC2822));\n $channel->appendChild($lastBuildDate);\n\n // Create the <items>\n foreach ($this->media as $media) {\n // Addition of media in the dom\n $media->addToDom($dom);\n\n // Get the latest date media for <pubDate>\n if ($this->pubDate == null) {\n $this->pubDate = $media->getPubDate();\n }\n else {\n if ($this->pubDate < $media->getPubDate()) {\n $this->pubDate = $media->getPubDate();\n }\n }\n }\n\n // Return the DOM\n return $dom;\n }"
] | [
"0.65768987",
"0.6274432",
"0.62230986",
"0.6052994",
"0.5948137",
"0.58830386",
"0.57767093",
"0.5631085",
"0.55451554",
"0.5391069",
"0.5360076",
"0.53109246",
"0.52984077",
"0.5295471",
"0.52904224",
"0.52841955",
"0.5261307",
"0.5255332",
"0.5227063",
"0.51863927",
"0.5155097",
"0.51426715",
"0.5122268",
"0.5101778",
"0.50979286",
"0.5080192",
"0.5055591",
"0.5054596",
"0.5032013",
"0.5007733"
] | 0.68252873 | 0 |
/ Insert Items into Users Inventory; Probably can also be used to remove items, but I've yet to actually test that | function updateUserInv($uid, $iid, $ammount)
{
$sql = "INSERT INTO user_inventory(item_id, uid)
VALUES ( :iid, :uid)
ON DUPLICATE KEY
UPDATE item_count = item_count+1;";
$this->db->setAttribute( PDO::ATTR_EMULATE_PREPARES, true );
$que = $this->db->prepare($sql);
$que->bindParam(':iid', $iid);
$que->bindParam(':uid', $uid);
try { if($que->execute()) { return true;} }catch(PDOException $e) { echo $e->getMessage(); }
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createItems()\n {\n $invoiceItems = $this->_itemsData; \n for ($i = 0; $i < count($invoiceItems); $i++) {\n $invoiceItems[$i]['invoice_id'] = $this->_invoiceId;\n $this->getItemModel()->create($invoiceItems[$i]); \n }\n }",
"public function add_users_and_item()\n\t{\n\t\t$this->form_validation->set_rules('name','Name','trim|required');\n\n\t\tif($this->form_validation->run() == FALSE)\n\t\t{\n\t\t\t$data['main_content'] = 'inventory/add';\n\t\t\t$data['branches'] = $this->branch_model->get_branches();\n\t\t\t$this->load->view('layouts/main', $data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($this->inventory_model->add_user_and_items())\n\t\t\t{\n\t\t\t\t$this->session->set_flashdata('add_msg', 'Inventory Successfully Added!');\n\t\t\t\tredirect('inventory/add_users_and_item');\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public function LoadItems()\n\t{\n\t\t$allitems = $this->mDoEdiInventory->GetItems();\n\t\tforeach($allitems as $thisitem)\n\t\t{\n\t\t\t$newitem = new EdiInventoryItem();\n\t\t\t$newitem->mId = $thisitem['ID'];\n\t\t\t$newitem->mSKU = $thisitem['partno'];\n\t\t\t$newitem->mDescription = $thisitem['description'];\n\t\t\t$newitem->mPrice = $thisitem['price'];\n\t\t\t$newitem->mStockCode = $thisitem['stockcode'];\n\t\t\t$newitem->mStockDate = $thisitem['stock_date'];\n\t\t\t$newitem->mStockDay = $thisitem['stock_day'];\n\t\t\t$newitem->mWeight = $thisitem['weight'];\n\t\t\t$newitem->mAllocated = ($thisitem['alloc'] == -1 ? '0' : $thisitem['alloc']);\n\t\t\t$newitem->mAvailable = ($thisitem['avail'] == -1 ? '100' : $thisitem['avail']);\n\t\t\t// grab the retailer item ID from the sku field\n echo \"here's the sku field...\".print_r($thisitem['sku'], true).\"\\n\";\n\t\t\t$data = split(':', $thisitem['sku']);\n echo \"heres the data after splitting...\".print_r($data, true).\"\\n\";\n // $data[0] = ASIN; $data[1] = RetailerItemId; $data[2] = UPC ///// Target\n // $data[0] = RetailerItemId; $data[1] = UPC\n $newitem->mRetailerItemID = count($data) > 2 ? $data[1] : (count($data) > 1 ? $data[0] : '');\n\t\t\t$newitem->mUPC = count($data) > 2 ? $data[2] : (count($data) > 1 ? $data[1] : $thisitem['upc']);\n $newitem->mASIN = count($data) > 2 ? $data[0] : '';\n\t\t\t$this->mItems[] = $newitem;\n\t\t\tunset($newitem);\n\t\t}\n\t}",
"public function add(string $itemName, string $userId): void;",
"public function saveInventory(\\Vgroup\\SafetyHubApp\\Api\\Data\\SafetyUsersItemsInterface $safetyUserItem, $id, $customerId);",
"public function insertItem($itemData);",
"public function createUserItem($user_id, $item_id){\n $stmt = $this->conn->prepare(\"INSERT INTO user_items(user_id,item_id) VALUES(?,?)\");\n $stmt->bind_param(\"ii\",$user_id,$item_id);\n $result = $stmt->execute();\n $stmt->close();\n return $result;\n }",
"function AddItemsToGame($gameId, $items)\n\t{\n\t\tforeach ($items as $item) \n\t\t{\n\t\t\t$sql = sprintf(\"INSERT INTO game_items (GameId,ItemIdInGame, ItemIdentifier , Name, Gold ,PickUpRange ,Lat ,Lng, KeyUnlocks, locked ,PickedUp ,Alive) \n\t\t\t\t\t\t\t\t\t\t\tVALUES ( %d, %d, %d , '%s',%d , %d, %.20f , %.20f,%d , %d , 0, 1)\", $gameId,\n\t\t\t\t\t\t\t\t\t\t\t$item[\"InGameId\"], $item[\"Item\"], $item[\"Name\"], $item[\"Gold\"], $item[\"Range\"], $item[\"Lat\"], $item[\"Lng\"], $item[\"Unlocks\"],$item[\"Locked\"] );\n\t\t\tRunSql($sql);\n\t\t}\n\t}",
"public function addItems(): void\n {\n $this->totalPrice = 0.00;\n $this->outOfStock = false;\n $items = explode(',', $this->input->get());\n if ($this->checkItemsOnStock($items)) {\n foreach ($items as $item) {\n $this->totalPrice += self::ITEMS[$item]['price'];\n $this->quantities[$item]--;\n }\n } else {\n $this->outOfStock = true;\n }\n }",
"function addItem($user_id, $item) {\n $stmt = $this->conn->prepare(\"INSERT INTO `items`(`user_id`, `item`) VALUES(?, ?)\");\n $stmt->bind_param(\"is\", $user_id, $item);\n if ($stmt->execute()) {\n return ITEM_ADDED_SUCCESSFULLY;\n } else {\n return FAILED_TO_ADD_ITEM;\n }\n }",
"public function addItem($data)\n {\n \n $tradeUserIns = new BuckysTradeUser();\n if (!$tradeUserIns->hasCredits($data['userID']))\n return; // no credits\n \n global $db;\n \n if (empty($data['userID']) || \n empty($data['title']) ||\n empty($data['subtitle']) ||\n empty($data['catID'])\n )\n return;\n \n $newID = $db->insertFromArray(TABLE_TRADE_ITEMS, $data);\n \n //Trade User has been created?\n $tradeUserIns->addUser($data['userID']);\n \n //Use one credits\n if ($newID)\n $tradeUserIns->useCredit($data['userID']);\n \n return $newID;\n }",
"function createOrderItem($connection, $orderID, $itemName, $userID, $quantity, $itemTotal) {\n $query = \"INSERT INTO orders_items (orderID, userID, itemName, orderQuantity, itemTotal) \n VALUES ($orderID, $userID, '$itemName', $quantity, $itemTotal)\";\n sendQuery($connection, $query);\n \n}",
"function AsignItemToPlayer($gameId,$userId,$itemId)\n\t{\n\t\t/*confirm that item has not alread been asigned*/\n\t\t$sql = sprintf(\"Select PickedUp from game_items Where id =%d\", $itemId);\n\t\t$result = RunSql($sql);\n\t\t$row = $result->fetch_assoc();\n\t\t$pickedUp = $row['PickedUp'];\n\t\tif($pickedUp == 0)\n\t\t{\n\t\t\t/*Assign*/\n\t\t\t$sql = sprintf(\"UPDATE game_items SET User = %d, PickedUp =1 Where id =%d\", $userId, $itemId);\n\t\t\tRunSql($sql);\t\n\t\t\t$itemGold = GetitemsGold($itemId);/*get items gold value*/\n\t\t\t$playersGold = GetPlayersGold($gameId,$userId);/*get the players gold value*/\n\t\t\t$newValue = $itemGold + $playersGold;/*add the items gold to the players gold*/\n\t\t\tSetPlayersGold($gameId,$userId, $newValue); /*sets the players new gold in db*/\n\t\t}\n\t}",
"public function addItems($items);",
"public function prepare_items() {\n\t\t// Get the id of the current user\n\t\t$user_id = get_current_user_id();\n\n\t\t// Deal with bulk actions if any were requested by the user\n\t\t$this->process_bulk_action();\n\n\t\t// Get the list of application passwords for this user\n\t\t$appass = get_user_meta( $user_id, XAP_USER_META_KEY );\n\n\t\t// Setup pagination\n\t\t$per_page = 40;\n\t\t$current_page = $this->get_pagenum();\n\t\t$total_items = count( $appass );\n\t\t$appass = array_slice( $appass, ( ( $current_page-1 ) * $per_page ), $per_page );\n\t\t$this->set_pagination_args( array(\n\t\t\t'total_items'\t=> $total_items,\n\t\t\t'per_page'\t\t=> $per_page\n\t\t) );\n\n\t\t$columns = $this->get_columns();\n\t\t$hidden = array();\n\t\t$sortable = array();\n\t\t$this->_column_headers = array( $columns, $hidden, $sortable );\n\t\t$this->items = $appass;\n\t}",
"function equip_items($items = array(), $character_id = 0)\n {\n if($character_id == 0):\n\t\t\t$character_id = $this->character_id;\n\t\telse:\n\t\t\t$this->character_id = $character_id;\n\t\tendif;\n\n $this->db->where('character_id', $character_id)\n ->where_in('id', $items)\n ->update('character_items', array('equipped' => '1'));\n\n }",
"function create($org_id, $qty, $item_ids)\n\t{\n\t\tforeach ($item_ids as $item_id)\n\t\t{\n\t\t\t$where = ['item_id' => $item_id, 'org_id' => $org_id];\n\n\t\t\t$this->db->where($where);\n\n\t\t\t//Ensure if $qty < 0 that total does not become negative\n\t\t\t$this->db->set('original', \"`original` + GREATEST($qty, -`original`)\", false);\n\t\t\t$this->db->set('quantity', \"`quantity` + GREATEST($qty, -`quantity`)\", false);\n\n\t\t\t$this->db->update('request', ['updated' => gmdate('c')]);\n\n\t\t\t//If not in donee inventory, add it now\n\t\t\tif ($this->db->affected_rows() == 0)\n\t\t\t{\n\t\t\t\tself::_create($where + ['original' => $qty, 'quantity' => $qty]);\n\t\t\t}\n\t\t}\n\t}",
"public static function insertinventorytable($username, $quantity, $elementname, $school, $building_number, $level, $orientation, $location, $reference, $registry_number, $img_inventory) {\n $con = mdlconection::connect();\n $image_name_insert = mdlinventory::uploadImageinventory();\n $id_invetory = validations::generateRamdonids();\n $id_spenders = mdlinventory::insertenergy_spenderstable($elementname, $quantity);\n $id_nomenclature = mdlinventory::insertnomenclaturetable($school, $building_number, $level, $orientation, $location, $reference, $registry_number);\n $insertintotableusers = \"INSERT INTO inventory(id_inventory,id_spenders,enabled,username,id_nomenclature,img_inventory)\n VALUES('$id_invetory','$id_spenders','1','$username','$id_nomenclature','$image_name_insert')\";\n if (!mysqli_query($con, $insertintotableusers)) {\n die('Error: ' . mysqli_error($con));\n }\n }",
"protected function Inventory_Save(array $arItems) {\n\t$arEv = array(\n\t 'code'\t=> 'INV',\n\t 'descr'\t=> 'Inventory: '.clsArray::Render($arItems),\n\t 'where'\t=> __METHOD__\n\t);\n\t$rcEv = $this->CreateEvent($arEv);\n\t\n\t$nUpd = 0;\n\t$nDup = 0;\n\t$nNew = 0;\n\t\n\t$idBin = $this->GetKeyValue();\n\t\n\tforeach ($arItems as $idItem => $qty) {\n\t $sqlLines = \"(ID_Bin=$idBin) AND (ID_Item=$idItem) AND (Qty > 0)\";\n\t $rsLines = $this->LineTable()->FetchRecords($sqlLines);\t// stock lines for this item\n\t if ($rsLines->HasRows()) {\n\t\t// old records exist -- update them\n\t\t// -- make sure there's only one record. If more than one, update the first and delete others.\n\t\t$isFirst = TRUE;\n\t\twhile ($rsLines->NextRow()) {\n\n\t\t if ($isFirst) {\n\t\t\t$isFirst = FALSE;\n\t\t\t// -- update the first record\n\t\t\t$rsLines->UpdateQty($qty,'inventory count');\n\t\t\t$nUpd++;\n\t\t } else {\n\t\t\t$rsLines->UpdateQty(0,'inventory: zeroing duplicate item');\n\t\t\t$nDup++;\n\t\t }\n\n\t\t}\n\t } else {\n\t\t// no record; create a new record\n\t\t$this->InventoryAdd($idItem,$qty);\n\t\t$nNew++;\n\t }\n\t}\n\t$sMsg =\n\t $nUpd.' updated, '\n\t .$nDup.' zeroed, '\n\t .$nNew.' new'\n\t ;\n\t$rcEv->Finish(array(fcrEvent::KF_DESCR_FINISH=>$sMsg));\n }",
"public function add() {\n\t\tif (!empty($this->data)) {\n\t\t\ttry {\n\t\t\t\t$result = $this->InventoryEntry->add(array('InventoryEntry' => array(\n\t\t\t\t\t'purchase_order_id' => $this->data['InventoryEntry']['purchase_order_id'],\n\t\t\t\t\t'user_id' => $this->Auth->user('id')\n\t\t\t\t)));\n\n\t\t\t\tif ($result === true) {\n\t\t\t\t\t$this->redirect(\n\t\t\t\t\t\tarray('controller' => 'inventory_items', 'action' => 'add', $this->InventoryEntry->id)\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$this->data = $result;\n\t\t\t\t}\n\t\t\t} catch (OutOfBoundsException $e) {\n\t\t\t\t$this->Session->setFlash($e->getMessage());\n\t\t\t}\n\t\t}\n\t\t$purchaseOrders = $this->InventoryEntry->PurchaseOrder->find('list', array(\n\t\t\t'conditions' => array(\n\t\t\t\t//\"NOT\" => array('PurchaseOrder.status' => array(PurchaseOrder::VOID, PurchaseOrder::COMPLETED)),\n\t\t\t\tarray('PurchaseOrder.status' => array(PurchaseOrder::INVOICED)),\n\t\t\t),\n\t\t\t'order' => array('PurchaseOrder.created' => 'desc')));\n\t\t$this->set(compact('purchaseOrders'));\n\t}",
"public function insert($item = array()){ \n if(!is_array($item) OR count($item) === 0){ \n return FALSE; \n }else{ \n if(!isset($item['s_id'], $item['s_name'], $item['s_cost'], $item['s_img'], $item['s_description'])){ \n return FALSE; \n }else{ \n /* \n * Insert Item \n */ \n // prep the quantity \n $item['s_amount'] = (float) $item['s_amount']; \n if($item['s_amount'] == 0){ \n return FALSE; \n } \n // prep the price \n $item['s_cost'] = (float) $item['s_cost']; \n\n // create a unique identifier for the item being inserted into the basket \n $rowid = md5($item['s_id']); \n\n // get quantity if it's already there and add it on \n $old_s_amount = isset($this->basket_contents[$rowid]['s_amount']) ? (int) $this->basket_contents[$rowid]['s_amount'] : 0; \n \n // re-create the entry with unique identifier and updated quantity \n $item['rowid'] = $rowid; \n $item['s_amount'] += $old_s_amount; \n $this->basket_contents[$rowid] = $item; \n \n // save basket Item \n if($this->save_basket()){ \n return isset($rowid) ? $rowid : TRUE; \n }else{ \n return FALSE; \n } \n } \n } \n }",
"public function insertItem($item) {\n\t\t$this->items[$item->idItem] = $item;\n\t}",
"public function addToWishList($userId, $itemId)\n {\n\n $sql = \"INSERT INTO wishlist (user_id, item_id)\n VALUES (:userID, :itemID)\";\n $query = $this->db->prepare($sql);\n $parameters = array(':userID' => $userId\n , ':itemID' => $itemId);\n\n// useful for debugging: you can see the SQL behind above construction by using:\n// echo '[ PDO DEBUG ]: ' . Helper::debugPDO($sql, $parameters); exit();\n\n $result = $query->execute($parameters);\n// echo $result ? \"Successfully added.\" : \"Error in sql statement: \";\n// print_r( $query->errorInfo()[2]);\n if (!$result)\n return $query->errorInfo();\n else\n return 1;\n }",
"function createItem($connection, $un, $userID, $image, $name, $description, $quantity, $category, $price) {\n //then returns the itemID of the newly created order\n $query = \"INSERT INTO items (userID, itemImage, itemName, itemDescription, itemQuantity, itemCategory, itemPrice) \n VALUES ($userID, '$image', '$name', '$description', $quantity, '$category', $price)\";\n \n sendQuery($connection, $query);\n \n $query = \"SELECT itemID FROM items WHERE userID = $userID\";\n $itemIDResult = sendQuery($connection, $query);\n $rows = $itemIDResult->num_rows;\n $itemID = 0;\n \n for ($j = 0 ; $j < $rows ; ++$j)\n {\n $itemIDResult->data_seek($j);\n $row = $itemIDResult->fetch_array(MYSQLI_ASSOC);\n $tempItemID = $row['itemID'];\n if ($tempItemID > $itemID) $itemID = $tempItemID;\n }\n\n return $itemID;\n}",
"function insert_item()\n{\n if (isset($_SESSION['ADMIN']))\n {\n $mitems = new MItems();\n $mitems->SetValue($_POST);\n $mitems->Insert();\n\n home();\n }\n\n else\n {\n forbidden();\n }\n\n return;\n\n}",
"abstract protected function addToStorage($storage, $items);",
"function item_register(){\n\t\t$obj=$this->check_errors();\n\n\t\t// Add user if no errors\n\t\tif(!$obj['error']){\n\t\t\t// Prepare statements to get selected id.\n\t\t\t$stmt = $this->pdo->prepare(\"INSERT INTO edit_users (username, email, password, api_key, referer_id) VALUES(:username, :email, :password, :api_key, :referer_id)\");\n\t\t\t$stmt->bindParam(':username', $this->data['username'], PDO::PARAM_STR, 254);\n\t\t\t$stmt->bindParam(':email', $this->data['email'], PDO::PARAM_STR, 254);\n\t\t\t$stmt->bindParam(':password', md5($this->data['password']), PDO::PARAM_STR, 32);\n\t\t\t$stmt->bindParam(':api_key', md5($this->data['password'].''.$this->data['api_key']), PDO::PARAM_STR, 32);\n\t\t\t$stmt->bindParam(':referer_id', intval($this->data['referer_id']), PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t\t\t\n\t\t\t// Include \n\t\t\t$id = $this->pdo->lastInsertId();\n\t\t\t\n\t\t\t// Return item data and send activation\n\t\t\tif($id>0){\n\t\t\t\t// Set fields to update\n\t\t\t\t$obj['item']=array(\n\t\t\t\t\t\"id\" => $id\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t// Prepare email template varibles\n\t\t\t\t$this->data['user_id']=$id;\n\t\t\t\t$this->data['hash']=md5(time());\n\t\t\t\t\n\t\t\t\t// Prepare statements to get selected id.\n\t\t\t\t$stmt = $this->pdo->prepare(\"INSERT INTO edit_users_activations (user_id, hash, mktime) VALUES(:user_id, :hash, :mktime)\");\n\t\t\t\t$stmt->bindParam(':user_id', $this->data['user_id'], PDO::PARAM_INT);\n\t\t\t\t$stmt->bindParam(':hash', $this->data['hash'], PDO::PARAM_STR, 32);\n\t\t\t\t$stmt->bindParam(':mktime', $this->data['time'], PDO::PARAM_INT);\n\t\t\t\t$stmt->execute();\n\t\t\n\t\t\t\t// Include \n\t\t\t\t$in = $this->pdo->lastInsertId();\n\t\t\t\t\n\t\t\t\tif($in>0){\n\t\t\t\t\t//$this->send_activiation();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$obj['status']='ok';\n\t\t\t}else{\n\t\t\t\t// Close session\n\t\t\t\tsession_unset();\n\t\t\t\tsession_destroy();\n\t\t\t\t\n\t\t\t\t// Return error if item not created\n\t\t\t\t$obj['errors'][]='can not insert item to: edit_users_activations';\n\t\t\t\t$obj['error']++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Return depends on type\n\t\tif($this->data['ajax']){\n\t\t\t// Print JSON object\n\t\t\techo json_encode($obj);\n\t\t}else{\n\t\t\t// Return JSON object\n\t\t\treturn $obj;\n\t\t}\n\t}",
"public function setItem()\n {\n //conditional checks by taking advantage of polymorphism\n $this->setAllBasics();\n $this->setParams();\n\n $addQuery = 'INSERT INTO items(sku, name, price, type, height, width, length) VALUES (:sku,:name,:price, :type,:height, :width, :length)';\n $query = $this->pdo->prepare($addQuery);\n $query->bindValue(':sku', $this->getSKU());\n $query->bindValue(':name', $this->getName());\n $query->bindValue(':price', $this->getPrice());\n $query->bindValue(':type', $this->getType());\n $query->bindValue(':height', $this->getHeight());\n $query->bindValue(':width', $this->getWidth());\n $query->bindValue(':length', $this->getLength());\n\n $query->execute();\n }",
"function addInventory($rid, $inv) {\n \n $sql = \"INSERT INTO (inv_type, inv_name, resource_id) VALUES (:type, :name, :rid)\";\n \n try {\n //lets try and put this together, a query for each inventory.\n $this->db->beginTransaction();\n foreach($inv as $k =>$v) {\n $this->db->query($sql);\n //bind data needed to create inventory.\n $this->db->bind('rid', $rid);\n $this->db->bind(':type', $k);\n $this->db->bind(':name', $v);\n $this->db->execute();\n }\n //commit our data\n $this->db->endTransaction();\n }\n catch(\\PDOException $e) {\n //if we had errors roll the data back. \n $this->db->cancelTransaction();\n $this->log->logError($e);\n return array('result' => 'Failure', 'message' => $e->getMessage());\n }\n }",
"public function addItem();"
] | [
"0.6531085",
"0.6382723",
"0.63061905",
"0.6213888",
"0.6199886",
"0.61703026",
"0.61624825",
"0.6150425",
"0.60649043",
"0.60395885",
"0.59579587",
"0.5956346",
"0.59350663",
"0.5902667",
"0.58999044",
"0.5897041",
"0.5893037",
"0.58052224",
"0.57816607",
"0.5774569",
"0.5767045",
"0.5763013",
"0.575676",
"0.5755168",
"0.57504326",
"0.57495",
"0.5748714",
"0.57311237",
"0.5730085",
"0.5701514"
] | 0.64561933 | 1 |
Get a new file name, e.g., originalfilename[imageWidth][uniqueId].ext Spaces and periods in the original file names are replaced with dashes. | private function getNewFileName($file, $width=0){
$info = pathinfo($file);
$uniqueId = $this->getUniqueId();
# get the suffix
$suffix = '';
if($width) $suffix .= '-' . $width;
$suffix .= '-' . $uniqueId;
# clean spaces and periods and replace with dashes
$justName = str_replace(array(' ', '.'), '-', $info['filename']);
$justName = preg_replace('/[\-]+/', '-', $justName);
$justName = preg_replace("/['\"]+/", '', $justName);
$fileName = $justName . $suffix . '.' . $info['extension'];
$this->fileNameBased = $justName . '-' . $uniqueId . $info['extension'];
return $fileName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function makeFileName()\n {\n $name = sha1(\n time() . $this->file->getClientOriginalName()\n );\n $extension = $this->file->getClientOriginalExtension();\n return \"{$name}.{$extension}\";\n }",
"public function createInternalFileName() {\r\n\t\t$newNameParts = explode(' ', microtime());\r\n\t\treturn $newNameParts[1] . substr($newNameParts[0], 2, 5);\r\n\t}",
"function newFileName($path, $filename) {\n\n\t\tif ($pos = strrpos($filename, '.')) {\n\n\t\t\t$name = substr($filename, 0, $pos);\n\t\t\t$ext = substr($filename, $pos);\n\n\t\t} else {\n\n\t\t\t$name = $filename;\n\n\t\t}\n\n\t\t$newpath = $path . '/' . $filename;\n\t\t$newname = $filename;\n\t\t$counter = 0;\n\n\t\twhile (file_exists($newpath)) {\n\t\t\t$newname = $name . '_' . $counter . $ext;\n\t\t\t$newpath = $path . '/' . $newname;\n\t\t\t$counter++;\n\t\t}\n\n\t\treturn $newname;\n\t}",
"private function getFileName(){\n \t$x = explode('.', $this->uploadedImage['name']);\n \tunset($x[count($x)-1]);\n \t$name = implode('.', $x);\n \t\n \t$file = $this->uploadDirectory.'/'.$name.'.png';\n \t$rand= \"\";\n \t\n \twhile (file_exists($file)) {\n \t\t\t$rand = random_string(6);\n \t\t\t$file = $this->uploadDirectory.'/'.$name.$rand.'.png';\n \t}\n \treturn ($rand != \"\" ? $name.$rand : $name).'.png';\n }",
"function getNewFileName($filename, $offal=''){\n\t\t$tempNum\t=\t\"0000\" . rand(0,9999);\n\t\t$aNewName\t= \tdate(\"ymdh\").rand(0,9999).substr($tempNum,strlen($tempNum)-4,4);\n\t\tif (empty($offal)) {\n\t\t\t$aNewName .= \".\" . $this->getFileType($filename);\n\t\t}else {\n\t\t\t$aNewName\t=\tarray( $aNewName. \".\" . $this->getFileType($filename) , $aNewName. \"_$offal.\" . $this->getFileType($filename));\n\t\t}\n\n\t\treturn $aNewName;\n\t}",
"protected function getUniqueFileName()\n\t{\n\t\t$counter = 0;\n\t\t\n\t\tdo {\n\t\t\t$filename = Inflector::slug($this->activeRecord->file->baseName) . $counter++ \n\t\t\t\t. '.' . $this->activeRecord->file->extension;\n\t\t} while ($this->fileExists($filename));\n\t\t\n\t\treturn $filename;\n\t}",
"function fileRenameOnUpload($filename)\n{\n $info = pathinfo($filename);\n $ext = empty($info['extension']) ? '' : '.' . $info['extension'];\n $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n $generatedChars = substr(str_shuffle($chars), 0, 12);\n\n return $generatedChars . '_' . time() . $ext;\n}",
"private function _filename() {\r\n\t\treturn $this->path . $this->id . '_' . $this->dimentions . '.jpg';\r\n\t}",
"public function generateNewFileName($filename) {\n\t\t$strSecret = '!@#$%^&*()_+QBGFTNKU' . time() . rand(111111,999999);\n\t\t$filenameMd5 = substr(md5($filename . $strSecret),0,10);\n\t\treturn date('Y_m_d') . '_' . $filenameMd5 . '.' . $this->getExtension($filename);\n\t}",
"protected function generateFileName()\n\t{\n\t\t$filename = Inflector::slug($this->activeRecord->file->baseName) . '.' . $this->activeRecord->file->extension;\n\t\t\n\t\t// if a file with the same name already exist append a number\n\t\tif ($this->fileExists($filename)) {\n\t\t\tif (false === Module::getInstance()->rename) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t$filename = $this->getUniqueFileName();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $filename;\n\t}",
"public function originalFilename();",
"public function getNewFileName($targetFilename);",
"public function getName() {\n\t\t$name = substr($this->filename, 0, strrpos($this->filename, '.'));\n\t\t$name = str_replace('_', ' ', $name);\n\t\treturn $name;\n\t}",
"public function fileName()\n {\n $name = sha1($this->file->getClientOriginalName());\n $extension = $this->file->getClientOriginalExtension();\n return \"{$name}.{$extension}\";\n }",
"function generateFileName(){\r\n\t\treturn uniqid().'-'.strtolower($_FILES[\"file\"][\"name\"]);\r\n\t}",
"function makeThumbnailName($image) {\n $i = strrpos($image, '.');\n $image_name = substr($image, 0, $i);\n $ext = substr($image, $i);\n $image = $image_name . '-tn' . $ext;\n return $image;\n}",
"function makeThumbnailName($image) {\n $i = strrpos($image, '.');\n $image_name = substr($image, 0, $i);\n $ext = substr($image, $i);\n $image = $image_name . '-tn' . $ext;\n return $image;\n}",
"function generateFilename(&$paperFile, $type, $originalName) {\n\t\t$extension = $this->parseFileExtension($originalName);\t\t\t\n\t\t$newFileName = $paperFile->getPaperId().'-'.$paperFile->getFileId().'-'.$paperFile->getRevision().'-'.$type.'.'.$extension;\n\t\t$paperFile->setFileName($newFileName);\n\t\treturn $newFileName;\n\t}",
"function makeThumbnailName($image) {\r\n $i = strrpos($image, '.');\r\n $image_name = substr($image, 0, $i);\r\n $ext = substr($image, $i);\r\n $image = $image_name . '-tn' . $ext;\r\n return $image;\r\n }",
"private function createUniqueFileName($originalFileName, $extensionFileName) \n { \n $fileName = ''; \n if ($this->isExistedFile($originalFileName)) \n { \n $fileNamewithoutExtension = $this->getFileNamewithoutExtension($originalFileName, $extensionFileName); \n $fileName = $fileNamewithoutExtension. uniqid('_'). '.'. $extensionFileName; \n } \n else $fileName = $originalFileName; \n return $fileName; \n }",
"function makeThumbnailName($image) {\r\n $i = strrpos($image, '.');\r\n $image_name = substr($image, 0, $i);\r\n $ext = substr($image, $i);\r\n $image = $image_name . '-tn' . $ext;\r\n return $image;\r\n}",
"private function getNameWithPath(){\n $name = $this->imageFolder.date('YmdHis').\".jpg\";\n return $name;\n }",
"private function setNewFileName() {\n\n if (isset($this->options['original_name']) || (isset($this->config['original_name']) && $this->config['original_name'])) {\n $this->new_image_name = $this->image->getClientOriginalName();\n } else {\n $this->new_image_name = FileName::get(\n $this->image->getClientOriginalName()\n , isset($this->options['filename']) ? $this->options['filename'] : []\n );\n }\n }",
"function getNextName($imgTitle) {\n $extension = $this->get_file_extension($imgTitle);\n $withoutExt = preg_replace('/\\\\.[^.\\\\s]{3,4}$/', '', $imgTitle);\n $pos = strrpos($withoutExt, '-');\n $end = $pos === false ? $withoutExt : substr($withoutExt, $pos + 1);\n if ( is_numeric($end) ) {\n $end++;\n $newName = substr($imgTitle, 0, strrpos($imgTitle, '-')) . '-' . $end . '.' . $extension;\n } else {\n $newName = $withoutExt . '-1.' . $extension;\n }\n return $newName;\n }",
"protected function getFilename()\n {\n $filename = trim($this->resolvePattern('%filename%'));\n return sanitize_file_name($filename ?: uniqid('img_', false));\n }",
"public function getFileName()\n {\n return $this->getShortName() . '-'. date(\"Ymd-His\",time());\n }",
"public function baseFileName($filename, $originalname)\n {\n $buf = file_get_contents($filename, false, null, -1, 32);\n $ext = Konekt::helper('core/image')->getImageType($buf);\n \n /* In case the extension could not be obtained use the original extension */\n $ext = empty($ext) ? Konekt::helper('core')->getFileExt($originalname, true) : $ext;\n \n return Konekt::helper('core')->getTreatedFileName(\n Konekt::helper('core')->getFileNameWithoutExt($originalname).\"_\".\n date('YmdHis').\".\".$ext);\n }",
"private function getNewName(\\SplFileInfo $file) : string\n {\n $directory = $file->getPath();\n $filename = $this->changeCase(pathinfo($file->getFilename(), PATHINFO_FILENAME));\n $fileExtension = $this->getExtension($file->getExtension());\n return \"{$directory}\" . DIRECTORY_SEPARATOR . \"{$filename}{$fileExtension}\";\n }",
"protected function makeFilename()\n\t{\n\t\t$ext = strtolower(pathinfo($this->file, PATHINFO_EXTENSION));\n\t\t$extLen = strlen($ext);\n\t\tif ($this->isNophoto() /* && $extLen <= 0 */) {\n\t\t\t$ext = strtolower(pathinfo($this->image, PATHINFO_EXTENSION));\n\t\t}\n\t\tif ($extLen <= 0) {\n\t\t\t$name = basename($this->file);\n\t\t} else {\n\t\t\t$name = substr(basename($this->file), 0, - $extLen - 1);\n\t\t}\n\t\t$this->thumb = $name . '_' . $this->config . '.' . $ext;\n\t\treturn $this->thumb;\n\t}",
"private function getFileName() {\n\n if (!$this->template->title_file) {\n return $this->list_id . \"_\" . $this->item_id;\n }\n\n $title = $this->replaceWithFieldsVals($this->template->title_file); \n $title = $this->replaceLatvian($title);\n\n return preg_replace(\"/[^a-zA-Z0-9.]/\", \"_\", $title);\n }"
] | [
"0.7752654",
"0.74024",
"0.73648393",
"0.73484725",
"0.73376405",
"0.71835744",
"0.7178738",
"0.7177846",
"0.7149437",
"0.714208",
"0.7125109",
"0.70826936",
"0.7057881",
"0.70528203",
"0.7027754",
"0.70174336",
"0.70174336",
"0.69710976",
"0.6967616",
"0.6962468",
"0.6954571",
"0.6929083",
"0.6919616",
"0.68966913",
"0.68692863",
"0.68656015",
"0.6824083",
"0.6816118",
"0.6812534",
"0.6807698"
] | 0.7557602 | 1 |
Get a unique id string from the property $uniqueId or generate a random 5letters string | private function getUniqueId(){
if($this->uniqueId) return $this->uniqueId;
else return substr(md5(time()), 0, 5);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUniqueId(): string\n {\n if (!$this->uniqID) {\n $prefix = strtolower($this->getRealIdentifier());\n $this->uniqID = $prefix . '_' . Str::random(3);\n }\n\n return $this->uniqID;\n }",
"public function generate_uniqid()\n {\n return '0'.substr(uniqid(rand()), 0, 11);\n }",
"public function generateUniqueID(){\n\t\t// \t\treturn base64_encode(uniqid() . substr(uniqid(), 11, 2));\t// e.g. NGYcZDRjODcxYzFkY2Rk (seems popular format)\n\t\t// \t\treturn uniqid();\t\t\t\t\t// e.g. 4f3d4c8602346\n\t\treturn str_replace('.', '', uniqid('', true));\t\t// e.g. 4f3d4c860235a529118898\n\t\t// \t\treturn str_replace('-', '', String::uuid());\t\t// e.g. 4f3d4c80cb204b6a8e580a006f97281a\n\t}",
"protected function generateId(): string\n {\n return uniqid(date('YmdHms'), false);\n }",
"private function generateUuid(){\n $num = \"100.\" . $this->randomNumber();\n // to-do: make sure ID is not already taken\n $id = \"[UUID:\" . $num . \"]\";\n return $id;\n }",
"protected static function generateUuid(): string\n {\n return uniqid(time(), true);\n }",
"protected function _randomid()\n {\n return strval(new Horde_Support_Randomid());\n }",
"private function getRandomId(): string\n {\n return bin2hex(random_bytes(12));\n }",
"private function generateUniqueName()\n {\n return str_random();\n }",
"protected function id()\n {\n return Str::random(32);\n }",
"public function randId()\n {\n $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $charLen = strlen($chars);\n $randStr = '';\n for ($i = 0; $i < 8; $i++) {\n $randStr .= $chars[rand(0, $charLen - 1)];\n }\n return $randStr;\n }",
"function get_random_id()\n{\n\treturn 'i' . md5(uniqid(mt_rand(), TRUE));\n}",
"public static function genUniqID(){\n\t//if($this->where(''))\n\treturn \\MS\\Core\\Helper\\Comman::random(4,1);\n}",
"private function getRandomId(){\n return str_replace('.', '', microtime(true).rand());\n }",
"private function makeId()\n {\n $random = mt_rand();\n $random = md5($random);\n $random = substr($random,0,12);\n $name = $this->config['name'];\n $length = strlen($name);\n \n if($length > 22){\n $name = substr($name,0,22);\n }\n\n return $name.\"-\".$random;\n }",
"public function generateUniqueName(): string\n {\n return md5(uniqid());\n }",
"protected function generateUuid()\n {\n return Str::uuid();\n }",
"function uniqueId() {\n\t$randomKey = rand(0, 99999999);\n\treturn padNumber( $randomKey, 8 );\n}",
"function generateID() {\n $str_result = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; \n // Shufle the $str_result and returns substring\n // of length 6\n return substr(str_shuffle($str_result), 0, 6); \n }",
"private function generateUuid(): string\n {\n $g = $this->getUuidGenerator();\n\n return $g();\n }",
"public function getUniqueId(): string;",
"function generateTransferId():string{\n return uniqid(true);\n }",
"static function generate() {\n\t\treturn\tuniqid(rand(), true);\n\t}",
"public function getUniqueTranId(){\n $unique_id = str_replace(\".\",\"\",microtime(true)).rand(000,999);\n return $unique_id;\n }",
"function createRandomUserID(){\n $characters = \"qwertyuiopasdfghjklzxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM\";\n $randString = \"\";\n for($i = 0; $i < 8; $i++){\n $randString.=($characters[rand(0,strlen($characters)-1)]);\n }\n return $randString;\n }",
"static public function uuid() \n {\n self::$uuid = md5(uniqid(rand() + MicroTime(), 1));\n return self::$uuid;\n }",
"function generateRandID(){\n return md5(generateRandStr(16));\n}",
"public function generateOwnerUUID()\n {\n $chars = md5(uniqid(mt_rand(), true));\n $uuid = substr ( $chars, 0, 8 ) . '-'\n . substr ( $chars, 8, 4 ) . '-'\n . substr ( $chars, 12, 4 ) . '-'\n . substr ( $chars, 16, 4 ) . '-'\n . substr ( $chars, 20, 12 );\n return $uuid ;\n }",
"function upfront_get_unique_id ($pfx = '') {\n\treturn sprintf(\"%s-%s-%s\", ($pfx ? $pfx : \"entity\"), time(), rand(1000,99999));\n}",
"function CreateID() {\n $result = \"\";\n $length = 16;\n for ($i=0; $i < $length; $i++) {\n $result.= dechex(mt_rand(0,$length-1));\n }\n return $result;\n }"
] | [
"0.7895003",
"0.7883441",
"0.7849262",
"0.7809076",
"0.7763758",
"0.7756901",
"0.77335626",
"0.77202046",
"0.76762694",
"0.7659313",
"0.7623988",
"0.7615763",
"0.760596",
"0.7605398",
"0.75945157",
"0.7582877",
"0.75459325",
"0.7514208",
"0.7471273",
"0.74680096",
"0.74615484",
"0.74578804",
"0.74192196",
"0.7401361",
"0.737798",
"0.7374322",
"0.7370048",
"0.7369762",
"0.7356088",
"0.73366994"
] | 0.81899756 | 0 |
Determines the PDO type for the specified PHP type. | public function getPdoType($type)
{
static $map=array
(
'boolean'=>\PDO::PARAM_BOOL,
'integer'=>\PDO::PARAM_INT,
'string'=>\PDO::PARAM_STR,
'resource'=>\PDO::PARAM_LOB,
'NULL'=>\PDO::PARAM_NULL,
);
return isset($map[$type]) ? $map[$type] : \PDO::PARAM_STR;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPdoType ($type) {\r\n static $map = array(\r\n \r\n 'boolean' => PDO::PARAM_BOOL, \r\n 'integer' => PDO::PARAM_INT, \r\n 'string' => PDO::PARAM_STR, \r\n 'NULL' => PDO::PARAM_NULL\r\n );\r\n return isset( $map[$type] ) ? $map[$type] : PDO::PARAM_STR;\r\n }",
"private function getPDOType($value) {\n\t\tswitch (gettype($value)) {\n\t\t\tcase 'integer':\n\t\t\t\treturn \\PDO::PARAM_INT;\n\t\t\tcase 'boolean':\n\t\t\t\treturn \\PDO::PARAM_BOOL;\n\t\t\tdefault:\n\t\t\t\treturn \\PDO::PARAM_STR;\n\t\t}\n\t}",
"public function getPdoType($data)\n {\n static $typeMap = [\n // php type => PDO type\n 'boolean' => \\PDO::PARAM_BOOL,\n 'integer' => \\PDO::PARAM_INT,\n 'string' => \\PDO::PARAM_STR,\n 'resource' => \\PDO::PARAM_LOB,\n 'NULL' => \\PDO::PARAM_NULL,\n ];\n $type = gettype($data);\n \n return isset($typeMap[$type]) ? $typeMap[$type] : \\PDO::PARAM_STR;\n }",
"public function getPdoType($data)\n {\n static $typeMap = [\n // php type => PDO type\n 'boolean' => \\PDO::PARAM_BOOL,\n 'integer' => \\PDO::PARAM_INT,\n 'string' => \\PDO::PARAM_STR,\n 'resource' => \\PDO::PARAM_LOB,\n 'NULL' => \\PDO::PARAM_STR, // [Informix][Informix ODBC Driver]Wrong number of parameters if set NULL\n ];\n $type = gettype($data);\n\n return isset($typeMap[$type]) ? $typeMap[$type] : \\PDO::PARAM_STR;\n }",
"protected function _getPdoType($sqlType)\n\t{\n\t\t$map = array(\n\t\t\tDBParamType::Integer => PDO::PARAM_INT,\n\t\t\tDBParamType::String => PDO::PARAM_STR,\n\t\t\tDBParamType::Lob => PDO::PARAM_LOB,\n\t\t\tDBParamType::Bool => PDO::PARAM_INT,\n\t\t\tDBParamType::Null => PDO::PARAM_NULL,\n\t\t\tDBParamType::Real => PDO::PARAM_STR\n\t\t);\n\n\t\tif (!array_key_exists($sqlType, $map)) return PDO::PARAM_STR;\n\t\treturn $map[$sqlType];\n\t}",
"private function getType($value)\n\t{\n\t\tif($value === null) return PDO::PARAM_NULL;\n\t\telseif(is_int($value) || is_float($value)) return PDO::PARAM_INT;\n\t\treturn PDO::PARAM_STR;\n\t}",
"private function evaluatePdoType(mixed $variable): int\n {\n if (is_float($variable)) {\n // PDO doesn't have PARAM_FLOAT, so it must be evaluated as STR\n return PDO::PARAM_STR;\n } elseif (is_int($variable)) {\n return PDO::PARAM_INT;\n } elseif (is_bool($variable)) {\n return PDO::PARAM_BOOL;\n } elseif (is_null($variable)) {\n return PDO::PARAM_NULL;\n }\n return PDO::PARAM_STR;\n }",
"private function getType($value)\n {\n // Type is either string or integer\n $return = (is_int($value)) ? \\PDO::PARAM_INT : \\PDO::PARAM_STR;\n\n // Do a last null check\n return (is_null($value)) ? \\PDO::PARAM_NULL : $return;\n }",
"abstract public function getSQLType();",
"private function bind($value, $type) {\r\n //$type should be null when sent if ommitted\r\n //See bindParam & bindValue functions\r\n if(is_null($type)) {\r\n switch (true) {\r\n case is_int($value):\r\n $type = PDO::PARAM_INT; //1\r\n break;\r\n case is_bool($value):\r\n $type = PDO::PARAM_BOOL; //5\r\n break;\r\n case is_null($value):\r\n $type = PDO::PARAM_NULL; //0\r\n break;\r\n default:\r\n $type = PDO::PARAM_STR; //2\r\n }\r\n }\r\n return $type;\r\n }",
"public function checkTypes ($params) {\r\n\r\n $type = gettype($params);\r\n\r\n /**\r\n * extend further in the future\r\n */\r\n switch ($type) {\r\n case \"integer\":\r\n $pdoType = PDO::PARAM_INT;\r\n return $pdoType;\r\n break;\r\n case \"string\" :\r\n $pdoType = PDO::PARAM_STR;\r\n return $pdoType;\r\n }\r\n\r\n }",
"public function dbType();",
"private function typecheck () {\n\t\t$types = array();\n\t\t$vars = array_values($this->get_object_vars());\n\t\t/* Maybe set the vars to default PDO consts instead of trying to detect them?\n\t\tPDO::PARAM_BOOL (integer) // Represents a boolean data type. \n\t\tPDO::PARAM_NULL (integer) // Represents the SQL NULL data type. \n\t\tPDO::PARAM_INT (integer) // Represents the SQL INTEGER data type. \n\t\tPDO::PARAM_STR (integer) // Represents the SQL CHAR, VARCHAR, or other string data type. \n\t\tPDO::PARAM_LOB // BLOB\n\t\t// Floats are apparently problematic and need to not be specified?!?\n\t\t*/\n\t\tforeach ($vars AS $var) {\n\t\t\tif (is_int($var)) $types[] = PDO::PARAM_INT; // var is an int, assign PDO int\n\t\t\telse $types[] = PDO::PARAM_STR; // Default to string\n\t\t}\n\t\t$this->types = $types;\n\t}",
"private function getType($value) {\n // is this a file stream?\n if (get_resource_type($value) == 'stream') {\n return PDO::PARAM_LOB;\n // either string or an integer then\n } else {\n return (Fari_Filter::isInt($value)) ? PDO::PARAM_INT : PDO::PARAM_STR;\n }\n }",
"function map_field_type_to_bind_type($field_type)\n{\n switch ($field_type) {\n case MYSQLI_TYPE_DECIMAL:\n case MYSQLI_TYPE_NEWDECIMAL:\n case MYSQLI_TYPE_FLOAT:\n case MYSQLI_TYPE_DOUBLE:\n return 'd';\n\n case MYSQLI_TYPE_BIT:\n case MYSQLI_TYPE_TINY:\n case MYSQLI_TYPE_SHORT:\n case MYSQLI_TYPE_LONG:\n case MYSQLI_TYPE_LONGLONG:\n case MYSQLI_TYPE_INT24:\n case MYSQLI_TYPE_YEAR:\n case MYSQLI_TYPE_ENUM:\n return 'i';\n\n case MYSQLI_TYPE_TIMESTAMP:\n case MYSQLI_TYPE_DATE:\n case MYSQLI_TYPE_TIME:\n case MYSQLI_TYPE_DATETIME:\n case MYSQLI_TYPE_NEWDATE:\n return 't';\n\n case MYSQLI_TYPE_INTERVAL:\n case MYSQLI_TYPE_SET:\n case MYSQLI_TYPE_VAR_STRING:\n case MYSQLI_TYPE_STRING:\n case MYSQLI_TYPE_CHAR:\n case MYSQLI_TYPE_GEOMETRY:\n return 's';\n\n case MYSQLI_TYPE_TINY_BLOB:\n case MYSQLI_TYPE_MEDIUM_BLOB:\n case MYSQLI_TYPE_LONG_BLOB:\n case MYSQLI_TYPE_BLOB:\n return 'b';\n\n default:\n trigger_error(\"unknown type: $field_type\");\n return 's';\n }\n}",
"private function valueType($value) {\n // a file\n if (get_resource_type($value) == 'stream') {\n return PDO::PARAM_LOB;\n // a string or an integer\n } else {\n return (Fari_Filter::isInt($value)) ? PDO::PARAM_INT : PDO::PARAM_STR;\n }\n }",
"public function get_database_column_type();",
"public function getDatabaseType()\r\n {\r\n $this->connect();\r\n\r\n return $this->pdo->getAttribute( \\PDO::ATTR_DRIVER_NAME );\r\n }",
"private function getOciType($pdoType)\r\n {\r\n $ociType = SQLT_CHR;\r\n $pdoType = $pdoType & ~\\PDO::PARAM_INPUT_OUTPUT;\r\n\r\n switch ($pdoType) {\r\n case \\PDO::PARAM_NULL:\r\n case \\PDO::PARAM_STR:\r\n $ociType = SQLT_CHR;\r\n break;\r\n case \\PDO::PARAM_INT:\r\n $ociType = SQLT_INT;\r\n break;\r\n case \\PDO::PARAM_BOOL:\r\n $ociType = SQLT_BOL;\r\n break;\r\n case \\PDO::PARAM_LOB:\r\n $ociType = SQLT_CLOB;\r\n break;\r\n case \\PDO::PARAM_LOB + PDO::PARAM_LOB:\r\n $ociType = SQLT_BLOB;\r\n break;\r\n }\r\n\r\n return $ociType;\r\n }",
"public function datatype($type)\n {\n static $types = [\n // SQL-92\n 'bit' => ['type' => 'string', 'exact' => true],\n 'bit varying' => ['type' => 'string'],\n 'char' => ['type' => 'string', 'exact' => true],\n 'char varying' => ['type' => 'string'],\n 'character' => ['type' => 'string', 'exact' => true],\n 'character varying' => ['type' => 'string'],\n 'date' => ['type' => 'string'],\n 'dec' => ['type' => 'float', 'exact' => true],\n 'decimal' => ['type' => 'float', 'exact' => true],\n 'double precision' => ['type' => 'float'],\n 'float' => ['type' => 'float'],\n 'int' => ['type' => 'int', 'min' => '-2147483648', 'max' => '2147483647'],\n 'integer' => ['type' => 'int', 'min' => '-2147483648', 'max' => '2147483647'],\n 'interval' => ['type' => 'string'],\n 'national char' => ['type' => 'string', 'exact' => true],\n 'national char varying' => ['type' => 'string'],\n 'national character' => ['type' => 'string', 'exact' => true],\n 'national character varying' => ['type' => 'string'],\n 'nchar' => ['type' => 'string', 'exact' => true],\n 'nchar varying' => ['type' => 'string'],\n 'numeric' => ['type' => 'float', 'exact' => true],\n 'real' => ['type' => 'float'],\n 'smallint' => ['type' => 'int', 'min' => '-32768', 'max' => '32767'],\n 'time' => ['type' => 'string'],\n 'time with time zone' => ['type' => 'string'],\n 'timestamp' => ['type' => 'string'],\n 'timestamp with time zone' => ['type' => 'string'],\n 'varchar' => ['type' => 'string'],\n\n // SQL:1999\n 'binary large object' => ['type' => 'string', 'binary' => true],\n 'blob' => ['type' => 'string', 'binary' => true],\n 'boolean' => ['type' => 'bool'],\n 'char large object' => ['type' => 'string'],\n 'character large object' => ['type' => 'string'],\n 'clob' => ['type' => 'string'],\n 'national character large object' => ['type' => 'string'],\n 'nchar large object' => ['type' => 'string'],\n 'nclob' => ['type' => 'string'],\n 'time without time zone' => ['type' => 'string'],\n 'timestamp without time zone' => ['type' => 'string'],\n\n // SQL:2003\n 'bigint' => ['type' => 'int', 'min' => '-9223372036854775808', 'max' => '9223372036854775807'],\n\n // SQL:2008\n 'binary' => ['type' => 'string', 'binary' => true, 'exact' => true],\n 'binary varying' => ['type' => 'string', 'binary' => true],\n 'varbinary' => ['type' => 'string', 'binary' => true]\n ];\n\n if (isset($types[$type])) {\n return $types[$type];\n }\n\n return array();\n }",
"public function getDatatype($strType);",
"public function getDBType() {\r\n\t\treturn get_class($this);\r\n\t}",
"public static function getDataSource(string $type): PDOSelectQueryDataSource|PDOUpdateQueryDataSource\n {\n if ($type === 'Select') {\n return new PDOSelectQueryDataSource();\n }\n if ($type === 'Update') {\n return new PDOUpdateQueryDataSource();\n } else throw new Error('PDOPBGDSBT');\n }",
"public function type($type);",
"function getType() {\n\t\treturn Formz::DoctrineDB;\n\t}",
"public function SQLType()\n\t{\n\t\treturn ($this->maxlength) ? \"VARCHAR\" : \"LONGTEXT\";\n\t}",
"public function GetDbType()\n {\n return $this->db_type;\n }",
"private function getPhpType(string $doctrineType): ?string\n {\n return match ($doctrineType) {\n Types::SMALLINT,\n Types::INTEGER => Type::BUILTIN_TYPE_INT,\n Types::FLOAT => Type::BUILTIN_TYPE_FLOAT,\n Types::BIGINT,\n Types::STRING,\n Types::TEXT,\n Types::GUID,\n Types::DECIMAL => Type::BUILTIN_TYPE_STRING,\n Types::BOOLEAN => Type::BUILTIN_TYPE_BOOL,\n Types::BLOB,\n Types::BINARY => Type::BUILTIN_TYPE_RESOURCE,\n Types::OBJECT,\n Types::DATE_MUTABLE,\n Types::DATETIME_MUTABLE,\n Types::DATETIMETZ_MUTABLE,\n 'vardatetime',\n Types::TIME_MUTABLE,\n Types::DATE_IMMUTABLE,\n Types::DATETIME_IMMUTABLE,\n Types::DATETIMETZ_IMMUTABLE,\n Types::TIME_IMMUTABLE,\n Types::DATEINTERVAL => Type::BUILTIN_TYPE_OBJECT,\n Types::ARRAY,\n Types::SIMPLE_ARRAY,\n 'json_array' => Type::BUILTIN_TYPE_ARRAY,\n default => null,\n };\n }",
"function setStatementType($type);",
"function parse_mysql_type($string, $type = NULL) {\n $type = strtolower($type);\n switch ($type) {\n case 'blob':\n case 'mediumblob':\n return base64_encode($string);\n case 'year':\n case 'int':\n case 'bigint':\n case 'smallint':\n case 'mediumint':\n case 'long':\n case 'tinyint':\n return (int)$string;\n case 'float':\n return (float)$string;\n case 'timestamp':\n return date(\"r\", (int)$string);\n case 'date':\n case 'datetime':\n return date(\"r\", strtotime($string));\n case 'VAR_STRING':\n return $string;\n }\n // If type is not present, just cast numbers...\n if (is_numeric($string)) {\n return (float)$string;\n }\n return $string;\n }"
] | [
"0.7681401",
"0.7614635",
"0.71094114",
"0.69785845",
"0.6929222",
"0.6752266",
"0.6739371",
"0.6673061",
"0.6569415",
"0.6418658",
"0.6393237",
"0.6374197",
"0.6334785",
"0.62222606",
"0.6097923",
"0.60954845",
"0.6084149",
"0.60728306",
"0.6020527",
"0.59438026",
"0.59276426",
"0.5910944",
"0.5908321",
"0.5884441",
"0.58507353",
"0.5824578",
"0.5783989",
"0.5733091",
"0.57237536",
"0.568225"
] | 0.7630212 | 1 |
Build api URL of news | function epfl_news_build_api_url($channel, $template, $nb_news, $lang, $category, $themes, $projects)
{
// returns the number of news according to the template
$limit = epfl_news_get_limit($template);
if ("1" == $template) {
$limit = $nb_news;
}
// define API URL
$url = NEWS_API_URL . $channel . '/news/?format=json&lang=' . $lang . '&limit=' . $limit;
// filter by category
if ($category !== '') {
$url .= '&category=' . $category;
}
// filter by themes
if ($themes !== '') {
$themes = explode(',', $themes);
foreach ($themes as $theme) {
$url .= '&themes=' . $theme;
}
}
// filter by projects
if ($projects !== '') {
$projects = explode(',', $projects);
foreach ($projects as $project) {
$url .= '&projects=' . $project;
}
}
return $url;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function epfl_news_build_api_url($channel, $template, $nb_news, $lang, $category, $themes, $projects)\n{\n // returns the number of news according to the template\n $limit = epfl_news_get_limit($template);\n if (\"1\" == $template) {\n $limit = $nb_news;\n }\n\n // define API URL\n $url = NEWS_API_URL . $channel . '/news/?format=json&lang=' . $lang . '&limit=' . $limit;\n\n // filter by category\n if ($category !== '') {\n $url .= '&category=' . $category;\n }\n\n // filter by themes\n if ($themes !== '' && $themes != '[]') {\n $themes = explode(',', $themes);\n foreach ($themes as $theme) {\n $url .= '&themes=' . $theme;\n }\n }\n\n // filter by projects\n if ($projects != '') {\n $projects = explode(',', $projects);\n foreach ($projects as $project) {\n $url .= '&projects=' . $project;\n }\n }\n return $url;\n}",
"protected function getAPIURL():string\n {\n return \"https://api.myjson.com/bins/11wxz1\";\n }",
"public function url()\n {\n $url = \"\";\n\n if ($this->offset) {\n $url .= \"offset=\".$this->offset.\"&\";\n }\n if ($this->project) {\n $url .= \"project=\".$this->project.\"&\";\n }\n if ($this->engineer) {\n $url .= \"engineer=\".$this->engineer.\"&\";\n }\n if ($this->limit) {\n $url .= \"limit=\".$this->limit.\"&\";\n }\n if ($this->type) {\n foreach($this->type as $type) {\n $url .= \"type[]=\".$type.\"&\";\n }\n }\n\n return $url;\n }",
"public function url()\n\t{\n\t\t\n\t\t$lang = Config::get('app.locale');\n\t\t$route_prefix = ($lang == \"ar\" ? \"ar/\" : \"\");\t\t\n\t\treturn Url::to($route_prefix .'news/' .$this->slug);\n\t}",
"protected function obtainAPIURLEndpoint()\n {\n $uri = str_replace('{forgeserver}', $this->server, config('forge-publish.get_certificates_uri'));\n $uri = str_replace('{forgesite}', $this->site, $uri);\n return config('forge-publish.url') . $uri;\n }",
"public function buildApiUrl(array $config){\n\n $scheme = isset($config['scheme']) ? $config['scheme'] . '://' : static::DEFAULT_API_SCHEME. '://';\n $host = isset($config['host']) ? $config['host'] : static::DEFAULT_API_HOST;\n $port = isset($config['port']) ? ':' . $config['port'] : ':' . static::DEFAULT_API_PORT;\n $contextPath = isset($config['context_path']) ? $config['context_path'] : static::DEFAULT_API_CONTEXT_PATH;\n $version = isset($config['version']) ? $config['version'] . '/' : static::DEFAULT_API_VERSION . '/';\n return $scheme . $host . $port . $contextPath . $version;\n }",
"public function getGenratedApiUrl(): string {\n\n\t\t$queryString = $this->buildQueryString();\n\n\t\treturn\n\t\t\tempty($queryString)\n\t\t\t\t? self::API_ENDPOINT\n\t\t\t\t: self::API_ENDPOINT . '?' . $queryString;\n\t}",
"private function constructUrl()\n {\n\n $url = $this->url . $this->inputKey;\n if ($this->tag) {\n $url .= '/tag/' . $this->tag . '/';\n }\n return $url;\n }",
"private function createUrl() {\r\n\r\n $url = \"\";\r\n\r\n\t\tif ( isset($this->shortUrl) ) {\r\n\r\n\t\t\t$url = \"/\" . $this->shortUrl;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tswitch( $this->type ) {\r\n\r\n\t\t\t\tcase 'category': $url = '/categories/c' . rawurlencode($this->id); break;\r\n\t\t\t\tcase 'geotarget': $url = '/categories/t' . rawurlencode($this->id); break;\r\n\t\t\t\tcase 'grouping': $url = '/categories/g' . rawurlencode($this->id); break;\r\n\t\t\t\tcase 'help': $url = '/help/h' . rawurlencode($this->id); break;\r\n\t\t\t\tcase 'landing': $url = '/categories/l' . rawurlencode($this->id); break;\r\n\t\t\t\tcase 'page': $url = str_replace(APP_ROOT, '', $this->filename); break;\r\n\t\t\t\tcase 'product': $url = '/products/' . rawurlencode($this->id); break;\r\n\t\t\t\tcase 'subcategory': $url = '/categories/s' . rawurlencode($this->id); break;\r\n\t\t\t}\r\n //just a test\r\n\t\t\tif (!empty($this->slug)) { $url .= \"/\" . rawurlencode($this->encodeSlug($this->slug)); }\r\n\t\t}\r\n\r\n\t\t// return ($this->secure ? URL_PREFIX_HTTPS : URL_PREFIX_HTTP) . $url . (mb_substr($url, -1) !== \"/\" ? \"/\" : \"\");\r\n\t\treturn ($this->secure ? URL_PREFIX_HTTPS : URL_PREFIX_HTTP) . $url;\r\n\t}",
"public function getBuiltUrl()\n {\n return $this->apiUrl . '?' . http_build_query($this->fields);\n }",
"public function api_uri() {\r\n return $this->api_url . $this->api_version . \"/\";\r\n }",
"protected function getApiUrl() {\n\n return '';\n\n }",
"public function url()\r\n {\r\n $query = array(\r\n 'key' => !empty($this->api_key) ? $this->api_key : PiplApi_SearchApi::$default_api_key,\r\n 'person' => PiplApi_Serializable::to_json($this->person),\r\n 'query_params_mode' => $this->query_params_mode,\r\n 'exact_name' => $this->exact_name,\r\n 'prioritize_records_by' => implode(',', $this->_prioritize_records_by),\r\n 'filter_records_by' => $this->_filter_records_by\r\n );\r\n \r\n return self::$BASE_URL . http_build_query($query);\r\n }",
"protected function getBaseApiUrl()\n {\n return self::API_URI;\n }",
"private function MakeUrl(){\n if(!empty($this->params) && $this->params){\n foreach($this->params as $k=>$v) $kv[] = \"$k=$v\";\n $url_params = str_replace(\" \",\"+\",implode('&',$kv));\n $this->url = trim($this->url) . '?' . $url_params;\n }\n return $this->url;\n }",
"protected function getApiUrl()\n\t{\n\t\t$repo = $this->getConfig('repo');\n\n\t\t$url = \"/repos/$repo/releases\";\n\t\treturn $url;\n\t}",
"public function get_rest_url();",
"private function build_url() {\n $args = array(\n $this->query_var => $this->options['client_key'],\n );\n\n $url = $this->options['client_remote_url'];\n $url = add_query_arg($args, $url);\n\n return $url;\n }",
"public function build_query()\n {\n $url = \"http://tinysong.com\";\n $url .= '/'.$this->method.'/';\n $url .= $this->query_string.'?';\n\n if ($this->limit) {\n $url .= 'limit='.$this->limit;\n }\n\n $url .= '&key='.$this->api_key;\n $url .= '&format=json';\n\n return $url;\n }",
"public function requestURL()\n\t{\n\t\t// We need this later to work out the URL of the API Call:\n\t\t$called_class \t= get_called_class();\n\n\t\t$query_string \t= $this->buildQueryString();\n\t\t$request_url \t= $called_class::API_URL . $query_string;\n\n\t\t// Add in the JSON format:\n\t\t$request_url .= '/format/json';\n\t\t\n\t\treturn $request_url;\n\t}",
"private function buildAdvertiserUrl()\n {\n return $this->advertiserUrlBase . http_build_query($this->urlFieldArray);\n }",
"public function getApiUrl()\n {\n return 'https://' . $this->hostname . ':' . $this->port . '/api2';\n }",
"function buildRESTAPIUrl($SiteURL, $APILink, $ObjectType, $ObjectIdentifier){\n\t\t//TODO: add ability to remove double slashes\n\t\t$url = $SiteURL . $APILink . $ObjectIdentifier . '/subscriptions?type=' . $ObjectType;\n\t\treturn $url;\n\t}",
"public function constructOpUrl();",
"public function getUrl()\n {\n $format = \"%s/%s/%s/?%s\";\n $host = $this->getHostname();\n $service = $this->getService();\n $appid = $this->getAppId();\n $country = $this->getCountry();\n $params = $this->getParametersAsUrl(); \n return sprintf($format, $host, $service, $appid, $params);\n }",
"private function apiEndpoint()\n {\n $key = $this->apiKey();\n $split = explode('-', $key);\n $dc = $split[1];\n\n return strtr('https://<dc>.api.mailchimp.com/3.0/', ['<dc>' => $dc]);\n }",
"protected function buildUrl() {\n return http_build_query($this->params);\n }",
"public function getApiUrl()\n {\n // this is used to make a call to recognition api\n return 'https://api.luxand.cloud/photo/search';\n }",
"abstract function apiLink();",
"private function getBaseUri(){\n return \"{$this->config['api_url']}/v{$this->config['api_version']}/\";\n }"
] | [
"0.7382424",
"0.6757893",
"0.6616536",
"0.6611317",
"0.65572053",
"0.6545116",
"0.6540228",
"0.64994514",
"0.6483885",
"0.6475928",
"0.6448904",
"0.64452505",
"0.6415865",
"0.6384179",
"0.63461345",
"0.63422453",
"0.6327262",
"0.6317809",
"0.6290935",
"0.6289874",
"0.62778646",
"0.6261293",
"0.6245099",
"0.6238868",
"0.6232459",
"0.6224179",
"0.6198218",
"0.6182666",
"0.6181718",
"0.6165722"
] | 0.7419939 | 0 |
Instantiates a new customTaskExtensionCalloutData and sets the default values. | public function __construct() {
parent::__construct();
$this->setOdataType('#microsoft.graph.identityGovernance.customTaskExtensionCalloutData');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function createFromDiscriminatorValue(ParseNode $parseNode): CustomTaskExtensionCalloutData {\n return new CustomTaskExtensionCalloutData();\n }",
"public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.identityGovernance.customTaskExtension');\n }",
"function assignCustomViewData() {}",
"public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.androidForWorkNineWorkEasConfiguration');\n }",
"protected function __construct(array $data = [], array $customOptions = [], object $globalStorage = null) \n { \t\t\n \t\t$options = self::mergeOptions(self::constructOptions(),$customOptions);\n\t\t\n\t\t// set default values\n\t\tforeach( $options as $property=>$option){\t\n\t\t\tif(empty($data[$property]) && isset($option['default'])){\n\t\t\t\t$data[$property] = $option['default'];\n\t\t\t}\n\t\t}\n\n\t\t// ensure data are sanitized and validated\n\t\t$sanitizedData = array_filter( filter_var_array($data, $options), function ($var){\n\t\t return !is_null($var);\n\t\t});\n\t\t\t\n\t\t// find and register dropped fields\n\t\tforeach($data as $property=>$value){\n\t\t\tif($value && empty($sanitizedData[$property])){\n\t\t\t\t$this->droppedFields[]=$property;\n\t\t\t}\n\t\t}\n\n\n\t\t$this->options = $options;\n\t\t$this->data = $sanitizedData;\n\t\t$this->setIdGenerator(function($data){return uniqid();});\n\t\t$this->globalStorage = $globalStorage;\n }",
"public function __construct(array $customResource = array())\n {\n $this\n ->setCustomResource($customResource);\n }",
"function initCustomConfig() {\n\t}",
"public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.androidForWorkApp');\n }",
"private static function addCustomData( $event, $data ){\n $custom_data = $event->getCustomData();\n\n if (!empty($data['currency'])) {\n $custom_data->setCurrency($data['currency']);\n }\n\n if (!empty($data['value'])) {\n $custom_data->setValue($data['value']);\n }\n\n if (!empty($data['content_ids'])) {\n $custom_data->setContentIds($data['content_ids']);\n }\n\n if (!empty($data['content_type'])) {\n $custom_data->setContentType($data['content_type']);\n }\n\n if (!empty($data['content_name'])) {\n $custom_data->setContentName($data['content_name']);\n }\n\n if (!empty($data['content_category'])) {\n $custom_data->setContentCategory($data['content_category']);\n }\n\n if (!empty($data['search_string'])) {\n $custom_data->setSearchString($data['search_string']);\n }\n\n if (!empty($data['num_items'])) {\n $custom_data->setNumItems($data['num_items']);\n }\n\n if (!empty($data['contents'])) {\n $contents = array();\n foreach($data['contents'] as $content) {\n $contents[] = new Content($content);\n }\n $custom_data->setContents($contents);\n }\n\n if( !empty($data['order_id']) ){\n $custom_data->setOrderId($data['order_id']);\n }\n\n return $event;\n }",
"public function customData(array $customData)\n {\n $this->customData = $customData;\n\n return $this;\n }",
"public function __construct($data=null)\n {\n $this->mergeWith($data);\n }",
"public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.androidForWorkPkcsCertificateProfile');\n }",
"public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.windowsUpdates.contentApproval');\n }",
"public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.easEmailProfileConfigurationBase');\n }",
"public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.microsoftManagedTrainingSetting');\n }",
"protected function __construct() {\r\n\t\t$this->extend = array();\r\n\t}",
"function __construct($data = null) {\n $this->data = $data;\n }",
"function initData() {\n\t\tif (isset($this->submission)) {\n\t\t\tparent::initData(array(\n\t\t\t\t'seriesId' => $this->submission->getSeriesId(),\n\t\t\t\t'seriesPosition' => $this->submission->getSeriesPosition(),\n\t\t\t\t'workType' => $this->submission->getWorkType(),\n\t\t\t));\n\t\t} else {\n\t\t\tparent::initData();\n\t\t}\n\t}",
"function __construct() {\n parent::__construct();\n $this->data = $this->get_data();\n\n\t}",
"public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow');\n }",
"function __construct(){\n\t\t\t$this->initPropertiesFromArray(array());\n\t\t}",
"function __construct($data = array())\n\t\t\t{\n\t\t\t\tparent::__construct($data);\n\t\t\t}",
"public function __construct()\n {\n $this->getConfigData();\n }",
"function __construct($data = null)\n {\n $this->data = $data;\n }",
"function __construct()\r\n {\r\n $this->property_info_data = new property_info_data;\r\n parent::__construct();\r\n }",
"public function __construct() {\n parent::__construct(\n array(\n 'onBeforeFill' => FALSE,\n 'onAfterFill' => NULL,\n 'onCreateItem' => NULL\n )\n );\n }",
"private function initViewData()\n {\n $this->dataForViews = [\n \"language_id\" => 0,\n \"language_name\" => \"en\",\n \"site_id\" => 1,\n \"site\" => [],\n \"current_content_id\" => 0,\n \"translations\" => [],\n \"currentPage\" => []\n ];\n\n return $this;\n }",
"public function __construct()\n {\n $this->loadPatchConfig();\n }",
"public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }",
"public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }"
] | [
"0.69167924",
"0.68265116",
"0.5517267",
"0.550695",
"0.5371265",
"0.5253279",
"0.5239917",
"0.5230517",
"0.51677465",
"0.51617354",
"0.51591134",
"0.51534885",
"0.5152524",
"0.5113814",
"0.5095539",
"0.5094954",
"0.5058309",
"0.5058305",
"0.5028586",
"0.4976165",
"0.49670884",
"0.49663717",
"0.4948364",
"0.49440622",
"0.493787",
"0.49072656",
"0.48991224",
"0.48957583",
"0.48916596",
"0.48916596"
] | 0.778866 | 0 |
Sets the task property value. The task property | public function setTask(?Task $value): void {
$this->getBackingStore()->set('task', $value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setTask( $task ){\n\t\t\n\t\t$this->task = $task;\n\t}",
"public function setTask($val)\n {\n $this->_propDict[\"task\"] = $val;\n return $this;\n }",
"public function set_task($task)\n {\n $task = asciiwords($task);\n\n if ($this->user && $this->user->ID)\n $task = !$task || $task == 'login' ? 'mail' : $task;\n else\n $task = 'login';\n\n $this->task = $task;\n $this->comm_path = $this->url(array('task' => $this->task));\n \n if ($this->output)\n $this->output->set_env('task', $this->task);\n }",
"public function setTask($value = \"\") {\r\n\r\n if (!ctype_alnum($value))\r\n throw new Exception('A task should contain either alphabits or numbers');\r\n if (strlen($value) > 64)\r\n throw new Exception('A task name should be max 64 characters');\r\n $this->task= $value;\r\n return $this;\r\n }",
"public function setTasks($value) {\n if (is_bool($value)) { $this->Tasks = $value; }\n }",
"public function setTaskName($taskName){ }",
"function assignTask()\n {\n $taskBean = new TaskBean($this->id, $this->_smarty, NULL, NULL);\n $taskBean->assignSingle();\n }",
"function pass_task( $this_task )\n\t{\n\t\t$this->task = $this_task;\n\t}",
"function pass_task( $this_task )\n\t{\n\t\t$this->task = $this_task;\n\t}",
"public function set_task_name($value)\n {\n $this->task_name = $value;\n return $this;\n }",
"public function __construct($task)\n {\n //\n $this->task =$task;\n }",
"public function testToPropertySetter()\n {\n $toProperty = 'myConfig';\n\n $this->assertSame($this->task, $this->task->setToProperty($toProperty));\n $this->assertAttributeSame($toProperty, 'toProperty', $this->task);\n }",
"public function update( Task $task)\n {\n $project=$task->project;\n $project->touch();\n $task->toggle();\n }",
"public function __construct(Task $task)\n {\n $this->task = $task;\n }",
"public function __construct(Task $task)\n {\n $this->task = $task;\n }",
"public function __construct(Task $task)\n {\n $this->task = $task;\n }",
"public function update(Task $task)\n {\n }",
"public function set_service_task($request_method, $task)\n {\n $service = $this->get_service($request_method);\n $service->service_task = $task;\n }",
"public function setTaskDefinition($val)\n {\n $this->_propDict[\"taskDefinition\"] = $val;\n return $this;\n }",
"public function setMembersTasks($value) {\n if (is_bool($value)) { $this->Members_Tasks = $value; }\n }",
"public function setTaskName($task_name){\n if($task_name && strlen($task_name)){\n $this->setParameter('task_name', $task_name);\n }\n return $this;\n }",
"public function setTaskAsDefault(Task $task, User $user)\n {\n $this->em->beginTransaction();\n\n $defaultTask = $this->taskRepository->findUserDefaultTask($user->getId());\n $defaultTask->setDefault(false);\n $task->setDefault(true);\n $this->taskRepository->update($task);\n\n $this->em->flush();\n $this->em->commit();\n }",
"public function waitPropertySetter()\n {\n $wait = 5;\n\n $this->assertSame($this->task, $this->task->setWait($wait));\n $this->assertAttributeSame($wait, 'wait', $this->task);\n }",
"public function setSyncTasks(?bool $value): void {\n $this->getBackingStore()->set('syncTasks', $value);\n }",
"public function updated(Task $task)\n {\n //\n }",
"public function setDefaultTask($taskName){ }",
"public function setDefaultTask($taskName){ }",
"public function setTask_id($task_id) {\n $this->_task_id = (int)$task_id;\n $this->_params['task_id'] = (int)$task_id;\n return $this;\n }",
"public function store(Task $task)\n {\n }",
"function addTask( $task ){\n $this->tasks[] = $task; \n }"
] | [
"0.80928177",
"0.7760211",
"0.69847244",
"0.69203657",
"0.6707974",
"0.6547613",
"0.6541764",
"0.64546275",
"0.64546275",
"0.6234207",
"0.61688876",
"0.61178935",
"0.61099565",
"0.6109161",
"0.6109161",
"0.6109161",
"0.60860336",
"0.60745937",
"0.6031426",
"0.60298043",
"0.6013876",
"0.5952639",
"0.5833936",
"0.5829415",
"0.5803408",
"0.57227314",
"0.57227314",
"0.5667106",
"0.56592107",
"0.5656287"
] | 0.7886362 | 1 |
Sets the taskProcessingresult property value. The taskProcessingresult property | public function setTaskProcessingresult(?TaskProcessingResult $value): void {
$this->getBackingStore()->set('taskProcessingresult', $value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setTaskProcessingResults($val)\n {\n $this->_propDict[\"taskProcessingResults\"] = $val;\n return $this;\n }",
"public function setTaskProcessingResults($val)\n {\n $this->_propDict[\"taskProcessingResults\"] = $val;\n return $this;\n }",
"public function getTaskProcessingResults()\n {\n if (array_key_exists(\"taskProcessingResults\", $this->_propDict)) {\n return $this->_propDict[\"taskProcessingResults\"];\n } else {\n return null;\n }\n }",
"public function getTaskProcessingResults()\n {\n if (array_key_exists(\"taskProcessingResults\", $this->_propDict)) {\n return $this->_propDict[\"taskProcessingResults\"];\n } else {\n return null;\n }\n }",
"public function setResult( $value ) {\r\n\t\t$this->result = $value;\r\n\t}",
"public function setResult(IterationResult $result)\n {\n $this->result = $result;\n }",
"public function getTaskProcessingresult(): ?TaskProcessingResult {\n $val = $this->getBackingStore()->get('taskProcessingresult');\n if (is_null($val) || $val instanceof TaskProcessingResult) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'taskProcessingresult'\");\n }",
"public function postProcess($result)\n {\n return;\n }",
"public function setResult($result)\n\t{\n\t\t// Allow only a set of results\n\t\tif ( !in_array($result, array(1, 0, -1)))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$this->result = $result;\n\t}",
"public function setProcessedTasks($value) {\n if (is_bool($value)) { $this->Processed_Tasks = $value; }\n }",
"public function setResult(Result $result);",
"protected function initializeResult()\n {\n /** @var ProcessorResult $result */\n $this->result = app(ProcessorResult::class);\n\n $this->result->setSuccess(false);\n $this->result->setErrors( app(MessageBag::class) );\n $this->result->setWarnings( app(MessageBag::class) );\n }",
"protected function setResultTo ( $result ) {\n\n $old = $this->result;\n $this->result = $result;\n\n return $old;\n }",
"public function setResultId($result_id) {\n $this->result_id = $result_id;\n }",
"public function type($value) {\n\t\t\t$this->resultProcessing=$value;\n\n\t\t\treturn $this;\n\t\t}",
"public function setOperationResult($operationResult) {\n $this->operationResult = $operationResult;\n return $this;\n }",
"public function setOperationResult($operationResult) {\n $this->operationResult = $operationResult;\n return $this;\n }",
"public function setResult($result)\n {\n $this->result = $result;\n return $this;\n }",
"public function setResult($result)\n {\n $this->result = $result;\n return $this;\n }",
"public function setResult($result = null)\n {\n $this->result = $result;\n\n return $this;\n }",
"public function setResult(?string $result): FileImportFilterEvent\n {\n $this->result = $result;\n \n return $this;\n }",
"public function setResult(Result $result)\n {\n $this->result = $result;\n return $this;\n }",
"protected function setBatchResult($result){\n $result_ary = preg_split('/\\s+/', $result[\"response\"]);\n // exit(var_dump($result));\n // exit(var_dump($result_ary));\n\n // $result_ary = $result_status[\"value\"];\n\n if (isset($result_ary[5]) && ($result_ary[5]==\"0\" || $result_ary[5]==\"100\")) {\n\n $status_code = $result_ary[5];\n $this->result(Agent::INFO, ([\n 'Status_Code' => $status_code,\n 'Status_Message' => (array_key_exists($status_code,$this->resultArr))?($this->resultArr[$status_code]):\"UNKONW\"\n ]));\n $this->result(Agent::SUCCESS, isset($result_ary[1]));\n $this->result(Agent::STATUS, \"Send\");\n } else {\n \n $this->result(Agent::INFO, ([\n 'Status' => \"Query Error\",\n 'Status_Message' => 'request failed',\n 'log' => $result_ary\n ]));\n $this->result(Agent::STATUS, \"UNKONW\");\n }\n }",
"public function setResult($value)\n {\n return $this->set(self::result, $value);\n }",
"public static function setResultFolderPath($resultFolderPath)\n {\n self::$resultFolderPath = $resultFolderPath;\n }",
"protected function preProcessResult($result)\n {\n // Do nothing\n return $result;\n }",
"public function setResult($value)\r\n {\r\n return $this->set(self::_RESULT, $value);\r\n }",
"public function setResult($value)\r\n {\r\n return $this->set(self::_RESULT, $value);\r\n }",
"public function setResult($value)\r\n {\r\n return $this->set(self::_RESULT, $value);\r\n }",
"public function setResult($value)\r\n {\r\n return $this->set(self::_RESULT, $value);\r\n }"
] | [
"0.77313954",
"0.77313954",
"0.6389152",
"0.6389152",
"0.61097586",
"0.60787797",
"0.5810012",
"0.56897163",
"0.56784165",
"0.56501627",
"0.55005914",
"0.54961175",
"0.54444075",
"0.5368114",
"0.5364918",
"0.5363379",
"0.5363379",
"0.5357525",
"0.5357525",
"0.5187397",
"0.5145534",
"0.5134497",
"0.5115819",
"0.5113101",
"0.51129735",
"0.51089156",
"0.510532",
"0.510532",
"0.510532",
"0.510532"
] | 0.8294916 | 0 |
Sets the workflow property value. The workflow property | public function setWorkflow(?Workflow $value): void {
$this->getBackingStore()->set('workflow', $value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setWorkflowVersion($val)\n {\n $this->_propDict[\"workflowVersion\"] = intval($val);\n return $this;\n }",
"public function setWorkflowState($workflowState)\n {\n $this->workflowState = isset($workflowState) ? $workflowState : '';\n }",
"public function setLogicAppWorkflowName(?string $value): void {\n $this->getBackingStore()->set('logicAppWorkflowName', $value);\n }",
"public function setWorkflowState($workflowState)\n {\n if ($this->workflowState !== $workflowState) {\n $this->workflowState = isset($workflowState) ? $workflowState : '';\n }\n }",
"public function setWorkflowTicket($workflowTicket)\n {\n $this->setValue('workflowTicket', $workflowTicket);\n }",
"public function setWorkflowId($var)\n {\n GPBUtil::checkString($var, True);\n $this->workflow_id = $var;\n\n return $this;\n }",
"function workflow_update($workflow) {\n $workflow = (object) $workflow;\n $workflow->tab_roles = is_array($workflow->tab_roles) ? implode(',', $workflow->tab_roles) : $workflow->tab_roles;\n $workflow = drupal_write_record('workflows', $workflow, 'wid');\n\n // Workflow name change affects tabs (local tasks), so force menu rebuild.\n menu_rebuild();\n workflow_invalidate_cache();\n\n return $workflow;\n}",
"public function set__WORKFLOW__($__WORKFLOW__ = [])\n {\n $this->__WORKFLOW__ = $__WORKFLOW__;\n }",
"public function addWorkflow(Workflow $workflow): self;",
"public function setWorkflowExecutionType($val)\n {\n $this->_propDict[\"workflowExecutionType\"] = $val;\n return $this;\n }",
"public function setWorkflowState(State $state = null)\n {\n $this->_workflow_state = $state;\n\n return $this;\n }",
"public function save($workflow);",
"public function setIsWorkflowInEffect()\n {\n // if there is a workflow applied, we can't set the publishing date directly, only the 'desired' publishing date\n $effective = $this->getWorkflowService()->getDefinitionFor($this->owner);\n $this->isWorkflowInEffect = $effective ? true : false;\n }",
"public function setWorkflowFileName($var)\n {\n GPBUtil::checkString($var, True);\n $this->workflow_file_name = $var;\n\n return $this;\n }",
"protected function _initWorkflow()\n {\n if (is_null($this->_workflow)) {\n\n $this->_workflow = array(\n 'unknown' => array('pending', 'active', 'suspended', 'canceled'),\n 'pending' => array('active', 'canceled'),\n 'active' => array('suspended', 'canceled', 'finished'),\n 'suspended' => array('active', 'canceled'),\n 'canceled' => array(),\n 'expired' => array(),\n 'finished' => array()\n );\n }\n }",
"public function resetWorkflow()\n {\n $this->setWorkflowState('initial');\n \n $serviceManager = ServiceUtil::getManager();\n $workflowHelper = $serviceManager->get('rk_team_module.workflow_helper');\n \n $schemaName = $workflowHelper->getWorkflowName($this['_objectType']);\n $this['__WORKFLOW__'] = [\n 'module' => 'RKTeamModule',\n 'state' => $this['workflowState'],\n 'obj_table' => $this['_objectType'],\n 'obj_idcolumn' => 'id',\n 'obj_id' => 0,\n 'schemaname' => $schemaName\n ];\n }",
"protected static function getFacadeAccessor() { return 'workflow'; }",
"public function getWorkflowId()\n {\n return $this->workflow_id;\n }",
"public function getWorkflowActivity()\n\t{\n\t\tif (!$this->workflowActivity)\n\t\t\t$this->workflowActivity = new FlowActivity();\n\n\t\tforeach ($this->getValues() as $key => $value) {\n\t\t\t$this->workflowActivity->$key = $value;\n\t\t}\n\n\t\t$this->workflowActivity->setOnEvent($this->compiledEvents['onEvent']);\n\t\t$this->workflowActivity->setOnStart($this->compiledEvents['onStart']);\n\n\t\treturn $this->workflowActivity;\n\t}",
"public function setDefaultValues(WorkflowActivity $workflowActivity)\n\t{\n\t\tif ($workflowActivity instanceof FlowActivity) {\n\t\t\tFormHelper::setDefaultValues($this, $workflowActivity);\n\t\t}\n\t}",
"public function setWorkflowService(WorkflowService $workflowService)\n {\n $this->workflowService = $workflowService;\n return $this;\n }",
"public function setRequired(?bool $value): void {\n $this->getBackingStore()->set('required', $value);\n }",
"public function setTeamwork(?UserTeamwork $value): void {\n $this->getBackingStore()->set('teamwork', $value);\n }",
"public function setTask(?Task $value): void {\n $this->getBackingStore()->set('task', $value);\n }",
"protected function setPipesOfWorkflow($workflow)\n\t{\n\t\t$pipes = $this->pipelines->getPipesByPipeline($workflow);\n\n\t\t$this->pipes = array_map(function($pipe)\n\t\t{\n\t\t\t$chunks = explode('\\\\', $pipe);\n\n\t\t\treturn end($chunks);\n\n\t\t}, $pipes);\n\n\t\t$this->geometry->setPipes($this->pipes);\n\t}",
"public function setIsSystemRule(?bool $value): void {\n $this->getBackingStore()->set('isSystemRule', $value);\n }",
"public function getWorkflow(): ?Workflow {\n $val = $this->getBackingStore()->get('workflow');\n if (is_null($val) || $val instanceof Workflow) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'workflow'\");\n }",
"public function getWorkflowVersion()\n {\n if (array_key_exists(\"workflowVersion\", $this->_propDict)) {\n return $this->_propDict[\"workflowVersion\"];\n } else {\n return null;\n }\n }",
"public function setProcess($process) {\r\n\t\t$this->process = $process;\r\n\t}",
"function setValue($value)\n {\n $this->_value = $value;\n }"
] | [
"0.62939",
"0.61946046",
"0.61730754",
"0.61083007",
"0.5960284",
"0.5775872",
"0.5747477",
"0.5738089",
"0.57244223",
"0.5666885",
"0.56632984",
"0.5629405",
"0.5596841",
"0.5571651",
"0.550277",
"0.53794956",
"0.53069335",
"0.5287405",
"0.5262259",
"0.520032",
"0.518106",
"0.51744187",
"0.5152001",
"0.5069804",
"0.50169325",
"0.5006967",
"0.4997847",
"0.49862653",
"0.49640322",
"0.49325064"
] | 0.77435255 | 0 |
fetches the name of the root node of the tree and fills $this>oRootNode with the CMSTreeNode object. | protected function GetRootNodeName($nodeID)
{
$oCMSTreeNode = TdbCmsTree::GetNewInstance(); /** @var $oCMSTreeNode TCMSTreeNode */
/** @var BackendSessionInterface $backendSession */
$backendSession = ServiceLocator::get('chameleon_system_cms_backend.backend_session');
$oCMSTreeNode->SetLanguage($backendSession->getCurrentEditLanguageId());
$oCMSTreeNode->Load($nodeID);
$this->oRootNode = $oCMSTreeNode;
$this->data['rootNodeName'] = $oCMSTreeNode->sqlData['name'];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRootNode() {\n\t\treturn $this->rootNode;\n\t}",
"function get_root_name(){ return $this->_tree[0][\"element\"];\t\t}",
"protected function getRootNodeName() {\n\t\treturn self::NODE_NAME_ROOT_NODE;\n\t}",
"protected function getRootNodeName()\n {\n return static::ROOT_NODE;\n }",
"public function getRootNode()\n {\n if (!$this->isMultiDomainHost()) {\n return parent::getRootNode();\n }\n\n if (is_null($this->rootNode)) {\n $host = $this->getHost();\n $internalName = $this->hosts[$host]['root'];\n $em = $this->container->get('doctrine.orm.entity_manager');\n $nodeRepo = $em->getRepository('KunstmaanNodeBundle:Node');\n $this->rootNode = $nodeRepo->getNodeByInternalName($internalName);\n }\n\n return $this->rootNode;\n }",
"public function getRoot() {\n\t\t\treturn $this->node;\n\t\t}",
"function GetRoot() {\r\n\t return $this->root;\r\n\t}",
"function getRoot(){\n\t\t return $this->root; \n\t\t}",
"public function getRootNode()\n {\n $root = $this->getRoot();\n if ($root && in_array($root->getId(), $this->getCategoryIds())) {\n $root->setChecked(true);\n }\n return $root;\n }",
"function GetRoot() \n\t{\n\t\treturn $this->root; \n\t}",
"private function getRootNode(TreeBuilder $treeBuilder, $name)\n {\n if (!method_exists($treeBuilder, 'getRootNode')) {\n return $treeBuilder->root($name);\n }\n\n return $treeBuilder->getRootNode();\n }",
"private function getRootNode(TreeBuilder $treeBuilder, $name)\n {\n if (!method_exists($treeBuilder, 'getRootNode')) {\n return $treeBuilder->root($name);\n }\n\n return $treeBuilder->getRootNode();\n }",
"private function getRootNode(TreeBuilder $treeBuilder, $name)\n {\n if (!\\method_exists($treeBuilder, 'getRootNode')) {\n return $treeBuilder->root($name);\n }\n\n return $treeBuilder->getRootNode();\n }",
"function addRoot($name, $content = '', $attributes = array(), $lineno = null)\n {\n $this->root = new XML_Tree_Node($name, $content, $attributes, $lineno);\n return $this->root;\n }",
"public function getRootNode(): RootNodeInterface;",
"public function __construct()\n {\n $this->root = new RootNode();\n }",
"public function getRootName() {\n\t\treturn $this->rootName;\n\t}",
"public function loadRoot() {\n $this->loadFromId(1);\n }",
"function getRoot()\n\t{\n\t \treturn $this->root;\n\t}",
"public function root()\n {\n $this->depth = 0;\n }",
"public function getTree()\n {\n return $this->_root;\n }",
"public function GetDivisionNode()\n {\n $oNode = new TCMSTreeNode();\n $oNode->Load($this->sqlData['cms_tree_id_tree']);\n\n return $oNode;\n }",
"public function getRoot()\r\n\t{\r\n\t\treturn reset($this->nodes);\r\n\t}",
"public function getRoot();",
"public function getRoot();",
"public static function rootNode()\n {\n if (self::$instance !== null) {\n return self::$instance;\n }\n $backend = function_exists('apc_fetch') ? 'apc' : 'file';\n self::$instance = new self('', $backend);\n if ($backend === 'file') {\n if (rand(1, 50) === 1) { // Run gc only once in every X requests.\n self::fileCleanup();\n }\n }\n\n return self::$instance;\n }",
"public function getRootObject()\n {\n return isset($this->_root) ? $this->_root : $this;\n }",
"public function root( $root ) {\n\t\t$this->root = $root;\n\t\treturn $this;\n\t}",
"public function getRootName(){\n\t\t\n\t\treturn $this->root_folder_name;\n\t}",
"function CTree($rootName=\"xms\", $type=\"\", $liType=0, $identSpace = 16)\n { \n $this->type = $type;\n $this->liType = $liType;\n $this->identSpace = $identSpace;\t\t\t\n \n\t\t$this->showRoot = 0;\t\t\t\t\t\t\t \n\t\t$this->selectedID = -1;\t\t\t\t\t\t\t\t\n\t\t$this->iconFolder = \"/sys/res/icon/\";\n $this->js_parent = \"\";\n $this->js_node = \"\";\n\t\t\n if ($this->liType == 1)\n { \t\t \n $this->iconExpand = $this->iconFolder.\"treeexpand.png\";\n\t $this->iconHide = $this->iconFolder.\"treehide.png\";\n\t $this->iconNull = $this->iconFolder.\"ctree_null_toc.gif\"; \n $this->imgStyle = \"cursor:pointer; margin: 3px 0px 0px 0px;\";\n \n $this->initSpace = 10;\n $this->wrap = \"\"; \n $this->valign = \"valign='top'\";\n $this->identSpace = 20;\n \n \t}\n \telse\n \t{\n\t $this->iconExpand = $this->iconFolder.\"ctree_expand.gif\";\n\t $this->iconHide = $this->iconFolder.\"ctree_hide.gif\";\n\t $this->iconNull = $this->iconFolder.\"ctree_null.gif\"; \n $this->imgStyle = \"cursor:pointer\";\n \n $this->initSpace = 13;\n $this->wrap = \"noWrap\"; \n $this->valign = \"\"; \n $this->identSpace = $identSpace; \n\t } \n\n\t\t$this->addNode(0, $rootName, -1, 0); \t\n }"
] | [
"0.6305893",
"0.61959034",
"0.61105573",
"0.6059018",
"0.6043158",
"0.58974105",
"0.57169557",
"0.566955",
"0.56324977",
"0.56219256",
"0.5621217",
"0.5621217",
"0.5603568",
"0.558615",
"0.5525667",
"0.5525299",
"0.5455574",
"0.54350215",
"0.54343426",
"0.54038286",
"0.54034007",
"0.5399079",
"0.53170484",
"0.5308911",
"0.5308911",
"0.53087145",
"0.52874917",
"0.5285107",
"0.5263351",
"0.52245045"
] | 0.66290575 | 0 |
loads the open tree nodes from cookie. | protected function LoadTreeState()
{
if (array_key_exists('chameleonTreeState', $_COOKIE) && !empty($_COOKIE['chameleonTreeState'])) {
$this->aOpenTreeNodes = explode(',', $_COOKIE['chameleonTreeState']);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function LoadODOMenus() {\n\t\t\n\t\t//menu MENU Selection\n\t\t//->List Menus\n\t\t//->New Head\n\t\t//->Edit Tree\n\t\t//->Clone Tree\n\t\t\n\t\t\n\t\t//menu Permissions\n\t\t//->Build Group Menus\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t}",
"private function loadAllNodes(){\n if($this->nodes == null){\n if($id = $this->get_adaquizid()){\n $this->nodes = Node::getAllNodes($id);\n }else{\n $this->nodes = array();\n }\n }\n }",
"protected function load()\n {\n $this->setObject(node_load($this->object->nid));\n }",
"protected function loadChildren() {\n }",
"public function loadTree()\n {\n if (!isset($this->treeCache)) {\n $treeEntity = $this->treeRepository->findOneBy(array(), array('created' => 'DESC'));\n\n if ($treeEntity) {\n $this->treeCache = unserialize($treeEntity->getContent());\n } else {\n $this->treeCache = Tree::createEmpty();\n }\n }\n\n return $this->treeCache;\n }",
"protected function loadAllnodes()\n {\n $this->set(\n 'allnodes',\n self::getSubObjectIDs(\n 'StorageNode',\n array(\n 'storagegroupID' => $this->get('id'),\n ),\n 'id'\n )\n );\n }",
"public function load()\n\t{\n\t\t$cache = KFactory::tmp('lib.joomla.cache', array('sys_menu', 'output'));\n\t\tif (!$data = $cache->get('items')) \n\t\t{\n\t\t\t$db = KFactory::get('lib.joomla.database');\n\t\t\t$nooku = KFactory::get('admin::com.nooku.model.nooku');\n\t\t\t$primary = $nooku->getPrimaryLanguage();\n\t\t\t\n\t\t\t$lang = KInput::get('lang', array('post', 'get'), 'lang', null, $primary->iso_code);\n\t\t\n\t\t\t$sql\t= 'SELECT m.*, c.`option` as component' .\n\t\t\t\t' FROM #__menu AS m' .\n\t\t\t\t' LEFT JOIN #__components AS c ON m.componentid = c.id'.\n\t\t\t\t' WHERE m.published = 1'.\n\t\t\t\t' ORDER BY m.sublevel, m.parent, m.ordering';\n\t\t\t$db->select($sql);\n\t\t\t$items = $db->loadObjectList('id');\n\t\t\t\n\t\t\t$query = $db->getQuery()\n\t\t\t\t->select(array('row_id', 'status'))\n\t\t\t\t->from('nooku_nodes')\n\t\t\t\t->where('table_name', '=', 'menu')\n\t\t\t\t->where('iso_code', '=', $lang);\n \n\t\t\t$db->select($query);\n\t\t\t$nodes = $db->loadObjectList('row_id');\n\n\t\t\tforeach($items as $item)\n\t\t\t{\n\t\t\t\t//Get parent information\n\t\t\t\t$parent_route = '';\n\t\t\t\t$parent_tree = array();\n\t\t\t\tif(($parent = $item->parent) && (isset($items[$parent])) &&\n\t\t\t\t\t(is_object($items[$parent])) && (isset($items[$parent]->route)) && isset($items[$parent]->tree)) {\n\t\t\t\t\t$parent_route = $items[$parent]->route.'/';\n\t\t\t\t\t$parent_tree = $items[$parent]->tree;\n\t\t\t\t}\n\n\t\t\t\t//Create tree\n\t\t\t\tarray_push($parent_tree, $item->id);\n\t\t\t\t$item->tree = $parent_tree;\n\n\t\t\t\t//Create route\n\t\t\t\t$route = $parent_route.$item->alias;\n\t\t\t\t$item->route = $route;\n\n\t\t\t\t//Create the query array\n\t\t\t\t$url = str_replace('index.php?', '', $item->link);\n\t\t\t\tif(strpos($url, '&') !== false){\n\t\t\t \t\t$url = str_replace('&','&',$url);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Set the item status\n\t\t\t\t$item->status = isset($nodes[$item->id]) ? $nodes[$item->id]->status : Nooku::STATUS_UNKNOWN;\n\n\t\t\t\tparse_str($url, $item->query);\n\t\t\t}\n\t\t\t\t\n \t$cache->store(serialize($items), 'items');\n \t$this->_items = $items;\n } \n else $this->_items = unserialize($data);\n\t}",
"public function loadRoot() {\n $this->loadFromId(1);\n }",
"public function getTree() {\n /**\n * A pid is passed in via the drupal menu that represents the page your on. A second pid is\n * passed by the tree when the nod is expanded. This requested_pid is the pid passed by the tree.\n * If it is not set or if it is root, then we want to build the tree based on the root node,\n * otherwise build the tree for the passed node.\n */\n if (module_exists('sidora_performance_monitor')) sidora_performance_monitor_start(\"f:getTree\");\n $requested_pid = (!isset($this->node) || $this->node == 'root') ? $this->root : $this->node;\n $this->getParents($this->pid); // Sets an instance variable used in other functions thoughout this function.\n if (module_exists('sidora_performance_monitor')) sidora_performance_monitor_start(\"c:buildTree\");\n $tree = $this->buildTree($requested_pid);\n if (module_exists('sidora_performance_monitor')) sidora_performance_monitor_write_out(\"c:buildTree\",\"tree builder\");\n if (module_exists('sidora_performance_monitor')) sidora_performance_monitor_write_out(\"f:getTree\",\"tree creator\");\n return json_encode(array('success' => TRUE, 'data' => $tree, 'parents' => $this->parents));\n }",
"function loadTreeList()\n {\n $db = new DB();\n $q = \"SELECT \n `\".TblModCatalog.\"`.id, \n `\".TblModCatalog.\"`.level, \n `\".TblModCatalog.\"`.move, \n `\".TblModCatalogSprName.\"`.name\n FROM \n `\".TblModCatalog.\"`, `\".TblModCatalogSprName.\"` \n WHERE \n `\".TblModCatalog.\"`.id = `\".TblModCatalogSprName.\"`.cod \n AND\n `\".TblModCatalogSprName.\"`.`lang_id`='\".$this->lang_id.\"' \n AND\n `\".TblModCatalog.\"`.visible ='2' \n ORDER BY \n `move` ASC\";\n \n $res = $db->db_Query($q);\n if(!$res OR !$db->result) \n return false;\n //echo '$q ='.$q.' <br/>$res = '.$res; \n $rows = $db->db_GetNUmRows($res); \n if($rows==0) \n return false;\n \n $tree = array();\n\n for($i = 0; $i < $rows; $i++){\n $row = $db->db_FetchAssoc($res);\n\n if(empty($tree[$row['level']])) {\n $tree[$row['level']] = array();\n }\n $tree[$row['level']][] = $row;\n //$this->tmpp_arr[$row['level']][$row['id']]='';\n }\n //print_r($this->tmpp_arr);\n return $this->makeTree($tree);\n }",
"private function fetchViewstate() {\r\n $ch1 = curl_init();\r\n curl_setopt($ch1, CURLOPT_COOKIEJAR, $this->cookie);\r\n //curl_setopt($ch1, CURLOPT_COOKIEFILE, $this->cookie);\r\n curl_setopt($ch1, CURLOPT_URL,$this->host.\"/login.aspx\");\r\n curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch1, CURLOPT_HEADER, true);\r\n curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, false);\r\n $html = curl_exec ($ch1);\r\n curl_close($ch1);\r\n $viewstate = $this->parseViewstate($html);\r\n return $viewstate;\r\n }",
"public function loadFolderData() {\n\t\t$pageDb = getPersistClass('Page');\n\t\tif ('/' == $this->docpath) {\n\t\t\t$tmp = $pageDb->getMainPageIdsForLocale($this->locale_id);\n\t\t\t$this->folderPage=array();\n\t\t\tforeach($tmp as $val) {\n\t\t\t\t$this->folderPage[$val['theme_id']]=$val['page_id'];\n\t\t\t}\n\t\t}\n\t\tif (!$this->docPage) {\n\t\t\t$tmp = $pageDb->getDefaultDocPageIdsForLocale($this->locale_id);\n\t\t\t$this->docPage=array();\n\t\t\tforeach($tmp as $val) {\n\t\t\t\t$this->docPage[$val['theme_id']]=$val['page_id'];\n\t\t\t}\n\t\t}\n\t\tif (is_null($this->subfolders)) {\n\t\t\t$db = getPersistClass('Folder');\n\t\t\tif (is_null($this->id)) {\n\t\t\t\t$folders=$db->getFoldersByLocaleId($this->locale_id);\n\t\t\t} else {\n\t\t\t\t$folders=$db->getFoldersByParentFolderId($this->id);\n\t\t\t}\n\t\t\t$this->subfolders=array();\n\t\t\tforeach($folders as $val) {\n\t\t\t if (is_null($val['locale_id'])) {\n\t\t\t $val['locale_id'] = $this->locale_id;\n\t\t\t }\n\t\t\t\t$tmp=new sys_cache_FolderCacheItem($val);\n\t\t\t\t$tmp->loadFolderData();\n\t\t\t\t$this->subfolders[$tmp->short]=$tmp;\n\t\t\t}\n\t\t}\n\t}",
"private function loadStack()\n\t{\n\t\t$stack = $this->container->platform->getSessionVar('cleantmp_stack', '', 'admintools');\n\n\t\tif (empty($stack))\n\t\t{\n\t\t\t$this->folderStack = array();\n\t\t\t$this->filesStack = array();\n\t\t\t$this->totalFolders = 0;\n\t\t\t$this->doneFolders = 0;\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (function_exists('base64_encode') && function_exists('base64_decode'))\n\t\t{\n\t\t\t$stack = base64_decode($stack);\n\t\t\t\n\t\t\tif (function_exists('gzdeflate') && function_exists('gzinflate'))\n\t\t\t{\n\t\t\t\t$stack = gzinflate($stack);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$stack = json_decode($stack, true);\n\n\t\t$this->folderStack = $stack['folders'];\n\t\t$this->filesStack = $stack['files'];\n\t\t$this->totalFolders = $stack['total'];\n\t\t$this->doneFolders = $stack['done'];\n\t}",
"function load_menu() {\r\n $this->assign(\"menu\", db::get_all(\"SELECT c.content_id, c.title AS name, c.path AS link, IF( ? LIKE CONCAT(c.path,'%') AND ( c.path != '' OR ? = '' ), 1, 0 ) AS selected \r\n FROM \" . DB_PREFIX . \"content c\r\n JOIN \" . DB_PREFIX .\"content_rel r ON c.content_id=r.content_id AND r.rel_type='parent'\r\n WHERE c.menu_id = 2 AND c.published=1\r\n ORDER BY r.position\", \r\n array($this->path, $this->path)\r\n )\r\n );\r\n\r\n $this->assign(\"menu2\", db::get_all(\"SELECT c.content_id, c.title AS name, c.path AS link, IF( ? LIKE CONCAT(c.path,'%') AND ( c.path != '' OR ? = '' ), 1, 0 ) AS selected\r\n FROM \" . DB_PREFIX . \"content c\r\n JOIN \" . DB_PREFIX .\"content_rel r ON c.content_id=r.content_id AND r.rel_type='parent'\r\n WHERE c.menu_id = 3 AND c.published=1\r\n ORDER BY r.position\", \r\n array($this->path, $this->path)\r\n )\r\n );\r\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->registerScriptFile(Yii::app()->baseUrl.'/js/wiki/treeview.js');\n\t\t$options=$this->getClientOptions();\n\t\t$options=$options===array()?'{}' : CJavaScript::encode($options);\n\t\t\n\t\t$bindString = '';\n\t\tif(count($this->binds) > 0) {\n\t\t foreach($this->binds as $event => $function) {\n\t\t $bindString .= '.bind(\"'.$event.'\", '.$function.')';\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\t$cs->registerScript('Yii.CTreeView#'.$id,\"jQuery(\\\"#{$id}\\\")\".$bindString.\".treeview($options);\");\n\t\tif($this->cssFile===null)\n\t\t\t$cs->registerCssFile($cs->getCoreScriptUrl().'/treeview/jquery.treeview.css');\n\t\telse if($this->cssFile!==false)\n\t\t\t$cs->registerCssFile($this->cssFile);\n\n\t\techo CHtml::tag('ul',$this->htmlOptions,false,false).\"\\n\";\n\t\techo self::saveDataAsHtml($this->data);\n\t}",
"function getMenuTree($uid,&$menuItemsArray,$path,$expand=0){\n\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t\t\t\t'tx_categories.*',\n\t\t\t\t\t\t\t\t'tx_categories '.($uid?'INNER':'LEFT').' JOIN tx_categories_mm mm ON tx_categories.uid=mm.uid_local AND mm.localtable=\"tx_categories\" '.($uid? 'AND mm.uid_foreign='.$uid : ''),\n\t\t\t\t\t\t\t\t($uid?'1=1':'mm.uid_foreign IS NULL').$this->enableFields\n\t\t\t\t\t\t\t);\n\t\t\n\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){\n\t\t\t$oldpath = $path;\n\t\t\t$path[] = $row['uid'];\n\t\t\t$this->getElementAndSub($row,$menuItemsArray,$path,$expand);\n\t\t\t$path = $oldpath;\n\t\t}\t\t\n\t}",
"static function load($user_id, $users_tree){\n sess::$sess = user::instanciate($user_id, $users_tree);\n sess::$sess->sql_update(array('user_connect'=>_NOW), \"ks_users_profile\");\n sess::$_storage = array();\n\n self::log(sess::$sess, \"log\");\n\n $_SESSION['client_addr'] = exyks::$REMOTE_ADDR;\n $_SESSION['remote_addr'] = $_SERVER['REMOTE_ADDR'];\n $_SESSION['session_create'] = _NOW;\n self::status_check();\n }",
"protected function load()\n {\n if (!$this->_isLoad) {\n $this->storage = Menu::all();\n $this->_isLoad = true;\n }\n }",
"function tree_fetch(&$ar_data, $s_table = 'nav', $s_where='1', $s_pos='`POS`', $s_fields='', $s_joins='')\n{\n global $db, $langval,\n $ar_ids, $nar_children, $ar_nokids;\n #echo ht(dump($ar_ret));\n if ($ar_ret)\n return;\n // go\n $ar_data = $ar_ids = $nar_children = array ();\n $s_pkey = '`ID_'.strtoupper($s_table). '`';\n if (0!==strpos('`', $s_pos)) \n $s_pos = '`'. $s_pos. '`';\n /*\n $ar_tmp = $db->fetch_table($db->lang_select($s_table). \"\n\twhere \". $s_where. \"\n group by \". $s_pkey. \"\n order by PARENT,\". $s_pos, $s_pkey\n );\n */\n $ar_tmp=array();\n #die($db->lang_select($s_table));\n $res = $db->querynow($query = $db->lang_select($s_table,\"*\".$s_fields).$s_joins.\"\n\twhere \". $s_where. \"\n group by \". $s_pkey. \"\n order by PARENT,\". $s_pos, $s_pkey\n );\n #die($query);\n if(!$res['rsrc'])\n ;//die(ht(dump($res)));\n while($row = mysql_fetch_assoc($res['rsrc']))\n {\n $ar_tmp[$row['ID_COMMENT']] = $row;\n }\n#echo \"query: \".ht(dump($GLOBALS['lastresult'])).\"<hr />\"; \n#echo \"Ergebnis: \".ht(dump($ar_tmp)).\"<hr />\";\n#echo '<h2>', $s_table, '</h2>';\n#echo ht(dump($GLOBALS['lastresult']));\n foreach($ar_tmp as $id=>$row)\n {\n#echo $id.\"<br />\";\n\t$ar_data[$id] = $row;\n $nar_children[$row['PARENT']][] = $id;\n $ar_ids[] = $id;\n }\n $ar_nokids = array_diff($ar_ids, array_keys($nar_children));\n#echo ht(dump($ar_nokids)); \n}",
"protected function readLiveNodes()\n {\n $this->liveNodes = $this->getChildren(self::LIVE_NODES_ZKNODE);\n }",
"public function actionAjaxFillTree()\n {\n if (!Yii::app()->request->isAjaxRequest) {\n exit();\n }\n // parse the user input\n $parentId = \"NULL\";\n if (isset($_GET['root']) && $_GET['root'] !== 'source') {\n $parentId = (int) $_GET['root'];\n }\n // read the data (this could be in a model)\n $children = Yii::app()->db->createCommand(\n \"SELECT m1.id, m1.name AS text, m2.id IS NOT NULL AS hasChildren \"\n . \"FROM category AS m1 LEFT JOIN category AS m2 ON m1.id=m2.parent_id \"\n . \"WHERE m1.parent_id <=> $parentId \"\n . \"GROUP BY m1.id ORDER BY m1.letter_index ASC\"\n )->queryAll();\n\n foreach ($children as $key => $child) {\n $link = CHtml::link($child['text'], array('book/category', 'id'=>$child['id']));\n\n $children[$key]['text'] = $link;\n }\n\n $json = CTreeView::saveDataAsJson($children);\n\n $json = str_replace(\n '\"hasChildren\":\"0\"',\n '\"hasChildren\":false',\n $json \n );\n\n echo $json;\n }",
"public function loadCategories () {\n\t\tif ($xrefs = FilesCategories::where(['file_id' => $this->id])->get()) {\n\t\t\tforeach (array_keys($xrefs) as $category_id) { //loop to use the cache in Category::find\n\t\t\t\tif ($category = Category::find($category_id)) {\n\t\t\t\t\t$this->addCategory($category);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function loadTopicsAction(){\r\n\t\t\r\n\t\t$tree = Array();\r\n \t$user = Zend_Registry::get('user'); \t\r\n \t$expand = false;\r\n \t\r\n \tif( $this->_getParam('node') != \"\" && $this->_getParam('node') != \"root\" ){\r\n \t\t$expand = true;\t\r\n \t\t$topics = Doctrine_Core::getTable('Console_Topic')->getByUserId( $user->getUserId(), $this->_getParam('node') ); \t\t \t\t \t \t\t\r\n \t}else{\r\n \t\t$topics = Doctrine_Core::getTable('Console_Topic')->getByUserId( $user->getUserId() );\r\n \t} \t \t \t \t\r\n \t\r\n \tforeach( $topics as $topic ){ \t\t \t\t\r\n \t\t\r\n \t\t$children = array();\r\n \t\t\r\n \t\tforeach( $topic->Notes as $note ){\r\n\t\t\t\t$children[] = array( \r\n\t\t\t\t\t\"id\" => \"note_\" . $note->ID, \r\n\t\t\t\t\t\"text\" => $note->DESCRIPTION, \r\n\t\t\t\t\t\"leaf\" => true, \r\n\t\t\t\t\t\"href\" => \"javascript:loadNote(\". $note->ID .\")\" \r\n\t\t\t\t); \t\t\t\r\n \t\t}\r\n \t\t\r\n \t\t$tree[] = array( \r\n \t\t\t\"id\" => \"topic_\" . $topic->ID, \r\n \t\t\t\"text\" => $topic->DESCRIPTION, \r\n \t\t\t\"cls\" => \"folder\", \r\n \t\t\t\"expanded\" => $expand, \r\n \t\t\t\"children\" => $children \r\n \t\t); \t \t\t\r\n \t\t\r\n \t} \t\r\n \t \t \r\n \t$this->_helper->json->sendJson( $tree );\r\n\t\t\r\n\t}",
"abstract public function getTree();",
"function loadAllNew() {\n\t\t$loadA = $this->loadAccessCount; $this->loadAccessCount = false;\n\t\tparent::checkConnection();\n\t\t\t\n\t\t$s = \"\n\t\tSELECT \" . DB::TABLE_CATEGORY . \".* , NULL AS \" . DB::SUB_CATEGORY_PARENT . \", \" . DB::CATEGORY_NAME . \" AS \" . DB::SUB_CATEGORY_CATEGORY . \"\n\t\tFROM \" . DB::TABLE_CATEGORY . \"\n\t\tWHERE \" . DB::CATEGORY_NAME . \" NOT IN (\n\t\t\t\tSELECT DISTINCT \" . DB::SUB_CATEGORY_CATEGORY . \"\n\t\t\t\tFROM \" . DB::TABLE_SUB_CATEGORY . \")\n\t\tUNION\n\t\tSELECT * \n\t\tFROM \" . DB::TABLE_CATEGORY . \", \" . DB::TABLE_SUB_CATEGORY . \"\n\t\tWHERE \" . DB::CATEGORY_NAME . \" = \" . DB::SUB_CATEGORY_CATEGORY;\n\t\t \n\t\t$this->db->execute($s);\n\t\t\t\n\t\t$cats = array(); //array di risultato\n\t\t$children = array(); //matrice dei figli\n\t\t$children = array(); //array di tutte le categorie\n\t\t$res = $this->db->fetch_all_results();\n\t\t\n\t\t$loadC = $this->loadChildren; $this->setLoadChildren(false);\n\t\t$loadP = $this->loadParent; $this->setLoadParent(false);\n\t\t$loadA = $this->loadAccessCount; $this->loadAccessCount = false;\n\t\tforeach($res as $row) {\n\t\t\t$cat = $this->createFromDBRow($row); //creo la categoria\n\t\t\tif(!isset($children[$cat->getName()]))\n\t\t\t\t$children[$cat->getName()] = array(); //creo un array per i suoi figli\n\t\t\t$allCats[] = $cat; //la aggiungo alla lista di tutte le categorie\n\t\t\t\t\n\t\t\tif(is_null($row[DB::SUB_CATEGORY_PARENT])) {\n\t\t\t\t$cats[] = $cat; //se non è figlia di nessuno la aggiungo all'array che verrà restituito \n\t\t\t} else {\n\t\t\t\t$cat->setParentName($row[DB::SUB_CATEGORY_PARENT]); //setto il nome del padre\n\t\t\t\tif(!isset($children[$cat->getParentName()]))\n\t\t\t\t\t$children[$cat->getParentName()] = array(); //se non esiste un array dei figli per suo padre lo creo\n\t\t\t\t$children[$cat->getParentName()][] = $cat; //la aggiungo all'array dei figli di suo padre\n\t\t\t}\n\t\t}\n\t\t$this->setLoadChildren($loadC);\n\t\t$this->setLoadParent($loadP);\n\t\t$this->loadAccessCount = $loadA;\n\t\t\n\t\tforeach($allCats as $c)\n\t\t\t$c->setChildren($children[$c->getName()]); //setto i figli\n\t\t\n\t\treturn $cats;\n\t}",
"private function loadCategories()\n {\n //TODO: Adicionar suporte à tradução também às categorias.\n $this->view->categories = Order_Model_ProductCategory::fetchTree();\n }",
"abstract protected function load_root_page();",
"public function getFolderTree()\n {\n return self::_loadFolderTree();\n }",
"function getNavigationJSTree($title='') {\r\n\r\n\t\t\t$nav = ($title) ? '<div class=\"root\">'.$title.'</div>' : '';\r\n\r\n \t for ($h=0;$h<count($this->navigation);$h++) {\r\n \t $entry = $this->navigation[$h];\r\n\t\t\t\tif ( !empty($entry->title) && $this->hasRight($entry->right) ) {\r\n\r\n\t\t\t\t\t// 1st level parent\r\n \t \t\tif ( is_array($entry->page) ) {\r\n\t\t\t\t\t\t$nav.='<div class=\"parent\" id=\"'.$h.'_parent\"><nobr>';\r\n\t\t\t\t\t\t$nav.='<img name=\"imEx\" src=\"images/tree_open.gif\" border=\"0\" class=\"item\" onclick=\"expandIt(\\''.$h.'\\'); return false;\" alt=\"+\" width=\"16\" height=\"16\" id=\"'.$h.'_image\"></img>';\r\n\t\t\t\t\t\t$nav.='<a class=\"item\" title=\"'.$this->htmlPrepare($entry->text).'\" href=\"'.$this->root.$h.(($entry->target) ? '\" target=\"'.$entry->target : '').'\">';\r\n\t\t\t\t\t\tif ($this->am[1]==$h) $nav.= '<span style=\"background:yellow;\">'.$this->htmlPrepare($entry->title).'</span>';\r\n\t\t\t\t\t\telse $nav.= $this->htmlPrepare($entry->title);\r\n\t\t\t\t\t\t$nav.='</a></nobr></div><div class=\"child\" id=\"'.$h.'_children\">';\r\n\r\n \t\t\t\tfor ($i=0;$i<count($this->navigation[$h]->page);$i++) {\r\n \t\t\t\t\t$entry = $this->navigation[$h]->page[$i];\r\n \t\t\t\t\t\tif ( !empty($entry->title) && $this->hasRight($entry->right) ) {\r\n\t\t\t\t\t\t\t\t// 2nd level parent\r\n \t \t\t\t\t\tif ( is_array($entry->page) ) {\r\n\t\t\t\t\t\t\t\t\t$nav.='<div class=\"parent\" id=\"'.$h.'_'.$i.'_parent\"><nobr>';\r\n\t\t\t\t\t\t\t\t\t$nav.='<img src=\"images/tree_blank.gif\" class=\"item\" border=\"0\" width=\"16\" height=\"16\" align=\"left\">';\r\n\t\t\t\t\t\t\t\t\t$nav.='<img name=\"imEx\" src=\"images/tree_open.gif\" border=\"0\" class=\"item\" onclick=\"expandIt(\\''.$h.'_'.$i.'\\'); return false;\" alt=\"+\" width=\"16\" height=\"16\" id=\"'.$h.'_image\"></img>';\r\n\t\t\t\t\t\t\t\t\t$nav.='<a class=\"item\" title=\"'.$this->htmlPrepare($entry->text).'\" href=\"'.$this->root.$h.'/'.$i\r\n\t\t\t\t\t\t\t\t\t\t\t.(($entry->target) ? '\" target=\"'.$entry->target : '').'\">';\r\n\t\t\t\t\t\t\t\t\tif ($this->am[1]==$h && $this->am[2]==$i) $nav.= '<span style=\"background:yellow;\">'.$this->htmlPrepare($entry->title).'</span>';\r\n\t\t\t\t\t\t\t\t\telse $nav.= $this->htmlPrepare($entry->title);\r\n\t\t\t\t\t\t\t\t\t$nav.='</a></nobr></div>';\r\n\t\t\t\t\t\t\t\t\t$nav.='<div class=\"child\" id=\"'.$h.'_'.$i.'_children\">';\r\n\r\n \t\t\t\t\t\t\tfor ($j=0;$j<count($entry->page);$j++) {\r\n \t\t\t\t\t\t\t\t\tif ( !empty($entry->page[$j]->title) && $this->hasRight($entry->page[$j]->right) ) {\r\n\t\t\t\t\t\t\t\t\t\t\t$nav.='<nobr><img src=\"images/tree_blank.gif\" class=\"item\" border=\"0\" width=\"16\" height=\"16\" align=\"left\">';\r\n\t\t\t\t\t\t\t\t\t\t\t$nav.='<img src=\"images/tree_blank.gif\" class=\"item\" border=\"0\" width=\"16\" height=\"16\" align=\"left\">';\r\n\t\t\t\t\t\t\t\t\t\t\t$nav.='<img src=\"images/tree_node.gif\" class=\"item\" border=\"0\" width=\"16\" height=\"16\" align=\"left\">';\r\n\t\t\t\t\t\t\t\t\t\t\t$nav.='<a class=\"item\" title=\"'.$this->htmlPrepare($entry->page[$j]->text).'\" href=\"'.$this->root.$h.'/'.$i.'/'.$j\r\n\t\t\t\t\t\t\t\t\t\t\t.(($entry->page[$j]->target) ? '\" target=\"'.$entry->page[$j]->target : '').'\">';\r\n\t\t\t\t\t\t\t\t\t\t\tif ($this->am[1]==$h && $this->am[2]==$i && $this->am[3]==$j) $nav.= '<span style=\"background:yellow;\">'.$this->htmlPrepare($entry->page[$j]->title).'</span>';\r\n\t\t\t\t\t\t\t\t\t\t\telse $nav.= $this->htmlPrepare($entry->page[$j]->title);\r\n\t\t\t\t\t\t\t\t\t\t\t$nav.='</a></nobr>';\r\n \t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t$nav.='</div>';\r\n\r\n\t\t\t\t\t\t\t\t// 2nd level node\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t$nav.='<nobr><img src=\"images/tree_blank.gif\" class=\"item\" border=\"0\" width=\"16\" height=\"16\" align=\"left\">';\r\n\t\t\t\t\t\t\t\t\t$nav.='<img src=\"images/tree_node.gif\" class=\"item\" border=\"0\" width=\"16\" height=\"16\" align=\"left\">';\r\n\t\t\t\t\t\t\t\t\t$nav.='<a class=\"item\" title=\"'.$this->htmlPrepare($entry->text).'\" href=\"'.$this->root.$h.'/'.$i\r\n\t\t\t\t\t\t\t\t\t.(($entry->target) ? '\" target=\"'.$entry->target : '').'\">';\r\n\t\t\t\t\t\t\t\t\tif ($this->am[1]==$h && $this->am[2]==$i) $nav.= '<span style=\"background:yellow;\">'.$this->htmlPrepare($entry->title).'</span>';\r\n\t\t\t\t\t\t\t\t\telse $nav.= $this->htmlPrepare($entry->title);\r\n\t\t\t\t\t\t\t\t\t$nav.='</a></nobr><br />';\r\n\t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t}\r\n \t\t\t\t}\r\n\r\n\t\t\t\t\t\t$nav.='</div>';\r\n\r\n\t\t\t\t\t// 1st level node\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$nav.='<nobr><a class=\"item\" title=\"'.$this->htmlPrepare($entry->text).'\" href=\"'.$this->root.$h\r\n\t\t\t\t\t\t.(($entry->target) ? '\" target=\"'.$entry->target : '')\r\n\t\t\t\t\t\t.'\">'.$this->htmlPrepare($entry->title).'</a></nobr>';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n \t }\r\n\r\n\t\t\treturn $nav;\r\n\r\n \t}",
"public function getTree()\n\t{\n\t\tif($this->user->hasRight('page_view'))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$this->setResponse(new Record('tree', $this->buildTreeArray()));\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}"
] | [
"0.56361836",
"0.5623395",
"0.53992033",
"0.537076",
"0.52110964",
"0.520241",
"0.516461",
"0.50461483",
"0.49870545",
"0.4958972",
"0.49479154",
"0.49020913",
"0.48845297",
"0.486915",
"0.481431",
"0.48107943",
"0.48034328",
"0.47785708",
"0.47749332",
"0.47523016",
"0.47497672",
"0.47146538",
"0.47026992",
"0.4683464",
"0.46833897",
"0.46808174",
"0.4679168",
"0.46521488",
"0.46505055",
"0.4645407"
] | 0.78149503 | 0 |
Fetches a list of all restricted nodes (of all portals) a restricted node is a startnavigation nodes of a portal. | protected function GetPortalNavigationStartNodes()
{
/** @var BackendSessionInterface $backendSession */
$backendSession = ServiceLocator::get('chameleon_system_cms_backend.backend_session');
$oPortalList = TdbCmsPortalList::GetList(null, $backendSession->getCurrentEditLanguageId());
$aRestrictedNodes = array();
while ($oPortal = $oPortalList->Next()) {
$aRestrictedNodes[] = $oPortal->fieldMainNodeTree;
$oNavigationList = $oPortal->GetFieldPropertyNavigationsList();
while ($oNavigation = $oNavigationList->Next()) {
$aRestrictedNodes[] = $oNavigation->fieldTreeNode;
}
}
return $aRestrictedNodes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNodes();",
"public function getNodes();",
"public function get_nodes_list()\n {\n $script = \"nodes.php\";\n // construct the url and add list=nodes query\n $api_url = $this->construct_url($script);\n\n //get the response\n $response = $this->handle_request($api_url);\n\n //return the response\n return $response;\n }",
"public function getList_nodes(){\n\t\t$result=array();\n\t\t$criteria=new CDbCriteria;\n\t\t$criteria->compare('type', $this->type);\n\t\t$criteria->compare('parent_id', 0);\n\t\t$criteria->order='category';\n\t\t$list_roles=self::model()->findAll($criteria);\t\n\t\tforeach ($list_roles as $role){\n\t\t\t$result += array($role->id => 1);\n\t\t\t$this->tmp_list=array();\n\t\t\t$this->treeTraversal($role->id, 1, $this->max_rank);\n\t\t\t$result += $this->tmp_list;\n\t\t}\n\t\treturn $result;\n\t}",
"public function getNodes() {\n\t\tif (is_null($this->_nodes)) {\n\t\t\t$this->_nodes = array();\n\t\t\t$data = df_mage()->coreHelper()->jsonDecode($this->getPage()->getNodesData());\n\t\t\t$collection = Df_Cms_Model_Hierarchy_Node::c();\n\t\t\t$collection\n\t\t\t\t->joinCmsPage()\n\t\t\t\t->setOrderByLevel()\n\t\t\t\t->joinPageExistsNodeInfo($this->getPage())\n\t\t\t;\n\t\t\tif (is_array($data)) {\n\t\t\t\tforeach ($data as $v) {\n\t\t\t\t\tif (isset($v['page_exists'])) {\n\t\t\t\t\t\t$pageExists = !!$v['page_exists'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$pageExists = false;\n\t\t\t\t\t}\n\t\t\t\t\t$node = array(\n\t\t\t\t\t\t'node_id' => $v['node_id']\n\t\t\t\t\t\t,'parent_node_id' => $v['parent_node_id']\n\t\t\t\t\t\t,'label' => $v['label']\n\t\t\t\t\t\t,'page_exists' => $pageExists\n\t\t\t\t\t\t,'page_id' => $v['page_id']\n\t\t\t\t\t\t,'current_page' => !!$v['current_page']\n\t\t\t\t\t);\n\t\t\t\t\t$item = $collection->getItemById($v['node_id']);\n\t\t\t\t\t$node['assigned_to_stores'] = !$item ? array() : $this->getPageStoreIds($item);\n\t\t\t\t\t$this->_nodes[]= $node;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tforeach ($collection as $item) {\n\t\t\t\t\t$this->_nodes[]=\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'node_id' => $item->getId()\n\t\t\t\t\t\t\t,'parent_node_id' => $item->getParentNodeId()\n\t\t\t\t\t\t\t,'label' => $item->getLabel()\n\t\t\t\t\t\t\t,'page_exists' => !!$item->getPageExists()\n\t\t\t\t\t\t\t,'page_id' => $item->getPageId()\n\t\t\t\t\t\t\t,'current_page' => !!$item->getCurrentPage()\n\t\t\t\t\t\t\t,'assigned_to_stores' => $this->getPageStoreIds($item)\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\treturn $this->_nodes;\n\t}",
"public function getNodes()\n {\n return $this->get('/nodes');\n }",
"public function getNodes()\n {\n return $this->nodesMap;\n }",
"protected function getPublicNodes()\n {\n $comic = $this->getTestHelper()->insertComic(2131);\n return [\"comics/\", \"comics/failed\", \"comics/show/\" . $comic->id];\n\n }",
"public function get_nodes()\n {\n return $this->_nodes;\n }",
"public function getNodes()\n {\n return $this->nodes;\n }",
"public function get_nodes($alt = NULL){\n if($alt){\n return(array(\n 'primary' => $this->primary_nodes,\n 'standby' => $this->standby_nodes,\n 'unused' => $this->unused_nodes\n ));\n }\n\n $primary_nodes = $this->primary_nodes;\n $standby_nodes = $this->standby_nodes;\n $unused_nodes = $this->unused_nodes;\n\n $return_array = array();\n \n foreach($primary_nodes as $node){\n $return_array[$node['host']] = $node;\n }\n \n foreach($standby_nodes as $node){\n if($return_array[$node['host']]){\n $return_array[$node['host']]['type'] = 'both';\n $return_array[$node['host']]['roles'] = $node['roles'];\n }else{\n $return_array[$node['host']] = $node;\n }\n }\n\n foreach($unused_nodes as $node){\n $return_array[$node['host']] = $node;\n }\n\n return($return_array);\n }",
"public function getNodes() {\n return $this->nodes;\n }",
"public function getNodes(){\n\t\t$promoters = $this->input->post('promoters');\n\t\t$tfs = $this->input->post('tfs');\n\t\t$edges = $this->input->post('edges');\n\t\t\n\t\t//////////////////////////////////////////////////////////////////////////\n\t\t// Get metaproject info\t\t\n\t\t$project_info = $this->Data_Model->getMetaProjects($this->input->post('user'), $this->input->post('project'));\n\t\t\n\t\tif($project_info['users'] && $project_info['projects']){\n\t\t\t$users = $project_info['users'];\n\t\t\t$projects = $project_info['projects'];\n\t\t} else {\n\t\t\t$users = array(0 => \"NULL\");\n\t\t\t$projects = array(0 => \"NULL\");\n\t\t}\n\t\t//////////////////////////////////////////////////////////////////////////\n\n\t\t// Grab the list of nodes that I must find\n\t\t$promoterArray = array();\n\t\t$tfArray = array();\n\n\t\tforeach($edges as $edge){\n\t\t\t$promoterArray[] = $edge['source'];\n\t\t\t$tfArray[] = $edge['target'];\n\t\t}\n\t\t\n\t\t// Make sure it is unique.\n\t\t$promoterArrayUniq = array_unique($promoterArray);\n\t\t$tfArrayUniq = array_unique($tfArray);\n\t\t\n\t\t// Create the list strings for use in functions\n\t\t// Query the nodes again to get the list for interactions\n\t\t$promoterString = \"\";\n\t\t$tfString = \"\";\n\t\t\n\t\tforeach($promoterArrayUniq as $value){\n\t\t\t$promoterString .= \"'$value',\";\n\t\t}\n\t\t$promoterString .= \"'catch'\";\n\t\t\n\t\tforeach($tfArrayUniq as $value){\n\t\t\t$tfString .= \"'$value',\";\n\t\t}\n\t\t$tfString .= \"'catch'\";\n\n\t\t// We now have a list of nodes that data is required for.\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t/// Set up the nodes array this will store an id and a name for all of the nodes\n\t\t/// for promoters the id will be the bait_id and for tf it will be the array coord.\n\t\t$nodes = array();\n\t\t\n\t\t/// Query up the promoter nodes\n\t\t$query = $this->Network_Model->queryPromoterNodes($users[0], $projects[0], $promoterString);\n\t\tforeach($query->result() as $value){\n\t\t\tif($value->bait_name != null){ $name = $value->bait_name ; } else { $name = $value->bait_id ;}\n\t\t\t\n\t\t\t$nodes[] = array(\"id\" => $value->bait_id, \"label\" => $name, \"shape\" => \"DIAMOND\", \"color\" => \"ORANGE\");\n\t\t}\n\t\t\n\t\t/// Query up the transcriptor nodes\n\t\t$query = $this->Network_Model->queryTranscriptionNodes($users[0], $projects[0], $tfString);\n\t\tforeach($query->result() as $value){\n\t\t\tif($value->common_name != null){ $name = $value->common_name ; } else { $name = $value->coordinate ;}\n\t\t\t$nodes[] = array(\"id\" => $value->coordinate, \"label\" => $name, \"shape\" => \"ELLIPSE\", \"color\" => \"BLUE\");\n\t\t}\n\t\t\n\t\t// echo it out\n\t\techo json_encode($nodes);$this->load->model('Network_Model');\n\t\t\n\t\t//queryTranscriptionNodes($userName, $projectName)\n\t}",
"public function getNodes(): CypherList\n {\n return $this->nodes;\n }",
"public function getNodes(): array\n {\n return $this->_nodes;\n }",
"protected function get_nodes()\n {\n if (isset($this->m_nodes))\n {\n return $this->m_nodes;\n } //if\n\n // Root node:\n $this->m_nodes = [\n self::C__ROOT => [\n 'title' => _L('LC__MODULE__JDISC'),\n 'nodes' => [\n isys_jdisc_dao::C__CONFIGURATION => [\n 'title' => _L('LC__MODULE__JDISC__CONFIGURATION')\n ],\n isys_jdisc_dao::C__PROFILES => [\n 'title' => _L('LC__MODULE__JDISC__PROFILES')\n ],\n self::C__IMPORT => [\n 'title' => _L('LC__MODULE__JDISC__IMPORT')\n ]\n ]\n ]\n ];\n\n return $this->m_nodes;\n }",
"function getExtractableNodes( $limit = false, $offset = false )\r\n {\r\n $classList = eZContentObjectAkismet::getExtractableClassList();\r\n\r\n include_once( 'kernel/classes/ezcontentobjecttreenode.php' );\r\n $params = array(\r\n 'ClassFilterType' => 'include',\r\n 'ClassFilterArray' => $classList,\r\n 'SortBy' => array( array( 'published', false ) ),\r\n 'Limit' => $limit,\r\n 'Offset' => $offset\r\n );\r\n\r\n $nodes = eZContentObjectTreeNode::subTree( $params, 1 );\r\n return $nodes;\r\n }",
"protected function getProjectionNodes()\n {\n $expandedProjectionNode = $this->getCurrentExpandedProjectionNode();\n if (is_null($expandedProjectionNode)\n || $expandedProjectionNode->canSelectAllProperties()\n ) {\n return null;\n }\n\n return $expandedProjectionNode->getChildNodes();\n }",
"public function getNodes() : array \n {\n return $this->nodes;\n }",
"protected function getNodesByTerm($accession, array $allNodes)\n {\n $term = $this->getTerm($accession);\n return $term->annotatedNodes()\n ->getBaseQuery()\n ->select('nodes.accession')\n ->whereIn('nodes.accession', $allNodes)\n ->pluck('accession');\n }",
"public function getRoomNodesListAction(ParamFetcher $paramFetcher)\n {\n\t$page = $paramFetcher->get('page');\n $count = $paramFetcher->get('count');\n \n $pager = $this->getNodeManager()->getPager($this->filterCriteria($paramFetcher), $page, $count);\n \n return $pager;\n }",
"public function nodes(Request $request)\n {\n $mapHelper = new MapHelper();\n\n if ($request->has('bounds')) {\n $bounds = $request->input('bounds');\n $nodes = $mapHelper->getNodesByBounds($bounds);\n } else {\n $nodes = Node::all();\n }\n\n return response()->json([\n 'nodes' => $nodes,\n ]);\n }",
"protected function GetChildrenPortalCondition()\n {\n static $internalCache = null;\n if (null !== $internalCache) {\n $aPortalExcludeList = $internalCache;\n } else {\n /** @var SecurityHelperAccess $securityHelper */\n $securityHelper = ServiceLocator::get(SecurityHelperAccess::class);\n $portalIds = $securityHelper->getUser()?->getPortals();\n\n $portalIdSql = '';\n if (null !== $portalIds && count($portalIds) > 0) {\n $portalIdSql = implode(', ', array_map(fn(string $portalId) => $this->getDatabaseConnection()->quote($portalId), array_keys($portalIds)));\n }\n\n $query = 'SELECT * FROM `cms_portal`';\n if ('' !== $portalIdSql) {\n $query .= ' WHERE `id` NOT IN ('.$portalIdSql.')';\n }\n $aPortalExcludeList = array();\n $portalRes = MySqlLegacySupport::getInstance()->query($query);\n while ($portal = MySqlLegacySupport::getInstance()->fetch_assoc($portalRes)) {\n if (!empty($portal['main_node_tree'])) {\n $aPortalExcludeList[] = $portal['main_node_tree'];\n }\n }\n $internalCache = $aPortalExcludeList;\n }\n\n $sPortalCondition = '';\n if (count($aPortalExcludeList) > 0) {\n $databaseConnection = $this->getDatabaseConnection();\n $quotedTableName = $databaseConnection->quoteIdentifier($this->treeTable);\n $portalExcludeListString = implode(',', array_map(array($databaseConnection, 'quote'), $aPortalExcludeList));\n $sPortalCondition .= \" AND $quotedTableName.`id` NOT IN ($portalExcludeListString)\";\n }\n\n return $sPortalCondition;\n }",
"protected function loadEnablednodes()\n {\n $find = array(\n 'storagegroupID' => $this->get('id'),\n 'id' => $this->get('allnodes'),\n 'isEnabled' => 1\n );\n $nodeids = array();\n $testurls = array();\n foreach ((array)self::getClass('StorageNodeManager')\n ->find($find) as &$node\n ) {\n if ($node->get('maxClients') < 1) {\n continue;\n }\n $nodeids[] = $node->get('id');\n unset($node);\n }\n $this->set('enablednodes', $nodeids);\n }",
"function venture_deal_node_access_records($node) {\n $grants = array();\n $private = FALSE;\n\n if ($node->field_deal_users) {\n foreach($node->field_deal_users as $user) {\n $private = $private || $user['value'];\n if ($user['value'] > 0) {\n $grants[] = array(\n 'realm' => 'venture_deal_user',\n 'gid' => $user['value'],\n 'grant_view' => TRUE,\n 'grant_update' => FALSE,\n 'grant_delete' => FALSE,\n 'priority' => 0\n );\n }\n }\n }\n \n if ($node->field_deal_groups) {\n foreach($node->field_deal_groups as $group) {\n $private = $private || $group['value'];\n if ($group['value'] > 0) {\n $grants[] = array(\n 'realm' => 'venture_deal_group',\n 'gid' => $group['value'],\n 'grant_view' => TRUE,\n 'grant_update' => FALSE,\n 'grant_delete' => FALSE,\n 'priority' => 0\n );\n }\n }\n }\n \n if ($private) {\n // Give full rights to deal creator\n $grants[] = array(\n 'realm' => 'venture_deal_user',\n 'gid' => $node->uid,\n 'grant_view' => TRUE,\n 'grant_update' => TRUE,\n 'grant_delete' => TRUE,\n 'priority' => 0\n );\n }\n \n return $grants;\n}",
"public function getNodesByIds(array $nodeIds, array $fetchOptions = array())\n\t{\n\t\tif (!$nodeIds)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t$inCondition = implode(',', $nodeIds);\n\t\n\t\n\t\t$fetchOptions = array_merge(\n\t\tarray(\n\t\t\t\t\t\t'permissionCombinationId' => 0\n\t\t), $fetchOptions\n\t\t);\n\t\n\t\t$permissionCombinationId = intval($fetchOptions['permissionCombinationId']);\n\t\n\t\t$data = $this->fetchAllKeyed('\n\t\t\t\t\tSELECT node.*\n\t\t\t\t\t\t' . ($permissionCombinationId ? ', permission.cache_value AS node_permission_cache' : '') . '\n\t\t\t\t\tFROM xf_node AS node\n\t\t\t\t\t' . ($permissionCombinationId ? '\n\t\t\t\t\t\tLEFT JOIN xf_permission_cache_content AS permission\n\t\t\t\t\t\t\tON (permission.permission_combination_id = ' . $permissionCombinationId . '\n\t\t\t\t\t\t\t\tAND permission.content_type = \\'node\\'\n\t\t\t\t\t\t\t\tAND permission.content_id = node.node_id)\n\t\t\t\t\t\t' : '') . '\n\t\t\t\t\tWHERE node.node_id IN ('. $inCondition . ')\n\t\t\t\t', 'node_id');\n\t\n\t\treturn $data;\n\t}",
"protected function lazy_get_nodes()\n\t{\n\t\t$ids = $this->model\n\t\t->select('nid')\n\t\t->join('INNER JOIN {prefix}taxonomy_terms__nodes ttnode USING(term_id)') // FIXME-20110614 Query should be cleverer then that\n\t\t->join(':nodes')\n\t\t->filter_by_term_id($this->term_id)\n\t\t->where('is_online = 1')\n\t\t->order('ttnode.weight')\n\t\t->all(\\PDO::FETCH_COLUMN);\n\n\t\tif (!$ids)\n\t\t{\n\t\t\treturn [];\n\t\t}\n\n\t\t$models = $this->model->models;\n\n\t\t$constructors = $models['nodes']\n\t\t\t->select('constructor, nid')\n\t\t\t->where([ 'nid' => $ids ])\n\t\t\t->all(\\PDO::FETCH_GROUP | \\PDO::FETCH_COLUMN);\n\n\t\t$rc = array_flip($ids);\n\n\t\tforeach ($constructors as $constructor => $constructor_ids)\n\t\t{\n\t\t\t$records = $models[$constructor]->find($constructor_ids);\n\n\t\t\tforeach ($records as $id => $record)\n\t\t\t{\n\t\t\t\t$rc[$id] = $record;\n\t\t\t}\n\t\t}\n\n\t\treturn array_values($rc);\n\t}",
"function _get_nodeaccess($node) {\n\n $nid = $node->nid;\n $result = db_query(\"SELECT r.rid, nra.name, na.grant_view, na.grant_update, na.grant_delete , nid\n FROM {role} r\n LEFT JOIN {nodeaccess_role_alias} nra ON r.rid = nra.rid\n LEFT JOIN {nodeaccess} na ON r.rid = na.gid AND na.realm = :realm AND na.nid = :nid\n where nra.name = 'anonymous user'\", array(':realm' => 'nodeaccess_rid', ':nid' => $nid));\n if ($result->rowCount() == 1) {\n $records = $result->fetchAll();\n $record = $records[0];\n return $record->grant_view;\n } else {\n return FALSE;\n }\n }",
"public function nodes()\n {\n $dom = new DOMDocument('1.0', 'UTF-8');\n $dom->preserveWhiteSpace = false; // we don't want to bother with white spaces\n $dom->formatOutput = true;\n @$dom->loadHTMLFile($this->address); // load given address\n\n // create DOMXPath from DOMDocument\n $xpath = new DOMXPath($dom);\n\n $expression = $this->XPath();\n\n // evaluates the given XPath expression\n $nodeList = $xpath->query($expression);\n\n $nodes = array();\n // adds the nodes to an array\n foreach ($nodeList as $node)\n {\n array_push($nodes, $this->DOMinnerHTML($node));\n }\n\n return $nodes;\n }",
"public function nodes()\n {\n return $this->belongsToMany(Config::get('workflow::node'), Config::get('workflow::node_user_table'));\n }"
] | [
"0.59590226",
"0.59590226",
"0.5854445",
"0.5729241",
"0.56212735",
"0.5611828",
"0.55146706",
"0.5364657",
"0.5341111",
"0.5340995",
"0.53240424",
"0.5302307",
"0.52554095",
"0.52530915",
"0.5243033",
"0.5238083",
"0.5231627",
"0.52257746",
"0.52003956",
"0.51975137",
"0.5179091",
"0.51032764",
"0.50757164",
"0.50406605",
"0.50371397",
"0.50104004",
"0.49722308",
"0.4939571",
"0.4921055",
"0.4895925"
] | 0.7838844 | 0 |
moves node to new position and updates all relevant node positions and the parent node connection if changed. | public function MoveNode()
{
$returnVal = false;
if ($this->global->UserDataExists('tableid') && $this->global->UserDataExists('nodeID') && $this->global->UserDataExists('parentNodeID') && $this->global->UserDataExists('position')) {
$updatedNodes = array();
$iTableID = $this->global->GetUserData('tableid');
$iNodeID = $this->global->GetUserData('nodeID');
$iParentNodeID = $this->global->GetUserData('parentNodeID');
$iPosition = $this->global->GetUserData('position');
if (!empty($iTableID) && !empty($iNodeID) && 'undefined' != $iNodeID && !empty($iParentNodeID)) { // prevent saving if node was dropped on empty space instead of an other node
$oTableEditor = new TCMSTableEditorManager();
$sEntrySortField = $this->GetSortFieldName($iParentNodeID);
$databaseConnection = $this->getDatabaseConnection();
$quotedTreeTable = $databaseConnection->quoteIdentifier($this->treeTable);
$quotedParentNodeId = $databaseConnection->quote($iParentNodeID);
if (0 == $iPosition) { // set every other node pos+1
$query = "SELECT * FROM $quotedTreeTable WHERE `parent_id` = $quotedParentNodeId";
$oCmsTreeList = TdbCmsTreeList::GetList($query);
while ($oCmsTreeNode = $oCmsTreeList->Next()) {
$oTableEditor->Init($iTableID, $oCmsTreeNode->id);
$newSortOrder = $oTableEditor->oTableEditor->oTable->sqlData[$sEntrySortField] + 1;
$oTableEditor->SaveField('entry_sort', $newSortOrder);
$updatedNodes[] = $oCmsTreeNode;
}
$oTableEditor->Init($iTableID, $iNodeID);
$oTableEditor->SaveField('entry_sort', 0);
$oTableEditor->SaveField('parent_id', $iParentNodeID);
} else {
$quotedNodeId = $databaseConnection->quote($iNodeID);
$quotedEntrySortField = $databaseConnection->quoteIdentifier($sEntrySortField);
$query = "SELECT * FROM $quotedTreeTable WHERE `parent_id` = $quotedParentNodeId AND `id` != $quotedNodeId ORDER BY $quotedEntrySortField ASC";
/** @var BackendSessionInterface $backendSession */
$backendSession = ServiceLocator::get('chameleon_system_cms_backend.backend_session');
$oCmsTreeList = TdbCmsTreeList::GetList($query, $backendSession->getCurrentEditLanguageId());
$count = 0;
while ($oCmsTree = $oCmsTreeList->Next()) {
if ($iPosition == $count) { // skip new position of moved node
++$count;
}
$oTableEditor->Init($iTableID, $oCmsTree->id);
$oTableEditor->SaveField('entry_sort', $count);
++$count;
}
$oTableEditor->Init($iTableID, $iNodeID);
$oTableEditor->SaveField('entry_sort', $iPosition);
$oTableEditor->SaveField('parent_id', $iParentNodeID);
$updatedNodes[] = $oCmsTree;
}
// update cache
TCacheManager::PerformeTableChange($this->treeTable, $iNodeID);
$this->UpdateSubtreePathCache($iNodeID);
$returnVal = true;
}
$node = TdbCmsTree::GetNewInstance($iNodeID);
$this->getNestedSetHelper()->updateNode($node);
$this->writeSqlLog();
$updatedNodes[] = $node;
$event = new ChangeNavigationTreeNodeEvent($updatedNodes);
$this->getEventDispatcher()->dispatch($event, CoreEvents::UPDATE_NAVIGATION_TREE_NODE);
}
return $returnVal;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function moveTo($new_parent_id) {\n\n if ($this->getNodeById()) {\n\n if ($this->asset_id == $new_parent_id) {\n return false;\n }\n\n $new_parent = new MY_Model($this->table_name);\n $new_parent->asset_id = $new_parent_id;\n $new_parent->getNodeById();\n\n $nodesize = $this->rgt - $this->lft + 1;\n\n\n //negate current node and children\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \"\n SET lft = ((lft - \" . $this->lft . \") + 1) * (-1), \n rgt = ((rgt - \" . $this->lft . \") + 1) * (-1),\n hlevel = (hlevel -\" . $this->hlevel . \")+1\n WHERE \n lft >= \" . $this->lft . \" \n AND rgt <= \" . $this->rgt . \"\n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n\n //update tree \n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n lft = lft - \" . $nodesize . \"\n WHERE\n lft > \" . $this->rgt . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n //update tree \n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n rgt = rgt - \" . $nodesize . \"\n WHERE\n rgt > \" . $this->rgt . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n\n // Update parent id\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n parent_id = \" . $new_parent_id . \"\n WHERE \n asset_id = \" . $this->db->escape($this->asset_id) . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n\n // Update tree \n $updatedtree = new MY_Model($this->table_name);\n $updatedtree->asset_id = $new_parent_id;\n $updatedtree->getNodeById();\n\n //update tree for isertion\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n lft = lft + \" . $nodesize . \" \n WHERE\n lft > \" . $updatedtree->lft . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n rgt = rgt + \" . $nodesize . \" \n WHERE\n rgt > \" . $updatedtree->lft . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n //update pluged nodes\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n lft = (lft *(-1) )+ \" . $updatedtree->lft . \",\n rgt = (rgt *(-1) ) + \" . $updatedtree->lft . \",\n hlevel = hlevel +\" . $updatedtree->hlevel . \"\n WHERE\n lft < 0 AND rgt < 0 \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n return true;\n } else {\n return false;\n }\n }",
"public function reorder_onMove()\n {\n $sourceNode = Menu::find(post('sourceNode'));\n $targetNode = post('targetNode') ? Menu::find(post('targetNode')) : null;\n\n if ($sourceNode == $targetNode) {\n return;\n }\n\n switch (post('position')) {\n case 'before':\n $sourceNode->moveBefore($targetNode);\n break;\n case 'after':\n $sourceNode->moveAfter($targetNode);\n break;\n case 'child':\n $sourceNode->makeChildOf($targetNode);\n break;\n default:\n $sourceNode->makeRoot();\n break;\n }\n }",
"protected function assertNodeMovedBefore() {\n // Check node is in new position.\n $node = $this->nestedSet->getNode(new NodeKey(7, 1));\n $this->assertEquals(3, $node->getLeft());\n $this->assertEquals(8, $node->getRight());\n $this->assertEquals(2, $node->getDepth());\n\n // Check children are in new position.\n $node = $this->nestedSet->getNode(new NodeKey(10, 1));\n $this->assertEquals(4, $node->getLeft());\n $this->assertEquals(5, $node->getRight());\n $this->assertEquals(3, $node->getDepth());\n\n $node = $this->nestedSet->getNode(new NodeKey(11, 1));\n $this->assertEquals(6, $node->getLeft());\n $this->assertEquals(7, $node->getRight());\n $this->assertEquals(3, $node->getDepth());\n\n // Check old parent is updated.\n $node = $this->nestedSet->getNode(new NodeKey(3, 1));\n $this->assertEquals(16, $node->getLeft());\n $this->assertEquals(21, $node->getRight());\n $this->assertEquals(1, $node->getDepth());\n }",
"public function moveToNewParent();",
"public function moveTo($newParent)\n {\n $newParent->addNode($this);\n $this->remove();\n }",
"protected function moveLeft(){\n\t\t$infoMoveNode = $this->getNodeInfo($this->_id);\n\t\t\n\t\t$lftMoveNode = $infoMoveNode['lft'];\n\t\t$rgtMoveNode = $infoMoveNode['rgt'];\n\t\t$widthMoveNode = $this->widthNode($lftMoveNode, $rgtMoveNode);\n\t\t\n\t\t$bind\t\t= array(\"rgt\"\t\t=> new Zend_db_Expr('rgt - '. $rgtMoveNode),\n\t\t\t\t\t\t\t\"lft\"\t\t=> new Zend_db_Expr('lft - '.$lftMoveNode));\n\t\t$where\t\t= 'lft BETWEEN ' . $lftMoveNode . ' AND ' . $rgtMoveNode;\n\t\t$this->_db->update($this->_name,$bind,$where);\n\t\t\n\t\t$bind\t\t= array(\"rgt\"\t\t=> new Zend_db_Expr('rgt - '. $widthMoveNode));\n\t\t$where\t\t= 'rgt > ' . $rgtMoveNode;\n\t\t$this->_db->update($this->_name,$bind,$where);\n\t\t\n\t\t$bind\t\t= array(\"lft\"\t\t=> new Zend_db_Expr('lft - '. $widthMoveNode));\n\t\t$where\t\t= 'lft > ' . $rgtMoveNode;\n\t\t$this->_db->update($this->_name,$bind,$where);\n\t\t\n\t\t$infoParentNode = $this->getNodeInfo($this->_parent);\n\t\t$lftParentNode = $infoParentNode['lft'];\n\t\t\n\t\t$bind\t\t= array(\"lft\"\t\t=> new Zend_db_Expr('lft + '. $widthMoveNode));\n\t\t$where\t\t= 'lft > ' . $lftParentNode.' AND rgt > 0 ';\n\t\t$this->_db->update($this->_name,$bind,$where);\n\t\t\n\t\t$bind\t\t= array(\"rgt\"\t\t=> new Zend_db_Expr('rgt + '. $widthMoveNode));\n\t\t$where\t\t= 'rgt > ' . $lftParentNode;\n\t\t$this->_db->update($this->_name,$bind,$where);\n\t\t\n\t\t$levelMoveNode \t\t= $infoMoveNode['level'];\n\t\t$levelParentNode\t= $infoParentNode['level'];\n\t\t$newLevelMoveNode = $levelParentNode + 1;\n\t\t\n\t\t$bind\t\t= array(\"level\"\t\t=> new Zend_db_Expr('level - '. $levelMoveNode . ' + ' . $newLevelMoveNode));\n\t\t$where\t\t= 'rgt <= 0';\n\t\t$this->_db->update($this->_name,$bind,$where);\n\t\t\n\t\t$newParent \t= $infoParentNode['id'];\n\t\t$newLeft \t= $infoParentNode['lft'] + 1;\n\t\t$newRight \t= $infoParentNode['lft'] + $widthMoveNode;\n\t\t\n\t\t$bind\t\t= array(\"parents\"=>$newParent,\n\t\t\t\t\t\t\t\"lft\"\t=>$newLeft,\n\t\t\t\t\t\t\t\"rgt\"\t=>$newRight);\n\t\t$where\t\t= 'id = ' . $this->_id;\n\t\t$this->_db->update($this->_name,$bind,$where);\n\t\t\n\t\t$bind\t\t= array(\"rgt\"\t\t=> new Zend_db_Expr('rgt + '. $newRight),\n\t\t\t\t\t\t\t\"lft\"\t\t=> new Zend_db_Expr('lft + '.$newLeft));\n\t\t$where\t\t= 'rgt < 0';\n\t\t$this->_db->update($this->_name,$bind,$where);\n\t}",
"public function moveToLeftOf($node);",
"public function MoveNode()\n {\n $sNodeID = $this->global->GetUserData('sourceNodeID');\n $sNewParentNodeID = $this->global->GetUserData('targetNodeID');\n $iNewIndex = $this->global->GetUserData('position');\n $oReturnObj = $this->oTreeWidget->MoveNode($sNodeID, $sNewParentNodeID, $iNewIndex);\n\n return $oReturnObj;\n }",
"public function moveNode(Zend_Db_TreeNodeInterface $origin,\n Zend_Db_TreeNodeInterface $destination,\n $position = null);",
"public function testUpdateNode()\n {\n }",
"public function testNodeOrderBeforeUpAndDelete()\n {\n $this->assertInstanceOf(NodeInterface::class, $this->node);\n $path = $this->node->getPath();\n\n $this->node->addNode('new1');\n $this->node->addNode('new2');\n $this->node->getNode('three')->remove();\n $this->node->orderBefore('four', 'two');\n $this->node->orderBefore('new1', 'two');\n $this->node->orderBefore('new2', 'two');\n $this->node->getNode('one')->remove();\n $this->assertChildOrder(['four', 'new1', 'new2', 'two'], $this->node);\n\n $this->session->save();\n $this->assertChildOrder(['four', 'new1', 'new2', 'two'], $this->node);\n\n $session = $this->renewSession();\n\n $node = $session->getNode($path);\n $this->assertChildOrder(['four', 'new1', 'new2', 'two'], $node);\n }",
"protected function moveRight(){\n\t\t$infoMoveNode = $this->getNodeInfo($this->_id);\n\t\t\n\t\t$lftMoveNode = $infoMoveNode['lft'];\n\t\t$rgtMoveNode = $infoMoveNode['rgt'];\n\t\t$widthMoveNode = $this->widthNode($lftMoveNode, $rgtMoveNode);\n\t\t\n\t\t$bind\t\t= array(\"rgt\"\t\t=> new Zend_db_Expr('rgt - '. $rgtMoveNode),\n\t\t\t\t\t\t\t\"lft\"\t\t=> new Zend_db_Expr('lft - '.$lftMoveNode));\n\t\t$where\t\t= 'lft BETWEEN ' . $lftMoveNode . ' AND ' . $rgtMoveNode;\n\t\t$this->_db->update($this->_name,$bind,$where);\n\t\t\n\t\t$bind\t\t= array(\"rgt\"\t\t=> new Zend_db_Expr('rgt - '. $widthMoveNode));\n\t\t$where\t\t= 'rgt > ' . $rgtMoveNode;\n\t\t$this->_db->update($this->_name,$bind,$where);\n\t\t\n\t\t$bind\t\t= array(\"lft\"\t\t=> new Zend_db_Expr('lft - '. $widthMoveNode));\n\t\t$where\t\t= 'lft > ' . $rgtMoveNode;\n\t\t$this->_db->update($this->_name,$bind,$where);\n\t\t\n\t\t$infoParentNode = $this->getNodeInfo($this->_parent);\n\t\t$rgtParentNode = $infoParentNode['rgt'];\n\t\t\n\t\t$bind\t\t= array(\"lft\"\t\t=> new Zend_db_Expr('lft + '. $widthMoveNode));\n\t\t$where\t\t= 'lft >= ' . $rgtParentNode. ' AND rgt > 0';\n\t\t$this->_db->update($this->_name,$bind,$where);\n\t\t\n\t\t$bind\t\t= array(\"rgt\"\t\t=> new Zend_db_Expr('rgt + '. $widthMoveNode));\n\t\t$where\t\t= 'rgt >= ' . $rgtParentNode;\n\t\t$this->_db->update($this->_name,$bind,$where);\n\t\t\n\t\t$levelMoveNode \t\t= $infoMoveNode['level'];\n\t\t$levelParentNode\t= $infoParentNode['level'];\n\t\t$newLevelMoveNode = $levelParentNode + 1;\n\t\t\n\t\t$bind\t\t= array(\"level\"\t\t=> new Zend_db_Expr('level - '. $levelMoveNode . ' + ' . $newLevelMoveNode));\n\t\t$where\t\t= 'rgt <= 0';\n\t\t$this->_db->update($this->_name,$bind,$where);\n\t\t\n\t\t$newParent \t= $infoParentNode['id'];\n\t\t$newLeft \t= $infoParentNode['rgt'];\n\t\t$newRight \t= $infoParentNode['rgt'] + $widthMoveNode - 1;\n\t\t\n\t\t$bind\t\t= array(\"parents\"\t\t=> $newParent,\n\t\t\t\t\t\t\t\"lft\"\t\t\t=>$newLeft,\n\t\t\t\t\t\t\t\"rgt\"\t\t\t=>$newRight);\n\t\t$where\t\t= 'id = ' . $this->_id;\n\t\t$this->_db->update($this->_name,$bind,$where);\n\t\t\n\t\t$bind\t\t= array(\"rgt\"\t\t=> new Zend_db_Expr('rgt + '. $newRight),\n\t\t\t\t\t\t\t\"lft\"\t\t=> new Zend_db_Expr('lft + '. $newLeft));\n\t\t$where\t\t= 'rgt <0';\n\t\t$this->_db->update($this->_name,$bind,$where);\n\t}",
"function move($object, $newparent = null)\n {\n $old_parent_path = $this->getParentIdString($object);\n $result = parent::move($object, $newparent);\n if (is_a($result, 'PEAR_Error')) {\n return $result;\n }\n $id = $this->getId($object);\n $new_parent_path = $this->getParentIdString($object);\n\n /* Fetch the object being moved and all of its children, since\n * we also need to update their parent paths to avoid creating\n * orphans. */\n $query = 'SELECT datatree_id, datatree_parents' .\n ' FROM ' . $this->_params['table'] .\n ' WHERE datatree_parents = ? OR datatree_parents LIKE ?' .\n ' OR datatree_id = ?';\n $values = array($old_parent_path . ':' . $id,\n $old_parent_path . ':' . $id . ':%',\n (int)$id);\n\n Horde::logMessage('SQL Query by Horde_DataTree_Sql::move(): ' . $query . ', ' . var_export($values, true), 'DEBUG');\n $rowset = $this->_db->query($query, $values);\n if (is_a($rowset, 'PEAR_Error')) {\n return $rowset;\n }\n\n /* Update each object, replacing the old parent path with the\n * new one. */\n while ($row = $rowset->fetchRow(DB_FETCHMODE_ASSOC)) {\n if (is_a($row, 'PEAR_Error')) {\n return $row;\n }\n\n $oquery = '';\n if ($row['datatree_id'] == $id) {\n $oquery = ', datatree_order = 0 ';\n }\n\n /* Do str_replace() only if this is not a first level\n * object. */\n if (!empty($row['datatree_parents'])) {\n $ppath = str_replace($old_parent_path, $new_parent_path, $row['datatree_parents']);\n } else {\n $ppath = $new_parent_path;\n }\n $query = sprintf('UPDATE %s SET datatree_parents = %s' . $oquery . ' WHERE datatree_id = %s',\n $this->_params['table'],\n $this->_write_db->quote($ppath),\n (int)$row['datatree_id']);\n\n Horde::logMessage('SQL Query by Horde_DataTree_Sql::move(): ' . $query, 'DEBUG');\n $result = $this->_write_db->query($query);\n if (is_a($result, 'PEAR_Error')) {\n return $result;\n }\n }\n\n $order = $this->getOrder($object);\n\n /* Shuffle down the old order positions. */\n $reorder = $this->reorder($old_parent_path, $order);\n\n /* Shuffle up the new order positions. */\n $reorder = $this->reorder($new_parent_path, 0, $id);\n\n return true;\n }",
"public function testMoveNode()\n {\n }",
"public function move(): void\n {\n $this->visitedCoordinates[] = $this->currentCoordinates;\n $candidateForNextCoordinates = $this->getNextCoordinates();\n\n if (!$this->matrix->containsCoordinates($candidateForNextCoordinates) || in_array($candidateForNextCoordinates, $this->visitedCoordinates)) {\n $this->direction = $this->direction->turnRight();\n $candidateForNextCoordinates = $this->getNextCoordinates();\n }\n $this->currentCoordinates = $candidateForNextCoordinates;\n }",
"public function moveToLeftOf($id) {\n if ($this->getNodeById()) {\n\n if ($this->asset_id == $id) {\n return false;\n }\n\n $right_node = new MY_Model($this->table_name);\n $right_node->asset_id = $id;\n $right_node->getNodeById();\n\n $nodesize = $this->rgt - $this->lft + 1;\n\n\n //negate current node and children\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \"\n SET lft = ((lft - \" . $this->lft . \") + 1) * (-1), \n rgt = ((rgt - \" . $this->lft . \") + 1) * (-1),\n hlevel = (hlevel -\" . $this->hlevel . \")\n WHERE \n lft >= \" . $this->lft . \" \n AND rgt <= \" . $this->rgt . \"\n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n\n //update tree \n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n lft = lft - \" . $nodesize . \"\n WHERE\n lft > \" . $this->rgt . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n //update tree \n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n rgt = rgt - \" . $nodesize . \"\n WHERE\n rgt > \" . $this->rgt . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n\n // Update parent id\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n parent_id = \" . $right_node->parent_id . \"\n WHERE \n asset_id = \" . $this->db->escape($this->asset_id) . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n\n // Update tree \n $updatedright = new MY_Model($this->table_name);\n $updatedright->asset_id = $id;\n $updatedright->getNodeById();\n\n //update tree for insertion\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n lft = lft + \" . $nodesize . \" \n WHERE\n lft >= \" . $updatedright->lft . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n rgt = rgt + \" . $nodesize . \" \n WHERE\n rgt > \" . $updatedright->lft . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n $updatedright->getNodeById();\n //update pluged nodes\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n lft = (lft *(-1) )+ \" . ($updatedright->lft - $nodesize - 1) . \",\n rgt = (rgt *(-1) ) + \" . ($updatedright->lft - $nodesize - 1) . \",\n hlevel = hlevel +\" . $updatedright->hlevel . \"\n WHERE\n lft < 0 AND rgt < 0 \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n return true;\n } else {\n\n return false;\n }\n }",
"public function testMoveSubTreeBelowEndParentNode() {\n\n $parent = $this->nestedSet->getNode(new NodeKey(1, 1));\n $nodeKey = new NodeKey(7, 1);\n $node = $this->nestedSet->getNode($nodeKey);\n\n $newRoot = $this->nestedSet->addRootNode(new NodeKey(12, 1));\n $this->nestedSet->moveSubTreeBelow($newRoot, $node);\n\n // Check node is in new position.\n $node = $this->nestedSet->getNode($nodeKey);\n $this->assertEquals(18, $node->getLeft());\n $this->assertEquals(23, $node->getRight());\n $this->assertEquals(1, $node->getDepth());\n\n // Check children are in new position.\n $node = $this->nestedSet->getNode(new NodeKey(10, 1));\n $this->assertEquals(19, $node->getLeft());\n $this->assertEquals(20, $node->getRight());\n $this->assertEquals(2, $node->getDepth());\n\n $node = $this->nestedSet->getNode(new NodeKey(11, 1));\n $this->assertEquals(21, $node->getLeft());\n $this->assertEquals(22, $node->getRight());\n $this->assertEquals(2, $node->getDepth());\n\n // Check old parent is updated.\n $node = $this->nestedSet->getNode(new NodeKey(3, 1));\n $this->assertEquals(10, $node->getLeft());\n $this->assertEquals(15, $node->getRight());\n $this->assertEquals(1, $node->getDepth());\n\n }",
"function updateOrdersWithOldNodeData($node) {\r\n\t\t$order = $node['Node']['order'];\r\n\t\t$nodes = $this->find('all',array(\r\n\t\t\t'conditions' => array(\r\n\t\t\t\t'Node.course_id' => $node['Node']['course_id'],\r\n\t\t\t\t'Node.parent_node_id' => $node['Node']['parent_node_id'],\r\n\t\t\t\t'Node.order >' => $order)\r\n\t\t));\r\n\t\t\r\n\t\t//$nodes = $this->findAll(array());\r\n\t\tforeach($nodes as $node) {\r\n\t\t\t$this->id = $node['Node']['id'];\r\n\t\t\t$this->saveField('order',$order++);\r\n\t\t}\r\n\t}",
"public function updateCircuitsParents();",
"public function moveRight() {\n if ($this->getNodeById()) {\n\n if ($rightnode = $this->getRgtNode()) {\n $nodesize = $this->rgt - $this->lft + 1;\n $rnodesize = $rightnode->rgt - $rightnode->lft + 1;\n\n //Negate the left and right of rightnode \n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \"\n\t\t\tSET lft = lft * (-1), \n\t\t\trgt = rgt * (-1)\n\t\t\tWHERE \n\t\t\tlft >= \" . $rightnode->lft . \" \n\t\t\tAND rgt <= \" . $rightnode->rgt . \"\n\t\t\tAND root_id = \" . $this->root_id . \"\n\t\t\tAND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n $this->db->query($sql);\n\n\n // Move node to right\n\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \"\n\t\t\tSET lft = lft+\" . $rnodesize . \",\n\t\t\trgt = rgt+\" . $rnodesize . \"\n\t\t\tWHERE \n\t\t\tlft >= \" . $this->lft . \" \n\t\t\tAND rgt <= \" . $this->rgt . \"\n\t\t\tAND root_id = \" . $this->root_id . \"\n\t\t\tAND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n $this->db->query($sql);\n\n\n //Move rightnode to left \n\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \"\n\t\t\tSET lft = (lft+\" . $nodesize . \") * (-1), \n\t\t\trgt = (rgt+\" . $nodesize . \") * (-1)\n\t\t\tWHERE \n\t\t\tlft <= \" . $rightnode->lft . \"*(-1) \n\t\t\tAND rgt >= \" . $rightnode->rgt . \"*(-1)\n\t\t\tAND root_id = \" . $this->root_id . \"\n\t\t\tAND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n $this->db->query($sql);\n\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }",
"function moveEdge($nodeId, $dir);",
"public function moveToRightOf($id) {\n if ($this->getNodeById()) {\n\n if ($this->asset_id == $id) {\n return false;\n }\n\n $left_node = new MY_Model($this->table_name);\n $left_node->asset_id = $id;\n $left_node->getNodeById();\n\n $nodesize = $this->rgt - $this->lft + 1;\n\n\n //negate current node and children\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \"\n SET lft = ((lft - \" . $this->lft . \") + 1) * (-1), \n rgt = ((rgt - \" . $this->lft . \") + 1) * (-1),\n hlevel = (hlevel -\" . $this->hlevel . \")\n WHERE \n lft >= \" . $this->lft . \" \n AND rgt <= \" . $this->rgt . \"\n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n\n //update tree \n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n lft = lft - \" . $nodesize . \"\n WHERE\n lft > \" . $this->rgt . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n //update tree \n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n rgt = rgt - \" . $nodesize . \"\n WHERE\n rgt > \" . $this->rgt . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n\n // Update parent id\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n parent_id = \" . $left_node->parent_id . \"\n WHERE \n asset_id = \" . $this->db->escape($this->asset_id) . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n\n // Updated tree \n $updatedleft = new MY_Model($this->table_name);\n $updatedleft->asset_id = $id;\n $updatedleft->getNodeById();\n\n //update tree for insertion\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n lft = lft + \" . $nodesize . \" \n WHERE\n lft > \" . $updatedleft->rgt . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n rgt = rgt + \" . $nodesize . \" \n WHERE\n rgt > \" . $updatedleft->rgt . \" \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n $updatedleft->getNodeById();\n //update pluged nodes\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \" SET\n lft = (lft *(-1) )+ \" . $updatedleft->rgt . \",\n rgt = (rgt *(-1) ) + \" . $updatedleft->rgt . \",\n hlevel = hlevel +\" . $updatedleft->hlevel . \"\n WHERE\n lft < 0 AND rgt < 0 \n AND root_id = \" . $this->root_id . \"\n AND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo \"<br>\".$sql;\n $this->db->query($sql);\n\n return true;\n } else {\n\n return false;\n }\n }",
"public function testMoveSubTreeBefore() {\n\n $target = $this->nestedSet->getNode(new NodeKey(4, 1));\n $nodeKey = new NodeKey(7, 1);\n $node = $this->nestedSet->getNode($nodeKey);\n\n $this->nestedSet->moveSubTreeBefore($target, $node);\n $this->assertNodeMovedBefore();\n\n $node = $this->nestedSet->getNode(new NodeKey(7, 1));\n // Check node is in new position.\n $node = $this->nestedSet->getNode($nodeKey);\n\n $this->nestedSet->moveSubTreeBefore($target, $node);\n $this->assertNodeMovedBefore();\n }",
"public function update () {\r\n\t\t$this->getParent ()->update();\r\n\t\t$this->_update();\r\n\t}",
"private function moveUp()\n\t{\n\t\t$value = $this->current->value;\n\t\tif ($this->current->parent) {\n\t\t\t$this->current = $this->current->parent;\n\t\t} else {\n\t\t\t$this->current = null;\n\t\t}\n\n\t\t$this->appendValue($value);\n\t}",
"function move_node($lft,$nlft){\n\t\t// Validate values\n\t\t$node = $this->get_node($lft);\n\t\tif(!$node || $lft == $nlft)return false;\n\t\t$root = $this->get_root();\n\t\tif($nlft > $root[$this->right_col] || $nlft < 2 || $lft == 1)return false;\n\t\t\n\t\t// Lock tree\n\t\t$this->lock_tree_table();\n\t\t\n\t\t// Create WHERE string, so we only affect those we want to\n\t\t$where = $this->id_col . ' = '.$node[$this->id_col];\n\t\t$descendants = $this->get_descendants($node[$this->left_col],$node[$this->right_col]);\n\t\tif($descendants){\n\t\t\tforeach($descendants as $to_move){\n\t\t\t\t$where .= ' OR '.$this->id_col.' = ' . $to_move[$this->id_col];\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Move the ones to be moved outside the tree\n\t\t$this->db->query('UPDATE '.$this->tree_table.\n\t\t\t' SET '.$this->left_col.' = '.$this->left_col.' + '.($root[$this->right_col] - $lft + 1).\n\t\t\t' WHERE '.$where);\n\t\t$this->db->query('UPDATE '.$this->tree_table.\n\t\t\t' SET '.$this->right_col.' = '.$this->right_col.' + '.($root[$this->right_col] - $lft + 1).\n\t\t\t' WHERE '.$where);\n\t\t\n\t\t// Shrink the tree\n\t\t$this->remove_gaps(); // HCG: I do not like this - should be deprecated\n\t\t\n\t\t$size = ($node[$this->right_col] - $node[$this->left_col] + 1);\n\t\t\n\t\tif($lft < $nlft){\n\t\t\t// We move the node down in tree (to a greater lft),\n\t\t\t// so compensate for size of the moved\n\t\t\t\n\t\t\t// Create space for nodes\n\t\t\t$this->create_space(($nlft - $size),$size);\n\t\t\t\n\t\t\t// Move them\n\t\t\t$this->db->query(\n\t\t\t\t'UPDATE '.$this->tree_table.\n\t\t\t\t' SET '.$this->left_col.' = '.$this->left_col.' - '.\n\t\t\t\t\t\t\t\t(($root[$this->right_col] - $nlft + 1) + $size).\n\t\t\t\t' WHERE '.$where);\n\t\t\t$this->db->query(\n\t\t\t\t'UPDATE '.$this->tree_table.\n\t\t\t\t' SET '.$this->right_col.' = '.$this->right_col.' - '.\n\t\t\t\t\t\t\t\t(($root[$this->right_col] - $nlft + 1) + $size).\n\t\t\t\t' WHERE '.$where);\n\t\t\t// to get correct rgt value\n\t\t\t$nlft = $lft;\n\t\t}\n\t\telse{\n\t\t\t// Create space for nodes\n\t\t\t$this->create_space($nlft,$size);\n\t\t\t\n\t\t\t// Move them\n\t\t\t$this->db->query('UPDATE '.$this->tree_table.\n\t\t\t\t' SET '.$this->left_col.' = '.$this->left_col.' - '.($root[$this->right_col] - $nlft + 1).\n\t\t\t\t' WHERE '.$where);\n\t\t\t$this->db->query('UPDATE '.$this->tree_table.\n\t\t\t\t' SET '.$this->right_col.' = '.$this->right_col.' - '.($root[$this->right_col] - $nlft + 1).\n\t\t\t\t' WHERE '.$where);\n\t\t}\n\t\t/*$this->db->select($this->right_col);\n\t\t$data = $this->db->get_where($this->tree_table, array($this->left_col => $nlft));\n\t\t$ret = $data->row_array();*/\n\t\t$ret = array($nlft,$nlft + $node[$this->right_col] - $node[$this->left_col]);\n\t\t$this->unlock_tree_table();\n\t\treturn $ret;\n\t}",
"public function moveLeft() {\n if ($this->getNodeById()) {\n\n if ($leftnode = $this->getLftNode()) {\n $nodesize = $this->rgt - $this->lft + 1;\n $lnodesize = $leftnode->rgt - $leftnode->lft + 1;\n\n //Negate the left and right of leftnode \n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \"\n\t\t\tSET lft = lft * (-1), \n\t\t\trgt = rgt * (-1)\n\t\t\tWHERE \n\t\t\tlft >= \" . $leftnode->lft . \" \n\t\t\tAND rgt <= \" . $leftnode->rgt . \"\n\t\t\tAND root_id = \" . $this->root_id . \"\n\t\t\tAND table_name = \" . $this->db->escape($this->table_name) . \";\";\n //echo $sql.\"<br>\";\n $this->db->query($sql);\n\n\n // Move node to left\n\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \"\n\t\t\tSET lft = lft-\" . $lnodesize . \",\n\t\t\trgt = rgt-\" . $lnodesize . \"\n\t\t\tWHERE \n\t\t\tlft >= \" . $this->lft . \" \n\t\t\tAND rgt <= \" . $this->rgt . \"\n\t\t\tAND root_id = \" . $this->root_id . \"\n\t\t\tAND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo $sql.\"<br>\";\n $this->db->query($sql);\n\n\n //Move leftnode to right \n\n $sql = \"UPDATE \" . $this->db->escape_str($this->table) . \"\n\t\t\tSET lft = (lft-\" . $nodesize . \") * (-1), \n\t\t\trgt = (rgt-\" . $nodesize . \") * (-1)\n\t\t\tWHERE \n\t\t\tlft <= \" . $leftnode->lft . \"*(-1) \n\t\t\tAND rgt >= \" . $leftnode->rgt . \"*(-1)\n\t\t\tAND root_id = \" . $this->root_id . \"\n\t\t\tAND table_name = \" . $this->db->escape($this->table_name) . \";\";\n\n //echo $sql.\"<br>\";\n $this->db->query($sql);\n\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }",
"private function moveNode(string $srcAbsPath, string $destAbsPath): void\n {\n $this->assertLoggedIn();\n PathHelper::assertValidAbsolutePath($srcAbsPath, false, true, $this->getNamespacePrefixes());\n PathHelper::assertValidAbsolutePath($destAbsPath, true, true, $this->getNamespacePrefixes());\n\n if (!$this->pathExists($srcAbsPath)) {\n throw new PathNotFoundException(\"Source path '$srcAbsPath' not found\");\n }\n\n if ($this->getSystemIdForNode($destAbsPath)) {\n throw new ItemExistsException(\n \"Cannot move '$srcAbsPath' to '$destAbsPath' because destination node already exists.\"\n );\n }\n\n if (!$this->getSystemIdForNode(PathHelper::getParentPath($destAbsPath))) {\n throw new PathNotFoundException(\"Parent of the destination path '\".$destAbsPath.\"' has to exist.\");\n }\n\n $query = 'SELECT path, id FROM phpcr_nodes WHERE path LIKE ? OR path = ? AND workspace_name = ? '.$this->getConnection()\n ->getDatabasePlatform()->getForUpdateSQL()\n ;\n $stmt = $this->getConnection()->executeQuery($query, [$srcAbsPath.'/%', $srcAbsPath, $this->workspaceName]);\n\n /*\n * TODO: https://github.com/jackalope/jackalope-doctrine-dbal/pull/26/files#L0R1057\n * the other thing i wonder: can't you do the replacement inside sql instead of loading and then storing\n * the node? this will be extremely slow for a large set of nodes. i think you should use query builder here\n * rather than raw sql, to make it work on a maximum of platforms.\n *\n * can you try to do this please? if we don't figure out how to do it, at least fix the where criteria, and\n * we can ask the doctrine community how to do the substring operation.\n * http://stackoverflow.com/questions/8619421/correct-syntax-for-doctrine2s-query-builder-substring-helper-method\n */\n\n $query = 'UPDATE phpcr_nodes SET ';\n $updatePathCase = 'path = CASE ';\n $updateParentCase = 'parent = CASE ';\n $updateLocalNameCase = 'local_name = CASE ';\n $updateSortOrderCase = 'sort_order = CASE ';\n $updateDepthCase = 'depth = CASE ';\n\n // TODO: Find a better way to do this\n // Calculate CAST type for CASE statement\n switch ($this->getConnection()->getDatabasePlatform()->getName()) {\n case 'pgsql':\n $intType = 'integer';\n break;\n case 'mysql':\n $intType = 'unsigned';\n break;\n default:\n $intType = 'integer';\n }\n\n $i = 0;\n $values = $ids = [];\n $srcAbsPathPattern = '/^'.preg_quote($srcAbsPath, '/').'/';\n while ($row = $stmt->fetchAssociative()) {\n $values['id'.$i] = $row['id'];\n $values['path'.$i] = preg_replace($srcAbsPathPattern, $destAbsPath, $row['path'], 1);\n $values['parent'.$i] = PathHelper::getParentPath($values['path'.$i]);\n $values['depth'.$i] = PathHelper::getPathDepth($values['path'.$i]);\n\n $updatePathCase .= \"WHEN id = :id$i THEN :path$i \";\n $updateParentCase .= \"WHEN id = :id$i THEN :parent$i \";\n $updateDepthCase .= \"WHEN id = :id$i THEN CAST(:depth$i AS $intType) \";\n\n if ($srcAbsPath === $row['path']) {\n [, $localName] = $this->getJcrName($values['path'.$i]);\n $values['localname'.$i] = $localName;\n\n $updateLocalNameCase .= \"WHEN id = :id$i THEN :localname$i \";\n $updateSortOrderCase .= \"WHEN id = :id$i THEN (SELECT * FROM ( SELECT MAX(x.sort_order) + 1 FROM phpcr_nodes x WHERE x.parent = :parent$i) y) \";\n }\n\n $ids[] = $row['id'];\n\n ++$i;\n }\n\n if (!$i) {\n return;\n }\n\n $ids = implode(',', $ids);\n\n $updateLocalNameCase .= 'ELSE local_name END, ';\n $updateSortOrderCase .= 'ELSE sort_order END ';\n\n $query .= $updatePathCase.'END, '.$updateParentCase.'END, '.$updateDepthCase.'END, '.$updateLocalNameCase.$updateSortOrderCase;\n $query .= \"WHERE id IN ($ids)\";\n\n try {\n $this->getConnection()->executeStatement($query, $values);\n } catch (DBALException $e) {\n throw new RepositoryException(\n \"Unexpected exception while moving node from $srcAbsPath to $destAbsPath\",\n $e->getCode(),\n $e\n );\n }\n\n $this->cleanIdentifierCache($srcAbsPath);\n }",
"public function move(int $newX, int $newY);",
"public function moveUp() {\n\t\t$this->data['positionOld'] = $this->data['position'];\n\t\t$this->data['position']['y']--;\n\t\t$this->move();\n\t}"
] | [
"0.6376597",
"0.63328356",
"0.6185446",
"0.6054066",
"0.60082704",
"0.5992126",
"0.59423685",
"0.5936413",
"0.5930739",
"0.59188503",
"0.5892504",
"0.5877976",
"0.58446527",
"0.58360124",
"0.57889193",
"0.5775889",
"0.5643669",
"0.56273836",
"0.5566554",
"0.5552678",
"0.55374736",
"0.5519204",
"0.54875064",
"0.54653746",
"0.5456191",
"0.5434652",
"0.5429673",
"0.53667057",
"0.5353718",
"0.5313414"
] | 0.70950425 | 0 |
update the cache of the tree path to each node of the given subtree. | protected function UpdateSubtreePathCache($iNodeId)
{
$oNode = TdbCmsTree::GetNewInstance();
/** @var BackendSessionInterface $backendSession */
$backendSession = ServiceLocator::get('chameleon_system_cms_backend.backend_session');
$oNode->SetLanguage($backendSession->getCurrentEditLanguageId());
$oNode->Load($iNodeId);
$oNode->TriggerUpdateOfPathCache();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rebuild() {\n\t\t$data = $this->_getTreeWithChildren();\n\t\t\n\t\t$level = 0; // need a variable to hold the running level tally\n\t\t// invoke the recursive function. Start it processing\n\t\t// on the fake \"root node\" generated in getTreeWithChildren().\n\t\t// because this node doesn't really exist in the database, we\n\t\t// give it an initial nleft value of 0 and an nlevel of 0.\n\t\t$this->_generateTreeData($data, 0, 0);\n\n\t\t// at this point the the root node will have nleft of 0, nlevel of 0\n\t\t// and nright of (tree size * 2 + 1)\n\n\t\tforeach ($data as $id => $row) {\n\n\t\t\t// skip the root node\n\t\t\tif ($id == 0)\n\t\t\t\tcontinue;\n\n\t\t\t$query = sprintf('update %s set nlevel = %d where %s = %d', $this->db->dbprefix( 'taxonomy_term_data' ), $row->nlevel, $this->fields['id'], $id);\n\t\t\t$this->db->query($query);\n\t\t}\n\t}",
"function update_path() {\n\t\tglobal $gpdb;\n\t\t$old_path = isset( $this->path )? $this->path : '';\n\t\t$parent_project = $this->get( $this->parent_project_id );\n\t\tif ( $parent_project )\n\t\t\t$path = gp_url_join( $parent_project->path, $this->slug );\n\t\telseif ( !$gpdb->last_error )\n\t\t\t$path = $this->slug;\n\t\telse\n\t\t\treturn null;\n\t\t$res_self = $this->update( array( 'path' => $path ) );\n\t\tif ( is_null( $res_self ) ) return $res_self;\n\t\t// update children's paths, too\n\t\tif ( $old_path ) {\n\t\t\t$query = \"UPDATE $this->table SET path = CONCAT(%s, SUBSTRING(path, %d)) WHERE path LIKE %s\";\n\t\t\treturn $this->query( $query, $path, strlen($old_path) + 1, like_escape( $old_path).'%' );\n\t\t} else {\n\t\t\treturn $res_self;\n\t\t}\n\t}",
"function regenerate_paths( $parent_project_id = null ) {\n\t\t// TODO: do it with one query. Use the tree generation code from GP_Route_Main::_options_from_projects()\n\t\tif ( $parent_project_id ) {\n\t\t\t$parent_project = $this->get( $parent_project_id );\n\t\t\t$path = $parent_project->path;\n\t\t} else {\n\t\t\t$path = '';\n\t\t\t$parent_project_id = null;\n\t\t}\n\t\t$projects = $this->find( array( 'parent_project_id' => $parent_project_id ) );\n\t\tforeach( (array)$projects as $project ) {\n\t\t\t$project->update( array( 'path' => gp_url_join( $path, $project->slug ) ) );\n\t\t\t$this->regenerate_paths( $project->id );\n\t\t}\n\t}",
"public function completeTreeUpdate($tree, $parent_id = null)\n {\n if (!is_array($tree)) {\n return;\n }\n $keys = array_keys($tree);\n sort($keys);\n $children = $this->find('list', array(\n 'conditions' => array(\n 'PermissibleAco.parent_id' => $parent_id\n ),\n 'fields' => array(\n 'PermissibleAco.alias'\n )\n ));\n sort($children);\n $same = ($children === $keys);\n $children = $this->find('list', array(\n 'conditions' => array(\n 'PermissibleAco.parent_id' => $parent_id\n ),\n 'fields' => array(\n 'PermissibleAco.alias'\n )\n ));\n if ($same) {\n foreach ($children as $id => $alias) {\n $this->completeTreeUpdate($tree[$alias], $id);\n }\n } else {\n foreach ($children as $id => $child) {\n if (!in_array($child, $keys)) {\n $this->delete($id);\n unset($children[$id]);\n }\n }\n foreach ($keys as $key) {\n if (!in_array($key, $children)) {\n $this->create();\n $this->save(array(\n 'PermissibleAco' => array(\n 'parent_id' => $parent_id,\n 'alias' => $key\n )\n ));\n }\n }\n }\n }",
"function upgradePath($path, $mode = Scanner::SCAN_RECURSIVE) {\n\t\tif (!$this->legacy->hasItems()) {\n\t\t\treturn;\n\t\t}\n\t\t\\OC_Hook::emit('\\OC\\Files\\Cache\\Upgrade', 'migrate_path', $path);\n\t\tif ($row = $this->legacy->get($path)) {\n\t\t\t$data = $this->getNewData($row);\n\t\t\tif ($data) {\n\t\t\t\t$this->insert($data);\n\t\t\t\t$this->upgradeChilds($data['id'], $mode);\n\t\t\t}\n\t\t}\n\t}",
"public function cacheTreeChartPageRefresh()\n {\n // we manage the \"tree chart page\"\n $params_treechart = array();\n $params_treechart['action'] = \"renderByClick\";\n $params_treechart['id'] = \".org-chart-page\";\n $params_treechart['menu'] = \"page\";\n // we sort an array by key in reverse order\n krsort($params_treechart);\n // we create de Etag cache\n $params_treechart = json_encode($params_treechart);\n $params_treechart = str_replace(':', '#', $params_treechart);\n // we refresh all caches \n $all_lang = $this->getRepository('Langue')->findByEnabled(true);\n foreach($all_lang as $key => $lang) {\n $id_lang = $lang->getId();\n $Etag_treechart = \"organigram:Rubrique~org-chart-page:$id_lang:$params_treechart\";\n // we refresh the cache\n $this->cacheRefreshByname($Etag_treechart);\n }\n }",
"public function updateCache()\n {\n //\n }",
"public function refresh()\n {\n $this->completeTreeUpdate($this->getCompleteTree());\n }",
"protected function update()\n {\n parent::update();\n\n // Copy all keys from all children\n $this->keys = new \\StdClass();\n foreach ($this->children as $child) {\n foreach ($child->keys as $key => $field) {\n $this->keys->$key = $field;\n }\n }\n\n // Copy default param only if every child has the same default param\n $defaultParam = $this->children[0]->defaultParam;\n $diff = false;\n foreach ($this->children as $child) {\n if ($child->defaultParam != $defaultParam) {\n $diff = true;\n }\n }\n\n if (!$diff) {\n $this->defaultParam = $defaultParam;\n }\n }",
"public function gatsbyUpdate() {\n foreach (self::$updateData as $urls) {\n foreach ($urls as $data) {\n $this->triggerRefresh($data['url'], $data['json'], $data['path']);\n }\n }\n\n // Reset update data to ensure it's only processed once.\n self::$updateData = [];\n }",
"private function _recursive_update($obj, $path, $update, $depth)\n {\n $node = $path[$depth];\n $next_node = $path[$depth+1];\n\n if(!$obj){\n throw new Exception(\"Field not found\");\n }\n if(!$path || gettype($path) != 'array'){\n throw new Exception(\"Invalid path\");\n }\n\n /* update at the root level */\n if(count($path) == 1){\n reset($update);\n $k = key($update);\n $v = current($update);\n\n if(isset($obj[$k])){\n return (object) array_replace_recursive((array) $obj, (array) $update);\n }\n else{\n return (object) array_merge_recursive((array) $obj, (array) $update);\n }\n }\n\n /**\n * special handling for updating arrays at depth 2\n * as arrays have to be replaced\n */\n if(count($path) == 2){\n if(gettype($obj[$path[1]]) == 'array'){\n $val = $obj[$path[1]];\n $new_val = array_merge_recursive($val, $update);\n $obj[$path[1]] = $new_val;\n return $obj;\n }\n }\n\n /**\n * similar to special handling above for arrays but at\n * a varied depth\n */\n if($depth == count($path) - 2){\n $temp = (array)$obj[$node];\n if(gettype($temp[$next_node]) == 'array'){\n reset($update);\n $k = key($update);\n $v = current($update);\n $val = $temp[$next_node];\n\n if(isset($val[$k])){\n $new_val = array_replace_recursive($val, $update);\n }\n else {\n $new_val = array_merge_recursive($val, $update);\n }\n\n if(gettype($obj[$node]) == 'object'){\n $obj[$node]->$next_node = $new_val;\n }\n else{\n $obj[$node][$next_node] = $new_val;\n }\n return;\n }\n }\n\n /* handling scalar values and JSON Object */\n if($depth == count($path) - 1){\n reset($update);\n $k = key($update);\n $v = current($update);\n\n if(gettype($obj[$node]) == 'object'){\n $obj[$node]->$k = $v;\n }\n else{\n $obj[$node][$k] = $v;\n }\n return;\n }\n\n if($depth == 0){\n /* ignore \"root\" */\n self::_recursive_update((array)$obj[$next_node], $path, $update, $depth + 2);\n }\n\n else{\n self::_recursive_update((array)$obj[$node], $path, $update, $depth + 1);\n }\n return $obj;\n }",
"function rebuildLinks() {\r\n\t $this->deleteLinkList();\r\n\t\t$directlinks = $this->createLinkList();\r\n\t\tforeach ($directlinks as $key => $value) {\r\n\t\t $startids[] = $key;\r\n\t\t }\r\n\t\t $this->getTree($directlinks,$startids);\r\n }",
"public function setDepthWithSubtree();",
"protected function flushDirectory($cacheDir)\n {\n foreach (new DirectoryIterator($cacheDir) as $child) {\n $this->flushEntry($child);\n }\n }",
"public static function set(&$data, $path, $value)\n {\n $paths = explode('.', $path);\n $pathCount = count($paths);\n $currentIteration = 0;\n $node = &$data;\n\n foreach ($paths as $nextPath) {\n if (array_key_exists($nextPath, $node)) {\n $node = &$node[$nextPath];\n $currentIteration++;\n } elseif ($currentIteration < $pathCount) {\n $node[$nextPath] = [];\n $node = &$node[$nextPath];\n $currentIteration++;\n }\n }\n\n $node = $value;\n }",
"public static function _rebuildTree($data_array)\n {\n if (is_array($data_array)) {\n foreach ($data_array as $data_node) {\n $node = CategoryArticle::find(3);\n //loop recursively through the children\n if (isset($data_node['children']) && is_array($data_node['children'])) {\n foreach ($data_node['children'] as $data_node_child) {\n //append the children to their (old/new)parents\n $descendant = CategoryArticle::find($data_node_child['item_id']);\n $descendant->appendTo($node)->update();\n //ordering trick here, shift the descendants to the bottom to get the right order at the end\n $shift = count($descendant->getSiblings());\n $descendant->down($shift);\n self::_rebuildTree($data_node['children']);\n }\n }\n }\n }\n }",
"private function filepath($word)\n {\n $hash = md5($word);\n $path = $this->basepath() . $this->target . DS;\n for ($i = 0; $i < $this->hierarchy; $i++) {\n // coution: use [<] , not [<=]\n $path .= $hash{$i} . DS;\n }\n $path .= $hash;\n return $path;\n }\n\n /**\n * Prepare hierarchy directory to cache\n */\n private function prepare($path)\n {\n $dir = $path;\n $dirs = array();\n for ($i = 0; $i <= $this->hierarchy; $i++) {\n $dir = dirname($dir);\n if (is_dir($dir)) {\n break;\n }\n $dirs[] = $dir;\n }\n while (($p = array_pop($dirs)) !== NULL) {\n mkdir($p, 0777);\n }\n }\n\n /**\n * Crean cache\n */\n public function clean()\n {\n if (! $this->flag) { return; }\n $path = $this->basepath();\n $real = realpath($path);\n $rlen = strlen($real);\n $dirs = array($real);\n for (;;) {\n // infinity of loop\n $dir = rtrim(array_shift($dirs), DS) . DS;\n if (is_dir($dir)) {\n $res = glob($dir . '*');\n $cnt = count($res);\n foreach ($res as $p) {\n if (is_dir($p)) {\n $dirs[] = $p;\n } elseif (! $this->valid($p)) {\n // clean\n unlink($p);\n $cnt--;\n }\n }\n if ($cnt === 0 && $real !== realpath($dir)) {\n rmdir($dir);\n if ($real !== ($parent = dirname($dir)) && $rlen < strlen($parent)) {\n // add parent dir, to be continued under $real dir\n $dirs[] = $parent;\n }\n }\n }\n if (empty($dirs)) {\n // done and break loop\n break;\n }\n }\n }\n\n /**\n * Check vaild cache or not\n */\n private function valid($path)\n {\n return (is_readable($path) && (time() - filemtime($path)) < $this->limit);\n }\n\n /**\n * exists\n */\n public function exist($word)\n {\n $path = $this->filepath($word);\n return $this->valid($path);\n }\n\n /**\n * Get data from cache\n */\n public function pull($word)\n {\n if (! $this->flag) { return; }\n $path = $this->filepath($word);\n if ($this->valid($path)) {\n return unserialize(file_get_contents($path));\n } else {\n return FALSE;\n }\n }\n\n /**\n * Put data to cache\n */\n public function push($word, $data)\n {\n if (! $this->flag) { return; }\n $pre = umask();\n umask(0);\n $path = $this->filepath($word);\n $this->prepare($path);\n if (($fp = fopen($path, 'w')) !== FALSE) {\n flock($fp, LOCK_EX);\n fwrite($fp, serialize($data));\n flock($fp, LOCK_UN);\n chmod($path, 0666);\n }\n fclose($fp);\n umask($pre);\n }\n\n /**\n * Automatic cache action\n */\n public function auto($word, $func)\n {\n if (! $this->flag) { return; }\n if (($res = $this->pull($word)) === FALSE) {\n $res = $func($this);\n if (! is_null($res)) {\n $this->push($word, $res);\n }\n }\n return $res;\n }\n\n}",
"public function treeUp(): PathCollection\n {\n $oCurrent = clone $this;\n $oPathCollection = new PathCollection();\n $oPathCollection->add($oCurrent);\n while (true)\n {\n if (in_array(\"{$oCurrent}\", [\n \".\",\n \"/\"\n ]))\n {\n return $oPathCollection;\n }\n $oCurrent = $oCurrent->dirname(1);\n $oPathCollection->add($oCurrent);\n }\n\n }",
"private function updatePath($id)\n {\n /* @var $model BookCategories */\n $model = BookCategories::model()->findByPk($id);\n if ($model->parent) {\n $path = $model->parent->path ? $model->parent->path . $model->parent_id . '-' : $model->parent_id . '-';\n BookCategories::model()->updateByPk($model->id, array('path' => $path));\n }\n foreach ($model->childs as $child)\n $this->updatePath($child->id);\n }",
"public function cacheRefresh()\n {\n // we refresh the cache of the tree Chart page.\n $this->cacheTreeChartPageRefresh();\n // we get the current page.\n $page = $this->getCurrentPage();\n if (!is_null($page) && !is_null($this->translations[$page->getId()])) {\n foreach ($this->translations[$page->getId()] as $translation) {\n // we get the lang page\n $lang_page = $translation->getLangCode()->getId();\n // we create the cache name\n $referer_url = $this->container->get('bootstrap.RouteTranslator.factory')->getRefererRoute($lang_page, null, true);\n $referer_url = str_replace($this->container->get('request')->getUriForPath(''), '', $referer_url);\n $name_page = $this->createEtag('page', $page->getId(), $lang_page, array('page-url'=>$referer_url));\n $name_page = str_replace('//', '/', $name_page);\n if (isset($this->widgets[$page->getId()]) && is_array($this->widgets[$page->getId()])) {\n foreach ($this->widgets[$page->getId()] as $key_block=>$widgets) {\n if (isset($this->widgets[$page->getId()][$key_block]) && is_array($this->widgets[$page->getId()][$key_block])) {\n foreach ($this->widgets[$page->getId()][$key_block] as $key_widget => $widget) {\n// print_r($this->container->get('request')->getLocale());\n// print_r(' - id : ' . $widget->getId());\n// print_r(' - plugin : ' . $widget->getPlugin());\n// print_r(' - action : ' . $widget->getAction());\n// print_r('<br />'); \n // we create the cache name of the widget\n $Etag_widget = 'widget:'.$widget->getId().':'.$lang_page;\n // we refesh only if the widget is in cash.\n $this->cacheRefreshByname($Etag_widget);\n //print_r('<br />');print_r('<br />');\n \n $params_transwidget = json_encode(array('widget-id'=>$widget->getId()), JSON_UNESCAPED_UNICODE);\n // we manage the \"transwidget\"\n $widget_translations = $this->getWidgetManager()->setWidgetTranslations($widget);\n if (is_array($widget_translations)) {\n foreach ($widget_translations as $translang => $translationWidget) {\n // we create the cache name of the transwidget\n $Etag_transwidget = 'transwidget:'.$translationWidget->getId().':'.$translang.':'.$params_transwidget;\n // we refresh the cache of the transwidget\n $this->cacheRefreshByname($Etag_transwidget);\n }\n }\n // If the widget is a \"content snippet\"\n if ( ($widget->getPlugin() == 'content') && ($widget->getAction() == 'snippet') ) {\n $xmlConfig = $widget->getConfigXml();\n // if the configXml field of the widget is configured correctly.\n try {\n $xmlConfig = new \\Zend_Config_Xml($xmlConfig);\n if ($xmlConfig->widgets->get('content')) {\n $id_snippet = $xmlConfig->widgets->content->id;\n // we create the cache name of the snippet\n $Etag_snippet = 'transwidget:'.$id_snippet.':'.$lang_page.':'.$params_transwidget;\n // we refresh the cache of the snippet\n $this->cacheRefreshByname($Etag_snippet);\n }\n } catch (\\Exception $e) {\n }\n }\n \n $path_json_file = $this->createJsonFileName('widget', $widget->getId(), $lang_page);\n \t\tif (file_exists($path_json_file)) {\n \t\t $info = explode('|', file_get_contents($path_json_file));\n \t\t $this->cacheRefreshByname($info[1]);\n \t\t //print_r($info[1]);\n \t\t //print_r('<br />');print_r('<br />');\n \t\t \n \t\t}\n \n \n// // If the widget is a tree a \"jqext\"\n// if ( ($widget->getPlugin() == 'content') && ($widget->getAction() == 'jqext') ) {\n// $xmlConfig = $widget->getConfigXml();\n// // if the configXml field of the widget is configured correctly.\n// try {\n// $xmlConfig = new \\Zend_Config_Xml($xmlConfig);\n// if ($xmlConfig->widgets->get('content') && $xmlConfig->widgets->content->get('controller') && $xmlConfig->widgets->content->get('params')) {\n// $controller = $xmlConfig->widgets->content->controller;\n// $params = $xmlConfig->widgets->content->params->toArray();\n// if ($xmlConfig->widgets->content->params->get('cachable')) {\n// $params['cachable'] = $xmlConfig->widgets->content->params->cachable;\n// } else {\n// $params['cachable'] = 'true';\n// } \n// $params['widget-id'] = $widget->getId();\n// $params['widget-lifetime'] = $widget->getLifetime();\n// $params['widget-cacheable'] = strval($widget->getCacheable());\n// $params['widget-update'] = $widget->getUpdatedAt()->getTimestamp();\n// $params['widget-public'] = strval($widget->getPublic());\n// $values = explode(':', $controller);\n// $JQcontainer= strtoupper($values[0]);\n// $JQservice = strtolower($values[1]); \n// // we sort an array by key in reverse order\n// $this->container->get('pi_app_admin.array_manager')->recursive_method($params, 'krsort');\n// // we create de Etag cache\n// //$params = $this->container->get('pi_app_admin.string_manager')->json_encodeDecToUTF8($params);\n// $params = $this->paramsEncode($params);\n// $id = $this->_Encode(\"$JQcontainer~$JQservice\", false);\n// $Etag_jqext = $widget->getAction() . \":$id:$lang_page:$params\"; \n// \t// we refesh only if the widget is in cash.\n// \t$this->cacheRefreshByname($Etag_jqext);\n// }\n// } catch (\\Exception $e) {\n// }\n// } \n// // If the widget is a \"gedmo snippet\"\n// if ( ($widget->getPlugin() == 'gedmo') && ($widget->getAction() == 'snippet') ) {\n// $xmlConfig = $widget->getConfigXml();\n// $new_widget = null; \n// // if the configXml field of the widget is configured correctly.\n// try {\n// $xmlConfig = new \\Zend_Config_Xml($xmlConfig);\n// if ($xmlConfig->widgets->get('gedmo')) {\n// $id_snippet = $xmlConfig->widgets->gedmo->id;\n// // we create the cache name of the snippet\n// $Etag_snippet = 'widget:'.$id_snippet.':'.$lang_page; \n// // we refresh the cache of the snippet\n// $this->cacheRefreshByname($Etag_snippet); \n// // we allow to refresh the cache of the widget of the snippet\n// $new_widget = $this->getWidgetById($id_snippet);\n// }\n// } catch (\\Exception $e) {\n// } \n// if (!is_null($new_widget) && ($new_widget instanceof Widget) ) {\n// $widget = $new_widget;\n// }\n// } \n\n// // print_r($this->container->get('request')->getLocale());\n// // print_r(' - id : ' . $widget->getId());\n// // print_r(' - plugin : ' . $widget->getPlugin());\n// // print_r(' - action : ' . $widget->getAction());\n// // print_r('<br />'); \n \n// // If the widget is a search lucene\n// if ( ($widget->getPlugin() == 'search') && ($widget->getAction() == 'lucene') ) {\n// \t$xmlConfig = $widget->getConfigXml();\n// \t// if the configXml field of the widget is configured correctly.\n// \ttry {\n// \t\t$xmlConfig = new \\Zend_Config_Xml($xmlConfig);\n// \t\tif ($xmlConfig->widgets->get('search') && $xmlConfig->widgets->search->get('controller') && $xmlConfig->widgets->search->get('params') ) {\n// \t\t $controller = $xmlConfig->widgets->search->controller;\n// if ($xmlConfig->widgets->search->params->get('cachable')) {\n// $params['cachable'] = $xmlConfig->widgets->search->params->cachable;\n// } else {\n// $params['cachable'] = 'true';\n// }\n// if ($xmlConfig->widgets->search->params->get('template')) {\n// $params['template'] = $xmlConfig->widgets->search->params->template;\n// } else {\n// $params['template'] = \"\";\n// }\n// if ($xmlConfig->widgets->search->params->get('MaxResults')) {\n// $params['MaxResults'] = $xmlConfig->widgets->search->params->MaxResults;\n// } else {\n// $params['MaxResults'] = 0; \n// }\n// $params['widget-id'] = $widget->getId();\n// $params['widget-lifetime'] = $widget->getLifetime();\n// $params['widget-cacheable'] = strval($widget->getCacheable());\n// $params['widget-update'] = $widget->getUpdatedAt()->getTimestamp();\n// $params['widget-public'] = strval($widget->getPublic());\n// \t\t if ($xmlConfig->widgets->search->params->get('lucene')) { \n// $params = array_merge($params, $xmlConfig->widgets->search->params->lucene->toArray()); \n// $values = explode(':', $controller);\n// $JQcontainer = strtoupper($values[0]);\n// $JQservice = strtolower($values[1]);\n// // we sort an array by key in reverse order\n// $this->container->get('pi_app_admin.array_manager')->recursive_method($params, 'krsort');\n// // we create de Etag cache\n// //$params = $this->container->get('pi_app_admin.string_manager')->json_encodeDecToUTF8($params);\n// $params = $this->paramsEncode($params);\n// $id = $this->_Encode(\"$JQcontainer~$JQservice\", false);\n// $Etag_searchlucene = $widget->getAction() . \":$id:$lang_page:$params\";\n// // we refesh only if the widget is in cash.\n// $this->cacheRefreshByname($Etag_searchlucene);\n// } \n// \t\t}\n// \t} catch (\\Exception $e) {\n// }\n// }\n \n// // If the widget is a \"listener\"\n// if ( ($widget->getPlugin() == 'gedmo') && ($widget->getAction() == 'listener') ) {\n// $xmlConfig = $widget->getConfigXml();\n// // if the configXml field of the widget is configured correctly.\n// try {\n// $xmlConfig = new \\Zend_Config_Xml($xmlConfig);\n// if ($xmlConfig->widgets->get('gedmo') && $xmlConfig->widgets->gedmo->get('controller') && $xmlConfig->widgets->gedmo->get('params')) {\n// $controller = $xmlConfig->widgets->gedmo->controller;\n// $params = $xmlConfig->widgets->gedmo->params->toArray();\n// //\n// if ($xmlConfig->widgets->gedmo->params->get('cachable')) {\n// $params['cachable'] = $xmlConfig->widgets->gedmo->params->cachable;\n// } else {\n// $params['cachable'] = 'true';\n// }\n// $params['widget-id'] = $widget->getId();\n// $params['widget-lifetime'] = $widget->getLifetime();\n// $params['widget-cacheable'] = strval($widget->getCacheable());\n// $params['widget-update'] = $widget->getUpdatedAt()->getTimestamp();\n// $params['widget-public'] = strval($widget->getPublic());\n// // we sort an array by key in reverse order\n// $this->container->get('pi_app_admin.array_manager')->recursive_method($params, 'krsort');\n// // we create de Etag cache\n// //$params = $this->container->get('pi_app_admin.string_manager')->json_encodeDecToUTF8($params);\n// $params = $this->paramsEncode($params);\n// $id = $this->_Encode($controller, false);\n// $Etag_listener = $widget->getAction() . \":$id:$lang_page:$params\";\n// //print_r($Etag_listener);\t \n// //print_r(\"<br/><br/>\");\n// // we refesh only if the widget is in cash.\n// \t$this->cacheRefreshByname($Etag_listener);\n// }\n// } catch (\\Exception $e) {\n// } \n// } \n// // If the widget is a \"tree\"\n// if ( ($widget->getPlugin() == 'gedmo') && (($widget->getAction() == 'navigation') || ($widget->getAction() == 'organigram')) ) {\n// $xmlConfig = $widget->getConfigXml();\n// // if the configXml field of the widget is configured correctly.\n// try {\n// $xmlConfig = new \\Zend_Config_Xml($xmlConfig);\n// if ($xmlConfig->widgets->get('gedmo') && $xmlConfig->widgets->gedmo->get('controller') && $xmlConfig->widgets->gedmo->get('params')) {\n// $values = explode(':', $xmlConfig->widgets->gedmo->controller);\n// $entity = $values[0] . ':' . $values[1];\n// $method = strtolower($values[2]);\n// $params = array();\n// // \n// if ($xmlConfig->widgets->gedmo->params->get('category')) {\n// $category = $xmlConfig->widgets->gedmo->params->category;\n// } else {\n// $category = \"\";\n// }\n// if ($xmlConfig->widgets->gedmo->params->get('node')) {\n// $params['node'] = $xmlConfig->widgets->gedmo->params->node;\n// } else {\n// $params['node'] = \"\";\n// }\n// if ($xmlConfig->widgets->gedmo->params->get('enabledonly')) {\n// $params['enabledonly'] = $xmlConfig->widgets->gedmo->params->enabledonly;\n// } else {\n// $params['enabledonly'] = \"true\";\n// }\n// if ($xmlConfig->widgets->gedmo->params->get('cachable')) {\n// $params['cachable'] = $xmlConfig->widgets->gedmo->params->cachable;\n// } else {\n// $params['cachable'] = 'true';\n// }\n// if ($xmlConfig->widgets->gedmo->params->get('template')) {\n// $template = $xmlConfig->widgets->gedmo->params->template;\n// } else {\n// $template = \"\";\n// }\n// $params['entity'] = $entity;\n// $params['category'] = $category;\n// $params['template'] = $template;\n// $params['widget-id'] = $widget->getId();\n// $params['widget-lifetime'] = $widget->getLifetime();\n// $params['widget-cacheable'] = strval($widget->getCacheable());\n// $params['widget-update'] = $widget->getUpdatedAt()->getTimestamp();\n// $params['widget-public'] = strval($widget->getPublic());\n// //\n// if ($xmlConfig->widgets->gedmo->params->get('navigation')) { \n// if ($xmlConfig->widgets->gedmo->params->navigation->get('separatorClass')) {\n// $params['separatorClass'] = $xmlConfig->widgets->gedmo->params->navigation->separatorClass;\n// } else {\n// $params['separatorClass'] = \"\";\n// } \n// if ($xmlConfig->widgets->gedmo->params->navigation->get('separatorText')) {\n// $params['separatorText'] = $xmlConfig->widgets->gedmo->params->navigation->separatorText;\n// } else {\n// $params['separatorText'] = \"\";\n// }\n// if ($xmlConfig->widgets->gedmo->params->navigation->get('separatorFirst')) {\n// $params['separatorFirst'] = $xmlConfig->widgets->gedmo->params->navigation->separatorFirst;\n// } else {\n// $params['separatorFirst'] = \"false\";\n// } \n// if ($xmlConfig->widgets->gedmo->params->navigation->get('separatorLast')) {\n// $params['separatorLast'] = $xmlConfig->widgets->gedmo->params->navigation->separatorLast;\n// } else {\n// $params['separatorLast'] = \"false\";\n// }\n// if ($xmlConfig->widgets->gedmo->params->navigation->get('ulClass')) {\n// $params['ulClass'] = $xmlConfig->widgets->gedmo->params->navigation->ulClass;\n// } else {\n// $params['ulClass'] = \"\";\n// }\n// if ($xmlConfig->widgets->gedmo->params->navigation->get('liClass')) {\n// $params['liClass'] = $xmlConfig->widgets->gedmo->params->navigation->liClass;\n// } else {\n// $params['liClass'] = \"\";\n// }\n// if ($xmlConfig->widgets->gedmo->params->navigation->get('counter')) {\n// $params['counter'] = $xmlConfig->widgets->gedmo->params->navigation->counter;\n// } else {\n// $params['counter'] = \"\";\n// }\n// if ($xmlConfig->widgets->gedmo->params->navigation->get('routeActifMenu')) {\n// $params['routeActifMenu'] = $xmlConfig->widgets->gedmo->params->navigation->routeActifMenu->toArray();\n// }\n// if ($xmlConfig->widgets->gedmo->params->navigation->get('lvlActifMenu')) {\n// $params['lvlActifMenu'] = $xmlConfig->widgets->gedmo->params->navigation->lvlActifMenu->toArray();\n// }\n// } elseif ($xmlConfig->widgets->gedmo->params->get('organigram')) { \n// if ($xmlConfig->widgets->gedmo->params->organigram->get('params'))\n// $params = array_merge($params, $xmlConfig->widgets->gedmo->params->organigram->params->toArray());\n \n// if ($xmlConfig->widgets->gedmo->params->organigram->get('fields') && $xmlConfig->widgets->gedmo->params->organigram->fields->get('field'))\n// {\n// $params['fields'] = $xmlConfig->widgets->gedmo->params->organigram->fields->field->toArray();\n// }\n// } \n// // we sort an array by key in reverse order\n// $this->container->get('pi_app_admin.array_manager')->recursive_method($params, 'krsort');\n// // we create de Etag cache\n// //$params = $this->container->get('pi_app_admin.string_manager')->json_encodeDecToUTF8($params);\n// $params = $this->paramsEncode($params);\n// $entity = stripslashes($this->_Encode($entity, false));\n// $id = $this->_Encode(\"$entity~$method~$category\", false);\n// $Etag_tree = $widget->getAction() . \":$id:$lang_page:$params\";\n// // we refesh only if the widget is in cash.\n// \t$this->cacheRefreshByname($Etag_tree);\n// \t//print_r($Etag_tree);\n// \t//print_r(\"<br/><br/>\");\n// }\n// } catch (\\Exception $e) {\n// }\n// } \n// // If the widget is a \"slider\"\n// if ( ($widget->getPlugin() == 'gedmo') && ($widget->getAction() == 'slider') ) {\n// $xmlConfig = $widget->getConfigXml();\n// // if the configXml field of the widget is configured correctly.\n// try {\n// $xmlConfig = new \\Zend_Config_Xml($xmlConfig);\n// if ($xmlConfig->widgets->get('gedmo') && $xmlConfig->widgets->gedmo->get('controller') && $xmlConfig->widgets->gedmo->get('params')) {\n// $values = explode(':', $xmlConfig->widgets->gedmo->controller);\n// $entity = $values[0] . ':' . $values[1];\n// $method = strtolower($values[2]);\n// $params = array();\n// // \n// if ($xmlConfig->widgets->gedmo->params->get('category')) {\n// $category = $xmlConfig->widgets->gedmo->params->category;\n// } else {\n// $category = \"\";\n// } \n// if ($xmlConfig->widgets->gedmo->params->get('template')) {\n// $template = $xmlConfig->widgets->gedmo->params->template;\n// } else {\n// $template = \"\";\n// } \n// $params = array();\n// if ($xmlConfig->widgets->gedmo->params->get('slider')) { \n// $params = $xmlConfig->widgets->gedmo->params->slider->toArray();\n// $params['entity'] = $entity;\n// $params['category'] = $category;\n// $params['template'] = $template;\n// $params['widget-id'] = $widget->getId();\n// $params['widget-lifetime'] = $widget->getLifetime();\n// $params['widget-cacheable'] = strval($widget->getCacheable());\n// $params['widget-update'] = $widget->getUpdatedAt()->getTimestamp();\n// $params['widget-public'] = strval($widget->getPublic());\n// \t\t\t\t\t\t\t\t\t\t\t\t// \n// if ($xmlConfig->widgets->gedmo->params->get('cachable')) {\n// $params['cachable'] = $xmlConfig->widgets->gedmo->params->cachable;\n// } else {\n// $params['cachable'] = 'true';\n// } \n// if ($xmlConfig->widgets->gedmo->params->slider->get('params')) {\n// $params['params'] = $xmlConfig->widgets->gedmo->params->slider->params->toArray();\n// }\n// if (!isset($params['action']) || empty($params['action'])) {\n// $params['action'] = 'renderDefault';\n// }\n// if (!isset($params['menu']) || empty($params['menu'])) {\n// $params['menu'] = 'entity';\n// }\n// } \n// // we sort an array by key in reverse order\n// $this->container->get('pi_app_admin.array_manager')->recursive_method($params, 'krsort');\n// // we create de Etag cache\n// //$params = $this->container->get('pi_app_admin.string_manager')->json_encodeDecToUTF8($params);\n// $params = $this->paramsEncode($params);\n// $entity = stripslashes($this->_Encode($entity, false));\n// $id = $this->_Encode(\"$entity~$method~$category\", false);\n// $Etag_slider = $widget->getAction() . \":$id:$lang_page:$params\";\n// // we refesh only if the widget is in cash.\n// \t$this->cacheRefreshByname($Etag_slider);\n// }\n// } catch (\\Exception $e) {\n// } \n// } \n\n }\n }\n }\n }\n // we refesh only if the widget is in cash.\n \t$this->cacheRefreshByname($name_page);\n \t//print_r('<br />');print_r('<br />');\n }\n }\n //exit;\n }",
"public function rebuild($rootNodeId);",
"protected function getPathNodes()\n\t{\n\t\tif (!$this->varValue)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (!is_array($this->varValue))\n\t\t{\n\t\t\t$this->varValue = array($this->varValue);\n\t\t}\n\n\t\tforeach ($this->varValue as $id)\n\t\t{\n\t\t\t$arrPids = $this->getParentRecords($id, 'tl_files');\n\t\t\tarray_shift($arrPids); // the first element is the ID of the page itself\n\t\t\t$this->arrNodes = array_merge($this->arrNodes, $arrPids);\n\t\t}\n\t}",
"public function cacheUpdate()\n\t{\n\t\t$this->cacheUpdateReceipts();\n\t\t$this->cacheUpdateComments();\n\t}",
"abstract public function refreshCache();",
"protected function updateCache($path, $stat) {\n\t\t$stat = parent::updateCache($path, $stat);\n\t\tif ($stat && 'directory' !== $stat['mime']) {\n\t\t\tif (0 === strpos($path, XOOPS_TRUST_PATH)) {\n\t\t\t\t$stat['_localpath'] = str_replace(XOOPS_ROOT_PATH, 'T', $path );\n\t\t\t} else {\n\t\t\t\t$stat['_localpath'] = str_replace(XOOPS_ROOT_PATH, 'R', $path );\n\t\t\t}\n\t\t}\n\t\treturn $this->cache[$path] = $stat;\n\t}",
"public function afterUpdateTree() {\n\t\tCache::clear(false, CAKE_LDAP_CACHE_KEY_TREE_EMPLOYEES);\n\t}",
"public function generate()\n {\n $this->allPaths = array();\n\n foreach ($this->tree as $key => $node) {\n $this->treeWalk($node);\n }\n return;\n }",
"public function update($object) {\n\t\t$uow = $this->entityManager->getUnitOfWork();\n\t\t$originalEntityData = $uow->getOriginalEntityData($object);\n\t\t$this->parentUpdate($object);\n\t\t$this->updateDocuments($object);\n\n\t\tif ($originalEntityData['path'] !== $object->getPath()) {\n\t\t\t$childs = $this->findByPathHead($originalEntityData['path']);\n\t\t\tforeach ($childs AS $category) {\n\t\t\t\t$replacedPath = $this->pathService->replacePath($category->getPath(), $originalEntityData['path'], $object->getPath());\n\t\t\t\t$category->setPath($replacedPath);\n\t\t\t\t$this->parentUpdate($category);\n\t\t\t\t$this->updateDocuments($category);\n\t\t\t}\n\t\t}\n\t}",
"static private function _assembleTagTree() {\n\t\t$tagsData = self::_retrieveTagData();\n\n\t\t// reformat the array to name => data\n\t\tforeach ($tagsData as $index => $tagData) {\n\t\t\t$tagsData[$tagData['name']] = $tagData;\n\t\t\tunset($tagsData[$index]);\n\t\t}\n\t\tforeach ($tagsData as $name => $tagData) {\n\t\t\tself::$_upTree[$name] = self::_findRootPath($name, $tagsData);\n\t\t}\n\t}",
"public function updateTreeData()\n\t{\n\t\t$app = JFactory::getApplication();\n\t\t$postData = $app->input->post;\n\t\t$orderNumber=$postData->get('orderNumber', '', 'string');\n\t\t$orderPass=$postData->get('orderPass', '', 'string');\n\t\t$treeData =$postData->get('treeData', '', 'string');\n\t\t$db = JFactory::getDBO();\n\t\t$encodeString = $treeData;\n\t\t$query=\"insert into `#__familytree_tree_data`(`Order_Number`,`Order_Pass`,`Tree_Data`) values('$orderNumber','$orderPass','$encodeString') ON DUPLICATE KEY UPDATE `Tree_Data`='$encodeString'\";\n\t\t$result = $db->setQuery($query)->query();\n\t\treturn $result;\n\t}"
] | [
"0.59941256",
"0.5434759",
"0.5328558",
"0.5263462",
"0.5223872",
"0.51648724",
"0.5061822",
"0.50583535",
"0.500806",
"0.4987514",
"0.49187416",
"0.49160796",
"0.4862289",
"0.48589116",
"0.48572487",
"0.48507",
"0.4788318",
"0.47768295",
"0.47636214",
"0.47562027",
"0.47310838",
"0.47304899",
"0.471299",
"0.4700125",
"0.4668059",
"0.46630013",
"0.46615985",
"0.46475682",
"0.46315515",
"0.46165463"
] | 0.5694145 | 1 |
Check if portal is installed | private function isPortalInstalled()
{
$packageList = json_decode(\File::get(base_path('vendor/composer/installed.json')));
$package = array_first($packageList, function ($key, $package) {
return preg_match("/^elms\/[a-z0-9]+-fe$/", $package->name);
});
$this->portalPackage = $package;
return !is_null($package);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isInstalled();",
"public function isInstalled();",
"public function displayIsInstalled();",
"public static function isPortalMustNotBeLoaded()\n\t{\n\t\tglobal $context, $modSettings;\n\n\t\tif (!defined('LP_NAME') || !empty($context['uninstalling']) || Helpers::request()->is('printpage')) {\n\t\t\t$modSettings['minimize_files'] = 0;\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public static function can_install()\n {\n return (self::has_permalinks() && self::php());\n }",
"function scrollon_is_installed()\n{\n\treturn scrollonGetSettingsGroup();\n}",
"protected function installed(): bool\n {\n return $this->cli->powershell('Get-Service -Name \"AcrylicDNSProxySvc\"')->isSuccessful();\n }",
"function onInstall() {\n\t\tglobal $conf;\n\t\treturn $conf['services']['web'] == true;\n\t}",
"function is_installed() {\n\t\t\t\n\t\t\tglobal $CONFIG;\n\t\t\treturn datalist_get('installed');\n\t\t\t\n\t\t}",
"function checkInstall() {\n if (file_exists($this->_addon . \"install.php\"))\n return true;\n }",
"public function isInstalled()\n {\n return false;\n }",
"public function isInstalled()\n {\n return $this->exists();\n }",
"public function installed(): bool;",
"public function isInstalled()\n {\n return $this->filesystem()->exists($this->licensePath());\n }",
"function checkInstall() {\n\tif ((getOption('zenphoto_release') != ZENPHOTO_RELEASE) ||\n\t\t\t(defined('RELEASE') && (getOption('zenphoto_install') != installSignature()))) {\n\t\tif (file_exists(dirname(__FILE__).'/setup.php')) {\n\t\t\theader(\"Location: \" . FULLWEBPATH . \"/\" . ZENFOLDER . \"/setup.php\");\n\t\t\texit();\n\t\t} else {\n\t\t\tdie('setup scripts missing');\n\t\t}\n\t}\n}",
"public function isDashboardInstalled() {\n\t\t//check if this is new\n\t\tif ( class_exists( 'WPMUDEV_Dashboard' ) ) {\n\t\t\treturn \\WPMUDEV_Dashboard::$version;\n\t\t}\n\n\t\treturn false;\n\t}",
"function bbp_is_install()\n{\n}",
"private function isInstalled()\n {\n return file_exists('App/Config/installation.cfg');\n }",
"function expmanager_is_installed()\n{\n\tglobal $db;\n\n\tif ($db->field_exists(\"expmanage_canSubmit\", \"forums\") && $db->table_exists('expsubmissions') && $db->table_exists('expcategories')) {\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}",
"function onInstall() {\n\t\tglobal $conf;\n\n\t\tif($conf['services']['web'] == true) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}",
"public function isInstalled()\n {\n return file_exists(dirname(\\pm_Context::getPlibDir()) . '/' . $this->extensionId);\n }",
"function isInstalled() {\n $db = new DB(\"addons\");\n $db->select(\"addon_name = '\" . $db->escape($this->_name) . \"' and addon_installed = '1'\");\n if ($db->numRows())\n return true;\n }",
"public function isInstalled()\n {\n $db = db_init();\n $qry = \"SELECT 1 FROM system WHERE entry ='module' AND value = '$this->module';\";\n $result = $db->query($qry);\n if (! $result)\n return FALSE;\n $found = $result->fetch_row();\n return $found[0];\n }",
"private function isWordpressInstalled(): bool\n {\n return $this->runWpCliCommand('core', 'is-installed', [], $output, $error);\n }",
"public function isInstalledInSubDir()\n {\n // Compare names without scheme (http/https) to bypass case where siteurl and home are stored with different schemes in database\n // This happens much more often than you expect\n $siteurl = preg_replace('#^https?://#', '', rtrim(get_option('siteurl'), '/'));\n $home = preg_replace('#^https?://#', '', rtrim(get_option('home'), '/'));\n\n return $home !== $siteurl;\n }",
"public static function isInstalled (\n\t)\t\t\t// <bool> TRUE if successfully installed, FALSE if not.\n\t\n\t// $plugin->isInstalled();\n\t{\n\t\t// Make sure the newly installed tables exist\n\t\t$pass = DatabaseAdmin::columnsExist(\"analytics_page_views\", array(\"timestamp_interval\", \"url_path\", \"visits\"));\n\t\t$pass2 = DatabaseAdmin::columnsExist(\"analytics_custom_trackers\", array(\"timestamp_interval\", \"custom_tracker\", \"visits\"));\n\t\t\n\t\treturn ($pass and $pass2);\n\t}",
"public static function is_installed() {\n return function_exists('init_woocommerce_memberships');\n }",
"public function is_installed() {\n return true;\n }",
"public function is_installed()\n {\n return function_exists('_wp_user_avatars') || function_exists('get_simple_local_avatar');\n }",
"public function hasInstallments();"
] | [
"0.72321457",
"0.72321457",
"0.7044305",
"0.69622284",
"0.6837403",
"0.67733747",
"0.67552173",
"0.67213506",
"0.6634525",
"0.6607442",
"0.6579638",
"0.65751237",
"0.6573452",
"0.64537746",
"0.6435455",
"0.6435162",
"0.6420641",
"0.6406569",
"0.6395161",
"0.6356167",
"0.6350698",
"0.63474154",
"0.6318641",
"0.63158524",
"0.62993425",
"0.6293625",
"0.628204",
"0.6272535",
"0.62496704",
"0.62397444"
] | 0.83498657 | 0 |
Method which executes `InstallDependencies` symfony command to resolve and install the dependencies | private function resolveDependencies()
{
$console_app = $this->getApplication();
$console_app->add(new InstallDependencies());
$command = $this->getApplication()->find('portal:install-dependencies');
$arguments = [
'path' => "vendor/" . $this->portalPackage->name,
'production' => $this->option('p')
];
$inputArgs = new ArrayInput($arguments);
$command->run($inputArgs, $this->output);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function install()\n {\n $command = 'install';\n $this->run($command);\n }",
"private function installVendors(){\n echo \"Vendors installation...\\n\\n\";\n\n exec('composer install');\n\n echo \"Node modules installation...\\n\\n\";\n\n exec('npm install');\n\n $this->initEnv();\n }",
"public function installAssets()\n {\n $kernel = $this->container->get('kernel');\n $application = new Application($kernel);\n $application->setAutoExit(false);\n $input = new ArrayInput([\n 'command' => 'assets:install'\n ]);\n $output = new NullOutput();\n $application->run($input, $output);\n }",
"public function install() {}",
"public function install() { }",
"public function install()\n {\n $this->environment->install();\n }",
"public function install();",
"public function install();",
"public function install();",
"public function install();",
"abstract public function install();",
"abstract public function install();",
"public function install() {\n \n }",
"function install() {}",
"protected function installMigration()\n {\n $this->log('Set all migration as executed ..');\n\n $application = $this->getApplication();\n $commandInput = new ArrayInput(array(\n 'command' => 'doctrine:migration:version',\n '--add' => true,\n '--all' => true\n ));\n // Replace --no-interaction option which only work on CLI mode\n $commandInput->setInteractive(false);\n $application->doRun($commandInput, $this->output);\n\n $this->log('Set all migration as executed done..');\n }",
"public static function install(){\n\t}",
"public function install()\n {\n // leave this empty\n }",
"public function install($force = false);",
"public function installPackages(): Response\n {\n return $this->rawCommand('install');\n }",
"public function install()\n\t{\n\t}",
"public static function install();",
"abstract public static function install();",
"abstract public function install(): void;",
"protected function load_dependencies() {}",
"protected function install() {\n $this->installVendor();\n $this->installEnv();\n $this->compileSass();\n $this->owner();\n\n if ($this->prod) {\n $this->compileView();\n }\n }",
"public function test_deploy_called_installRequirements()\n {\n $command_requirements = new Command('ansible-galaxy install -r '.self::PLAYBOOK_FOLDER.'/requirements.yml');\n $command_deploy = new Command('ansible-playbook -i '.self::PLAYBOOK_FOLDER.'/'.self::ENVIRONMENT.' '.self::PLAYBOOK_FOLDER.'/deploy.yml');\n $exec_double = $this->prophesize('AdamBrett\\ShellWrapper\\Runners\\Exec');\n $exec_double->run($command_requirements)->shouldBeCalled();\n $exec_double->run($command_deploy)->shouldBeCalled();\n $sut = new DeployService(self::ENVIRONMENT, self::PLAYBOOK_FOLDER, $exec_double->reveal());\n $sut->deploy('master');\n }",
"public function manualInstallationAction() {\n\t\t$this->writeMergedComposerJson();\n\t\t$this->assignViewVariables();\n\t}",
"function install () {\r\n\r\n }",
"public static function install(): void\n {\n static::info('');\n static::info('Starts the activitylog preset installation');\n\n static::info('Run composer and artisan commands');\n shell_exec('composer require spatie/laravel-activitylog -q -n');\n shell_exec('php artisan vendor:publish --provider=\"Spatie\\Activitylog\\ActivitylogServiceProvider\" --tag=\"config\" -q');\n shell_exec('php artisan vendor:publish --provider=\"Spatie\\Activitylog\\ActivitylogServiceProvider\" --tag=\"migrations\" -q');\n shell_exec('php artisan migrate -q');\n }",
"function buildProjectDependencies()\n {\n $this->envVariables->required(['DB_HOST', 'DB_NAME', 'DB_USER', 'DB_PASS']);\n\n $this->taskNpmInstall()->run();\n\n $this->taskWriteToFile(self::BASE_DIR . '/web/typo3conf/conf.d/DatabaseCredentials.php')\n ->line('<?php')\n ->line('$GLOBALS[\\'TYPO3_CONF_VARS\\'][\\'DB\\'][\\'host\\'] = \\'' . getenv('DB_HOST') . '\\';')\n ->line('$GLOBALS[\\'TYPO3_CONF_VARS\\'][\\'DB\\'][\\'database\\'] = \\'' . getenv('DB_NAME') . '\\';')\n ->line('$GLOBALS[\\'TYPO3_CONF_VARS\\'][\\'DB\\'][\\'username\\'] = \\'' . getenv('DB_USER') . '\\';')\n ->line('$GLOBALS[\\'TYPO3_CONF_VARS\\'][\\'DB\\'][\\'password\\'] = \\'' . getenv('DB_PASS') . '\\';')\n ->run();\n\n $this->taskWriteToFile(self::BASE_DIR . '/web/typo3conf/conf.d/InstallToolPassword.php')\n ->line('<?php')\n ->line('$GLOBALS[\\'TYPO3_CONF_VARS\\'][\\'BE\\'][\\'installToolPassword\\'] = md5(\\'wurst#\\');')\n ->run();\n\n if(strtolower($this->context) != 'production') {\n $this->taskReplaceInFile('web/robots.txt')\n ->from('#CONTEXT_DEPENDED_CONFIGURATION#')\n ->to('Disallow: /')\n ->run();\n }\n }"
] | [
"0.60580003",
"0.5995735",
"0.59504026",
"0.5882496",
"0.5794719",
"0.572718",
"0.5697775",
"0.5697775",
"0.5697775",
"0.5697775",
"0.5649295",
"0.5649295",
"0.56410486",
"0.5629419",
"0.56233865",
"0.556668",
"0.5549361",
"0.55464685",
"0.54914486",
"0.5457562",
"0.54421204",
"0.54290885",
"0.53873354",
"0.53568274",
"0.53491163",
"0.5343335",
"0.5336843",
"0.53213614",
"0.53126323",
"0.5290105"
] | 0.8373525 | 0 |
Echo select element for required objects section. | private function display_required_objects_select_element( string $name, array $sf_objects, string $selected_name, string $selected_id, bool $hidden = false ) {
$is_selected = false;
$class = "";
if ( $hidden ) {
$class .= "hidden";
}
?>
<select class="<?php echo $class; ?>" name="<?php echo $name; ?>">
<?php foreach( $sf_objects as $sf_object ): ?>
<option
<?php if ( $selected_id == $sf_object["id"] ): ?>
selected
<?php $is_selected = true; ?>
<?php endif; ?>
value="<?php echo $sf_object["name"] . "|" . $sf_object["label"] ."|" . $sf_object["id"]; ?>"><?php echo $sf_object["label"] . " (" . $sf_object["id"] . ")"; ?>
</option>
<?php endforeach; ?>
</select>
<?php
return $is_selected;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displaySelectBox($objs = array(), $option = array()) {\r\n\t\tglobal $vsLang;\r\n\t\t\r\n\t\t// Build select tag\n\t\t$html = '<select id=\"' . $option ['id'] . '\" style=\"width: 100%;\"';\r\n\t\t$html .= $option ['size'] ? ' size=\"' . $option ['size'] . '\"' : '';\r\n\t\t$html .= $option ['class'] ? ' class=\"' . $option ['class'] . '\"' : '';\r\n\t\t$html .= $option ['multiple'] ? ' multiple' : '';\r\n\t\t$html .= $option ['name'] ? ' name=\"' . $option ['name'] . '\"' : '';\r\n\t\t$html .= $option ['onclick'] ? ' onclick=\"' . $option ['onclick'] . '()\"' : '';\r\n\t\t$html .= '><option value=\"0\">' . $vsLang->getWords ( 'menus_option_root', \"Root\" ) . '</option>';\r\n\t\tisset ( $option ['index'] ) ? \"\" : $option ['index'] = 1;\r\n\t\t$this->buildOptionMenuTree ( $objs, &$html, $option );\r\n\t\t$html .= \"</select>\";\r\n\t\treturn $html;\r\n\t}",
"public function makeSelect(){\r\n echo \"<select name=\\\"\" .$this->getName(). \"\\\">\\n\";\r\n //Create options.\r\n $this->makeOptions($this->getValue());\r\n echo \"</select>\" ;\r\n }",
"public function getOptions()\n {\n ?>\n<strong><?php echo jgettext('Include Fields');?></strong>\n<table>\n\t<tr>\n\t\t<td><?php echo jgettext('Id');?></td>\n\t\t<td><?php echo JHTML::_('select.booleanlist', 'pack_mat_id', 'readonly; disabled=true', 1);?></td>\n\t</tr>\n\t<tr>\n\t\t<td><?php echo jgettext('Title');?></td>\n\t\t<td><?php echo JHTML::_('select.booleanlist', 'pack_mat_title', 'readonly; disabled=true', 1);?></td>\n\t</tr>\n\t<tr>\n\t\t<td><?php echo jgettext('Description');?></td>\n\t\t<td><?php echo JHTML::_('select.booleanlist', 'pack_mat_description', '', 1);?></td>\n\t</tr>\n\t<tr>\n\t\t<td><?php echo jgettext('Published');?></td>\n\t\t<td><?php echo JHTML::_('select.booleanlist', 'pack_mat_published', '', 1);?></td>\n\t</tr>\n\t<tr>\n\t\t<td><?php echo jgettext('Ordering');?></td>\n\t\t<td><?php echo JHTML::_('select.booleanlist', 'pack_mat_ordering', '', 1);?></td>\n\t</tr>\n</table>\n <?php\n EcrHtml::drawSelectName();\n EcrHtml::drawLoggingOptions();\n\n $requireds = array('element_name');\n EcrHtml::drawSubmitParts($requireds);\n }",
"function ec_print_manufacturer_select( $id ){\n\techo \"<select class=\\\"ec_editor_select_box\\\" id=\\\"\" . $id . \"\\\">\";\n\t$db = new ec_db( );\n\t$manufacturers = $db->get_manufacturer_list( );\n\tif( count( $manufacturers ) > 0 ){\n\t\techo \"<option value=\\\"0\\\">Select a Manufacturer</option>\";\n\t\tforeach( $manufacturers as $manufacturer ){\n\t\t\techo \"<option value=\\\"\" . $manufacturer->manufacturer_id . \"\\\">\" . $manufacturer->name . \"</option>\";\n\t\t}\n\t}else{\n\t\techo \"<option value=\\\"0\\\">No Manufacturers Exist</option>\";\n\t}\n\techo \"</select>\";\n}",
"function CrearSelect2($Vector){\r\n $nombre=$Vector[\"Nombre\"];\r\n $evento=$Vector[\"Evento\"];\r\n $funcion=$Vector[\"Funcion\"];\r\n if($Vector[\"Required\"]==1){\r\n $R=\"required\";\r\n }else{\r\n $R=\"\";\r\n }\r\n print(\"<select id='$nombre' $R name='$nombre' $evento='$funcion'>\");\r\n\t\t\r\n\t}",
"function professionComboBox() {\n \n $professions = getProfessions();\n\n echo <<<select\n <select class='be-custom-select'>\n <option value=\"\" disabled selected>\n Profesión\n </option>\nselect;\n\n if (Util::val($professions)) {\n foreach ($professions as $prof) {\n echo \"<option value='$prof->profession_id'>$prof->profession</option>\";\n }\n echo \"</select>\";\n } else {\n echo <<<select\n <option value=\"\" disabled>\n No hay profesiones disponibles\n </option>\n </select>\nselect;\n }\n}",
"function wp_sto_print_select($arr_data, $name, $value)\n{\n\t$print_select = \"\";\n\t$print_select.= \"<select name='$name'>\";\n\n\tforeach ($arr_data as $data) \n\t{\n\t\t$selected = $data['value'] == $value ? 'selected' : '';\n\n\t\t$print_select.= \"<option value='{$data['value']}' $selected >{$data['label']}</option>\";\n\t}\n\n\t$print_select.= \"</select>\";\n\n\techo $print_select;\n}",
"function residenceComboBox() {\n \n $residence = getResidences();\n\n echo <<<select\n <select class='be-custom-select'>\n <option value=\"\" disabled selected>\n Lugar de Residencia\n </option>\nselect;\n\n if (Util::val($residence)) {\n foreach ($residence as $res) {\n echo \"<option value='$res->residence_id'>$res->location</option>\";\n }\n echo \"</select>\";\n } else {\n echo <<<select\n <option value=\"\" disabled>\n No hay ciudades de residencia disponibles\n </option>\n </select>\nselect;\n }\n}",
"public function toString(){\n\t\t$html = '<select';\n\n\t\t$html .= $this->generateBasicProperty();\n\n\t\tif($this->multiple){\n\t\t\t$html .= ' multiple';\n\t\t}\n\n\t\t$html .= ' size=\"' . $this->size . '\"';\n\n\t\t$html .= '>';\n\n\t\tforeach($this->getOptions() as $value => $desc){\n\t\t\t$html .= '<option value=\"' . $value . '\"';\n\n\t\t\tif(in_array($value, $this->selected) && !empty($this->selected)){\n\t\t\t\t$html .= ' selected=\"selected\"';\n\t\t\t}\n\n\t\t\t$html .= '>' . $desc . '</option>';\n\t\t}\n\n\t\t$html .= '</select>';\n\n\t\treturn $html;\n\t}",
"function print_select($value) {\r\n\t\tif(isset($value['std'])) {\r\n\t\t\t$default = $value['std'];\r\n\t\t} else {\r\n\t\t\t$default = false;\r\n\t\t}\r\n\t\tif(isset($value['protected'][0][\"id\"])) {\r\n\t\t\t$protectedValue = $value['protected'][0][\"id\"];\r\n\t\t} else {\r\n\t\t\t$protectedValue = false;\r\n\t\t}\r\n\t\t\r\n\t\t$protected_value = $this->get_field_value($protectedValue, $default);\r\n\t\t\r\n\t\t\r\n\t\tif(((isset($value['protected'][0][\"id\"]) && $value['protected'][0][\"id\"]!=\"\") && $protected_value==$value['protected'][0][\"value\"]) || (!isset($value['protected'][0][\"id\"]))) {\r\n\t\t\t$input_value = $this->get_field_value($value['id'], $default);\r\n\t\t\t\r\n\t\t?>\r\n\t\t<?php if( isset($value['home']) && $value['home'] == \"yes\" ) { ?><div class=\"input-item-full-width-inside clearfix <?php if(isset($value[\"class\"])) { echo $value[\"class\"]; }?>\"><?php } else { ?>\r\n\t\t\t<div class=\"input-item-full-width clearfix <?php echo $value['class'];?>\">\r\n\t\t<?php } ?>\r\n\t\t\t<label><?php echo $value['title'];?></label>\r\n\t\t<?php\r\n\t\t\tif (isset($value['info'])) {\r\n\t\t\t\techo different_themes_info_message($value['info']);\r\n\t\t\t}\r\n\t\t?>\r\n\t\t\t<span class=\"select\">\r\n\t\t\t\t<select name=\"<?php echo $value['id'];?>\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\tforeach($value['options'] as $options) {\r\n\t\t\t\t\t\tif($input_value == $options['slug']) { $selected='selected=\"selected\"'; } else { $selected=''; }\r\n\t\t\t\t\t\techo '<option value=\"'.$options['slug'].'\" '.$selected.'>'.$options['name'].'</option>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t?>\r\n\t\t\t\t</select>\r\n\t\t\t</span>\r\n\t\t</div>\t\t\t\t\t\t\t\r\n\t\t<?php\r\n\t\r\n\r\n\t\t}\r\n\t}",
"public function display() {\n\n\t\tob_start();\n\n\t\tforeach ( $this->ordered_terms as $term ) {\n\t\t\tdev_hierarchical_taxonomy_dropdown_options( $term, $this->populate() );\n\t\t}\n\n\t\t$options = ob_get_contents();\n\n\t\tob_end_clean();\n\n\t\treturn sprintf( '<label {{label_atts}}>{{label}}</label><select {{atts}}><option value=\"\">%s</option>%s</select>', __( 'Please select', 'awesome-support' ), $options );\n\n\t}",
"public function openDivSelect($label,$name,$id,$class)\r\n\t\t{\r\n\t\t\techo \"<div class='form-group'> \\n\";\r\n\t\t\techo \"<lable>\".$label.\"</label> \\n\";\r\n\t\t\techo \"<select name='\".$name.\"' id='\".$id.\"' class='\".$class.\"' required >\";\r\n\t\t}",
"function List_sel (){\n\techo \"<select name='{$this->texto_field}' id='{$this->texto_field}' class='' tabindex='++$ind'>\";\n\techo \"<option value=''>-->> Escolha <<--</option>\";\n\t while($this->col_lst = mysql_fetch_array($this->sql_lst))\n\t {\n\t echo \"<option value='\".$this->col_lst[\"id\"].\"'>\".$this->col_lst[$this->campo_retorno].\"</option>\";\n\t }\n\techo \"</select>\";\n }",
"function ec_print_productdetails_select( $id ){\n\t\n\tglobal $wpdb;\n\t$total = $wpdb->get_var( \"SELECT COUNT( ec_product.product_id ) as total FROM ec_product\" );\n\t\n\tif( $total > 500 ){\n\t\t\n\t\techo \"<input type=\\\"text\\\" class=\\\"ec_editor_select_box\\\" id=\\\"\" . $id . \"\\\">\";\n\t\t\n\t}else{\n\t\t\n\t\techo \"<select class=\\\"ec_editor_select_box\\\" id=\\\"\" . $id . \"\\\">\";\n\t\t$products = $wpdb->get_results( \"SELECT ec_product.title, ec_product.model_number FROM ec_product ORDER BY ec_product.title\" );\n\t\tif( count( $products ) > 0 ){\n\t\t\techo \"<option value=\\\"0\\\">Select a Product</option>\";\n\t\t\tfor( $i=0; $i<count( $products ); $i++ ){\n\t\t\t\techo \"<option value=\\\"\" . $products[$i]->model_number . \"\\\">\" . $products[$i]->title . \"</option>\";\n\t\t\t}\n\t\t}else{\n\t\t\techo \"<option value=\\\"0\\\">No Products Exist</option>\";\n\t\t}\n\t\techo \"</select>\";\n\t\t\n\t}\n\t\n}",
"function html_select($options, $attrib)\n{\n\tif($attrib !== null && count($attrib) !== 0){\n\t\techo \"<select \";\n\t\tforeach ($attrib as $key => $value) {\n\t\t\techo \"{$key}=\\\"{$value}\\\" \";\n\t\t}\n\t\techo \">\\n\";\n\t}else{\n\t\techo \"<select>\\n\";\n\t}\n\techo \"<option value=\\\"\\\">-- select type --</option>\\n\";\n\tforeach ($options as $id => $text) {\n\t\techo \"<option value=\\\"{$id}\\\">{$text}</option>\\n\";\n\t}\n\techo \"</select>\\n\";\n}",
"function opcionesSelect($combo) {\r\n if ($combo == 'comboRoles') { // carga el combo de permisos roles\r\n echo '<select class=\"form-control \" name =\"' . $combo . '\" id=\"' . $combo . '\" onchange=\"guardarvaloractual(this);\" >';\r\n } else if ($combo == 'comboRolesModal') { //carga el combo de eliminacion\r\n echo '<select class=\"form-control \" name =\"' . $combo . '\" id= \"' . $combo . '\" >';\r\n } else if ($combo == 'comboRolesUsuariosModal') { //carga el combo de usuarios roles\r\n echo '<select class=\"form-control \" name =\"' . $combo . '\" id= \"' . $combo . '\" onchange=\"comboRolesUsuarios(this);\" >';\r\n }\r\n}",
"public function renderOptionsSection() {\n\t\t?>\n\t\t<p><?php esc_html_e( 'Enter the associated options into each of the fields below.', 'am-managed-missions' ) ?></p>\n\t\t<?php\n\t}",
"function ec_print_product_select( $id ){\n\t\n\tglobal $wpdb;\n\t$total = $wpdb->get_var( \"SELECT COUNT( ec_product.product_id ) as total FROM ec_product\" );\n\t\n\tif( $total > 500 ){\n\t\t\n\t\techo \"<input type=\\\"text\\\" class=\\\"ec_editor_select_box\\\" id=\\\"\" . $id . \"\\\">\";\n\t\t\n\t}else{\n\t\t\n\t\techo \"<select class=\\\"ec_editor_select_box\\\" id=\\\"\" . $id . \"\\\">\";\n\t\t$products = $wpdb->get_results( \"SELECT ec_product.product_id, ec_product.title, ec_product.model_number FROM ec_product ORDER BY ec_product.title\" );\n\t\tif( count( $products ) > 0 ){\n\t\t\techo \"<option value=\\\"0\\\">Select a Product</option>\";\n\t\t\tfor( $i=0; $i<count( $products ); $i++ ){\n\t\t\t\techo \"<option value=\\\"\" . $products[$i]->product_id . \"\\\">\" . $products[$i]->title . \"</option>\";\n\t\t\t}\n\t\t}else{\n\t\t\techo \"<option value=\\\"0\\\">No Products Exist</option>\";\n\t\t}\n\t\techo \"</select>\";\n\t\t\n\t}\n\t\n}",
"public function getPropertyOptionSelect()\n {\n return '\n \t\t\tSELECT 0;\n \t\t';\n }",
"function htmlobject_select($name, $value, $title = '', $selected = array()) {\n\n\t\t$html = new htmlobject_select();\n\t\t$html->id = 'p'.uniqid();\n\t\t$html->name = $name;\n\t\t$html->title = $title;\n\t\t$html->selected = $selected;\n\t\t$html->text_index = array(\"value\" => \"value\", \"text\" => \"label\");\n\t\t$html->text = $value;\n\n\t\treturn htmlobject_box_from_object($html, ' select');\n}",
"private function display_required_objects_section( array $sf_object_description, array $required_sf_objects, string $to, string $to_label ) {\n $sf_objects_raw = $this->sf->get_all_objects();\n $sf_objects = array();\n\n // prepare array of possible required salesforce objects\n foreach( $sf_object_description[\"fields\"] as $sf_field ) {\n if ( $sf_field[\"type\"] == \"reference\" && $sf_field[\"createable\"] && !$sf_field[\"defaultedOnCreate\"] ) {\n // user is by default included\n if( $sf_field[\"referenceTo\"][0] != $to && $sf_field[\"referenceTo\"][0] != \"User\" ) {\n array_push( $sf_objects, array(\n \"name\" => $sf_field[\"referenceTo\"][0],\n \"label\" => $sf_field[\"referenceTo\"][0],\n \"id\" => $sf_field[\"name\"]\n ) );\n }\n }\n }\n foreach( $sf_objects_raw[\"sobjects\"] as $sf_object_raw ) {\n if( !$sf_object_raw[\"deprecatedAndHidden\"] && $sf_object_raw[\"createable\"] && $sf_object_raw[\"updateable\"] && $sf_object_raw[\"deletable\"] ) {\n array_push( $sf_objects, array(\n \"name\" => $sf_object_raw[\"name\"],\n \"label\" => $sf_object_raw[\"label\"],\n \"id\" => $sf_object_raw[\"name\"] . \"Id\"\n ) );\n }\n }\n\n $counter = 0;\n ?>\n <div id=\"nwsi-required-sf-objects-wrapper\" class=\"nwsi-new-relationship-form-metabox\">\n <?php // for JS to copy and paste as new required object when users click add button ?>\n <?php $this->display_required_objects_select_element( \"defaultRequiredSfObject\", $sf_objects, \"\", \"\", true ); ?>\n <h4>\n <?php _e( \"Required Salesforce objects\", \"woocommerce-integration-nwsi\" ); ?>\n </h4>\n <table id=\"nwsi-required-sf-objects\">\n <thead>\n <th><?php _e( \"Active\", \"woocommerce-integration-nwsi\" ); ?></th>\n <th><?php _e( \"Object\", \"woocommerce-integration-nwsi\" ); ?></th>\n </thead>\n <tbody>\n <?php foreach( $required_sf_objects as $required_sf_object ): ?>\n <tr>\n <td><input name=\"requiredSfObjectIsActive-<?php echo $counter; ?>\" type=\"checkbox\" checked></td>\n <td>\n <?php\n $this->display_required_objects_select_element( \"requiredSfObject-\" . $counter, $sf_objects, $required_sf_object->name, $required_sf_object->id );\n $counter++;\n ?>\n </td>\n </tr>\n <?php endforeach; ?>\n </tbody>\n </table>\n <br/>\n <button id=\"nwsi-add-new-required-sf-object\" class=\"button button-primary\">+ <?php _e( \"Add\", \"woocommerce-integration-nwsi\" ); ?></button>\n </div>\n <br/>\n <?php\n }",
"public static function renderSelectStart($conf = array()){\n\t\t$conf = self::mergeConf($conf);\n\t\tself::out(\n\t\t\tself::openTag('select', (array) $conf)\n\t\t);\n\t}",
"function CrearSelectPers($Vector){\r\n $nombre=$Vector[\"Nombre\"];\r\n $Evento=$Vector[\"Evento\"];\r\n $Ancho=$Vector[\"Ancho\"];\r\n $Alto=$Vector[\"Alto\"];\r\n print('<select name=\"'.$nombre.'\" '.$Evento.' style=\"width:'.$Ancho.'px; height:'.$Alto.'px;\" >');\r\n\t\t\r\n\t}",
"function ec_print_category_select( $id ){\n\techo \"<select class=\\\"ec_editor_select_box\\\" id=\\\"\" . $id . \"\\\">\";\n\t$db = new ec_db( );\n\t$category_items = $db->get_category_list( );\n\tif( count( $category_items ) > 0 ){\n\t\techo \"<option value=\\\"0\\\">Select a Category Item</option>\";\n\t\tforeach( $category_items as $category ){\n\t\t\techo \"<option value=\\\"\" . $category->category_id . \"\\\">\" . $category->category_name . \"</option>\";\n\t\t}\n\t}else{\n\t\techo \"<option value=\\\"0\\\">No Category Items Exist</option>\";\n\t}\n\techo \"</select>\";\n}",
"function render(){\n\t\t\n // class\n\t\t$class = 'class=\"nhpopts-iconselect '.(isset($this->field['class']) ? $this->field['class'] : '').'\"';\n\t\t\n // subset\n if (!empty($this->field['subset']) && isset($this->icons[$this->field['subset']])) {\n\t\t $subset = $this->field['subset'];\n\t\t $this->icons = array($this->icons[$subset]);\n\t\t}\n \n // allow empty\n $allow_empty = true; // default\n if (isset($this->field['allow_empty']) && ($this->field['allow_empty'] == false || $this->field['allow_empty'] == 'false')) {\n $allow_empty = false;\n }\n \n\t\techo '<select id=\"'.$this->field['id'].'\" name=\"'.$this->args['opt_name'].'['.$this->field['id'].']\" '.$class.' style=\"width: 100%; max-width: 240px;\">';\n\t\tif ($allow_empty)\n echo '<option value=\"\"'.selected($this->value, '', false).'>'.__('No Icon', 'best' ).'</option>';\n foreach ( $this->icons as $icon_category => $icons ) {\n if (!isset($subset))\n echo '<optgroup label=\"'.$icon_category.'\">';\n foreach ($icons as $icon) {\n echo '<option value=\"'.$icon.'\"'.selected($this->value, $icon, false).'>'.ucwords(str_replace('-', ' ', $icon)).'</option>';\n }\n echo '</optgroup>';\n\t\t}\n\n\t\techo '</select>';\n\n\t\techo (isset($this->field['desc']) && !empty($this->field['desc']))?' <span class=\"description\">'.$this->field['desc'].'</span>':'';\n\t\t\n\t}",
"function CrearOptionSelect($value,$label,$selected){\r\n\t\t\r\n\t\tif($selected==1)\r\n\t\t\tprint('<option value=\"'.$value.'\" selected>'.$label.'</option>');\r\n\t\telse\r\n\t\t\tprint('<option value=\"'.$value.'\">'.$label.'</option>');\r\n\t\t\r\n\t}",
"protected function getSelectHtml()\n {\n $name = $this->getName();\n $folder = $this->getComponentFolder();\n $options = $this->getOptions();\n $options = $options ? $options : $this->setOptionsFromFolder()->getOptions();\n if ($options) {\n $generator = new Generator();\n $generator->newElement( 'ul', array(\n 'data-mxid' => $this->mxid,\n 'class' => \"tr-builder-select builder-select-{$name}\",\n 'data-group' => $this->getGroup()\n ) );\n foreach ($options as $name => $value) {\n $attr['data-value'] = $value;\n $attr['data-thumbnail'] = $this->getComponentThumbnail($folder, $value);\n $attr['class'] = 'builder-select-option';\n $attr['data-id'] = $this->mxid;\n $attr['data-folder'] = $folder;\n $attr['data-root'] = '/';\n $attr['data-group'] = $this->getName();\n $img = new Generator();\n $img->newImage($attr['data-thumbnail']);\n $li = new Generator();\n $li->newElement('li', $attr, '<span>' . $name . '</span>')->appendInside( $img );\n $generator->appendInside( $li );\n }\n $select = $generator->getString();\n } else {\n $dir = $this->paths['matrix_folder'] . '/' . $folder;\n $select = \"<div class=\\\"tr-dev-alert-helper\\\"><i class=\\\"icon tr-icon-bug\\\"></i> Add a component folder at <code>{$dir}</code> and add your component files to it.</div>\";\n }\n return $select;\n }",
"static function buildSelect($title,$name,$id,$mod,$foreignTable,$curVal,$foreignscheme=\"\",$event=\"\",$disabled=\"\") {\r\n\t\t\techo '<LABEL>';\r\n \t\techo '<SPAN>'.$title.' :</SPAN>';\r\n\t\t\tif ($event != \"\") {\r\n\t\t\t\t$event = 'onchange=\"'.$event.'\"';\r\n\t\t\t}\r\n\t\t\techo '<SELECT '.$disabled.' name=\"'.$name.'\" id=\"'.$id.'\" '.$event.' >';\r\n\t\t\t$mod->fillForeignTableCombo($foreignTable,$curVal,$foreignscheme);\r\n\t\t\techo '</SELECT>';\r\n\t\t\techo '</LABEL>';\r\n\t\t}",
"function fill_search_prod(){\n\t\t$user_info = select(\"select codigo from producto where activo=1\");\n\t\techo('<optgroup label=\"Codigo\">');\n\t\tfor($i=0;$i<count($user_info);$i++){\n\t\t\techo('<option value=\"'.array_values($user_info[$i])[0].'\">'.array_values($user_info[$i])[0].'</option>');\n\t\t}\n\t\techo('<optgroup label=\"Nombre\">');\n\t\t$user_info = select(\"select codigo, nombre from producto where activo=1\");\n\t\tfor($i=0;$i<count($user_info);$i++){\n\t\t\techo('<option value=\"'.array_values($user_info[$i])[0].'\">'.array_values($user_info[$i])[1].'</option>');\n\t\t}\n\t}",
"function select($attributes = array()){\r\n $attr = array(); //default empty\r\n $col = \"6\"; //default col\r\n $class=\"input-group\"; //default class\r\n extract($attributes);\r\n \r\n $html = $this->divbegin($col,$class);\r\n $html.='<span class=\"input-group-addon\"><i class=\"glyphicon glyphicon-' . $icon . '\"></i></span>';\r\n $html .='<select id=\"'.$field.'\" name=\"data['.$field.']\" required/>';\r\n foreach($option as $k=>$v){\r\n if($k==$this->data[$field]){\r\n $html .= '<option value=\"'.$k.'\" selected=\"selected\">'.$v.'</option>';\r\n }else{\r\n $html .= '<option value=\"'.$k.'\">'.$v.'</option>';\r\n }\r\n }\r\n $html.= '</select>';\r\n $html .= $this->inputend($field,\"sélectionner une option\");\r\n return $html;\r\n }"
] | [
"0.6332767",
"0.6262279",
"0.60784435",
"0.60714316",
"0.60506856",
"0.60298336",
"0.5964911",
"0.5933231",
"0.5831334",
"0.58145237",
"0.5770577",
"0.57550246",
"0.5748123",
"0.57455355",
"0.57164437",
"0.5665457",
"0.5662824",
"0.5659355",
"0.5637332",
"0.5618639",
"0.5586667",
"0.55834824",
"0.55821294",
"0.5577056",
"0.5573062",
"0.55365413",
"0.5501462",
"0.5492714",
"0.5487593",
"0.5482986"
] | 0.65344167 | 0 |
Return select HTML element with given name and options from Salesforce. | private function generate_sf_select_element( array $fields, string $name, string $selected ) {
return $this->generate_select_element( $fields, $name, $selected, true );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _getFormElement($name)\n {\n return new Zend_Form_Element_Select($name);\n }",
"public function makeSelect(){\r\n echo \"<select name=\\\"\" .$this->getName(). \"\\\">\\n\";\r\n //Create options.\r\n $this->makeOptions($this->getValue());\r\n echo \"</select>\" ;\r\n }",
"function createSelect($name, $label, $options)\n{\n $html = \"<label>\" . $label . \"</label>\";\n $html .= \"<select>'\" . $name . \"'>\";\n foreach ($options as $key => $value)\n {\n $html .= \"<option value ='\" . $value['value'] . \"'>\" . $value['content'] . \"</option>\";\n }\n $html .= \"</select>\";\n return $html;\n}",
"function createSelect($name, $label, $options)\n{\n\n $html = \"<label>\". $label . \"</label>\";\n $html = \"<select name='\" . $name .\"'>\";\n foreach ($options as $key => $value)\n {\n $html .= \"<option value='\". $value['value'] . \"'>\" . $value['content'] . \"</option>\";\n }\n $html .= \"</select>\";\n return $html;\n}",
"public function selectOptionListHtml($name = \"\")\n {\n global $Language;\n $empty = true;\n $curValue = (CurrentPage()->RowType == ROWTYPE_SEARCH) ? (StartsString(\"y\", $name) ? $this->AdvancedSearch->SearchValue2 : $this->AdvancedSearch->SearchValue) : $this->CurrentValue;\n $str = \"\";\n if (is_array($this->EditValue)) {\n $ar = $this->EditValue;\n if ($this->SelectMultiple) {\n $armulti = (strval($curValue) != \"\") ? explode(\",\", strval($curValue)) : [];\n $cnt = count($armulti);\n $rowcnt = count($ar);\n $empty = true;\n for ($i = 0; $i < $rowcnt; $i++) {\n $sel = false;\n for ($ari = 0; $ari < $cnt; $ari++) {\n if (SameString($ar[$i][0], $armulti[$ari]) && $armulti[$ari] != null) {\n $armulti[$ari] = null; // Marked for removal\n $sel = true;\n $empty = false;\n break;\n }\n }\n if (!$sel) {\n continue;\n }\n foreach ($ar[$i] as $k => $v) {\n $ar[$i][$k] = RemoveHtml(strval($ar[$i][$k]));\n }\n $str .= \"<option value=\\\"\" . HtmlEncode($ar[$i][0]) . \"\\\" selected>\" . $this->displayValue($ar[$i]) . \"</option>\";\n }\n } else {\n if ($this->UsePleaseSelect) {\n $str .= \"<option value=\\\"\\\"> </option>\"; // Blank option\n }\n $rowcnt = count($ar);\n $empty = true;\n for ($i = 0; $i < $rowcnt; $i++) {\n if (SameString($curValue, $ar[$i][0])) {\n $empty = false;\n } else {\n continue;\n }\n foreach ($ar[$i] as $k => $v) {\n $ar[$i][$k] = RemoveHtml(strval($ar[$i][$k]));\n }\n $str .= \"<option value=\\\"\" . HtmlEncode($ar[$i][0]) . \"\\\" selected>\" . $this->displayValue($ar[$i]) . \"</option>\";\n }\n }\n if ($this->SelectMultiple) {\n for ($ari = 0; $ari < $cnt; $ari++) {\n if ($armulti[$ari] != null) {\n $str .= \"<option value=\\\"\" . HtmlEncode($armulti[$ari]) . \"\\\" selected></option>\";\n }\n }\n } else {\n if ($empty && strval($curValue) != \"\") {\n $str .= \"<option value=\\\"\" . HtmlEncode($curValue) . \"\\\" selected></option>\";\n }\n }\n }\n if ($empty) {\n $this->OldValue = \"\";\n }\n return $str;\n }",
"function teamselect($name, $tl) {\n\tprint <<<EOT\n<select name=\"$name\" size=\"0\">\nEOT;\n\tforeach ($tl as $t)\n\t\tprint <<<EOT\n<option>{$t->display_name()}</option>\nEOT;\n\tprint \"</select>\\n\";\n}",
"function generateSelect($name = '', $options = array()) {\n $html = '<form action =' .htmlentities($_SERVER['PHP_SELF']) .' method= \"post\" >';\n \n $html .='<p style=\"text-align:center;\"><label>select the sensor</label><br>';\n $html .='<p style=\"text-align:center;\">';\n $html .= '<select name=\"'.$name.'\">';\n foreach ($options as $option => $value) {\n $html .= '<option value='.$value.'>'.$value.'</option>';\n }\n $html .= '</select>';\n $html .= '<input type=\"submit\" name=\"formSubmit\" value=\"Submit\" > </form>';\n\n return $html;\n}",
"function select(string $name, $value, array $options): string\n{\n $html_options = [];\n\n foreach ($options as $k => $option) {\n\n $attributes = $k == $value ? 'selected' : '';\n $html_options[] = \"<option value= '$k' $attributes>$option</option>\";\n }\n return \"<select class='form-control' name ='$name'\" . implode($html_options) . '<selected>';\n}",
"static function select($name, $options = null, $attributes = null) {\n if(empty($attributes)) {\n $attributes = array();\n } // if\n \n if(empty($attributes['id'])) {\n $attributes['id'] = self::uniqueId('select_box');\n } // if\n\n // IE10 fix for https://connect.microsoft.com/IE/feedback/details/787135/select-boxes-using-the-html5-required-attribute-and-using-optgroups-are-not-accepted-as-valid-even-if-a-value-was-selected\n if(isset($attributes['required']) && $attributes['required'] && isset($_SERVER) && preg_match('/(?i)msie [10]/', $_SERVER['HTTP_USER_AGENT'])) {\n unset($attributes['required']);\n } // if\n\n if(isset($attributes['label']) && $attributes['label']) {\n $required = isset($attributes['required']) && $attributes['required'];\n\n $prefix = self::label($attributes['label'], $attributes['id'], $required, array('class' => 'main_label'));\n unset($attributes['label']);\n } else {\n $prefix = '';\n } // if\n \n $attributes['name'] = $name;\n\n\t\t\tif(AngieApplication::getPreferedInterface() == AngieApplication::INTERFACE_PHONE) {\n $attributes['data-native-menu'] = 'false';\n \t} // if\n \n\t\t\t$return = $prefix . self::openTag('select', $attributes);\n\t\t\t\n\t\t\tif($options) {\n \t $return .= is_array($options) ? implode(\"\\n\", $options) : (string) $options;\n \t} // if\n \t\n \treturn \"$return</select>\";\n }",
"public static function select(string $name, array $options) {\n\n $htmlOptions = [];\n $attributes = ' class=\"'.self::$class.'\"';\n\n foreach ($options as $key => $option) {\n\n $htmlOptions[] = '<option value=\"'.$key.'\">'.$option.'</option>';\n }\n return '<select'.$attributes.' name=\"'.$name.'\">'.implode($htmlOptions).'</select>';\n }",
"public function htmlSelect ($use)\n\t{\n\t\t$return_string = '<select id=\"'.CSS_ID_OPTION_QUIZ.'\" name=\"quizname\">'.\"\\n\";\n\t\t// sort first\n\t\t$this->_sort();\n\t\t// includes formatting of table input fields - but no other html\n\t\tforeach ($this->quiz_objects as $this_object)\n\t\t{\n\t\t\tif (!$this_object->isEnabled($use)) {continue;}\n\t\t\t$return_string.=\"\\t<option value=\\\"\".$this_object->getQuizname().\"\\\">\".$this_object->getTitle().\"</option>\\n\";\n\t\t}\n\t\t$return_string .= \"</select>\\n\";\n\t\treturn ($return_string);\n\t}",
"function wp_scgcge_Select($name, $values = '', $value = '', $required = '', $class = '', $id = '', $gfaa = '')\n{\n $gfaa_tag = $gfaa != '' ? ' maps = \"' . $gfaa . '\" ' : '';\n $required = $required != '' ? 'required' : '';\n return '<select id=\"' . $name . '\" name=\"' . $name . '\" class=\"form-control ' . $class . '\" ' . $required . ' ' . $gfaa_tag . '>\n ' . $values . '\n </select>';\n}",
"protected function getSelectHtml()\n {\n $name = $this->getName();\n $folder = $this->getComponentFolder();\n $options = $this->getOptions();\n $options = $options ? $options : $this->setOptionsFromFolder()->getOptions();\n if ($options) {\n $generator = new Generator();\n $generator->newElement( 'ul', array(\n 'data-mxid' => $this->mxid,\n 'class' => \"tr-builder-select builder-select-{$name}\",\n 'data-group' => $this->getGroup()\n ) );\n foreach ($options as $name => $value) {\n $attr['data-value'] = $value;\n $attr['data-thumbnail'] = $this->getComponentThumbnail($folder, $value);\n $attr['class'] = 'builder-select-option';\n $attr['data-id'] = $this->mxid;\n $attr['data-folder'] = $folder;\n $attr['data-root'] = '/';\n $attr['data-group'] = $this->getName();\n $img = new Generator();\n $img->newImage($attr['data-thumbnail']);\n $li = new Generator();\n $li->newElement('li', $attr, '<span>' . $name . '</span>')->appendInside( $img );\n $generator->appendInside( $li );\n }\n $select = $generator->getString();\n } else {\n $dir = $this->paths['matrix_folder'] . '/' . $folder;\n $select = \"<div class=\\\"tr-dev-alert-helper\\\"><i class=\\\"icon tr-icon-bug\\\"></i> Add a component folder at <code>{$dir}</code> and add your component files to it.</div>\";\n }\n return $select;\n }",
"function select_tag($name, $options, $selected=\"\", $css_class=\"\", $onchange=\"\"){\n $select_tag = '<select class=\"' . $css_class . '\" name=\"'.$name;\n if($onchange!=\"\"){\n $select_tag .= '\" onchange=\"'.$onchange;\n }\n $select_tag .= '\">';\n $select_options = \"\";\n\n foreach($options as $a) {\n if(is_array($a)){\n $ky = $a[0];\n $val = $a[1];\n }else{\n $ky = $a;\n $val = $a;\n }\n $select_options .= '<option value=\"' . $ky . '\"';\n if($selected==$ky){ \n $select_options .= ' selected=\"selected\"';\n }\n $select_options .= '>' . $val . '</option>';\n }\n\n $select_tag .= $select_options . '</select>';\n \n return $select_tag;\n }",
"function select($name, array $dropdownValues, array $options = array()) {\n\t\treturn $this->add('select', array(\n\t\t\t'name' => $name,\n\t\t\t'dropdownValues' => $dropdownValues\n\t\t) + $options);\n\t}",
"public function selectTag($name, $options, array $attrs = [])\n {\n # This is found also in Form::select()\n if (!is_string($options)) {\n if (is_array($options) && ArrayTools::isIndexed($options) && count($options) == 2)\n list ($options, $value) = $options;\n else\n $value = null;\n $options = $this->optionsForSelect($options, $value);\n }\n \n if (isset($attrs['prompt'])) {\n $options = $this->contentTag('option', $attrs['prompt'], ['value' => '', 'allow_blank_attrs' => true]) . \"\\n\" . $options;\n unset($attrs['prompt']);\n }\n $attrs['value'] = $attrs['type'] = null;\n \n $select_tag = $this->_form_field_tag('select', $name, $options, $attrs, true);\n return $select_tag;\n }",
"public function optionsForName(string $name)\n {\n $selects = $this->model\n ->with(\n [\n 'options' => function ($q) {\n return $q\n ->select('id', 'lists_selects_id', 'option_name', 'background_color', 'color', 'notes')\n ->with('currentTrans')\n ->where($this->isShow())\n ->remember(60);\n }\n ]\n )->where($this->forName($name))->remember(60)->first();\n $options = new Collection();\n\n $selects->options->each(function ($option) use ($options) {\n $temp = new Collection();\n $temp->put('id', $option->id);\n $temp->put('value', $option->currentTrans->value);\n $options->push($temp);\n });\n\n return $options;\n }",
"static public function select($val,$txts,$name,$opts=[]) {\n $tag = '';\n $tag .= '<select name=\"'.$name.'\" id=\"form_'.$name.'\"';\n foreach ($opts as $k => $v) {\n if (preg_match('/^\\d+$/',$k)) {\n $tag .= ' '.$v;\n } else {\n\t$tag .= ' '.$k.'=\"'.$v.'\"';\n }\n }\n $tag .= '>';\n foreach ($txts as $k=>$v) {\n $tag .= '<option value=\"'.$k.'\"';\n if ($k.'' == $val.'') $tag.= ' selected'; // Force string comparisons...\n $tag .= '>'.$v.'</option>';\n }\n $tag .= '</select>';\n return $tag;\n }",
"public function getDomSelect(){\n $DOM = new Balise('select');\n foreach ($this->oListe as $KC => $OCAT){\n $OPT = new Balise('option');\n $DOM->add($OPT);\n $OPT->add($OCAT->getLibelle());\n $OPT->addAttribut('value', $KC);\n }\n return $DOM;\n }",
"function getFieldsCombo($name, $field, $data) {\n $result = '';\n if (isset($this->data['form_feedback'])) {\n $dbObject = &$this->getDatabaseObject();\n $option = '';\n $structure = '';\n if ($name == 'msg_sender_name') {\n if (!isset($data) || $data == 0) {\n $selected = ' selected=\"selected\"';\n }\n $result .= sprintf('<option value=\"0\"%s></option>', $selected);\n $selected = '';\n }\n $sql = 'SELECT feedback_form_structure\n FROM %s\n WHERE feedback_form_id = %d';\n $params = array(\n PAPAYA_DB_TABLEPREFIX.'_feedback_forms',\n $this->data['form_feedback']\n );\n if ($res = $dbObject->databaseQueryFmt($sql, $params)) {\n while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $structure = $row;\n }\n }\n $result .= sprintf(\n '<select name=\"%s[%s]\" class=\"dialogSelect dialogScale\" fid=\"%s[%s]\">',\n papaya_strings::escapeHTMLChars($this->paramName),\n papaya_strings::escapeHTMLChars($name),\n papaya_strings::escapeHTMLChars($this->paramName),\n papaya_strings::escapeHTMLChars($name)\n );\n if (isset($structure) && is_object($xmlTree = &simple_xmltree::create())) {\n if (isset($structure['feedback_form_structure'])) {\n if ($xmlTree->loadXML($structure['feedback_form_structure'])) {\n if (isset($xmlTree->documentElement) && $xmlTree->documentElement->hasChildNodes()) {\n for ($idx = 0; $idx < $xmlTree->documentElement->childNodes->length; $idx++) {\n $groupNode = &$xmlTree->documentElement->childNodes->item($idx);\n if ($groupNode->hasChildNodes()) {\n for ($idx2 = 0; $idx2 < $groupNode->childNodes->length; $idx2++) {\n $fieldNode = &$groupNode->childNodes->item($idx2);\n if ($fieldNode->nodeType == XML_ELEMENT_NODE &&\n $fieldNode->nodeName == 'field') {\n $option = trim($fieldNode->getAttribute('name'));\n if ($option != '') {\n if ($data == $option) {\n $selected = ' selected=\"selected\"';\n } else {\n $selected = '';\n }\n $result .= sprintf(\n '<option value=\"%s\"%s>%s</option>',\n papaya_strings::escapeHTMLChars($option),\n $selected,\n papaya_strings::escapeHTMLChars($option)\n );\n }\n }\n }\n }\n }\n }\n }\n }\n }\n $result .= '</select>';\n } else {\n $result .= sprintf(\n '<input type=\"text\" name=\"%s[%s]\" value=\"%s\" class=\"dialogInput dialogScale\" fid=\"%s\" />',\n papaya_strings::escapeHTMLChars($this->paramName),\n papaya_strings::escapeHTMLChars($name),\n papaya_strings::escapeHTMLChars($data),\n papaya_strings::escapeHTMLChars($name)\n );\n }\n return $result;\n }",
"private function generate_sf_picklist_select_element( array $fields, string $name, string $selected, bool $required = false ) {\n return $this->generate_select_element( $fields, $name, $selected, false, $required );\n }",
"public function select_options_pulldown ( $name, $options, $selected='' ) {\n\t global $vmat_plugin;\n\t $output = '';\n\t $output .= '<select name=\"' . $name . '\" id=\"_vmat_' . $name . '\" class=\"postform vmat-select\">';\n\t foreach ( $options as $opt_value=>$opt_name ) {\n\t $title = '';\n\t if( 'vmat_org' == $name ) {\n\t $org_data = $vmat_plugin->get_common()->get_organization_data( $opt_value );\n\t $title = $org_data['description'];\n\t }\n\t $option_selected = 'selected';\n\t if ( $opt_value != $selected ) {\n\t $option_selected = '';\n\t }\n\t $output .= '<option title=\"' . $title . '\" value=\"' . $opt_value . '\" ' . $option_selected .'>' . $opt_name . '</option>';\n\t }\n\t $output .= '</select>';\n\t return $output;\n\t}",
"function get_services_as_list_html() {\n $content = \"\";\n $conn = connectMySQL();\n $sql = \"SELECT * FROM Service\";\n $result = $conn->query($sql);\n if ($result->num_rows > 0) {\n // output data of each row\n while ($row = $result->fetch_assoc()) {\n //Adding option to the select input element based on services stored in the DB\n $content .= '<option value=\"' . $row[\"Name\"] . '\">' . $row[\"Name\"] . '</option>';\n }\n $conn->close();\n } else {\n $content .= '<option value=\"Error\">No current services were found</option>';\n }\n return $content;\n}",
"public function getOptionsForm()\n {\n return view('sigesCore::field.types.select.optionsForm')->render();\n }",
"private function populateSelect($optionValue, $optionName, $field){\t\n\t\t $i=0;\n\t\t foreach($optionValue as $value){\n\t\t\t\t$html.='<option value=\"'.$value.'\"';\n\t\t\t\tif($field==$value){\n\t\t\t\t\t $html.=' selected=\"selected\"';\n\t\t\t\t}\n\t\t\t\t$html.=' >'.\"\\n\";\n\t\t\t\t$html.=$optionName[$i].'</option>'.\"\\n\";\n\t\t\t\t$i++;\n\t\t } \t \n\t\t return $html;\n\t }",
"function dropdown($name, $options) {\n\t$select = \"<select name=\\\"$name\\\">\";\n\t\n\t// Add option elements to select element\n\tforeach($options as $value => $text) {\n\t\t// If there is session form data for $name, AND its value\n\t\t// is the same as the current array element, select it\n\t\tif(isset($_SESSION['POST'][$name]) && $_SESSION['FORM'][$name] == $value) {\n\t\t\tunset($_SESSION['FIRM'][$name]);\n\t\t\t$selected = 'selected=\"selected';\n\t\t} else {\n\t\t\t$selected = '';\n\t\t}\n\t\t$select .= \"<option $selected value=\\\"$value\\\">$text</option>\";\n\t}\n\t\n\t$select .= \"</select>\";\n\treturn $select;\n}",
"public function get()\n {\n if ($this->multiple) {\n $input = \"<select multiple='multiple' name='{$this->name}[]' class='form-control'>\";\n } else {\n $input = \"<select name='{$this->name}' class='form-control'>\";\n }\n $input .= $this->allow_none ? sprintf('<option value=\"0\">%s</option>', $this->allow_none) : '';\n $input .= $this->forum_options ?: '';\n $input .= $this->role_options ?: '';\n $input .= $this->permission_settings_options ?: '';\n $input .= '</select>';\n return $input;\n }",
"public function getSystemRolesAsDropList($name)\n {\n $systemRoles = $this->getSystemRoles();\n if (count($systemRoles) > 0) {\n $systemRoleOptions = [];\n foreach ($systemRoles as $systemRole) {\n $systemRoleOptions[$systemRole->id] = $systemRole->role;\n }\n \n $htmlSelectElement = new \\Phalcon\\Forms\\Element\\Select($name, $systemRoleOptions);\n $htmlSelectElement->addOption([\"\"=>\"select\"]);\n $htmlSelectElement->setDefault(\"\");\n return $htmlSelectElement;\n }\n }",
"function htmlobject_select($name, $value, $title = '', $selected = array()) {\n\n\t\t$html = new htmlobject_select();\n\t\t$html->id = 'p'.uniqid();\n\t\t$html->name = $name;\n\t\t$html->title = $title;\n\t\t$html->selected = $selected;\n\t\t$html->text_index = array(\"value\" => \"value\", \"text\" => \"label\");\n\t\t$html->text = $value;\n\n\t\treturn htmlobject_box_from_object($html, ' select');\n}",
"public static function dropDownList($name,$select,$data,$htmlOptions=array())\n\t{\n /* x2modstart */ \n if (isset($htmlOptions['class']) ) {\n $htmlOptions['class'] .= ' x2-select';\n } else {\n $htmlOptions['class'] = 'x2-select';\n }\n /* x2modend */ \n\n\t\t$htmlOptions['name']=$name;\n\n\t\tif(!isset($htmlOptions['id']))\n\t\t\t$htmlOptions['id']=self::getIdByName($name);\n\t\telseif($htmlOptions['id']===false)\n\t\t\tunset($htmlOptions['id']);\n\n\n\t\tself::clientChange('change',$htmlOptions);\n /* x2modstart */ \n // use late static binding to call modified listOptions method\n\t\t$options=\"\\n\".static::listOptions($select,$data,$htmlOptions);\n /* x2modend */ \n\t\t$hidden='';\n\n\t\tif(!empty($htmlOptions['multiple']))\n\t\t{\n\t\t\tif(substr($htmlOptions['name'],-2)!=='[]')\n\t\t\t\t$htmlOptions['name'].='[]';\n\n\t\t\tif(isset($htmlOptions['unselectValue']))\n\t\t\t{\n\t\t\t\t$hiddenOptions=isset($htmlOptions['id']) ? array('id'=>self::ID_PREFIX.$htmlOptions['id']) : array('id'=>false);\n\t\t\t\t$hidden=self::hiddenField(substr($htmlOptions['name'],0,-2),$htmlOptions['unselectValue'],$hiddenOptions);\n\t\t\t\tunset($htmlOptions['unselectValue']);\n\t\t\t}\n\t\t}\n\t\t// add a hidden field so that if the option is not selected, it still submits a value\n\t\treturn $hidden . self::tag('select',$htmlOptions,$options);\n\t}"
] | [
"0.68264747",
"0.6719296",
"0.66610587",
"0.6550973",
"0.6523824",
"0.6519675",
"0.65080386",
"0.6473344",
"0.6401154",
"0.63889575",
"0.6385524",
"0.6381083",
"0.63424176",
"0.63420206",
"0.6330581",
"0.6298416",
"0.6274287",
"0.6255417",
"0.6211814",
"0.61962575",
"0.61640114",
"0.6161891",
"0.6141543",
"0.61344063",
"0.61197513",
"0.6111711",
"0.6099289",
"0.6096168",
"0.6088621",
"0.6084084"
] | 0.68954885 | 0 |
Return select HTML element with given options from the SF field picklist. | private function generate_sf_picklist_select_element( array $fields, string $name, string $selected, bool $required = false ) {
return $this->generate_select_element( $fields, $name, $selected, false, $required );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getOptionsForm()\n {\n return view('sigesCore::field.types.select.optionsForm')->render();\n }",
"private function populateSelect($optionValue, $optionName, $field){\t\n\t\t $i=0;\n\t\t foreach($optionValue as $value){\n\t\t\t\t$html.='<option value=\"'.$value.'\"';\n\t\t\t\tif($field==$value){\n\t\t\t\t\t $html.=' selected=\"selected\"';\n\t\t\t\t}\n\t\t\t\t$html.=' >'.\"\\n\";\n\t\t\t\t$html.=$optionName[$i].'</option>'.\"\\n\";\n\t\t\t\t$i++;\n\t\t } \t \n\t\t return $html;\n\t }",
"public function optionsHtml(string $field) {\n $list = static::DB_MODEL[$field]['list'] ?? null;\n if ( !$list ) throw new Exception($field.' not defined as list in data model');\n $html='';\n $values=$this->getListValues($list); // expects field to be of type 'list'\n foreach($values as $key => $label) {\n $selected = ( $key == $this->get($field) ) ? 'SELECTED' : '';\n $html .= '<option value=\"'.$key.'\" '.$selected.'>'.htmlspecialchars($label).'</option>';\n }\n return $html;\n }",
"public function get()\n {\n if ($this->multiple) {\n $input = \"<select multiple='multiple' name='{$this->name}[]' class='form-control'>\";\n } else {\n $input = \"<select name='{$this->name}' class='form-control'>\";\n }\n $input .= $this->allow_none ? sprintf('<option value=\"0\">%s</option>', $this->allow_none) : '';\n $input .= $this->forum_options ?: '';\n $input .= $this->role_options ?: '';\n $input .= $this->permission_settings_options ?: '';\n $input .= '</select>';\n return $input;\n }",
"public function Field()\n {\n $classAttr = '';\n $options = '';\n if ($extraClass = trim($this->extraClass())) {\n $classAttr = \"class=\\\"$extraClass\\\"\";\n }\n $selectedYet = false;\n if ($this->source) {\n foreach ($this->source as $s) {\n $value = $s['value'];\n $title = $s['title'];\n $selected = ($value == $this->value && !$selectedYet) ? \" selected=\\\"selected\\\"\" : \"\";\n if ($selected && $this->value != 0) {\n $selectedYet = true;\n $this->isSelected = true;\n }\n $options .= \"<option$selected value=\\\"$value\\\">$title</option>\";\n }\n }\n \n $id = $this->id();\n $disabled = $this->disabled ? \" disabled=\\\"disabled\\\"\" : \"\";\n \n return \"<select $classAttr $disabled name=\\\"$this->name\\\" id=\\\"$id\\\">$options</select>\";\n }",
"public function component_select_options()\n {\n return Component::select_options($this->id);\n }",
"function select_field( $args ){\n\t\t$field = \"\";\n\t\t$field .= sprintf( '<select id=\"%1$s\" name=\"%2$s\" class=\"%3$s\" %4$s>', \n\t\t\t\t\t\t\t\tesc_attr( $this->field_id ), \n\t\t\t\t\t\t\t\tesc_attr( $this->field_name ), \n\t\t\t\t\t\t\t\tesc_attr( implode( $this->field_class, \" \" ) ), \n\t\t\t\t\t\t\t\t$this->field_attributes\n\t\t\t\t\t\t);\n\t\t//datas that should be populated dynamically from $data_json container and select options // \n\t\t$respond_data = $choices = array();\n\t\t\n\t\t//our select choices/options //\n\t\tif( !empty( $args[ \"choices\" ] ) ) $choices = $args[ \"choices\" ];\n\t\t\n\t\t//if we have a data-json index in our $args, we populate our choices dynamically //\n\t\tif( !empty( $args[ \"attributes\" ][ \"data-json\" ] ) ){\n\n\t\t\t//now check if the data-json index has a key in our data_json property //\n\t\t\tif( !empty( $this->data_json[ $args[ \"attributes\" ][ \"data-json\" ] ] ) ) \n\t\t\t{\n\t\t\t\t//copy the data to choices from our data_json property //\n\t\t\t\t$choices = $this->data_json[ $args[ \"attributes\" ][ \"data-json\" ] ];\n\n\t\t\t\t//check if we have a data-respond attributes set and the data-respond exist in our $data_json property //\n\t\t\t\tif( !empty( $args[ \"attributes\" ][ \"data-respond\" ] ) && \n\t\t\t\t\t!empty( $this->data_json[ $args[ \"attributes\" ][ \"data-respond\" ] ] ) \n\t\t\t\t){\n\t\t\t\t\t//get the value of the data-respond field from our saved options //\n\t\t\t\t\t$respond_data = $this->get_field_value( $args[ \"section_key\" ], \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$args[ \"attributes\" ][ \"data-respond\" ], \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->options \n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t//if we got a value, check if it exists in our choices and populate accordingly //\n\t\t\t\t\t$choices = \t( !empty( $respond_data ) && !empty( $choices[ $respond_data ] ) ) ? \n\t\t\t\t\t\t\t\t$choices[ $respond_data ] : \n\t\t\t\t\t\t\t\tarray();\n\t\t\t\t}//end if empty check for data-respond //\n\n\t\t\t}//end if empty( $this->data_json[ $args[ \"attributes\" ] ] )//\n\t\t\t\t\n\t\t}//end if data-json //\n\t\t\n\t\t//if we dont have any $choices/options for select field, add others and return field // \n\t\tif( empty( $choices ) ){\n\t\t\tif( !empty( $args[ \"others\" ] ) ) \n\t\t\t\t$field .= sprintf( '<option value=\"\" class=\"select-others\" %1$s>%2$s</option>', \n\t\t\t\t\t\t\t\t\tselected( $this->field_value, \"\", false ),\n\t\t\t\t\t\t\t\t\t__( \"Others:\", \"abbey-author-profile\" ) \n\t\t\t\t\t\t\t\t);\n\t\t\t$field .= \"</select>\";\n\t\t\treturn $field;\n\t\t}\n\t\t\n\t\t/** if for some reason the field value is not present in our choices array, add it */\n\t\tif( !empty( $this->field_value ) && \n\t\t\t!in_array( $this->field_value, $choices ) &&\n\t\t\t!array_key_exists( $this->field_value, $choices ) && \n\t\t\tempty( $args[ \"attributes\" ][ \"data-json\" ] ) \n\t\t)\n\t\t\t$choices[ $this->field_value ] = $this->field_value;\n\t\t\n\t\tforeach ( $choices as $key => $choice ){\n\t\t\t//if the current choice is an array, dont flatten just use the $key instead //\n\t\t\tif( is_array( $choice ) ) $choice = $key;\n\n\t\t\t//use $keys as values except if $key is an integer //\n\t\t\t$option_value = is_int( $key ) ? $choice : $key; \n\n\t\t\t$field .= sprintf( '<option value=\"%1$s\" %2$s >%3$s</option>', \n\t\t\t\t\t\t\t\tesc_attr( $option_value ), \n\t\t\t\t\t\t\t\tselected( $this->field_value, $option_value, false ), \n\t\t\t\t\t\t\t\tesc_html( $choice )\n\t\t\t\t\t\t\t);\n\t\t}//end foreach loop $choices //\n\n\t\t//add an others field if we have it in $args //\n\t\tif( !empty( $args[\"others\"] ) )\n\t\t\t$field .= sprintf( '<option value=\"\" class=\"select-others\" %1$s>%2$s</option>', \n\t\t\t\t\t\t\t\tselected( $this->field_value, \"\", false ),\n\t\t\t\t\t\t\t\t__( \"Others:\" ) \n\t\t\t\t\t\t\t);\n\n\t\t$field .= \"</select>\";\n\n\t\treturn $field;\n\t\t\t\n\t}",
"public function getOptions()\n {\n ?>\n<strong><?php echo jgettext('Include Fields');?></strong>\n<table>\n\t<tr>\n\t\t<td><?php echo jgettext('Id');?></td>\n\t\t<td><?php echo JHTML::_('select.booleanlist', 'pack_mat_id', 'readonly; disabled=true', 1);?></td>\n\t</tr>\n\t<tr>\n\t\t<td><?php echo jgettext('Title');?></td>\n\t\t<td><?php echo JHTML::_('select.booleanlist', 'pack_mat_title', 'readonly; disabled=true', 1);?></td>\n\t</tr>\n\t<tr>\n\t\t<td><?php echo jgettext('Description');?></td>\n\t\t<td><?php echo JHTML::_('select.booleanlist', 'pack_mat_description', '', 1);?></td>\n\t</tr>\n\t<tr>\n\t\t<td><?php echo jgettext('Published');?></td>\n\t\t<td><?php echo JHTML::_('select.booleanlist', 'pack_mat_published', '', 1);?></td>\n\t</tr>\n\t<tr>\n\t\t<td><?php echo jgettext('Ordering');?></td>\n\t\t<td><?php echo JHTML::_('select.booleanlist', 'pack_mat_ordering', '', 1);?></td>\n\t</tr>\n</table>\n <?php\n EcrHtml::drawSelectName();\n EcrHtml::drawLoggingOptions();\n\n $requireds = array('element_name');\n EcrHtml::drawSubmitParts($requireds);\n }",
"public function select_field_callback( $args ) {\n\t\n\t\t$options = $this->options;\n\t\n\t\tif( !isset( $options['default_buyer_status'] ) )\n\t\t\t$options['default_buyer_status'] = 'individuals';\n\t\n\t\tif( !isset( $options['default_vendor_status'] ) )\n\t\t\t$options['default_vendor_status'] = 'either';\n\t\n\t\tif( !isset( $options['default_business_type'] ) )\n\t\t\t$options['default_business_type'] = 'either';\n\t\n\t\t$html = '';\n\t\t$f_id\t= $args['field_id'];\n\t\t$current = isset($options[ $f_id ])?$options[ $f_id ]:'';\n\t\n\t\t$html .= '<select id=\"' . $f_id . '\" ' .\n\t\t\t\t'name=\"' . mangopayWCConfig::OPTION_KEY . '[' . $f_id . ']\">';\n\t\n\t\tif( 'default_business_type' == $f_id ) {\n\t\t\t$html .= \"<option value='organisations' \" . selected( 'organisations', $current, false ) . '>' .\n\t\t\t\t\t__( 'Organisations', 'mangopay' ) . '</option>';\n\t\t\t$html .= \"<option value='soletraders' \" . selected( 'soletraders', $current, false ) . '>' .\n\t\t\t\t\t__( 'Soletraders', 'mangopay' ) . '</option>';\n\t\t} else {\n\t\t\t$html .= \"<option value='individuals' \" . selected( 'individuals', $current, false ) . '>' .\n\t\t\t\t\t__( 'Individuals', 'mangopay' ) . '</option>';\n\t\t}\n\t\t$html .= \"<option value='businesses' \" . selected( 'businesses', $current, false ) . '>' .\n\t\t\t\t__( 'Businesses', 'mangopay' ) . '</option>';\n\t\t$html .= \"<option value='either' \" . selected( 'either', $current, false ) . '>' .\n\t\t\t\t__( 'Either', 'mangopay' ) . '</option>';\n\t\n\t\t$html .= '</select>';\n\t\n\t\techo $html;\n\t}",
"public function form_select($fld = array())\n\t{\n\t\t// label, type, name & options are required\n\t\tif (empty($fld['value']))\n\t\t\t$fld['value'] = '';\n\t\t\n\t\tif (empty($fld['class']))\n\t\t\t$fld['class'] = '';\n\t\t\n\t\t$output = '<div class=\"form-item\">'.\"\\n\";\n\t\t$output .= \"\\t\".'<label for=\"'.$fld['name'].'\">'.$fld['label']; \n\t\tif (!empty($fld['req']))\n\t\t\t$output .= '<span class=\"req\">*</span>';\n\t\t$output .= '</label>'.\"\\n\";\n\t\t$output .= \"\\t\".'<select class=\"'.$fld['class'].'\" ';\n\t\t\n\t\t//need to add [] for multiple\n\t\tif (!empty($fld['multiple']))\n\t\t{\n\t\t\t$output .= 'name=\"'.$fld['name'].'[]\" ';\n\t\t\t$output .= ' multiple=\"multiple\"';\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$output .= 'name=\"'.$fld['name'].'\" ';\n\t\t}\t\n\t\t$output .= '>';\n\t\t\n\t\t//check to see if any options match previously selected options\n\t\tforeach($fld['options'] as $key => $value)\n\t\t{\n\t\t\tif (isset($fld['selected']) && is_array($fld['selected'])) //multiple selected\n\t\t\t{\n\t\t\t\t$match = false; \n\t\t\t\tforeach($fld['selected']as $fkey => $fval)\n\t\t\t\t{\n\t\t\t\t\tif ($fkey == $key)\n\t\t\t\t\t{\n\t\t\t\t\t\t$output .= '<option value=\"'.$key.'\" selected=\"selected\">'.$value.'</option>'.\"\\n\";\n\t\t\t\t\t\t$match = true; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!$match)\n\t\t\t\t\t$output .= '<option value=\"'.$key.'\">'.$value.'</option>'.\"\\n\";\n\t\t\t}\n\t\t\telseif (isset($fld['selected']) && $fld['selected'] == $key)\n\t\t\t{\n\t\t\t\t$output .= '<option value=\"'.$key.'\" selected=\"selected\">'.$value.'</option>'.\"\\n\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$output .= '<option value=\"'.$key.'\">'.$value.'</option>'.\"\\n\";\n\t\t\t}\n\t\t}\n\t\t$output .= '</select>'.self::fieldError($fld['name']).\"\\n\";\n\t\t$output .= '</div>'.\"\\n\\n\";\n\t\treturn $output;\n\t}",
"public function present()\n {\n $options = [];\n foreach(unserialize($this->fieldOptions) as $o)\n {\n $options[$o] = $o;\n }\n return Field::select($this->fieldSlug, $options , $this->value, ['label' => $this->fieldName, 'class' => 'select2']);\n }",
"function getFieldsCombo($name, $field, $data) {\n $result = '';\n if (isset($this->data['form_feedback'])) {\n $dbObject = &$this->getDatabaseObject();\n $option = '';\n $structure = '';\n if ($name == 'msg_sender_name') {\n if (!isset($data) || $data == 0) {\n $selected = ' selected=\"selected\"';\n }\n $result .= sprintf('<option value=\"0\"%s></option>', $selected);\n $selected = '';\n }\n $sql = 'SELECT feedback_form_structure\n FROM %s\n WHERE feedback_form_id = %d';\n $params = array(\n PAPAYA_DB_TABLEPREFIX.'_feedback_forms',\n $this->data['form_feedback']\n );\n if ($res = $dbObject->databaseQueryFmt($sql, $params)) {\n while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $structure = $row;\n }\n }\n $result .= sprintf(\n '<select name=\"%s[%s]\" class=\"dialogSelect dialogScale\" fid=\"%s[%s]\">',\n papaya_strings::escapeHTMLChars($this->paramName),\n papaya_strings::escapeHTMLChars($name),\n papaya_strings::escapeHTMLChars($this->paramName),\n papaya_strings::escapeHTMLChars($name)\n );\n if (isset($structure) && is_object($xmlTree = &simple_xmltree::create())) {\n if (isset($structure['feedback_form_structure'])) {\n if ($xmlTree->loadXML($structure['feedback_form_structure'])) {\n if (isset($xmlTree->documentElement) && $xmlTree->documentElement->hasChildNodes()) {\n for ($idx = 0; $idx < $xmlTree->documentElement->childNodes->length; $idx++) {\n $groupNode = &$xmlTree->documentElement->childNodes->item($idx);\n if ($groupNode->hasChildNodes()) {\n for ($idx2 = 0; $idx2 < $groupNode->childNodes->length; $idx2++) {\n $fieldNode = &$groupNode->childNodes->item($idx2);\n if ($fieldNode->nodeType == XML_ELEMENT_NODE &&\n $fieldNode->nodeName == 'field') {\n $option = trim($fieldNode->getAttribute('name'));\n if ($option != '') {\n if ($data == $option) {\n $selected = ' selected=\"selected\"';\n } else {\n $selected = '';\n }\n $result .= sprintf(\n '<option value=\"%s\"%s>%s</option>',\n papaya_strings::escapeHTMLChars($option),\n $selected,\n papaya_strings::escapeHTMLChars($option)\n );\n }\n }\n }\n }\n }\n }\n }\n }\n }\n $result .= '</select>';\n } else {\n $result .= sprintf(\n '<input type=\"text\" name=\"%s[%s]\" value=\"%s\" class=\"dialogInput dialogScale\" fid=\"%s\" />',\n papaya_strings::escapeHTMLChars($this->paramName),\n papaya_strings::escapeHTMLChars($name),\n papaya_strings::escapeHTMLChars($data),\n papaya_strings::escapeHTMLChars($name)\n );\n }\n return $result;\n }",
"function Htmls_Select_Hashes_Field($fieldname,$items,$args=array(),$selectoptions=array(),$optionsoptions=array())\n {\n $selected=$this->MyHash_Default($args,\"Selected\",0);\n $namekey=$this->MyHash_Default($args,\"Name_Key\",\"Name\");\n $titlekey=$this->MyHash_Default($args,\"Title_Key\",\"Title\");\n $idkey=$this->MyHash_Default($args,\"ID_Key\",\"ID\");\n $emptytext=$this->MyHash_Default($args,\"Empty_Text\",\"\");\n \n $optionsoptions[ \"VALUE\" ]=\" 0\";\n $selects=\n array\n (\n $this->Html_Tags\n (\n \"OPTION\",\n $emptytext,\n $optionsoptions\n )\n );\n\n foreach ($items as $rid => $item)\n {\n //Copy of options, preventing mixing option options.\n $roptionsoptions=$optionsoptions;\n \n $id=$item[ $idkey ];\n $title=$this->Html_Option_Title($titlekey,$item,$namekey);;\n if ($id==$selected)\n {\n $roptionsoptions[ \"SELECTED\" ]=\"\";\n $roptionsoptions[ \"CLASS\" ]=\"selected\";\n $roptionsoptions[ \"CLASS\" ]=\"selected\";\n $selectoptions[ \"TITLE\" ]=$title;\n }\n\n $roptionsoptions[ \"VALUE\" ]=$id;\n $roptionsoptions[ \"TITLE\" ]=$this->Html_Option_Title($titlekey,$item);\n\n if (!empty($item[ \"Disabled\" ]))\n {\n $roptionsoptions[ \"DISABLED\" ]=\" \";\n $roptionsoptions[ \"CLASS\" ]= \"disabled\";\n }\n\n array_push\n (\n $selects,\n $this->Html_Tags\n (\n \"OPTION\",\n $item[ $namekey ],\n $roptionsoptions\n )\n );\n }\n \n $selectoptions[ \"NAME\" ]=$fieldname;\n\n return\n $this->Htmls_Tag\n (\n \"SELECT\",\n array($selects),\n $selectoptions\n );\n }",
"public function getLeagueSelect()\n {\n $mainframe = Factory::getApplication();\n $db = Factory::getDbo();\n $query = $db->getQuery(true);\n\n $options = array(HTMLHelper::_('select.option', 0, Text::_($this->getParam('leagues_text'))));\n\n $query->select('l.id AS value, l.name AS text');\n $query->select('CONCAT_WS( \\':\\', l.id, l.alias ) AS league_slug');\n $query->from('#__sportsmanagement_league AS l');\n\n $db->setQuery($query);\n $res = $db->loadObjectList();\n if ($res) {\n $options = array_merge($options, $res);\n }\n return HTMLHelper::_('select.genericlist', $options, 'l', 'class=\"jlnav-select\"',\n 'value', 'text', $this->getLeagueId());\n }",
"function acf_get_select_input( $attrs = array() ) {\n\t$value = (array) acf_extract_var( $attrs, 'value' );\n\t$choices = (array) acf_extract_var( $attrs, 'choices' );\n\treturn sprintf(\n\t\t'<select %s>%s</select>',\n\t\tacf_esc_attrs( $attrs ),\n\t\tacf_walk_select_input( $choices, $value )\n\t);\n}",
"private function get_options() {\n\t\t$this->html = null;\n\t\n\t\tforeach ($this->options as $key=>$val) {\n\t\t\t$this->html .= '<option value=\"'.$key.'\"';\n\t\t\t$this->html .= $this->selected == $key ? ' selected=\"selected\"' : '';\n\t\t\t$this->html .= '>';\n\t\t\t$this->html .= $val;\n\t\t\t$this->html .= '</option>';\n\t\t}\n\t\n\t\treturn $this->html;\n\t}",
"public function makeSelect(){\r\n echo \"<select name=\\\"\" .$this->getName(). \"\\\">\\n\";\r\n //Create options.\r\n $this->makeOptions($this->getValue());\r\n echo \"</select>\" ;\r\n }",
"protected function getSelectHtml()\n {\n $name = $this->getName();\n $folder = $this->getComponentFolder();\n $options = $this->getOptions();\n $options = $options ? $options : $this->setOptionsFromFolder()->getOptions();\n if ($options) {\n $generator = new Generator();\n $generator->newElement( 'ul', array(\n 'data-mxid' => $this->mxid,\n 'class' => \"tr-builder-select builder-select-{$name}\",\n 'data-group' => $this->getGroup()\n ) );\n foreach ($options as $name => $value) {\n $attr['data-value'] = $value;\n $attr['data-thumbnail'] = $this->getComponentThumbnail($folder, $value);\n $attr['class'] = 'builder-select-option';\n $attr['data-id'] = $this->mxid;\n $attr['data-folder'] = $folder;\n $attr['data-root'] = '/';\n $attr['data-group'] = $this->getName();\n $img = new Generator();\n $img->newImage($attr['data-thumbnail']);\n $li = new Generator();\n $li->newElement('li', $attr, '<span>' . $name . '</span>')->appendInside( $img );\n $generator->appendInside( $li );\n }\n $select = $generator->getString();\n } else {\n $dir = $this->paths['matrix_folder'] . '/' . $folder;\n $select = \"<div class=\\\"tr-dev-alert-helper\\\"><i class=\\\"icon tr-icon-bug\\\"></i> Add a component folder at <code>{$dir}</code> and add your component files to it.</div>\";\n }\n return $select;\n }",
"private function generate_sf_select_element( array $fields, string $name, string $selected ) {\n return $this->generate_select_element( $fields, $name, $selected, true );\n }",
"function createSelect($name, $label, $options)\n{\n\n $html = \"<label>\". $label . \"</label>\";\n $html = \"<select name='\" . $name .\"'>\";\n foreach ($options as $key => $value)\n {\n $html .= \"<option value='\". $value['value'] . \"'>\" . $value['content'] . \"</option>\";\n }\n $html .= \"</select>\";\n return $html;\n}",
"function createSelect($name, $label, $options)\n{\n $html = \"<label>\" . $label . \"</label>\";\n $html .= \"<select>'\" . $name . \"'>\";\n foreach ($options as $key => $value)\n {\n $html .= \"<option value ='\" . $value['value'] . \"'>\" . $value['content'] . \"</option>\";\n }\n $html .= \"</select>\";\n return $html;\n}",
"function _rw_field_edit_select($field){\r\n\t\t\r\n\t\t$field['value_range'] = _rw_setup_value_range_array($field);\r\n\t\t\r\n\t\t// build select options\r\n\t\t$select_options\t= '<option value=\"\">Select a '.$field['name'].'</option>';\r\n\t\tforeach($field['value_range'] as $option_value=>$option_label)\t\t\t\t\r\n\t\t\t$select_options\t .= '<option value=\"'.$option_value.'\"'.(($field['value']==$option_value) ? ' selected=\"selected\"' : \"\").'>'.$option_label.'</option>';\r\n\t\r\n\t\techo '<p><label class=\"screen-reader-text\" for=\"'.$field['slug'].'\">'.$field['name'].'</label>'.\r\n\t\t'<select name=\"'.$field['slug'].'\" id=\"select-'.$field['slug'].'\" class=\"'.($field['required'] ? 'required-meta-field' : '').'\">'.$select_options.\r\n\t\t'</select></p>';\r\n\t\t\t\t\r\n\t}",
"public function render()\n {\n $ele_value = $this->getValue();\n if (!is_array($ele_value)) {\n $ele_value = (array) $ele_value;\n }\n $ele_options = $this->getOptions();\n $ele_optgroup = $this->getOptgroup();\n\n $extra = ($this->getExtra() != '' ? \" \" . $this->getExtra() : '');\n $attributes = $this->renderAttributeString();\n $ret = '<select ' . $attributes . $extra .' >' . NWLINE;\n\n if (empty($ele_optgroup)) {\n foreach ($ele_options as $value => $name) {\n $ret .= '<option value=\"' . htmlspecialchars($value, ENT_QUOTES) . '\"';\n if (count($ele_value) > 0 && in_array($value, $ele_value)) {\n $ret .= ' selected=\"selected\"';\n }\n $ret .= '>' . $name . '</option>' . NWLINE;\n }\n } else {\n foreach ($ele_optgroup as $name_optgroup => $value_optgroup) {\n $ret .= '<optgroup label=\"' . $name_optgroup . '\">' . NWLINE;\n foreach ($value_optgroup as $value => $name) {\n $ret .= '<option value=\"' . htmlspecialchars($value, ENT_QUOTES) . '\"';\n if (count($ele_value) > 0 && in_array($value, $ele_value)) {\n $ret .= ' selected=\"selected\"';\n }\n $ret .= '>' . $name . '</option>' . NWLINE;\n }\n $ret .= '</optgroup>' . NWLINE;\n }\n }\n $ret .= '</select>' . NWLINE;\n return $ret;\n }",
"public function selectOptionListHtml($name = \"\")\n {\n global $Language;\n $empty = true;\n $curValue = (CurrentPage()->RowType == ROWTYPE_SEARCH) ? (StartsString(\"y\", $name) ? $this->AdvancedSearch->SearchValue2 : $this->AdvancedSearch->SearchValue) : $this->CurrentValue;\n $str = \"\";\n if (is_array($this->EditValue)) {\n $ar = $this->EditValue;\n if ($this->SelectMultiple) {\n $armulti = (strval($curValue) != \"\") ? explode(\",\", strval($curValue)) : [];\n $cnt = count($armulti);\n $rowcnt = count($ar);\n $empty = true;\n for ($i = 0; $i < $rowcnt; $i++) {\n $sel = false;\n for ($ari = 0; $ari < $cnt; $ari++) {\n if (SameString($ar[$i][0], $armulti[$ari]) && $armulti[$ari] != null) {\n $armulti[$ari] = null; // Marked for removal\n $sel = true;\n $empty = false;\n break;\n }\n }\n if (!$sel) {\n continue;\n }\n foreach ($ar[$i] as $k => $v) {\n $ar[$i][$k] = RemoveHtml(strval($ar[$i][$k]));\n }\n $str .= \"<option value=\\\"\" . HtmlEncode($ar[$i][0]) . \"\\\" selected>\" . $this->displayValue($ar[$i]) . \"</option>\";\n }\n } else {\n if ($this->UsePleaseSelect) {\n $str .= \"<option value=\\\"\\\"> </option>\"; // Blank option\n }\n $rowcnt = count($ar);\n $empty = true;\n for ($i = 0; $i < $rowcnt; $i++) {\n if (SameString($curValue, $ar[$i][0])) {\n $empty = false;\n } else {\n continue;\n }\n foreach ($ar[$i] as $k => $v) {\n $ar[$i][$k] = RemoveHtml(strval($ar[$i][$k]));\n }\n $str .= \"<option value=\\\"\" . HtmlEncode($ar[$i][0]) . \"\\\" selected>\" . $this->displayValue($ar[$i]) . \"</option>\";\n }\n }\n if ($this->SelectMultiple) {\n for ($ari = 0; $ari < $cnt; $ari++) {\n if ($armulti[$ari] != null) {\n $str .= \"<option value=\\\"\" . HtmlEncode($armulti[$ari]) . \"\\\" selected></option>\";\n }\n }\n } else {\n if ($empty && strval($curValue) != \"\") {\n $str .= \"<option value=\\\"\" . HtmlEncode($curValue) . \"\\\" selected></option>\";\n }\n }\n }\n if ($empty) {\n $this->OldValue = \"\";\n }\n return $str;\n }",
"private function generate_select_element( array $fields, string $name, string $selected = \"\", bool $ignore_refrences = false, bool $required = false, string $type = \"\" ) {\n\n $select_element = \"<select\";\n if ( $required ) {\n $select_element .= \" required \";\n }\n $select_element .= \" id='\" . $name . \"' name='\". $name . \"' >\";\n $select_element .= \"<option value=''>None</option>\";\n\n if ( !empty( $type ) ) {\n if ( in_array( $type, array( \"string\", \"double\", \"integer\", \"url\", \"phone\", \"textarea\" ) ) ) {\n array_push( $fields, array( \"name\" => \"custom-value\", \"label\" => \"Custom value\" ) );\n } else if ( $type == \"date\" ) {\n array_push( $fields, array( \"name\" => \"custom-current-date\", \"label\" => \"Current Date\" ) );\n } else if ( $type == \"boolean\" ) {\n array_push( $fields, array( \"name\" => \"custom-true\", \"label\" => \"True\" ) );\n array_push( $fields, array( \"name\" => \"custom-false\", \"label\" => \"False\" ) );\n }\n }\n\n foreach( $fields as $field ) {\n // field check\n if ( $ignore_refrences ) {\n if ( !$field[\"createable\"] || $field[\"deprecatedAndHidden\"] || $field[\"type\"] == \"reference\" ) {\n continue;\n }\n }\n\n if( array_key_exists( \"active\", $field ) && !$field[\"active\"] ) {\n continue;\n }\n\n if ( array_key_exists( \"value\", $field ) && !array_key_exists( \"name\", $field ) ) {\n $field[\"name\"] = $field[\"value\"];\n }\n\n if ( $selected == $field[\"name\"] ) {\n $select_element .= $this->generate_option_element( $field[\"label\"], $field[\"name\"], true );\n } else {\n $select_element .= $this->generate_option_element( $field[\"label\"], $field[\"name\"]);\n }\n }\n\n $select_element .= \"</select>\";\n return $select_element;\n }",
"public function field()\n {\n $yesOption = '<option value=\"1\"'.($this->value === 1 ? ' selected=\"selected\"' : null).'>'.\n trans('panel::global.yes').'</option>';\n $noOption = '<option value=\"0\"'.($this->value === 0 ? ' selected=\"selected\"' : null).'>'.\n trans('panel::global.no').'</option>';\n\n $input = new HTMLBrick('select', $yesOption.$noOption, [\n 'id' => $this->id,\n 'name' => $this->name,\n ]);\n $input->addClass('form-control');\n\n return $input;\n }",
"function gvf_wp_select( $field ) {\n global $thepostid, $post;\n\n $thepostid = empty( $thepostid ) ? $post->ID : $thepostid;\n $field = wp_parse_args(\n $field, array(\n 'class' => 'select',\n 'style' => '',\n 'wrapper_class' => '',\n 'value' => get_post_meta( $thepostid, $field['id'], true ),\n 'name' => $field['id'],\n 'desc_tip' => false,\n 'custom_attributes' => array(),\n )\n );\n\n $field_attributes = (array) $field['custom_attributes'];\n $field_attributes['style'] = $field['style'];\n $field_attributes['id'] = $field['id'];\n $field_attributes['name'] = $field['name'];\n $field_attributes['class'] = $field['class'];\n ?>\n <div class=\"field-row <?php esc_attr_e( $field['id'] ) ?>_field\">\n <div class=\"field-wrapper\">\n <label for=\"<?php esc_attr_e( $field['id'] ) ?>\"><?php echo wp_kses_post( $field['label'] ) ?></label>\n <div class=\"select-input-container\">\n <select <?php echo gvf_implode_html_attributes( $field_attributes ); // WPCS: XSS ok. ?>>\n <?php\n if ( isset( $field['options'] ) && ! empty($field['options']) ) :\n foreach ( $field['options'] as $key => $value ) : ?>\n <option value=\"<?php esc_attr_e( $key ) ?>\" <?php gvf_selected( $key, $field['value'] ) ?>><?php esc_html_e( $value ) ?></option>\n <?php endforeach;\n endif;\n ?>\n </select>\n </div>\n </div>\n </div>\n <?php\n}",
"public function getDomSelect(){\n $DOM = new Balise('select');\n foreach ($this->oListe as $KC => $OCAT){\n $OPT = new Balise('option');\n $DOM->add($OPT);\n $OPT->add($OCAT->getLibelle());\n $OPT->addAttribut('value', $KC);\n }\n return $DOM;\n }",
"public function getSelectList () {\n return $this->_selectList;\n }",
"public function get_select_field_markup( $field = null ) {\n\n if ( $field && isset( $field['name'] ) ) {\n $field_value = isset( $field['value'] ) ? $field['value'] : get_option( $field['name'] );\n $options = isset( $field['options'] ) ? (array) $field['options'] : array();\n $classes = isset( $field['class'] ) ? $field['class'] : array();\n if ( ! is_array( $classes ) ) {\n $classes = array( $classes );\n }\n\n if ( isset( $field['label'] ) ) {\n echo '<label>';\n }\n // remove duplicated classes\n $classes = array_unique( $classes );\n\n echo '<select name=\"' . esc_attr( $field['name'] ) . '\"';\n\n if ( isset( $field['id'] ) ) {\n echo ' id=\"' . esc_attr( $field['id'] ) . '\"';\n }\n\n if ( isset( $field['disabled'] ) && $field['disabled'] ) {\n echo ' disabled';\n }\n\n if ( ! empty( $classes ) ) {\n echo ' class=\"' . esc_attr( implode( ' ', $classes ) ) . '\"';\n }\n\n echo '>';\n\n foreach ( $options as $option ) {\n if ( ! is_array( $option ) ) {\n $option_value = $option_text = $option;\n } else {\n $option_value = isset( $option['value'] ) ? $option['value'] : '';\n $option_text = isset( $option['text'] ) ? $option['text'] : '';\n }\n $selected = '';\n if ( absint( $field_value ) === absint( $option_value ) ) {\n $selected = 'selected';\n }\n echo '<option value=\"' . esc_attr( $option_value ) . '\" ' . esc_attr( $selected ) . '>' . esc_html( $option_text ) . '</option>';\n }\n\n echo '</select>';\n if ( isset( $field['appended_text'] ) ) {\n echo '<dfn class=\"lp_appended-text\">' . esc_html( $field['appended_text'] ) . '</dfn>';\n }\n if ( isset( $field['label'] ) ) {\n echo esc_html( $field['label'] );\n echo '</label>';\n }\n }\n }"
] | [
"0.6463366",
"0.6440533",
"0.6413982",
"0.6397902",
"0.6367219",
"0.63507724",
"0.6262634",
"0.62414545",
"0.6241018",
"0.6220799",
"0.6197771",
"0.6183006",
"0.6182615",
"0.6172906",
"0.6168728",
"0.6165816",
"0.6165546",
"0.6153839",
"0.61463505",
"0.61376405",
"0.6125491",
"0.6102922",
"0.6102816",
"0.60674584",
"0.60550135",
"0.60320264",
"0.6022776",
"0.6018138",
"0.6009077",
"0.6003886"
] | 0.6783666 | 0 |
Return select HTML element with given name and options from WooCommerce. | private function generate_wc_select_element( array $field_names, string $name, string $selected, bool $required = false, string $type = "" ) {
$fields = array();
foreach( $field_names as $field_name ) {
array_push( $fields, array(
"name" => $field_name,
"label" => ucwords( str_replace( "_", " ", $field_name ) )
) );
}
return $this->generate_select_element( $fields, $name, $selected, false, $required, $type );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function gvf_wp_select( $field ) {\n global $thepostid, $post;\n\n $thepostid = empty( $thepostid ) ? $post->ID : $thepostid;\n $field = wp_parse_args(\n $field, array(\n 'class' => 'select',\n 'style' => '',\n 'wrapper_class' => '',\n 'value' => get_post_meta( $thepostid, $field['id'], true ),\n 'name' => $field['id'],\n 'desc_tip' => false,\n 'custom_attributes' => array(),\n )\n );\n\n $field_attributes = (array) $field['custom_attributes'];\n $field_attributes['style'] = $field['style'];\n $field_attributes['id'] = $field['id'];\n $field_attributes['name'] = $field['name'];\n $field_attributes['class'] = $field['class'];\n ?>\n <div class=\"field-row <?php esc_attr_e( $field['id'] ) ?>_field\">\n <div class=\"field-wrapper\">\n <label for=\"<?php esc_attr_e( $field['id'] ) ?>\"><?php echo wp_kses_post( $field['label'] ) ?></label>\n <div class=\"select-input-container\">\n <select <?php echo gvf_implode_html_attributes( $field_attributes ); // WPCS: XSS ok. ?>>\n <?php\n if ( isset( $field['options'] ) && ! empty($field['options']) ) :\n foreach ( $field['options'] as $key => $value ) : ?>\n <option value=\"<?php esc_attr_e( $key ) ?>\" <?php gvf_selected( $key, $field['value'] ) ?>><?php esc_html_e( $value ) ?></option>\n <?php endforeach;\n endif;\n ?>\n </select>\n </div>\n </div>\n </div>\n <?php\n}",
"function wp_scgcge_Select($name, $values = '', $value = '', $required = '', $class = '', $id = '', $gfaa = '')\n{\n $gfaa_tag = $gfaa != '' ? ' maps = \"' . $gfaa . '\" ' : '';\n $required = $required != '' ? 'required' : '';\n return '<select id=\"' . $name . '\" name=\"' . $name . '\" class=\"form-control ' . $class . '\" ' . $required . ' ' . $gfaa_tag . '>\n ' . $values . '\n </select>';\n}",
"function widget_layered_nav_dropdown()\n{\n?>\n<section class=\"widget woocommerce widget_layered_nav_dropdown\">\n\t<h2 class=\"widget-title\">\n\t\tWoo Layered Nav Dropdown.\n\t</h2>\n\t<div class=\"widget-body\">\n\t\t<select id=\"dropdown_layered_nav_color\">\n\t\t\t<option value=\"\">Any Colors</option>\n\t\t\t<option value=\"\">Black</option>\n\t\t\t<option value=\"\">Blue</option>\n\t\t\t<option value=\"\">Green</option>\n\t\t</select>\n\t</div>\n</section>\n<?php\n}",
"public function paymentSelectWeb(){\n $payment = $this->paymentArrayWeb();\n $option='';\n foreach($payment as $key=>$val){\n $option.= \"<option value='$key'>$val</option>\";\n }\n return $option;\n }",
"static function get_option($options){\n\n\t\t\t\tif( !empty($options) ){\n\t\t\t\t\tforeach($options as $option_slug => $option){\n\n\t\t\t\t\t\techo '<p>';\n\t\t\t\t\t\tif( !empty($option['title']) ){\n\t\t\t\t\t\t\techo '<label for=\"' . esc_attr($option['id']) . '\" >' . $option['title'] . '</label>';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tswitch( $option['type'] ){\n\n\t\t\t\t\t\t\tcase 'text': \n\t\t\t\t\t\t\t\techo '<input type=\"text\" class=\"widefat\" id=\"' . esc_attr($option['id']) . '\" name=\"' . esc_attr($option['name']) . '\" ';\n\t\t\t\t\t\t\t\techo 'value=\"' . (isset($option['value'])? esc_attr($option['value']): '') . '\" />';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'combobox':\n\t\t\t\t\t\t\t\tif( $option['options'] == 'thumbnail-size' ){\n\t\t\t\t\t\t\t\t\t$option['options'] = tourmaster_get_thumbnail_list();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif( empty($option['value']) && !empty($option['default']) ){\n\t\t\t\t\t\t\t\t\t$option['value'] = $option['default'];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\techo '<select class=\"widefat\" id=\"' . esc_attr($option['id']) . '\" name=\"' . esc_attr($option['name']) . '\" >'; \n\t\t\t\t\t\t\t\tforeach( $option['options'] as $key => $value ){\n\t\t\t\t\t\t\t\t\techo '<option value=\"' . esc_attr($key) . '\" ' . ((isset($option['value']) && $key == $option['value'])? 'selected': '') . ' >' . esc_html($value) . '</option>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo '</select>';\n\t\t\t\t\t\t\t\tbreak; \n\n\t\t\t\t\t\t\tcase 'multi-combobox':\n\t\t\t\t\t\t\t\tif( empty($option['value']) && !empty($option['default']) ){\n\t\t\t\t\t\t\t\t\t$option['value'] = $option['default'];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$values = empty($option['value'])? array(): explode(',', $option['value']);\n\t\t\t\t\t\t\t\techo '<select multiple class=\"widefat\" ';\n\t\t\t\t\t\t\t\techo 'onChange=\"this.nextSibling.value = jQuery(this).val().join(',');\" ';\n\t\t\t\t\t\t\t\techo ' >'; \n\t\t\t\t\t\t\t\tforeach( $option['options'] as $key => $value ){\n\t\t\t\t\t\t\t\t\techo '<option value=\"' . esc_attr($key) . '\" ' . (in_array($key, $values)? 'selected': '') . ' >' . esc_html($value) . '</option>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo '</select>';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\techo '<input type=\"hidden\" id=\"' . esc_attr($option['id']) . '\" name=\"' . esc_attr($option['name']) . '\" value=\"' . esc_attr($option['value']) . '\" />';\n\t\t\t\t\t\t\t\tbreak; \n\n\t\t\t\t\t\t\tdefault: break; \n\n\t\t\t\t\t\t} // switch\n\t\t\t\t\t\techo '</p>';\n\n\t\t\t\t\t} // $option['type']\n\t\t\t\t} // $options\n\n\t\t\t}",
"function select_dal_country($post) {\n\n\techo '<input type=\"hidden\" name=\"taxonomy_noncename\" id=\"taxonomy_noncename\" value=\"' . wp_create_nonce( 'taxonomy_pais' ) . '\" />';\n\n\t// Get all pais taxonomy terms\n\t$paises = get_terms('pais', 'hide_empty=0'); \n $names = wp_get_object_terms($post->ID, 'pais'); \n?>\n <select name='post_pais' id='post_pais'>\n <!-- Display paises as options -->\n <option class='pais-option' value='' <?php echo (!count($names)) ? \"selected=selected\" : '' ?>><?php __(\"None\",'dal-functionality'); ?></option>\n <?php\n foreach ($paises as $pais) {\n if (!is_wp_error($names) && !empty($names) && !strcmp($pais->slug, $names[0]->slug)) \n echo \"<option class='pais-option' value='\" . $pais->slug . \"' selected=selected>\" . $pais->name . \"</option>\\n\"; \n else\n echo \"<option class='pais-option' value='\" . $pais->slug . \"'>\" . $pais->name . \"</option>\\n\"; \n }\n ?>\n </select> \n<?php\n}",
"function buildProductsSelect($products) {\n $prodList = '<select name=\"invId\" id=\"invId\" class=\"drop-down\">';\n $prodList .= \"<option>Choose a Product</option>\";\n foreach ($products as $product) {\n $prodList .= \"<option value='$product[invId]'>$product[invName]</option>\";\n }\n $prodList .= '</select>';\n return $prodList;\n}",
"function ps_selectbox() {\n $per_page = filter_input(INPUT_GET, 'myBrandAttr', FILTER_SANITIZE_NUMBER_INT); \n echo '<div class=\"woocommerce-myBrandAttr\">';\n echo '<select onchange=\"if (this.value) window.location.href=this.value\">'; \n echo \"<option \".selected( $per_page, $value ).\" value='?myBrandAttr=all'>Select Brand</option>\";\n $category_names = get_terms('product_cat'); //taxonomy\n foreach($category_names as $category_name){\n if(!empty($category_name->term_id)){\n $brand_names = get_term_meta( $category_name->term_id, '_woocommerce_gpf_data', false );\n foreach($brand_names as $brand_name){\n if(!empty($brand_name['brand'])){\n $cat_id = $category_name->term_id;\n $brand_title = $brand_name['brand'];\n echo \"<option \".selected( $per_page, $cat_id ).\" value='?myBrandAttr=$cat_id'>$brand_title</option>\";\n }\n }\n \n }\n }\n echo '</select>';\n echo '</div>';\n}",
"public static function create_options() { \r\n add_option( 'wpf_product_teaser_button_text', __( 'Select options', 'wpf' ), '', 'yes' ); \r\n add_option( 'wpf_radio_field_empty_label', __( 'None', 'wpf' ), '', 'yes' );\r\n add_option( 'wpf_select_field_empty_label', __( '--Select option--', 'wpf' ), '', 'yes' );\r\n add_option( 'wpf_checkbox_is_checked_label', __( 'yes', 'wpf' ), '', 'yes' );\r\n add_option( 'wpf_fields_location', 'before_addtocart', '', 'yes' );\r\n add_option( 'wpf_base_price_info', 'yes', '', 'yes' );\r\n add_option( 'wpf_base_price_label', 'Price', '', 'yes' );\r\n add_option( 'wpf_field_profile_show_links', 'yes', '', 'yes' );\r\n add_option( 'wpf_field_profiles', array(), '', 'yes' ); \r\n }",
"function appcountry_styling_function($post) {\n\n echo '<input type=\"hidden\" name=\"taxonomy_noncename\" id=\"taxonomy_noncename\" value=\"' . wp_create_nonce( 'taxonomy_appcountry' ) . '\" />';\n\n // Get all appcountry taxonomy terms\n $appcountryes = get_terms('appcountry', 'hide_empty=0'); \n?>\n<select name='post_appcountry' id='post_appcountry'>\n <!-- Display appcountryes as options -->\n <?php \n $names = wp_get_object_terms($post->ID, 'appcountry'); \n ?>\n <option class='appcountry-option' value='' \n <?php if (!count($names)) echo \"selected\";?>><?php __(\"None\",'dal-functionality'); ?></option>\n <?php\n foreach ($appcountryes as $appcountry) {\n if (!is_wp_error($names) && !empty($names) && !strcmp($appcountry->slug, $names[0]->slug)) \n echo \"<option class='appcountry-option' value='\" . $appcountry->slug . \"' selected>\" . $appcountry->name . \"</option>\\n\"; \n \n else\n echo \"<option class='appcountry-option' value='\" . $appcountry->slug . \"'>\" . $appcountry->name . \"</option>\\n\"; \n }\n\n ?>\n</select> \n<?php\n}",
"public function getProductSelect()\n {\n $attributes = [\n 'description',\n 'name',\n 'short_description',\n 'status',\n 'manufacturer',\n 'price',\n 'cost',\n 'tax_class_id',\n 'meta_keyword',\n 'special_price',\n ];\n\n $custom_select = '';\n foreach ($this->getAttributes() as $attributeID => $attribute) {\n $custom_select .= \",\n\t\t\t\t$attributeID.value\t\t\t\t\t\t\t\t\tas `$attributeID`\";\n $attributes[] = $attributeID;\n }\n\n $sql = \"\n\t\t\tSELECT\n\n\t\t\t\tcatalog_product.entity_id\t\t\t\t\t\tas productID,\n\t\t\t\tcatalog_product.sku\t\t\t\t\t\t\t\tas ordernumber,\n\t\t\t\tcatalog_product.created_at\t\t\t\t\t\tas added,\n\n\t\t\t\tname.value\t\t\t\t\t\t\t\t\t\tas name,\n\t\t\t\tNULL\t\t\t\t\t\t\t\t\t\t\tas additionaltext,\n\t\t\t\tdescription.value\t\t\t\t\t\t\t\tas description_long,\n\t\t\t\tshort_description.value\t\t\t\t\t\t\tas description,\n\t\t\t\tmeta_keyword.value\t\t\t\t\t\t\t\tas keywords,\n\t\t\t\tmanufacturer_option.value\t\t\t\t\t\tas supplier,\n\n\t\t\t\tcs.qty\t\t\t\t\t\t\t\t\t\t\tas instock,\n\t\t\t\tcs.min_qty\t\t\t\t\t\t\t\t\t\tas stockmin,\n\t\t\t\tcs.min_sale_qty\t\t\t\t\t\t\t\t\tas minpurchase,\n\t\t\t\tcs.max_sale_qty\t\t\t\t\t\t\t\t\tas maxpurchase,\n\n\t\t\t\ttax_class_id.value\t\t\t\t\t\t\t\tas taxID,\n\t\t\t\tcost.value\t\t\t\t\t\t\t\t\t\tas baseprice,\n\t\t\t\tIFNULL(special_price.value, price.value)\t\tas price,\n\t\t\t\tIF(special_price.value IS NULL, 0, price.value) as pseudoprice\n\n\t\t\t\t$custom_select\n\n\t\t\tFROM catalog_product_entity catalog_product\n\n\t\t\t-- Joins the attribute tables\n\t\t\t{$this->createTableSelect('catalog_product', $attributes, 0)}\n\n\t\t\t-- Join for instock\n\t\t\tLEFT JOIN cataloginventory_stock_item cs\n\t\t\tON cs.`product_id`=catalog_product.`entity_id`\n\t\t\tAND cs.`stock_id`=1\n\n -- maps child products to parents\n\t\t\tLEFT JOIN catalog_product_relation relation\n\t\t\tON catalog_product.entity_id=relation.child_id\n\n\t\t\t-- Joins the attribute values for the manufacturer\n\t\t\tLEFT JOIN eav_attribute_option_value manufacturer_option\n\t\t\tON manufacturer_option.option_id=manufacturer.value\n\n -- Need to order by parent id in order to correctly assign children later\n\t\t\tORDER BY relation.parent_id ASC\n\t\t\";\n\n return $sql;\n }",
"function rakitpc() {\r\n $term_names = array('T-shirts');\r\n\r\n // The WP_Query\r\n $query = new WP_Query( array(\r\n 'posts_per_page' => -1,\r\n 'post_type' => 'product',\r\n 'post_status' => 'publish',\r\n 'hide_empty' => 0,\r\n 'orderby' => 'title',\r\n 'tax_query' => array( array(\r\n 'taxonomy' => 'product_cat', // for a Product category (or 'product_tag' for a Product tag)\r\n 'field' => 'name', // can be 'name', 'slug' or 'term_id'\r\n 'terms' => $term_names,\r\n ) ),\r\n 'echo' => '0'\r\n ) );\r\n\r\n $output = '<select>';\r\n // foreach ( $products as $product ) {\r\n if ( $query->have_posts() ) :\r\n while ( $query->have_posts() ) : $query->the_post();\r\n\r\n $permalink = get_permalink($query->post->ID);\r\n $title = $query->post->post_title;\r\n $output .= '<option value=\"' . $permalink . '\">' . $title . '</option>';\r\n\r\n endwhile;\r\n\r\n wp_reset_postdata();\r\n\r\n $output .='</select>';\r\n\r\n else :\r\n\r\n $output = '<p>No products found<p>';\r\n\r\n endif;\r\n\r\n return $output;\r\n}",
"public function selectOptionListHtml($name = \"\")\n {\n global $Language;\n $empty = true;\n $curValue = (CurrentPage()->RowType == ROWTYPE_SEARCH) ? (StartsString(\"y\", $name) ? $this->AdvancedSearch->SearchValue2 : $this->AdvancedSearch->SearchValue) : $this->CurrentValue;\n $str = \"\";\n if (is_array($this->EditValue)) {\n $ar = $this->EditValue;\n if ($this->SelectMultiple) {\n $armulti = (strval($curValue) != \"\") ? explode(\",\", strval($curValue)) : [];\n $cnt = count($armulti);\n $rowcnt = count($ar);\n $empty = true;\n for ($i = 0; $i < $rowcnt; $i++) {\n $sel = false;\n for ($ari = 0; $ari < $cnt; $ari++) {\n if (SameString($ar[$i][0], $armulti[$ari]) && $armulti[$ari] != null) {\n $armulti[$ari] = null; // Marked for removal\n $sel = true;\n $empty = false;\n break;\n }\n }\n if (!$sel) {\n continue;\n }\n foreach ($ar[$i] as $k => $v) {\n $ar[$i][$k] = RemoveHtml(strval($ar[$i][$k]));\n }\n $str .= \"<option value=\\\"\" . HtmlEncode($ar[$i][0]) . \"\\\" selected>\" . $this->displayValue($ar[$i]) . \"</option>\";\n }\n } else {\n if ($this->UsePleaseSelect) {\n $str .= \"<option value=\\\"\\\"> </option>\"; // Blank option\n }\n $rowcnt = count($ar);\n $empty = true;\n for ($i = 0; $i < $rowcnt; $i++) {\n if (SameString($curValue, $ar[$i][0])) {\n $empty = false;\n } else {\n continue;\n }\n foreach ($ar[$i] as $k => $v) {\n $ar[$i][$k] = RemoveHtml(strval($ar[$i][$k]));\n }\n $str .= \"<option value=\\\"\" . HtmlEncode($ar[$i][0]) . \"\\\" selected>\" . $this->displayValue($ar[$i]) . \"</option>\";\n }\n }\n if ($this->SelectMultiple) {\n for ($ari = 0; $ari < $cnt; $ari++) {\n if ($armulti[$ari] != null) {\n $str .= \"<option value=\\\"\" . HtmlEncode($armulti[$ari]) . \"\\\" selected></option>\";\n }\n }\n } else {\n if ($empty && strval($curValue) != \"\") {\n $str .= \"<option value=\\\"\" . HtmlEncode($curValue) . \"\\\" selected></option>\";\n }\n }\n }\n if ($empty) {\n $this->OldValue = \"\";\n }\n return $str;\n }",
"function wp_sto_print_select($arr_data, $name, $value)\n{\n\t$print_select = \"\";\n\t$print_select.= \"<select name='$name'>\";\n\n\tforeach ($arr_data as $data) \n\t{\n\t\t$selected = $data['value'] == $value ? 'selected' : '';\n\n\t\t$print_select.= \"<option value='{$data['value']}' $selected >{$data['label']}</option>\";\n\t}\n\n\t$print_select.= \"</select>\";\n\n\techo $print_select;\n}",
"function wc_dropdown_variation_attribute_options($args = array())\n {\n $args = wp_parse_args(\n apply_filters('woocommerce_dropdown_variation_attribute_options_args', $args),\n array(\n 'options' => false,\n 'attribute' => false,\n 'product' => false,\n 'selected' => false,\n 'name' => '',\n 'id' => '',\n 'class' => '',\n 'show_option_none' => __('Choose an option', 'woocommerce'),\n )\n );\n\n // Get selected value.\n if (false === $args['selected'] && $args['attribute'] && $args['product'] instanceof WC_Product) {\n $selected_key = 'attribute_' . sanitize_title($args['attribute']);\n // phpcs:disable WordPress.Security.NonceVerification.Recommended\n $args['selected'] = isset($_REQUEST[ $selected_key ]) ? wc_clean(wp_unslash($_REQUEST[ $selected_key ])) : $args['product']->get_variation_default_attribute($args['attribute']);\n // phpcs:enable WordPress.Security.NonceVerification.Recommended\n }\n $options = $args['options'];\n $product = $args['product'];\n $attribute = $args['attribute'];\n $name = $args['name'] ? $args['name'] : 'attribute_' . sanitize_title($attribute);\n $id = $args['id'] ? $args['id'] : sanitize_title($attribute);\n $class = $args['class'];\n $show_option_none = (bool) $args['show_option_none'];\n $show_option_none_text = $args['show_option_none'] ? $args['show_option_none'] : __('Choose an option', 'woocommerce'); // We'll do our best to hide the placeholder, but we'll need to show something when resetting options.\n\n if (empty($options) && ! empty($product) && ! empty($attribute)) {\n $attributes = $product->get_variation_attributes();\n $options = $attributes[ $attribute ];\n }\n\n if ($args['attribute'] == \"pa_gift\") {\n $html = '<select id=\"' . esc_attr($id) . '\" class=\"d-none ' . esc_attr($class) . '\" name=\"' . esc_attr($name) . '\" data-attribute_name=\"attribute_' . esc_attr(sanitize_title($attribute)) . '\" data-show_option_none=\"' . ($show_option_none ? 'yes' : 'no') . '\">';\n } else {\n $html = '<select id=\"' . esc_attr($id) . '\" class=\"' . esc_attr($class) . '\" name=\"' . esc_attr($name) . '\" data-attribute_name=\"attribute_' . esc_attr(sanitize_title($attribute)) . '\" data-show_option_none=\"' . ($show_option_none ? 'yes' : 'no') . '\">';\n }\n $html .= '<option value=\"\">' . esc_html($show_option_none_text) . '</option>';\n\n if (! empty($options)) {\n if ($product && taxonomy_exists($attribute)) {\n // Get terms if this is a taxonomy - ordered. We need the names too.\n $terms = wc_get_product_terms(\n $product->get_id(),\n $attribute,\n array(\n 'fields' => 'all',\n )\n );\n\n foreach ($terms as $term) {\n if (in_array($term->slug, $options, true)) {\n $html .= '<option value=\"' . esc_attr($term->slug) . '\" ' . selected(sanitize_title($args['selected']), $term->slug, false) . '>' . esc_html(apply_filters('woocommerce_variation_option_name', $term->name, $term, $attribute, $product)) . '</option>';\n }\n }\n } else {\n foreach ($options as $option) {\n // This handles < 2.4.0 bw compatibility where text attributes were not sanitized.\n $selected = sanitize_title($args['selected']) === $args['selected'] ? selected($args['selected'], sanitize_title($option), false) : selected($args['selected'], $option, false);\n $html .= '<option value=\"' . esc_attr($option) . '\" ' . $selected . '>' . esc_html(apply_filters('woocommerce_variation_option_name', $option, null, $attribute, $product)) . '</option>';\n }\n }\n }\n\n $html .= '</select>';\n\n\n if ($args['attribute'] == \"pa_gift\") {\n if (! empty($options)) {\n $html .= '<div class=\"switch-text\"><i class=\"fa fa-gift\"></i> Regálalo';\n $html .= '<label id=\"product-combinations\" class=\"switch\">';\n if ($product && taxonomy_exists($attribute)) {\n // Get terms if this is a taxonomy - ordered. We need the names too.\n $terms = wc_get_product_terms(\n $product->get_id(),\n $attribute,\n array(\n 'fields' => 'all',\n )\n );\n \n if (count($terms) == 2) {\n $html .= '<input type=\"checkbox\" id=\"gift-switch\" data-target=\"false\">';\n $html .= '<div class=\"slider round\"></div>';\n $html .= '</label></div>';\n\n $html .= '<div id=\"hidden-block\">';\n foreach ($terms as $term) {\n if (in_array($term->slug, $options, true)) {\n $html .= '<input id=\"'.esc_attr($term->slug).'\" data-target=\"#'.esc_attr($id).'\" data-value=\"'. esc_attr($term->slug) .'\" type=\"hidden\" value=\"' . esc_attr($term->slug) . '\" ' . selected(sanitize_title($args['selected']), $term->slug, false) . '>';\n }\n }\n $html .= '</div>';\n } else {\n echo '<div class=\"alert alert-warning\"><p>ERROR: This module just works with two options</p></div>';\n }\n }\n }\n }\n\n // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n echo apply_filters('woocommerce_dropdown_variation_attribute_options_html', $html, $args);\n }",
"function output_limit_currency_option() {\n\t\tglobal $hrb_options;\n\n\t\t$args = array(\n\t\t\t'id' => 'allowed_currencies',\n\t\t\t'name' => 'allowed_currencies[]',\n\t\t\t'placeholder' => __( 'Choose one or multiple currencies. Leave empty to allow all.', APP_TD ),\n\t\t\t'multiple' => 'multiple',\n\t\t);\n\n\t\t$opts = '';\n\t\tforeach( APP_Currencies::get_currency_string_array() as $key => $value ) {\n\t\t\t$atts = array( 'value' => $key, 'title' => $value );\n\t\t\tif ( in_array( $key, (array) $hrb_options->allowed_currencies ) ) {\n\t\t\t\t$atts['selected'] = 'selected';\n\t\t\t}\n\t\t\t$opts .= html( 'option', $atts, $value );\n\t\t}\n\n\t\treturn html( 'select', $args, $opts );\n\t}",
"private function generateWalletHtmlSelectChoices()\n {\n $walletChoices = array();\n $wallets = $this->walletRepository->findAll();\n foreach ($wallets as $wallet) {\n $walletChoices[$wallet->getId()->getValue()] = $wallet->getName();\n }\n return $walletChoices;\n }",
"function wporg_field_type_cb($args)\n{\n // get the value of the setting we've registered with register_setting()\n $options = get_option('wporg_options');\n // output the field\n ?>\n <select id=\"<?= esc_attr($args['label_for']); ?>\"\n data-custom=\"<?= esc_attr($args['wporg_custom_data']); ?>\"\n name=\"wporg_options[<?= esc_attr($args['label_for']); ?>]\"\n >\n <option value=\"Desarrollo\" <?= isset($options[$args['label_for']]) ? (selected($options[$args['label_for']], 'Desarrollo', false)) : (''); ?>>\n <?= esc_html('Desarrollo', 'wporg'); ?>\n </option>\n <option value=\"Producción\" <?= isset($options[$args['label_for']]) ? (selected($options[$args['label_for']], 'Producción', false)) : (''); ?>>\n <?= esc_html('Producción', 'wporg'); ?>\n </option>\n </select>\n <p class=\"description\">\n <?= esc_html('Selecciona Desarrollo para mostrar las opciones para desarrolladores.', 'wporg'); ?>\n </p>\n <p class=\"description\">\n <?= esc_html('Selecciona Producción para eliminar las opciones de desarrollo.', 'wporg'); ?>\n </p>\n <?php\n}",
"function buildProductsSelect($products) {\n $prodList = '<select name=\"invId\" id=\"invId\">';\n $prodList .= \"<option>Choose a Product</option>\";\n foreach ($products as $product) {\n $prodList .= \"<option value='$product[invId]'>$product[invName]</option>\";\n }\n $prodList .= '</select>';\n return $prodList;\n}",
"function ec_print_product_select( $id ){\n\t\n\tglobal $wpdb;\n\t$total = $wpdb->get_var( \"SELECT COUNT( ec_product.product_id ) as total FROM ec_product\" );\n\t\n\tif( $total > 500 ){\n\t\t\n\t\techo \"<input type=\\\"text\\\" class=\\\"ec_editor_select_box\\\" id=\\\"\" . $id . \"\\\">\";\n\t\t\n\t}else{\n\t\t\n\t\techo \"<select class=\\\"ec_editor_select_box\\\" id=\\\"\" . $id . \"\\\">\";\n\t\t$products = $wpdb->get_results( \"SELECT ec_product.product_id, ec_product.title, ec_product.model_number FROM ec_product ORDER BY ec_product.title\" );\n\t\tif( count( $products ) > 0 ){\n\t\t\techo \"<option value=\\\"0\\\">Select a Product</option>\";\n\t\t\tfor( $i=0; $i<count( $products ); $i++ ){\n\t\t\t\techo \"<option value=\\\"\" . $products[$i]->product_id . \"\\\">\" . $products[$i]->title . \"</option>\";\n\t\t\t}\n\t\t}else{\n\t\t\techo \"<option value=\\\"0\\\">No Products Exist</option>\";\n\t\t}\n\t\techo \"</select>\";\n\t\t\n\t}\n\t\n}",
"public function getDomSelect(){\n $DOM = new Balise('select');\n foreach ($this->oListe as $KC => $OCAT){\n $OPT = new Balise('option');\n $DOM->add($OPT);\n $OPT->add($OCAT->getLibelle());\n $OPT->addAttribut('value', $KC);\n }\n return $DOM;\n }",
"public function getStoresAsCombo($name)\n\t{\n\t\t$retour = '<select name=\"'.$name.'\" id=\"'.$name.'\">';\n\t\t\n\t\t$collection = mage::getModel('core/store')->getCollection();\n\t\tforeach ($collection as $item)\n\t\t{\n\t\t\t$enable = mage::getStoreConfig('privatesales/general/enable', $item);\n\t\t\tif ($enable)\n\t\t\t\t$retour .= '<option value=\"'.$item->getstore_id().'\">'.$item->getname().'</option>';\n\t\t}\t\n\t\t\n\t\t$retour .= '</select>';\n\t\treturn $retour;\n\t}",
"public function optionsForName(string $name)\n {\n $selects = $this->model\n ->with(\n [\n 'options' => function ($q) {\n return $q\n ->select('id', 'lists_selects_id', 'option_name', 'background_color', 'color', 'notes')\n ->with('currentTrans')\n ->where($this->isShow())\n ->remember(60);\n }\n ]\n )->where($this->forName($name))->remember(60)->first();\n $options = new Collection();\n\n $selects->options->each(function ($option) use ($options) {\n $temp = new Collection();\n $temp->put('id', $option->id);\n $temp->put('value', $option->currentTrans->value);\n $options->push($temp);\n });\n\n return $options;\n }",
"private function generate_sf_select_element( array $fields, string $name, string $selected ) {\n return $this->generate_select_element( $fields, $name, $selected, true );\n }",
"protected function _getFormElement($name)\n {\n return new Zend_Form_Element_Select($name);\n }",
"function get_theme_option($option_name){\n $value = Customizer::get_option_value($option_name);\n return $value;\n }",
"function select(string $name, $value, array $options): string\n{\n $html_options = [];\n\n foreach ($options as $k => $option) {\n\n $attributes = $k == $value ? 'selected' : '';\n $html_options[] = \"<option value= '$k' $attributes>$option</option>\";\n }\n return \"<select class='form-control' name ='$name'\" . implode($html_options) . '<selected>';\n}",
"public static function options_content()\n {\n global $post;\n $configs_services = OmnivaLt_Core::get_configs('additional_services');\n ?>\n <div id='omnivalt_options' class='panel woocommerce_options_panel'>\n <div class='options_group'>\n <?php\n foreach ($configs_services as $service_key => $service_values) {\n if (!$service_values['in_product']) continue;\n\n $field_params = array(\n 'id' => '_omnivalt_' . $service_key,\n 'label' => $service_values['title'],\n );\n if (!empty($service_values['desc_product'])) {\n $field_params['desc_tip'] = 'true';\n $field_params['description'] = $service_values['desc_product'];\n }\n\n if ($service_values['in_product'] === 'checkbox') {\n woocommerce_wp_checkbox($field_params);\n }\n if ($service_values['in_product'] === 'text') {\n $field_params['type'] = 'text';\n woocommerce_wp_text_input($field_params);\n }\n if ($service_values['in_product'] === 'number') {\n $field_params['type'] = 'number';\n $field_params['custom_attributes'] = array(\n 'min' => '',\n 'max' => '',\n 'step' => '1',\n );\n woocommerce_wp_text_input($field_params);\n }\n }\n ?>\n </div>\n </div>\n <?php\n }",
"function select_control( $control_set, $name, $value, $initial='' ) {\n return NL . '<select id=\"' . $name . '\" name=\"' . $name . '\">'\n . get_control_options( $control_set, $name, $value, translate( $initial ))\n . NL . '</select>'\n ;\n}",
"public function select_options_pulldown ( $name, $options, $selected='' ) {\n\t global $vmat_plugin;\n\t $output = '';\n\t $output .= '<select name=\"' . $name . '\" id=\"_vmat_' . $name . '\" class=\"postform vmat-select\">';\n\t foreach ( $options as $opt_value=>$opt_name ) {\n\t $title = '';\n\t if( 'vmat_org' == $name ) {\n\t $org_data = $vmat_plugin->get_common()->get_organization_data( $opt_value );\n\t $title = $org_data['description'];\n\t }\n\t $option_selected = 'selected';\n\t if ( $opt_value != $selected ) {\n\t $option_selected = '';\n\t }\n\t $output .= '<option title=\"' . $title . '\" value=\"' . $opt_value . '\" ' . $option_selected .'>' . $opt_name . '</option>';\n\t }\n\t $output .= '</select>';\n\t return $output;\n\t}"
] | [
"0.62109494",
"0.6082722",
"0.5913582",
"0.59130645",
"0.58531076",
"0.5803474",
"0.5771432",
"0.57469326",
"0.5745065",
"0.5733586",
"0.5727624",
"0.57155466",
"0.57145584",
"0.5713374",
"0.5707338",
"0.5695983",
"0.5676209",
"0.5660745",
"0.5642868",
"0.5634097",
"0.563322",
"0.5619292",
"0.55909944",
"0.55758494",
"0.55591124",
"0.55387527",
"0.55350816",
"0.5514445",
"0.5513891",
"0.5505849"
] | 0.61210287 | 1 |
return true or false if the current user can use the translation tools | public static function canTranslate(sfContext $context)
{
$sf_user = $context->getUser();
if($sf_user instanceof sfGuardSecurityUser)
{
return $sf_user->isSuperAdmin();
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _checkTranslate()\n\t{\n\t\tglobal $lng, $ilSetting, $ilUser, $rbacsystem;\n\n\t\tif (!$ilSetting->get(\"lang_ext_maintenance\")\n\t\tor !$ilSetting->get(\"lang_translate_\".$lng->getLangKey()))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($ilUser->getId())\n\t\t{\n\t\t\t$ref_id = self::_lookupLangFolderRefId();\n\t\t\treturn $rbacsystem->checkAccess(\"read,write\", (int) $ref_id);\n\t\t}\n\t\treturn false;\n\t}",
"protected function translatable() : bool\n {\n return true;\n }",
"public function isTranslationSystemEnabled(): bool\n {\n $availableLanguages = $this->getAvailableLanguages();\n\n return is_array($availableLanguages) && !empty($availableLanguages);\n }",
"public function isUsingNewTranslationSystem()\n {\n return false;\n }",
"public function isAppTranslatable();",
"public function isMultilingual();",
"public function isMultilanguage()\n {\n return false;\n }",
"protected function localize_access() {\n // We could check also whether the object has strings to translate:\n // && $this->get_strings(array('empty' => TRUE))\n // However it may be better to display the 'No available strings' message\n // for the user to have a clue of what's going on. See i18n_string_translate_page_object()\n return user_access('translate interface') && user_access('translate user-defined strings');\n }",
"public function authorize(): bool\n {\n return Gate::allows('seo.translation.edit', [$this->translation]);\n }",
"public function isAppTranslatable()\n {\n return count(config('translatable.locales')) > 1;\n }",
"public function isTranslationOverlay() {\n \treturn $this->supportsTranslations() && ($this->getLanguageUid() != 0);\n }",
"function rocket_has_translation_plugin_active() {\n\t\t_deprecated_function( __FUNCTION__, '2.2', 'rocket_has_i18n()' );\n\t\treturn rocket_has_i18n();\n\t}",
"public function getTranslated(): bool\n {\n return $this->translated;\n }",
"static public function globalToolsPrivilege()\n {\n if (self::getCurrentPage() && self::getCurrentPage()->userHasPrivilege('edit'))\n {\n return true;\n }\n // if you are the site admin, there are ALWAYS tools for you in the apostrophe\n $user = sfContext::getInstance()->getUser();\n return $user->hasCredential('cms_admin');\n }",
"protected function addLocalLanguage(): bool\n {\n return true;\n }",
"public function hasTranslator()\r\n {\r\n return (bool)$this->_translator;\r\n }",
"public function hasTranslator()\n {\n return (bool)$this->_translator;\n }",
"public function need_autocomplete_language () {\n\n $this->test_config_initialized();\n\n return ($this->database_config['conn_schema']['correct_language'] ? true : false);\n }",
"public function supportsTranslation() {\r\n\t\treturn tx_tcaobjects_div::supportsTranslations($this->getTable());\r\n\t}",
"public function isToolsAllowed();",
"function apsa_qtranslate_old_available() {\n\n if (function_exists('qtrans_getLanguage') && !function_exists('qtranxf_getLanguage')) {\n return true;\n } else {\n return false;\n }\n}",
"public function getIsTranslator()\n {\n return $this->hasRole(Role::GROUP_TRANSLATOR);\n }",
"function WPBC_is_qtrans(){\n\t\tif( function_exists('qtrans_getLanguage') && defined('BC_ACF_QTRANSLATEX_ENABLED') && BC_ACF_QTRANSLATEX_ENABLED == true ){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function hasTranslator ()\n {\n return (bool) $this->_translator;\n }",
"function _multilingual(){\n\tif(_cfg('languages')){\n\t\treturn (count(_cfg('languages')) > 1) ? true : false;\n\t}else{\n\t\treturn false;\n\t}\n}",
"public function checkRegistryRequestsAnswers()\n {\n return $this->translate && $this->util;\n }",
"function apsa_qtranslateX_available() {\n if (function_exists('qtranxf_getLanguage')) {\n return true;\n } else {\n return false;\n }\n}",
"private function hasTranslator()\n {\n return $this->translator instanceof Translator;\n }",
"public function supportsTranslations() {\n \treturn tx_tcaobjects_div::supportsTranslations($this->_table); \n }",
"protected function canRun() {\n\t\t$helper = JPATH_SITE.'/components/com_rseventspro/helpers/rseventspro.php';\n\t\tif (file_exists($helper)) {\n\t\t\trequire_once $helper;\n\t\t\tJFactory::getLanguage()->load('plg_system_rsepropaypal',JPATH_ADMINISTRATOR);\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}"
] | [
"0.7629178",
"0.7068364",
"0.7023277",
"0.69676983",
"0.67403126",
"0.6675513",
"0.6667751",
"0.6655514",
"0.664027",
"0.6598743",
"0.65435404",
"0.6534369",
"0.6469519",
"0.64583737",
"0.64479196",
"0.643577",
"0.6434347",
"0.63951623",
"0.63913995",
"0.6359687",
"0.63570046",
"0.6352298",
"0.63196886",
"0.6318354",
"0.6317587",
"0.6301695",
"0.6288024",
"0.6247255",
"0.621585",
"0.62128335"
] | 0.72903913 | 1 |
TODO: Implement getAuthIdentifierName() method. | public function getAuthIdentifierName()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAuthIdentifierName();",
"public function getAuthIdentifier()\n {\n }",
"public function getAuthIdentifierName(){\n return 'id';\n }",
"public function getAuthIdentifier(){\n $name = $this->getAuthIdentifierName();\n\n return $this->{$name};\n }",
"public function getAuthIdentifierName(): string\n {\n return $this->getKeyName();\n }",
"public function getAuthIdentifierName()\n {\n return $this->getKeyName();\n }",
"public function getAuthIdentifier()\n {\n return $this->{$this->getAuthIdentifierName()};\n }",
"public function getAuthIdentifierName()\n {\n return 'id';\n }",
"public function getAuthIdentifier(){\n return $this->id;\n }",
"public function getAuthIdentifierName()\n {\n return '_id';\n }",
"public function getAuthIdentifier()\n\t\t{\n\t\t return $this->getKey();\n\t\t}",
"public function getAuthIdentifier()\n {\n $name = $this->getAuthIdentifierName();\n\n return $this->{$name};\n }",
"public function getAuthIdentifier()\n {\n $getId = 'get' . $this->getAuthIdentifierName(); \n return $this->$getId();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->id;\n }",
"public function getAuthIdentifier(){\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->id;\n\t}",
"public function getAuthIdentifier()\n {\n return $this->_id;\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}"
] | [
"0.86994195",
"0.8487985",
"0.8264663",
"0.81271976",
"0.80596644",
"0.8053448",
"0.80420417",
"0.803147",
"0.79482645",
"0.7862972",
"0.7857616",
"0.78461194",
"0.7814905",
"0.78073126",
"0.78051114",
"0.778071",
"0.7767777",
"0.7714401",
"0.7661296",
"0.7661296",
"0.7661296",
"0.7661296",
"0.7661296",
"0.7661296",
"0.7661296",
"0.7658902",
"0.7658902",
"0.7658902",
"0.7658902",
"0.7658902"
] | 0.88825744 | 0 |
TODO: Implement getAuthIdentifier() method. | public function getAuthIdentifier()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAuthIdentifier(){\n return $this->id;\n }",
"public function getAuthIdentifier()\n {\n return $this->id;\n }",
"public function getAuthIdentifier()\n {\n return $this->_id;\n }",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->id;\n\t}",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier(){\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n\t\t{\n\t\t return $this->getKey();\n\t\t}",
"public function getAuthIdentifier()\n {\n return $this->{$this->getAuthIdentifierName()};\n }",
"public function getAuthIdentifierName()\n {\n }",
"public function getAuthIdentifier(){\n $name = $this->getAuthIdentifierName();\n\n return $this->{$name};\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n {\n return $this->getKey();\n }",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}",
"public function getAuthIdentifier()\n\t{\n\t\treturn $this->getKey();\n\t}"
] | [
"0.8351338",
"0.8128239",
"0.8104458",
"0.8055232",
"0.795858",
"0.79549026",
"0.79501134",
"0.78313434",
"0.77775383",
"0.7753335",
"0.774261",
"0.774261",
"0.774261",
"0.774261",
"0.774261",
"0.774261",
"0.774261",
"0.7739201",
"0.7739201",
"0.7739201",
"0.7739201",
"0.7739201",
"0.7739201",
"0.7739201",
"0.7739201",
"0.7739201",
"0.7739201",
"0.7739201",
"0.7739201",
"0.7739201"
] | 0.8642736 | 0 |
TODO: Implement getRememberToken() method. | public function getRememberToken()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRememberToken()\n {\n // TODO: Implement getRememberToken() method.\n }",
"public function getRememberToken(){\n return $this->rememberToken;\n }",
"public function getRememberToken()\n {\n return $this->remember_token;\n }",
"public function getRememberToken()\n {\n return $this->remember_token;\n }",
"public function getRememberToken()\n {\n return $this->remember_token;\n }",
"public function getRememberToken()\n {\n return $this->remember_token;\n }",
"public function getRememberToken()\n {\n return $this->remember_token;\n }",
"public function getRememberToken()\n {\n return $this->remember_token;\n }",
"public function getRememberToken()\n {\n return $this->remember_token;\n }",
"public function getRememberToken()\n {\n return $this->remember_token;\n }",
"public function getRememberToken()\n\t{\n\t\treturn null;\n\t}",
"public function getRememberToken()\n\t{\n\t return $this->remember_token;\n\t}",
"public function getRememberToken()\n {\n return null;\n }",
"public function getRememberToken()\n\t{\n\t\treturn $this->remember_token;\n\t}",
"public function getRememberToken()\n\t{\n\t\treturn $this->remember_token;\n\t}",
"public function getRememberToken()\n\t{\n\t\treturn $this->remember_token;\n\t}",
"public function getRememberToken()\n {\n return $this->rememberToken;\n }",
"public function getRememberToken()\n {\n $getRemember = 'get' . $this->getRememberTokenField();\n return $this->$getRemember();\n }",
"public function getRememberToken()\n\n\t{\n\n\t\treturn $this->remember_token;\n\n\t}",
"private function rememberToken()\n {\n return CookieManager::get(self::REMEMBER_ME);\n }",
"public function getRememberToken(): string\n {\n return $this->rememberToken;\n }",
"public function getRememberToken()\n {\n return $this->get($this->params['db.rememberToken']);\n }",
"public function getRememberTokenName(){\n return $this->remember_token;\n }",
"public function getRememberToken()\n {\n throw new \\BadMethodCallException('Unexpected method [getRememberToken] call');\n }",
"public function getRememberTokenName()\n {\n }",
"public function getRememberTokenName()\n {\n }",
"public function getRememberTokenName()\n {\n return 'remember_token';\n }",
"public function getRememberTokenName(){\n return \"rememberToken\";\n }",
"public function getRememberTokenName()\n {\n return 'remember_token';\n }",
"public function getRememberTokenName()\n {\n return 'remember_token';\n }"
] | [
"0.8910994",
"0.8532921",
"0.8517573",
"0.8517573",
"0.8517573",
"0.8517573",
"0.8517573",
"0.8517573",
"0.8517573",
"0.8517573",
"0.85013807",
"0.8499009",
"0.8487146",
"0.8485294",
"0.8485294",
"0.8485294",
"0.84591526",
"0.84185606",
"0.8405636",
"0.8336467",
"0.8145043",
"0.8126541",
"0.801039",
"0.78724706",
"0.7847373",
"0.7847373",
"0.7799535",
"0.77900773",
"0.7694297",
"0.7694297"
] | 0.9063597 | 1 |
TODO: Implement getRememberTokenName() method. | public function getRememberTokenName()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRememberTokenName()\n {\n // TODO: Implement getRememberTokenName() method.\n }",
"public function getRememberTokenName()\n\t{\n\t\treturn null;\n\t}",
"public function getRememberTokenName()\n\t{\n\t return 'remember_token';\n\t}",
"public function getRememberTokenName(){\n return $this->remember_token;\n }",
"public function getRememberTokenName()\n {\n return 'remember_token';\n }",
"public function getRememberTokenName()\n\t{\n\t\treturn 'remember_token';\n\t}",
"public function getRememberTokenName()\n\t{\n\t\treturn 'remember_token';\n\t}",
"public function getRememberTokenName()\n\t{\n\t\treturn 'remember_token';\n\t}",
"public function getRememberTokenName()\n {\n return $this->rememberTokenName;\n }",
"public function getRememberTokenName()\n {\n return 'remember_token';\n }",
"public function getRememberTokenName()\n {\n return 'remember_token';\n }",
"public function getRememberTokenName()\n {\n return 'remember_token';\n }",
"public function getRememberTokenName()\n {\n return 'remember_token';\n }",
"public function getRememberTokenName()\n {\n return 'remember_token';\n }",
"public function getRememberTokenName()\n {\n return 'remember_token';\n }",
"public function getRememberTokenName()\n {\n return 'remember_token';\n }",
"public function getRememberTokenName()\n {\n return 'remember_token';\n }",
"public function getRememberTokenName()\n\n\t{\n\n\t\treturn 'remember_token';\n\n\t}",
"public function getRememberTokenName(){\n return \"rememberToken\";\n }",
"public function getRememberTokenName()\n {\n return $this->getRememberTokenField();\n }",
"public function getRememberTokenName()\n {\n return '';\n }",
"public function getRememberToken()\n {\n }",
"public function getRememberToken()\n {\n }",
"public function getRememberToken()\n {\n // TODO: Implement getRememberToken() method.\n }",
"public function getRememberTokenName()\n {\n throw new \\BadMethodCallException('Unexpected method [getRememberTokenName] call');\n }",
"public function getRememberToken(): string\n {\n return $this->rememberToken;\n }",
"public function getRememberToken()\n\t{\n\t\treturn $this->remember_token;\n\t}",
"public function getRememberToken()\n\t{\n\t\treturn $this->remember_token;\n\t}",
"public function getRememberToken()\n\t{\n\t\treturn $this->remember_token;\n\t}",
"public function getRememberToken()\n\t{\n\t return $this->remember_token;\n\t}"
] | [
"0.88858753",
"0.87319547",
"0.8727533",
"0.8720018",
"0.8681054",
"0.867871",
"0.867871",
"0.867871",
"0.8663663",
"0.86444366",
"0.86444366",
"0.86444366",
"0.86444366",
"0.86444366",
"0.86444366",
"0.86444366",
"0.86444366",
"0.8591845",
"0.85862726",
"0.85647315",
"0.85348636",
"0.85210925",
"0.85210925",
"0.8393348",
"0.8301183",
"0.8239555",
"0.8178281",
"0.8178281",
"0.8178281",
"0.8173668"
] | 0.90439224 | 1 |
Display the past course page. | public function actionPastcourse($id)
{
$edition = CourseSite::findIdentity($id);
return $this->render('pastcourse', [
'edition' => $edition,
'pages' => $edition->getPages()->all()
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function teacherCourseOverview(){\n\t\t$courseID=$this->isCourseLeader();\n\t\tif($courseID){\n\t\t\t$course = new Course($this->db);\n\t\t\t$course->courseByID($courseID);\n\t\t\t$this->f3->set('courseCard',$course->courseToArray());\n\t\t\t$this->f3->set('teacherCourseOverviewHeader',$this->f3->get('lang.deadlineEditCourseAchieved',$this->f3->get('deadlineEditCourse')));\n\t\t\t$this->f3->set('content','teacher/courseOverview.html');\n\t\t}else{\n\t\t\t$this->f3->set('message',array($this->f3->get('lang.deadlineEditCourseAchieved',$this->f3->get('deadlineEditCourse')),$this->f3->get('lang.teacherNoCourse')));\n\t\t\t$this->f3->set('content','message.html');\n\t\t}\n\t\t$this->mainTemplate();\n\t}",
"public function add_course_page()\n\t{\n\t\t$data['get_course']=$this->file_model->get_course();\n\t\t$this->load->view('common/header');\n\t \t$this->load->view('common/sidebar');\n\t\t$this->load->view('course_listing',$data);\n\t}",
"public function index()\n {\n return view('admin.major_admin.course')->with(['url'=>'course']);\n }",
"function displayEditPastCoursesForm($pastCourses)\n{\n\techo '<p><b style=\"font-size:25\">Past Courses </b>';\n\t\n\t// display the link to shrink/expand the past courses (the text alternates between + and - on click)\n\techo '<a href=\"javascript:show(\\'editPastCourses\\')\" onclick=\"this.innerHTML=(this.innerHTML==\\'[+]\\' ? \\'[–]\\':\\'[+]\\')\">[–]</a></p>';\n\n\techo '<div id=\"editPastCourses\" style=\"display:block\">';\n\n\techo '<table width=\"100%\"><tr>';\n\t\techo '<th>Department</th>';\n\t\techo '<th>Course</th>';\n\t\techo '<th>Section</th>';\n\t\techo '<th>Time</th>';\n\t\techo '<th>Days</th>';\n\t\techo '<th>Semester</th>';\n\t\techo '<th>Year</th>';\t\n\t\techo '<th>Grade</th>';\n\techo '</tr>';\n\n\t\n\t$sems = array('SP','SI','SU','FA','WI');\t\n\t$possibleGrades = array('A','B','C','D','F','CR','NC','W','I','-');\n\n\t// displays each past course taken as a row in the table with the course dept, course num, section num, meet and end times,\n\t// meeting days, semester, year, and grade which is in a drop down (it is changeable)\n\t// also displays a remove button for each course\n\twhile ($row = mysql_fetch_assoc($pastCourses))\n\t{\n\t\textract($row);\n\t\techo '<tr>';\n\t\t\techo '<td style=\"text-align:center\">'.$course_dept.'</td>';\n\t\t\techo '<td style=\"text-align:center\">'.$course_num.'</td>';\n\t\t\techo '<td style=\"text-align:center\">'.$section_num.'</td>';\n\t\t\techo '<td style=\"text-align:center\">'.$meet_time.' - '.$end_time.'</td>';\n\t\t\techo '<td style=\"text-align:center\">'.$days.'</td>';\n\t\t\techo '<td style=\"text-align:center\">'.$sems[$semester].'</td>';\n\t\t\techo '<td style=\"text-align:center\">'.$year.'</td>';\n\t\t\techo '<td align=\"center\">';\n\t\t\t\t// course grade cell\n\t\t\t\techo '<form name=\"changeGrade\" action=\"profileEditCourses.php?edit=changeGrade\" method=\"post\">';\n\t\t\t\t// hidden inputs contain the required information to the identify the course when a grade being changed\n\t\t\t\techo '<input type=\"hidden\" name=\"course_dept\" value='.$course_dept.' />';\n\t\t\t\techo '<input type=\"hidden\" name=\"course_num\" value='.$course_num.' />';\n\t\t\t\techo '<input type=\"hidden\" name=\"section_num\" value='.$section_num.' />';\n\t\t\t\techo '<input type=\"hidden\" name=\"semester\" value='.$semester.' />';\n\t\t\t\techo '<input type=\"hidden\" name=\"year\" value='.$year.' />';\n\t\t\t\t\t\n\t\t\t\t// grade drop down menu\n\t\t\t\techo '<select name=\"grade\" onchange=\"this.form.submit();\">';\n\n\t\t\t\t// display each possible grades as an option in the dropdown and selects the one currently recorded as the default\n\t\t\t\tforeach ($possibleGrades as $g) \n\t\t\t\t\techo '<option'.($grade==$g || (!$grade && $g=='-')?' selected=\"selected\"':'').'>'.$g.'</option>';\n\n\t\t\t\techo '</select>';\n\t\t\t\techo '</form>';\n\t\t\techo '</td>';\n\n\t\t\t// remove button\n\t\t\techo '<td align=\"right\">';\n\t\t\t\techo '<form name=\"removePastCourse\" action=\"profileEditCourses.php?edit=removeCourse\" method=\"post\">';\n\t\t\t\t// hidden inputs contain the identifying information for the course being removed\n\t\t\t\techo '<input type=\"hidden\" name=\"course_dept\" value='.$course_dept.' />';\n\t\t\t\techo '<input type=\"hidden\" name=\"course_num\" value='.$course_num.' />';\n\t\t\t\techo '<input type=\"hidden\" name=\"section_num\" value='.$section_num.' />';\n\t\t\t\techo '<input type=\"hidden\" name=\"semester\" value='.$semester.' />';\n\t\t\t\techo '<input type=\"hidden\" name=\"year\" value='.$year.' />';\n\t\t\t\techo '<input type=\"submit\" value=\"Remove\" />';\n\t\t\t\techo '</form>';\n\t\t\techo '</td>';\n\t\techo '</tr>';\n\t}\n\techo '</table>';\n\techo '</div>';\n}",
"public function viewCourseAction(Course $course)\n\t{\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t\n\t\t$repository = $em->getRepository('InkyCourseBundle:Lesson\\Lesson');\n\t\t// If user not logged, error !\n\t\tif ($this->getUser()){$lessonList = $repository->getLessons($course->getId(), $this->getUser());}\n\t\telse {$lessonList = $repository->getLessons($course->getId());}\n\t\t\n\t\treturn $this->render(\t'InkyCourseBundle:Course:viewCourse.html.twig',\n\t\t\t\t\t\t\t\tarray(\t'course' => $course,\n\t\t\t\t\t\t\t\t\t\t'lessonList' => $lessonList,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t}",
"public function index()\n {\n $courses = Course::latest()->get();\n return view ('dashboard.courses.index', compact('courses'));\n }",
"public function index()\n {\n\n return view('admission.course');\n }",
"public function index()\n {\n $courses = $this->courseRepository->getCourseByTime();\n $categories = $this->categoryRepository->getParentCategory();\n\n return view('client.course.index', compact('courses', 'categories'));\n }",
"public function index()\n {\n $this->load->view('add_course_page');\n }",
"public function index() {\n\t\t\treturn view('course.index');\n\t\t\t\n\t\t}",
"public function indexAction()\n {\n return $this->render('CleverBirdBundle:Course:index.html.twig', [\n 'courses' => $this->getRep('CleverBirdBundle:Course')->findBy(['user' => $this->getUser()->getId()], ['id' => 'desc']),\n ]);\n }",
"public function show()\n {\n $course = Course::all();\n\n return view('admission.course-show',compact('course'));\n }",
"public function index()\n {\n $courses = course_year_lecturer::where('ucr_user_id', Auth::id())->get();\n// dd($courses);\n $pages = 'course';\n return view('lecturer.course.list', compact('courses', 'pages'));\n }",
"public function indexAction()\r\n {\r\n\t $this->view->courses = $this->getCourses();\r\n\t\t\r\n\t\t// Retrieve the form and assign it to the view\r\n\t\t$this->view->form = $this->getForm();\r\n \t\t$form = $this->getForm();\r\n }",
"public function index()\n {\n //\n \n $user = Auth::user();\n \n $courses = $user->courses_taken();\n $myCourses = $user->courses_owned();\n\n\treturn view('course.index')->with('courses',$courses)->with('courseOwned', $myCourses);\n }",
"public function show(Course $course)\n {\n //\n }",
"public function show(Course $course)\n {\n //\n }",
"public function show(Course $course)\n {\n //\n }",
"public function show(Course $course)\n {\n //\n }",
"public function show(Course $course)\n {\n //\n }",
"public function index()\n {\n return view('dashboard.course.index')->with('courses',Course::get());\n }",
"function displayProfileEditCourses($clid)\n{\n\techo '<h1 style=\"text-align:center\">Student Profile</h1><h3 style=\"text-align:center\">Edit Courses</h3><hr>';\n\n\techo '<center><form action=\"profile.php\"><input type=\"submit\" value=\"Back to profile\" /></form></center>';\n\t\n\tdisplayAddCoursesForm();\n\techo '<br>';\n\t$upcomingCourses = getUpcomingCourses($clid);\n\tdisplayEditUpcomingCoursesForm($upcomingCourses);\n\techo '<br>';\n\t$currentCourses = getCurrentCourses($clid);\n\tif ($_SESSION['advisor']==true) // user is an advisor\n\t\tdisplayEditCurrentCoursesForm($currentCourses);\n\telse\n\t\tdisplayCurrentCourses($currentCourses);\n\techo '<br>';\n\t$pastCourses = getPastCourses($clid);\n\tif ($_SESSION['advisor']==true) // user is an advisor\n\t\tdisplayEditPastCoursesForm($pastCourses);\n\telse\n\t\tdisplayPastCourses($pastCourses);\n\t\n}",
"public function show(Course $course)\n {\n\n }",
"function cma_pla_college()\n {\n drupal_set_title('College Courses Title');\n $includePath=$_SERVER['DOCUMENT_ROOT'].base_path().drupal_get_path('module','vcn_cma').\"/vcn_cma_pla.theme.inc\";\n include_once($includePath);\n $output .= displayCollegeCourses();\n return($output);\n }",
"public function show(Course $course)\n {\n $courseSchedule = Day::where('course_id', $course->id)->count();\n if($course->type == 1 || ($course->type == 3 && $courseSchedule == 0)){\n $days[0] = \"Bebas\";\n $hours[0] = \"Bebas\";\n }\n else {\n $days = preg_split('@;@', $course->day, NULL, PREG_SPLIT_NO_EMPTY);\n $hours = preg_split('@;@', $course->hour, NULL, PREG_SPLIT_NO_EMPTY);\n }\n\n $type = $course->type;\n if($type === 1){\n $backRoute = 'admin.muaythai.courses';\n }\n else if($type === 2){\n $backRoute = 'admin.dance.courses';\n }\n else if($type === 3){\n $backRoute = 'admin.private.courses';\n }\n else{\n $backRoute = 'admin.gymnastic.courses';\n }\n\n //Get customer/murid\n $customers = Schedule::where('course_id', $course->id)->get();\n return view('admin.courses.show', ['course' => $course, 'days' => $days, 'hours' => $hours, 'customers' => $customers, 'backRoute' => $backRoute]);\n }",
"public function wip_single_course_summary() {\n\t\t\tinclude_once WIP_PLUGIN_PATH . 'front/content-landing.php';\n\t\t}",
"function teacherStartpage(){\n\t\t//-> is coursemember? -> select: editcourse, deletecourse, leavecourse\n\t\t//-> no coursemember? -> newcourse, ask for enter course\n\t\t$courseID=$this->isCourseLeader();\n\t\tif($courseID){\n\t\t\t$course = new Course($this->db);\n\t\t\t$course->courseByID($courseID);\n\t\t\t$this->f3->set('course',$course);\n\t\t\t$this->f3->set('courseCard',$course->courseToArray());\n\t\t\t$this->f3->set('teacherCourseOverviewHeader',$this->f3->get('lang.teacherStartpageCourse'));\n\t\t\t$this->f3->set('content','teacher/startpageExistingCourse.html');\n\t\t\t\n\t\t}else{\n\t\t\t$this->f3->set('content','teacher/startpageWithoutCourse.html');\n\t\t}\n\t\t$this->mainTemplate();\n\t}",
"public function index()\n {\n $courses = Course::where('type', '!=', 'Base')\n ->orderBy('type')\n ->orderBy('live', 'desc')\n ->orderBy('created_at', 'desc')\n ->paginate(4);\n return view('courses.index')->with('courses', $courses);\n }",
"function coursePage($id) {\n $course = Course::find($id);\n $questions = $course->questions;\n return view('course', compact('course', 'questions'));\n }",
"public function index()\n {\n \n return view('home')->with('courses', Course::take(3)->where('status', 'open')->get());\n }"
] | [
"0.64893246",
"0.61615264",
"0.60790503",
"0.6029924",
"0.60230654",
"0.5968218",
"0.59590644",
"0.5942533",
"0.59406364",
"0.5919192",
"0.59141237",
"0.59014815",
"0.58972794",
"0.58955026",
"0.5883412",
"0.58567744",
"0.58567744",
"0.58567744",
"0.58567744",
"0.58567744",
"0.58197457",
"0.58145636",
"0.5812596",
"0.58018166",
"0.5801647",
"0.57687736",
"0.57531273",
"0.5741774",
"0.57364845",
"0.57189924"
] | 0.73784494 | 0 |
Save Ticket, ensuring a Staffer and Category is assigned | public function save(array $options = array())
{
// Do some testing before passing onto parent save method
if( $this->staffer === null || $this->staffer->exists === false )
{
throw new DomainException('Ticket must be assigned a Staffer under Category: '.$this->category);
}
if( $this->category === null || $this->category->exists === false )
{
throw new DomainException('Ticket must be assigned a Category');
}
if( ! $this->exists )
{
$this->raise( new TicketCreatedEvent($this) );
}
$saved = parent::save($options);
$this->saveMessages();
return $saved;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function saving(TicketCategory $model)\n {\n \n }",
"public function store(Request $request)\n {\n $common_data = $this->validation_common($request);\n extract($common_data);\n\n DB::beginTransaction();\n $ticket = new Ticket();\n\n $ticket->subject = $request->subject;\n $ticket->creator_id = $this->member->id;\n $ticket->user_id = $request->owner_id;\n\n if ($permission_level > 1) {\n $ticket->hidden = $request->hidden;\n\n if ($request->complete == 'yes') {\n $ticket->completed_at = Carbon::now();\n }\n\n $ticket->status_id = $request->status_id;\n $ticket->priority_id = $request->priority_id;\n } else {\n $ticket->status_id = Setting::grab('default_status_id');\n $default_priority_id = Setting::grab('default_priority_id');\n $ticket->priority_id = $default_priority_id == 0 ? Models\\Priority::first()->id : $default_priority_id;\n }\n\n if ($request->start_date != '') {\n $ticket->start_date = date('Y-m-d H:i:s', strtotime($request->start_date));\n } else {\n $ticket->start_date = Carbon::now();\n }\n if ($request->limit_date == '') {\n $ticket->limit_date = null;\n } else {\n $ticket->limit_date = date('Y-m-d H:i:s', strtotime($request->limit_date));\n }\n\n $ticket->category_id = $request->category_id;\n\n if ($permission_level == 1 or $request->input('agent_id') == 'auto') {\n $ticket->autoSelectAgent();\n } else {\n $ticket->agent_id = $request->input('agent_id');\n }\n\n $ticket->content = $a_content['content'];\n $ticket->html = $a_content['html'];\n\n if ($permission_level > 1) {\n $ticket->intervention = $a_intervention['intervention'];\n $ticket->intervention_html = $a_intervention['intervention_html'];\n }\n\n if ($ticket->agent_id != $this->member->id) {\n // Ticket will be unread for assigned agent\n $ticket->read_by_agent = 0;\n }\n\n $ticket->save();\n\n if (Setting::grab('ticket_attachments_feature')) {\n // Create attachments from embedded images\n $this->embedded_images_to_attachments($permission_level, $ticket);\n\n // Attached files\n $a_result_errors = $this->saveAttachments(compact('request', 'a_result_errors', 'ticket'));\n }\n\n // Embedded Comments\n list($a_new_comments, $a_result_errors) = $this->add_embedded_comments($permission_level, $request, $ticket, $a_result_errors);\n\n // If errors present\n if ($a_result_errors) {\n return response()->json(array_merge(\n ['result' => 'error'],\n $a_result_errors\n ));\n }\n\n // End transaction\n DB::commit();\n\n // Ticket event\n event(new TicketCreated($ticket));\n\n // Comment events\n if ($a_new_comments) {\n foreach ($a_new_comments as $comment) {\n event(new CommentCreated($comment, $request));\n }\n }\n\n $this->sync_ticket_tags($request, $ticket);\n\n session()->flash('status', trans('panichd::lang.the-ticket-has-been-created', [\n 'name' => '#'.$ticket->id.' '.$ticket->subject,\n 'link' => route(Setting::grab('main_route').'.show', $ticket->id),\n 'title' => trans('panichd::lang.ticket-status-link-title'),\n ]));\n\n return response()->json([\n 'result' => 'ok',\n 'url' => action('\\PanicHD\\PanicHD\\Controllers\\TicketsController@index'),\n ]);\n }",
"function save_ticket($topic,$topic_ticket)\n\t{\n\t\t\t//update also the priority / close status of the ticket if someone change it \n\t\t\t$this->db->where('support_ticket_id', $topic['support_ticket_id']);\t\t\t\n\t\t\t$this->db->update('support_ticket', $topic_ticket);\n\n\t\t\t$this->db->insert('support_ticket_item', $topic);\n\t\t\treturn $this->db->insert_id();\n\t}",
"public function save() {\n\t\t// refresh modified date\n\t\tif (isset($this->request->data['id'])) {\n\t\t\t$this->request->data['modified'] = null;\n\t\t}\n\n\t\t$this->Ticket->save($this->request->data);\n\n\t\t$this->set(array(\n\t\t\t'message' => $this->Ticket->makeMessage($this->Ticket->validationErrors, __('Ticket saved')),\n\t\t\t'_serialize' => array('message')\n\t\t));\n\t}",
"public function store(Request $request){\n $validator = $request->validate([\n 'ticket_category_name' => 'required|string|unique:ticket_categories,ticket_category_name',\n ]);\n\n try{\n $ticket_category = new TicketCategory();\n $ticket_category->ticket_category_name = $request->ticket_category_name;\n $ticket_category = $ticket_category->save();\n \n return redirect('admin/list-ticket-category')->with('success','Ticket Category Added Successfully.');\n }catch(\\Exception $e){\n return redirect()->route('admin.dashboard')->with('error','Something went wrong.');\n }\n }",
"function save() {\n $id = $this->input->post('id');\n\n // if ($id) {\n // validate_submitted_data(array(\n // \"ticket_type_id\" => \"required|numeric\"\n // ));\n // } else {\n // validate_submitted_data(array(\n // \"client_id\" => \"required|numeric\",\n // \"ticket_type_id\" => \"required|numeric\"\n // ));\n // }\n\n\n $client_id = $this->input->post('client_id');\n\n $this->access_only_allowed_members_or_client_contact($client_id);\n\n //if this logged in user is a client then overwrite the client id\n if ($this->login_user->user_type === \"client\") {\n $client_id = $this->login_user->client_id;\n }\n\n\n $now = get_current_utc_time();\n\n $location_data = array(\n \"client_id\" => $client_id,\n \"rental_type\" => $this->input->post('rental_type'),\n \"quantity\" => $this->input->post('quantity'),\n \"patient\" => $this->input->post('patient'),\n \"room\" => $this->input->post('room'),\n \"service\" => $this->input->post('service'),\n \"comment\" => $this->input->post('comment'), \n \"created_by\" => $this->login_user->id,\n \"created_at\" => $now,\n );\n\n $location_data = clean_data($location_data);\n\n if ($id) {\n //client can't update ticket\n if ($this->login_user->user_type === \"client\") {\n redirect(\"forbidden\");\n }\n\n //remove not updateable fields\n unset($location_data['client_id']);\n unset($location_data['created_by']);\n unset($location_data['created_at']);\n }\n\n $location_id = $this->Location_model->save($location_data, $id);\n\n\n\n if ($location_id) {\n\n\n //ticket added. now add a comment in this ticket\n if (!$id) {\n\n\n if ($location_id) {\n log_notification(\"location_created\", array(\"location_id\" => $location_id));\n }\n }\n\n echo json_encode(array(\"success\" => true, \"data\" => $this->_row_data($location_id),'id' => $location_id, 'message' => lang('record_saved')));\n } else {\n echo json_encode(array(\"success\" => false, 'message' => lang('error_occurred')));\n }\n }",
"public function store(Request $request)\n {\n $ticket=new Ticket;\n $ticket->title=$request->input('title');\n $ticket->priority=$request->input('priority');\n $ticket->status=$request->input('status');\n $ticket->severity=$request->input('severity');\n $ticket->ticket_num=$request->input('ticket_num');\n $ticket->description=$request->input('description');\n //Get the real time\n //$ticket->create_time=$request->input(create_time);\n //$ticket->modified_time=$request->input(modified_time);\n $ticket->assign_to=Auth::id();\n //Update\n //假装有\n $ticket->update=\"\";\n //这样写行不行\n //$lead->update=\"创建票务 \".$request->input(title).\" 于 \".$ticket->create_time;\n\n $organization_name=$request->input('organization_name');\n $contact_name=$request->input('contact_name');\n $organizationId=DB::table('organizations')->where('organization_name',$organization_name)\n ->value('id');\n $contactId=DB::table('contacts')->where('full_name',$contact_name)\n ->value('id');\n\n //If the organization doesn't exist\n if($organizationId=='') {\n //Create a new organization\n $organization=new Organization;\n $organization->organization_name=$request->input('organization_name');\n $organization->assign_to=Auth::id();\n $organization->city=\"\";\n $organization->website=\"\";\n $organization->phone=\"\";\n $organization->update=\"\";\n $organization->save();\n\n $organizationId=DB::table('organizations')->where('organization_name',$organization_name)\n ->value('id');\n $ticket->organization_id=$organizationId;\n }\n //If the organization exists\n else{\n $ticket->organization_id=$organizationId;\n }\n\n //If the organization doesn't exist\n if($contactId=='') {\n //Create a new contact\n $contact=new Contact;\n $contact->assign_to=Auth::id();\n $contact->first_name=\"\";\n $contact->last_name=\"\";\n $contact->full_name=$request->input('contact_name');\n $contact->title=\"\";\n $contact->organization_id=\"\";\n $contact->email=\"\";\n $contact->update=\"\";\n $contact->save();\n\n $contactId=DB::table('contacts')->where('contact_name',$contact_name)\n ->value('id');\n $ticket->contact_id=$contactId;\n }\n //If the organization exists\n else{\n $ticket->contact_id=$contactId;\n }\n\n if($ticket->save())\n { return Redirect::to('ticket/list'); }\n else\n { return Redirect::back()->withInput()->withErrors('保存失败!'); }\n }",
"public function store()\n\t{\n\t\t$tag = $this->sanitizeString(Input::get('tag'));\n\t\t$this->tickettype = 'complaint';\n\n\t\tif(Input::has('tickettype'))\n\t\t{\n\t\t\t$this->tickettype = 'incident';\n\t\t}\n\n\t\t/*\n\t\t|--------------------------------------------------------------------------\n\t\t|\n\t\t| \tVerifies if the user inputs a title\n\t\t|\n\t\t|--------------------------------------------------------------------------\n\t\t|\n\t\t*/\n\t\tif(Input::has('subject'))\n\t\t{\n\t\t\t$this->ticketname = $this->sanitizeString(Input::get('subject'));\n\n\t\t\t/*\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t|\n\t\t\t| \tCheck if ticketname has no value\n\t\t\t|\tif no value, type will be automatically complaint\n\t\t\t|\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t|\n\t\t\t*/\n\t\t\tif($this->ticketname == '' || $this->ticketname == null)\n\t\t\t{\n\t\t\t\t$this->ticketname = $tickettype;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ticketname = $tickettype;\n\t\t}\n\n\t\t/*\n\t\t|--------------------------------------------------------------------------\n\t\t|\n\t\t| \tVerifies if the user inputs an author\n\t\t|\n\t\t|--------------------------------------------------------------------------\n\t\t|\n\t\t*/\n\t\tif(Input::has('author'))\n\t\t{\n\t\t\t$this->author = $this->sanitizeString(Input::get('author'));\n\t\t}\n\n\t\t$this->details = $this->sanitizeString(Input::get('description'));\n\n\t\t/*\n\t\t|--------------------------------------------------------------------------\n\t\t|\n\t\t| \tVerifies if the user inputs an author\n\t\t|\n\t\t|--------------------------------------------------------------------------\n\t\t|\n\t\t*/\n\t\t$user = App\\User::where('accesslevel','=',0)->first();\n\n\t\tif(Auth::user()->accesslevel == 2)\n\t\t{\n\t\t\tif(Input::has('assign-to-staff'))\n\t\t\t{\n\t\t\t\t$this->staffassigned = $this->sanitizeString(Input::get('staffassigned'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->staffassigned = Auth::user()->id;\n\t\t\t}\n\t\t}\n\n\t\t$validator = Validator::make([\n\t\t\t\t'Ticket Subject' => $this->ticketname,\n\t\t\t\t'Details' => $this->details,\n\t\t\t\t'Author' => $this->author,\n\t\t\t],App\\Ticket::$complaintRules);\n\n\t\tif($validator->fails())\n\t\t{\n\t\t\treturn redirect('ticket/create')\n\t\t\t\t->withInput()\n\t\t\t\t->withErrors($validator);\n\t\t}\n\n\t\t$this->generateTaggedTicket($tag);\n\n\t\tSession::flash('success-message','Ticket Generated');\n\t\treturn redirect('ticket');\n\n\t}",
"public function store($ticket, Request $request)\n { //todo moze uzivatel presunut?\n\n $data = $request->all();\n\n $ticketObj = Ticket::find($ticket);\n $areaObj = $ticketObj->area;\n\n if ($data['status'] == 3) {\n\n // presun poziadavky na vyssi level\n\n $oldLevel = $ticketObj->actualStatus()->level;\n $newLevel = $ticketObj->actualStatus()->level + 1;\n\n //presun na vyssiu uroven\n $ticketStatus = TicketStatus::create([\n 'ticket_id' => $ticketObj->id,\n 'user_id' => Auth::user()->id,\n 'status' => $data['status'],\n 'level' => $newLevel,\n 'description' => $data['description']\n ]);\n\n //notifikacia autorovi ticketu\n $ticketObj->user->notify(new User\\TicketTransfered($ticketObj));\n\n //notifikacia manazerovi, ktory upravil ticket\n Auth::user()->notify(new Manager\\TicketTransfered($ticketObj));\n\n\n //notifikacia pre vsetkych adminov urovne $oldLevel\n $managers = $ticketObj->area->managers()\n ->where('users.id', '!=', Auth::user()->id)\n ->wherePivot('level', $oldLevel)->get();\n\n $managers = $managers->concat(\n Area::withoutGlobalScope('not_global')->find(1)\n ->managers()->where('users.id', '!=', Auth::user()->id)\n ->wherePivot('level', $oldLevel)->get()\n );\n\n\n Notification::send($managers, new Manager\\Area\\TicketTransfered($ticketObj));\n\n //notifikacia pre vsetkych adminov urovne $newLevel\n $managers = $ticketObj->area\n ->managers()->wherePivot('level', $newLevel)\n ->where('users.id', '!=', Auth::user()->id)->get();\n\n $managers = $managers->concat(\n Area::withoutGlobalScope('not_global')->find(1)\n ->managers()->wherePivot('level', $newLevel)\n ->where('users.id', '!=', Auth::user()->id)->get()\n );\n\n Notification::send($managers, new Manager\\Area\\TicketTransfered($ticketObj));\n\n } else {\n //zmena stavu\n TicketStatus::create([\n 'ticket_id' => $ticketObj->id,\n 'user_id' => Auth::user()->id,\n 'status' => $data['status'],\n 'level' => $ticketObj->actualStatus()->level,\n 'description' => $data['description']\n ]);\n\n\n if ($data['status'] == env('MANAGER_LEVELS')) {\n //notifikacia autorovi ticketu\n $ticketObj->user->notify(new User\\TicketSolved($ticketObj));\n\n //notifikacia manazerovi, ktory upravil ticket\n Auth::user()->notify(new Manager\\TicketSolved($ticketObj));\n\n } else {\n\n //notifikacia autorovi ticketu\n $ticketObj->user->notify(new User\\TicketUpdated($ticketObj));\n\n //notifikacia manazerovi, ktory upravil ticket\n Auth::user()->notify(new Manager\\TicketUpdated($ticketObj));\n\n $managers = $ticketObj->area->\n managers()->wherePivot('level', $ticketObj->actualStatus()->level)\n ->where('users.id', '!=', Auth::user()->id)->get();\n\n $managers = $managers->concat(\n Area::withoutGlobalScope('not_global')->find(1)\n ->managers()->wherePivot('level', $ticketObj->actualStatus()->level)\n ->where('users.id', '!=', Auth::user()->id)->get()\n );\n\n Notification::send($managers, new Manager\\Area\\TicketUpdated($ticketObj));\n }\n\n //todo notifikacia - pre vsetkch adminov danej urovne tejto oblasti\n\n }\n\n return redirect(action('Management\\TicketController@show', [$ticketObj->id]));\n }",
"public function store(TicketFormRequest $request)\n {\n $data = $request->all();\n $data['opened_at'] = \\Carbon\\Carbon::now()->toDateTimeString();\n $data['user_id'] = auth()->user()->id;\n\n // dd($data);\n $ticket = Ticket::create($data);\n return redirect()->route('tickets.index')->with('success','Chamado criado com sucesso!');\n }",
"public function store(Request $request) {\n\t\t$tickets = new Ticket();\n\t\t$tickets->folio = $request->input('folio');\n\t\t$tickets->commentary = $request->input('commentary');\n\t\t$tickets->category_id = $request->category_id;\n\t\t$tickets->problem_id = $request->problem_id;\n\t\t$tickets->priority_id = $request->priority_id;\n\t\t$tickets->status_id = $request->status_id;\n\t\t$tickets->turn_id = $request->turn_id;\n\t\t$tickets->client_id = $request->client_id;\n\t\t$tickets->user_id = $request->user_id;\n\t\t$tickets->save();\n\n\t\treturn redirect()->route('products.index', $tickets->id)\n\t\t\t->with('info', 'Ticket Guardado con Éxito!');\n\t}",
"public function store(Request $request)\n {\n\n //return $request->all();\n\n /* $this->validate($request,[\n 'cat_incident' => 'required',\n 'niveau_sev' => 'required',\n 'description' => 'required'\n ]);*/\n\n $ticket = new Ticket;\n $ticket->id_user= Auth::id();\n $ticket->cat_incident= request('categorie');\n $ticket->niveau_sev = request('niv_sev');\n $ticket->description = request('description');\n $ticket->save();\n\n\n $data = array(\n 'cat' => $request->categorie,\n 'niv' => $request->niv_sev,\n 'descr' => $request->description,\n 'id_user'=> Auth::id(),\n 'user_name'=> Auth::user()->name,\n 'serv'=> $request->serv,\n );\n Mail::to('[email protected]')->send(new EnvMail($data));\n return redirect('accueil');\n }",
"public function store(Request $request) {\n //\n $validator = Validator::make($request->all(), $this->rulesCreated, $this->rulesMessages);\n if ($validator->fails()) {\n return redirect('ticket/create')\n ->withErrors($validator)\n ->withInput();\n }\n //Creacion del Ticket\n $ticket = new TicketModel();\n $ticket->descripcion = $request->descripcion;\n $ticket->beneficiario_x_canaima_id = $request->beneficiario_x_canaima_id;\n $ticket->users_id = $request->users_id;\n $ticket->estatus_id = $request->estatus_id;\n $ticket->falla_id = $request->falla_id;\n $ticket->save();\n $id = $ticket->id;\n //Creacion del Historial de Ticket\n $historialTicket = new HistorialTicketModel();\n $historialTicket->ticket_id = $id;\n $historialTicket->users_id = $request->users_id;\n $historialTicket->save();\n\n notify()->flash('Se ha Registrado el Ticket Correctamente', 'success');\n return redirect()->route('ticket.index');\n }",
"public function store(TicketFormRequest $request) // Here in the TicketFormRequest we do requset data validation\n {\n $slug = uniqid();//PHP built-in function genereate unique ID based on current miliseconds\n $ticket = new Ticket(array(\n 'title' => $request->input('title'), // get() returns item at the given key as argument\n 'content' => $request->input('content'),\n 'slug' => $slug\n ));\n\n $ticket->save(); //Here we save our Ticket in the database\n\n //$data = array(\n //'ticket' => $slug,\n //);\n Mail::send('emails.ticket', ['id' => $slug], function ($message) {// Here we have three arguments: VIEW for bodytext of mail, data for data for body, CLOSURE\n $message->from('[email protected]', 'Advanced Blogger');\n $message->to('[email protected]')->subject('There is a new ticket!');\n });\n\n\n\n return redirect()->route('tickets.create')->with('status', 'Your ticket has been created! Its unique id is: '.$slug);// redirect() is global helper for create redirect response instance (object)\n\n }",
"public function add()\n {\n if ($this->request->is('post')) {\n $this->Ticket->create();\n //programatically set user number, ticket status and the date.\n $this->request->data['Ticket']['user_number'] = $this->Auth->user('user_number');\n $this->request->data['Ticket']['ticket_status_code'] = 1;\n $this->request->data['Ticket']['ticket_open_date_time'] = $this->datetime();\n //set priority to 0 if not selected\n if (!isset($this->request->data['Ticket']['ticket_priority_code'])) $this->request->data['Ticket']['ticket_priority_code'] = 0;\n //save the ticket\n if ($this->Ticket->save($this->request->data)) {\n //confirmation message\n $this->Session->setFlash(__('Your ticket has been saved.'), 'default', array('class' => 'message success'));\n return $this->redirect(array('action' => 'myTickets'));\n } else {\n //error message\n $this->Session->setFlash(__('Your ticket could not be saved. Please, try again.'));\n }\n }\n //store categories and departments so they can be used in the view\n $categories = $this->Ticket->Category->find('list');\n $departments = $this->Ticket->Department->find('list');\n $users = $this->Ticket->User->find('list');\n $this->set(compact('categories', 'departments', 'users'));\n }",
"public function store(TicketRequest $request)\n {\n $ticket = new Ticket();\n $ticket->price = $request->price;\n $ticket->code = Crypt::encryptString($request->code);\n $ticket->start_date = $request->start_date;\n $ticket->end_date = $request->end_date;\n $ticket->ticket_type_id = $request->tickettype;\n $ticket->user_id = $request->user;\n $ticket->bump_date = Carbon::now();\n $ticket->sold = $request->sold;\n $ticket->published = $request->published;\n $ticket->save();\n\n return redirect('tickets')->with(['message' => $ticket->trashed_ticket_type->trashed_festival->name . ' - ' . $ticket->trashed_ticket_type->name, 'datatype' => 'Ticket', 'crudtype' => 'created']);\n }",
"public function postSave(\\Symfony\\Component\\Form\\Form $form, \\Taskeet\\MainBundle\\Entity\\Ticket $Ticket)\n {\n $proveedor = $this->container->get('security.acl.provider');\n\n $idObjeto = ObjectIdentity::fromDomainObject($Ticket);\n\n //poniendo al usuario logueado como owner\n $this->setPermissions($proveedor, $idObjeto, $this->getUser(), MaskBuilder::MASK_OWNER);\n\n //si la tarea tiene asignado un empleado se le asigna el perm operator\n if($assignedTo = $Ticket->getAssignedTo())\n {\n $this->setPermissions($proveedor, $idObjeto, $assignedTo, MaskBuilder::MASK_EDIT);\n }\n\n if($data = $form->get('repeat')->getData())\n {\n $start = clone $form->get('startDate')->getData();\n $end = clone $form->get('dueDate')->getData();\n $ocurrences = $form->get('ocurrences')->getData();\n $interval = new DateInterval($form->get('repeat')->getData());\n\n $periodo = new \\DatePeriod($start, $interval, $ocurrences,\n \\DatePeriod::EXCLUDE_START_DATE);\n\n $em = $this->getDoctrine()->getManager();\n \n\n foreach ($periodo as $key => $fecha) {\n $ticket = clone $Ticket;\n $ticket->setStartDate($fecha);\n $ticket->setDueDate($end->add($interval));\n $ticket->setTitle(sprintf('%s-%s', $Ticket->getTitle(), $key));\n $ticket->setSlug(sprintf('%s-%s', $Ticket->getSlug(), $key));\n $this->saveObject($ticket);\n $idObjeto = ObjectIdentity::fromDomainObject($ticket);\n $this->setPermissions($proveedor, $idObjeto, $this->getUser(), MaskBuilder::MASK_OWNER);\n $this->setPermissions($proveedor, $idObjeto, $ticket->getAssignedTo(), MaskBuilder::MASK_EDIT);\n \n }\n\n }\n\n\n }",
"public function creating(TicketCategory $model)\n {\n # Set Current User as Creator\n $model->setAttribute('creator', $model->getAttribute('creator') ?: $this->getUserId() );\n\n # Set Ticket Status ID\n //$model->setAttribute('ticket_status', $model->getAttribute('ticket_status') ?: $this->getInitialStatus() );\n }",
"public function store(Request $request)\n {\n // validate the data\n // $this->validate($request, array(\n // 'startStation_id' => 'required|string|max:191',\n // 'endStation_id' => 'required|string|max:191', \n // 'class' => 'required|string|max:2',\n // ));\n\n //store in the database\n // $ticket = new Ticket;\n\n // $ticket->startStation_id = $request->startStation_id;\n // $ticket->endStation_id = $request->endStation_id;\n // $ticket->class = $request->class; \n\n // $ticket->save();\n\n // // Session::flash('success', 'Your Ticket was successfully booked!');\n\n // return redirect()->route('trips.index', $ticket->id);\n }",
"public function store(StoreTicketsRequest $request)\n {\n if (! Gate::allows('ticket_create')) {\n return abort(401);\n }\n\t\t$request['user_id'] = Auth::user()->id;\n\t\t$ticket = Ticket::create($request->all());\n return redirect()->route('tickets.index')->with('success','Ticket created successfully!');\n }",
"public function store(TicketRequest $request)\n {\n try {\n $ticket = new Ticket([\n 'account_id' => get_user()->account_id,\n 'email_address' => get_user()->email_address,\n 'subject' => $request->input('subject'),\n 'description' => $request->input('description'),\n 'ticket_group_id' => config(\"customer_portal.ticket_group_id\"),\n 'user_id' => config(\"customer_portal.ticket_user_id\"),\n 'priority' => config(\"customer_portal.ticket_priority\"),\n 'inbound_email_account_id' => config(\"customer_portal.inbound_email_account_id\"),\n ]);\n } catch (Exception $e) {\n Log::error($e->getMessage());\n return redirect()->back()->withErrors(utrans(\"errors.failedToCreateTicket\"))->withInput();\n }\n\n $accountTicketController = new AccountTicketController();\n try {\n $accountTicketController->createTicket($ticket, get_user()->contact_name, get_user()->email_address);\n } catch (Exception $e) {\n Log::error($e->getMessage());\n return redirect()->back()->withErrors(utrans(\"errors.failedToCreateTicket\"))->withInput();\n }\n\n $this->clearTicketCache();\n return redirect()->action(\"TicketController@index\")->with('success', utrans(\"tickets.ticketCreated\"));\n }",
"public function store(CreateTicketCategory $request)\n {\n $user = auth()->user();\n\n $category = $user->categorys()->create([\n 'name' => $request->input('category.name'),\n ]);\n\n return $this->respondWithTransformer($category);\n }",
"public function store(TicketEventCriterionRequest $request)\n {\n $ticketEventCriterion = TicketEventCriterion::create($request->input());\n $ticketEventCriterion->weekdays()->sync($request->get('weekday_id'));\n\n return redirect()->route('ticket-event-criteria.index')->with('success', 'Created successfully');\n }",
"public function store(Request $request)\n {\n //sanitize input\n $this->validate($request, [\n 'firstname' => 'required|max:255|alpha_num',\n 'lastname' => 'required|max:255|alpha_num',\n 'os' => 'required|between:1,5',\n 'issue' => 'required',\n ]);\n\n //Get authentication details\n\n $userId = Auth::id();\n $userEmail = Auth::user()->email;\n\n //Fill initial details\n\n $ticket = Ticket::create(array_merge($request->all(), ['user_id' => $userId, 'email' => $userEmail]));\n\n $os = 'No OS';\n\n //Save OS, switch to corresponding value\n\n switch($request['os']) {\n case 1:\n $os = 'Windows';\n break;\n case 2:\n $os = 'Mac OS';\n break;\n case 3:\n $os = 'Linux';\n break;\n case 4:\n $os = 'iOS';\n break;\n case 5:\n $os = 'Android';\n break;\n }\n\n $ticket->os = $os;\n\n //Set status\n $status = 'Pending';\n $ticket->status = $status;\n\n //Redirect with status\n if($ticket->save()) {\n return redirect()->back()->with('successMessage','Sent successfully.');\n }\n else {\n return redirect()->back()->with('failMessage','An error has occurred. Please try again.');\n }\n\n }",
"public function store(CreateTicketRequest $request)\n {\n $input_data = $request->all();\n $input_data['status_id'] = 1;\n $input_data['user_id'] = Auth::user()->id;\n $ticket = Ticket::create($input_data);\n\n //perform upload file if has input\n\n if ($request->hasFile('file_attachment') && $request->file('file_attachment')->isValid()) {\n\n //rename file to make it unique\n $fileName = $ticket->id.'-'.$request->file('file_attachment')->getClientOriginalName();\n\n //set destination path\n $destinationPath = base_path() . '/public/uploads/';\n\n //pindah upload gambar ke destination baru\n $request->file('file_attachment')->move($destinationPath, $fileName);\n $ticket_attachment = new TicketAttachment();\n $ticket_attachment->attachment_filename = $fileName;\n //save polymorphism\n $ticket->attachments()->save($ticket_attachment);\n\n }\n\n //save activity log\n\n //send email\n\n Event::fire(new TicketCreated($ticket));\n \n flash('Your ticket was successfully submitted','success');\n\n return redirect(route('tickets.index'));\n }",
"public function created(TicketCategory $model)\n {\n \n }",
"public function store(Request $request)\n {\n // recupération des données du formulaire\n $description = $request['description'];\n //recuperation du user\n\n $user = User::all()->first();\n //création de l'objet ticket\n $ticket = new Ticket();\n $ticket->description = $description;\n $ticket->user_id = $user->id;\n //enregistrement du ticket\n $ticket->date_debut_traitement = now();\n $ticket->save();\n\n return redirect(route('home'));\n }",
"function shd_post_ticket()\n{\n\tglobal $context, $user_info, $sourcedir, $txt, $scripturl, $reply_request, $smcFunc, $options, $memberContext, $new_ticket, $modSettings;\n\t$context['tabindex'] = 1;\n\n\t$new_ticket = $_REQUEST['sa'] == 'newticket';\n\n\tif ($new_ticket)\n\t{\n\t\t// Need to have a department to post in. If not, goodbye.\n\t\t$_REQUEST['dept'] = isset($_REQUEST['dept']) ? (int) $_REQUEST['dept'] : 0;\n\n\t\tshd_is_allowed_to('shd_new_ticket', $_REQUEST['dept']); // If we don't have a department, we will verify the ability in any department, and figure it out later.\n\t}\n\telse\n\t{\n\t\tcheckSession('get');\n\t\t$ticketinfo = shd_load_ticket();\n\t\tif (!shd_allowed_to('shd_edit_ticket_any', $ticketinfo['dept']) && (!shd_allowed_to('shd_edit_ticket_own', $ticketinfo['dept']) || !$ticketinfo['is_own']))\n\t\t\tfatal_lang_error('cannot_shd_edit_ticket');\n\t}\n\n\t// Things we need\n\tloadTemplate('sd_template/SimpleDesk-Post');\n\trequire_once($sourcedir . '/sd_source/Subs-SimpleDeskPost.php');\n\trequire_once($sourcedir . '/Subs-Attachments.php');\n\trequire_once($sourcedir . '/Subs-Post.php');\n\trequire_once($sourcedir . '/Subs-Editor.php');\n\n\t$context['template_layers'][] = 'shd_post_nojs';\n\n\t$dept = $new_ticket ? $_REQUEST['dept'] : $ticketinfo['dept'];\n\n\t$context['ticket_form'] = array( // yes, everything goes in here.\n\t\t'dept' => $dept,\n\t\t'selecting_dept' => $context['shd_multi_dept'] && empty($dept),\n\t\t'form_title' => $new_ticket ? $txt['shd_create_ticket'] : $txt['shd_edit_ticket'],\n\t\t'form_action' => $scripturl . '?action=helpdesk;sa=saveticket',\n\t\t'first_msg' => $new_ticket ? 0 : $ticketinfo['id_first_msg'],\n\t\t'message' => $new_ticket ? '' : $ticketinfo['body'],\n\t\t'subject' => $new_ticket ? '' : $ticketinfo['subject'],\n\t\t'ticket' => $new_ticket ? 0 : $context['ticket_id'],\n\t\t'link' => $new_ticket ? '' : '<a href=\"' . $scripturl . '?action=helpdesk;sa=ticket;ticket=' . $context['ticket_id'] . '\">' . $ticketinfo['subject'] . '</a>',\n\t\t'msg' => $new_ticket ? 0 : $ticketinfo['id_first_msg'],\n\t\t'display_id' => $new_ticket ? '' : str_pad($context['ticket_id'], $modSettings['shd_zerofill'], '0', STR_PAD_LEFT),\n\t\t'status' => $new_ticket ? TICKET_STATUS_NEW : $ticketinfo['status'],\n\t\t'urgency' => array(\n\t\t\t'setting' => $new_ticket ? TICKET_URGENCY_LOW : $ticketinfo['urgency'],\n\t\t),\n\t\t'private' => array(\n\t\t\t'setting' => $new_ticket ? false : ($ticketinfo['private'] == 1),\n\t\t\t'can_change' => shd_allowed_to('shd_alter_privacy_any', $dept) || (shd_allowed_to('shd_alter_privacy_own', $dept) && ($new_ticket || !empty($ticketinfo['is_own']))),\n\t\t\t'options' => array(\n\t\t\t\t0 => 'shd_ticket_notprivate',\n\t\t\t\t1 => 'shd_ticket_private',\n\t\t\t),\n\t\t),\n\t\t'errors' => array(),\n\t\t'num_replies' => $new_ticket ? 0 : $ticketinfo['num_replies'],\n\t\t'do_attach' => shd_allowed_to('shd_post_attachment', $dept),\n\t\t'num_allowed_attachments' => empty($modSettings['attachmentNumPerPostLimit']) || $modSettings['shd_attachments_mode'] == 'ticket' ? -1 : $modSettings['attachmentNumPerPostLimit'],\n\t\t'return_to_ticket' => isset($_REQUEST['goback']),\n\t\t'disable_smileys' => $new_ticket ? !empty($_REQUEST['no_smileys']) : ($ticketinfo['smileys_enabled'] == 0),\n\t);\n\t$context['can_solve'] = !$new_ticket && (shd_allowed_to('shd_resolve_ticket_any', $dept) || (shd_allowed_to('shd_resolve_ticket_own', $dept) && $ticketinfo['starter_id'] == $user_info['id']));\n\t$context['can_post_proxy'] = $new_ticket && isset($_REQUEST['proxy']) && shd_allowed_to('shd_post_proxy', $dept);\n\tif ($context['can_post_proxy'] && !empty($_REQUEST['proxy']))\n\t{\n\t\t// Did they specify a user id?\n\t\tglobal $user_profile;\n\t\t$user = (int) $_REQUEST['proxy'];\n\t\tif ($user != 0)\n\t\t{\n\t\t\tloadMemberData($user, false, 'minimal');\n\t\t\tif (!empty($user_profile[$user]))\n\t\t\t\t$context['ticket_form']['proxy'] = $user_profile[$user]['real_name'];\n\t\t}\n\t}\n\tif (!empty($context['ticket_form']['selecting_dept']))\n\t\tshd_get_postable_depts();\n\n\tshd_posting_additional_options();\n\n\t// A few basic checks\n\tif ($context['ticket_form']['status'] == TICKET_STATUS_CLOSED)\n\t\tfatal_lang_error('shd_cannot_edit_closed', false);\n\telseif ($context['ticket_form']['status'] == TICKET_STATUS_DELETED)\n\t\tfatal_lang_error('shd_cannon_edit_deleted', false);\n\n\tshd_load_custom_fields(true, $context['ticket_form']['ticket'], $context['ticket_form']['dept']);\n\n\t// Ticket privacy\n\tif (empty($modSettings['shd_privacy_display']) || $modSettings['shd_privacy_display'] == 'smart')\n\t\t$context['display_private'] = shd_allowed_to('shd_view_ticket_private_any', $dept) || shd_allowed_to('shd_alter_privacy_own', $dept) || shd_allowed_to('shd_alter_privacy_any', $dept) || $context['ticket_form']['private']['setting'];\n\telse\n\t\t$context['display_private'] = true;\n\n\tif ($new_ticket)\n\t{\n\t\t$context['ticket_form'] += array(\n\t\t\t'member' => array(\n\t\t\t\t'name' => $context['user']['name'],\n\t\t\t\t'id' => $context['user']['id'],\n\t\t\t\t'link' => shd_profile_link($context['user']['name'], $context['user']['id']),\n\t\t\t),\n\t\t\t'assigned' => array(\n\t\t\t\t'id' => 0,\n\t\t\t\t'name' => $txt['shd_unassigned'],\n\t\t\t\t'link' => '<span class=\"error\">' . $txt['shd_unassigned'] . '</span>',\n\t\t\t),\n\t\t);\n\t}\n\telse\n\t{\n\t\t$context['ticket_form'] += array(\n\t\t\t'member' => array(\n\t\t\t\t'name' => $ticketinfo['starter_name'],\n\t\t\t\t'id' => $ticketinfo['starter_id'],\n\t\t\t\t'link' => shd_profile_link($ticketinfo['starter_name'], $ticketinfo['starter_id']),\n\t\t\t),\n\t\t\t'assigned' => array(\n\t\t\t\t'id' => $ticketinfo['assigned_id'],\n\t\t\t\t'name' => !empty($ticketinfo['assigned_id']) ? $ticketinfo['assigned_name'] : $txt['shd_unassigned'],\n\t\t\t\t'link' => !empty($ticketinfo['assigned_id']) ? shd_profile_link($ticketinfo['assigned_name'], $ticketinfo['assigned_id']) : '<span class=\"error\">' . $txt['shd_unassigned'] . '</span>',\n\t\t\t),\n\t\t);\n\n\t\tloadMemberData($ticketinfo['starter_id']);\n\t\tif (loadMemberContext($ticketinfo['starter_id']))\n\t\t\t$context['ticket_form']['member']['avatar'] = $memberContext[$ticketinfo['starter_id']]['avatar'];\n\n\t\tif (!$new_ticket && !empty($ticketinfo['modified_time']))\n\t\t{\n\t\t\t$context['ticket_form'] += array(\n\t\t\t\t'modified' => array(\n\t\t\t\t\t'name' => $ticketinfo['modified_name'],\n\t\t\t\t\t'id' => $ticketinfo['modified_id'],\n\t\t\t\t\t'time' => timeformat($ticketinfo['modified_time']),\n\t\t\t\t\t'link' => shd_profile_link($ticketinfo['modified_name'], $ticketinfo['modified_id']),\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\t// Some other setup stuff\n\t\tshd_load_attachments();\n\n\t\t$context['ticket_form']['message'] = un_preparsecode($context['ticket_form']['message']);\n\t\tcensorText($context['ticket_form']['subject']);\n\t\tcensorText($context['ticket_form']['message']);\n\t}\n\n\tshd_get_urgency_options($new_ticket || $ticketinfo['is_own'], $context['ticket_form']['dept']);\n\n\tif ($context['ticket_form']['num_replies'])\n\t\tshd_setup_replies($ticketinfo['id_first_msg']);\n\n\tshd_check_attachments();\n\n\t// Set up the fancy editor\n\tshd_postbox(\n\t\t'shd_message',\n\t\t$context['ticket_form']['message'],\n\t\tarray(\n\t\t\t'post_button' => $context['ticket_form']['form_title'],\n\t\t)\n\t);\n\n\t// Build the link tree and navigation\n\t$context['linktree'][] = array(\n\t\t'name' => $new_ticket ? $txt['shd_create_ticket'] : sprintf($txt['shd_edit_ticket_linktree'], $context['ticket_form']['link']),\n\t);\n\n\t$context['page_title'] = $txt['shd_helpdesk'];\n\t$context['sub_template'] = 'ticket_post';\n\n\t// Register this form in the session variables.\n\tcheckSubmitOnce('register');\n}",
"public function store(Ticket $ticket)\n {\n if ($ticket->user_id != auth()->user()->JID)\n {\n return redirect()->route('users.tickets.index');\n }\n\n if ($ticket->status == config('constants.ticket_system.status_from_name.Closed'))\n {\n Alert::warning('You can\\'t post a message to this ticket!');\n\n return redirect()->back();\n }\n\n $validated = request()->validate([\n 'message' => ['required', 'string', 'max:1800', 'min:6'],\n 'close_ticket' => ['sometimes', 'boolean'],\n 'attachments' => ['sometimes', 'array', 'max:' . setting('ticketsystem.attachments.maxfilecount', 3)],\n 'attachments.*' => ['image', 'distinct', 'max:' . setting('ticketsystem.attachments.maxfilesize', 1024), Rule::dimensions()->maxWidth(3840)->maxHeight(2160)],\n ]);\n\n $newMessage = $ticket->messages()->create([\n 'user_id' => auth()->user()->JID,\n 'content' => $validated['message'],\n 'ip' => request()->getClientIp(),\n ]);\n\n if (array_key_exists('attachments', $validated))\n {\n foreach ($validated['attachments'] as $attachment)\n {\n if (!$attachment->isValid())\n {\n continue;\n }\n\n $storedFile = $attachment->store(auth()->user()->JID, 'tickets');\n\n $newMessage->attachments()->create([\n 'name' => $storedFile,\n ]);\n }\n }\n\n if (request()->has('close_ticket'))\n {\n $ticket->update([\n 'status' => config('constants.ticket_system.status_from_name.Closed'),\n ]);\n }\n else\n {\n if ($ticket->status != config('constants.ticket_system.status_from_name.New'))\n {\n $ticket->update([\n 'status' => config('constants.ticket_system.status_from_name.NotAnswered'),\n ]);\n }\n }\n\n Alert::success('Success!', 'Your message has been sent to the support team.');\n\n return redirect()->route('users.tickets.show', $ticket);\n }",
"public function store(Requests\\CreateTicketRequest $request)\n {\n TicketType::insert(['type' => $request['type'], 'price' => $request['price']]);\n\n\n //return view('backend.movies.index')->with('movies', $movies);\n return redirect('admin/ticket')->with('status', 'A new ticket type has been created!');\n\n }"
] | [
"0.72163296",
"0.6765308",
"0.6753732",
"0.67100155",
"0.6649573",
"0.65892535",
"0.6564695",
"0.6487174",
"0.6462021",
"0.6287",
"0.62565815",
"0.62412953",
"0.6235356",
"0.61938983",
"0.6166874",
"0.61573267",
"0.6139451",
"0.6123535",
"0.61061275",
"0.60816735",
"0.60765857",
"0.6072941",
"0.6050945",
"0.6002161",
"0.5956701",
"0.5925686",
"0.5912326",
"0.5902377",
"0.58896744",
"0.5882297"
] | 0.68652874 | 1 |
Parses the output of lspci utility | public function parseLspci($data) {
$aDevices = array();
$aParagraphs = $this->getParagraphs($data);
// If only 1 paragraph, it's a simple output of lspci (no verbosity)
if (count($aParagraphs) <= 2)
$aParagraphs = explode("\n", $aParagraphs[0]);
// Each paragraph of lspci is a device
foreach ($aParagraphs as $sDevice) {
// Some flags
$bLastWasCollapsed = false;
$iLastLvl = 0;
$iLastId = 0;
$aDevice = array(
'key' => '',
'val' => '',
'chld' => array(),
);
$aIndex = array();
$sDevPciBus = '';
$sDevType = '';
$sDevTypeCode = '';
$sDevDetail = '';
$sDevModel = '';
$sDevModelCode = '';
$sDevVendor = '';
$sDevVendorCode = '';
//
preg_match_all('#([\t]*)(.+)#', $sDevice, $aLinesParts, PREG_SET_ORDER);
foreach ($aLinesParts as $aLineParts) {
$iLvl = substr_count($aLineParts[1], "\t");
$sLine = $aLineParts[2];
$aLineRes = array();
// Device name and PCI Addr
if ($iLvl == 0) {
// <PCI-Addr> <Device Type>: <Constructor> <Device Name>
$sPtrnGrp = '#([0-9a-f:\.]+) (.+?): (.+)$#';
preg_match($sPtrnGrp, $sLine, $aLineRes);
// Fill the device base info
$sDevPciBus = $aLineRes[1];
$sDevType = $aLineRes[2];
$sDevDetail = $aLineRes[3];
$aDevice['key'] = trim($sDevPciBus);
$aDevice['val'] = trim($sLine);
$aIndex[0] = &$aDevice;
// 04:00.0 0108: 144d:a802 (rev 01) (prog-if 02 [NVM Express])
// 04:00.0 Non-Volatile memory controller [0108]: Samsung Electronics Co Ltd NVMe SSD Controller [144d:a802] (rev 01) (prog-if 02 [NVM Express])
// Extract Hex IDs from line
$sHex = '[0-9a-f]{4}';
$sHex1 = '(?:'.$sHex.'|\['.$sHex.'\])';
$sHex2 = '(?:'.$sHex.':'.$sHex.'|\['.$sHex.':'.$sHex.'\])';
$sPtrnIds = '#^'.$sDevPciBus.' '.'(.*)('.$sHex1.'): (.*)('.$sHex2.')( .+)?$#';
// Try to get the Codes for more precision
if (preg_match($sPtrnIds, $sLine, $aDetails)) {
print_r($aDetails);
$sDevType = $aDetails[1];
$sDevTypeCode = $aDetails[2];
$sDevDetail = $aDetails[3];
$aDevDetailCode = explode(':', $aDetails[4]);
$sDevVendorCode = $aDevDetailCode[0];
$sDevModelCode = $aDevDetailCode[1];
}
}
// Device features enumeration
else {
$parent = &$aIndex[$iLvl-1];
// Check for "Feature: state" key
if (preg_match('#^(.+?):(.*)$#', $sLine, $aLineRes)) {
$sKey = $aLineRes[1];
$sVal = $aLineRes[2];
// Add the feature definition
$parent['chld'][] = array(
'key' => $sKey,
'val' => $sVal,
'chld' => array(),
);
// Save for collapsing
$iLastId = count($parent['chld']) -1;
$bLastWasCollapsed = false;
$aIndex[$iLvl] = &$parent['chld'][$iLastId];
}
// No ":" in the line, and good format for collapsing it with previous
elseif ( ($iLvl-1 == $iLastLvl) ||
($iLvl == $iLastLvl && $bLastWasCollapsed) ) {
// If last line was also collapse, parent is 2 levels before
if ($bLastWasCollapsed)
$parent = &$aIndex[$iLvl-2];
// Collapse
$parent['val'] .= " ".$sLine;
$bLastWasCollapsed = true;
}
// Wow, what's that ?
else {
echo "WOW, Unhandled line $sLine\n";
}
}
$iLastLvl = $iLvl;
}
// Create or find the base device
$sQuery = ' model=""';
if ($sDevVendor)
$oDev = Device::find($sQuery);
if (!$oDev) {
$oDev = new Device();
//$oDev->model =
}
// Add device to final list
$aDevices[] = $aDevice;
unset($parent);
}
return $aDevices;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ios12ReadCDPStatus ($input)\n{\n\t$ret = array();\n\tforeach (explode (\"\\n\", $input) as $line)\n\t{\n\t\t$matches = array();\n\t\tswitch (TRUE)\n\t\t{\n\t\tcase preg_match ('/^Device ID:\\s*([A-Za-z0-9][A-Za-z0-9\\.\\-\\_]*)/', $line, $matches):\n\t\tcase preg_match ('/^System Name:\\s*([A-Za-z0-9][A-Za-z0-9\\.\\-\\_]*)/', $line, $matches):\n\t\t\t$ret['current']['device'] = $matches[1];\n\t\t\tbreak;\n\t\tcase preg_match ('/^Interface: (.+), ?Port ID \\(outgoing port\\): (.+)$/', $line, $matches):\n\t\t\tif (array_key_exists ('device', $ret['current']))\n\t\t\t\t$ret[shortenIfName ($matches[1])][] = array\n\t\t\t\t(\n\t\t\t\t\t'device' => $ret['current']['device'],\n\t\t\t\t\t'port' => $matches[2],\n\t\t\t\t);\n\t\t\tunset ($ret['current']);\n\t\t\tbreak;\n\t\tdefault:\n\t\t}\n\t}\n\tunset ($ret['current']);\n\treturn $ret;\n}",
"function getCpuModel(&$errors)\n{\n $result = \"N/A\";\n\n if ($cpuinfo = shell_exec('cat /proc/cpuinfo')) {\n $processors = preg_split('/\\s?\\n\\s?\\n/', trim($cpuinfo));\n\n foreach ($processors as $processor) {\n $details = preg_split('/\\n/', $processor, -1, PREG_SPLIT_NO_EMPTY);\n\n foreach ($details as $detail) {\n list($key, $value) = preg_split('/\\s*:\\s*/', trim($detail));\n\n switch (strtolower($key)) {\n case 'model name':\n case 'cpu model':\n case 'cpu':\n case 'processor':\n $result = $value;\n }\n }\n }\n\n if ($result === \"N/A\") {\n array_push($errors, \"CPU model could not be determined: output could not be parsed\");\n }\n } else {\n array_push($errors, \"CPU model could not be determined: command failed\");\n }\n\n return $result;\n}",
"function GetDbmsOutput($c)\n {\n $res = false;\n $s = oci_parse($c, \"BEGIN DBMS_OUTPUT.GET_LINE(:LN, :ST); END;\");\n if (oci_bind_by_name($s, \":LN\", $ln, 255) &&\n oci_bind_by_name($s, \":ST\", $st)) {\n $res = array();\n while (($succ = oci_execute($s)) && !$st)\n $res[] = $ln;\n if (!$succ)\n $res = false;\n }\n oci_free_statement($s);\n return $res;\n }",
"protected function _parse()\n {\n $this->totalAccesses = (int) $this->_match('/Total Accesses: (.*)/');\n $this->totalKBytes = (int) $this->_match('/Total kBytes: (.*)/');\n $this->cpuLoad = (float) $this->_match('/CPULoad: (.*)/');\n $this->uptime = (int) $this->_match('/^Uptime: (.*)$/m');\n $this->reqPerSec = (float) $this->_match('/ReqPerSec: (.*)/');\n $this->bytesPerSec = (float) $this->_match('/BytesPerSec: (.*)/');\n $this->bytesPerReq = (float) $this->_match('/BytesPerReq: (.*)/');\n $this->busyWorkers = (int) $this->_match('/BusyWorkers: (.*)/');\n $this->idleWorkers = (int) $this->_match('/IdleWorkers: (.*)/');\n\n\n $this->scoreboard = $this->_match('/Scoreboard: (.*)/');\n\n $length = strlen($this->scoreboard);\n $used = 0;\n foreach (str_split($this->scoreboard) as $i) {\n if ($i != '.' AND $i != '_') {\n $used++;\n }\n }\n\n $this->utilization = $used / $length;\n\n return null;\n\n }",
"public function getStats ()\r\n\t{\r\n\t\tob_start();\r\n\t\tsystem(\"ipcs -q\");\r\n\t\t$stat = ob_get_contents();\r\n\t\tob_end_clean();\r\n\t\treturn $stat;\r\n\t}",
"public function CPUInfo()\n {\n $data = explode(\"\\n\", $this->run('lscpu'));\n array_pop($data);\n return $data;\n }",
"function printCLine($array)\n{\n // Print each token in the C Line\n foreach($array as $token)\n {\n echo(\"\\\"\" . $token . \"\\\" \");\n }\n\n // Print all the error flags stored in session\n foreach($_SESSION['C_LINE_ERR'] as $error=>$value)\n {\n echo ($error . ': ' . $value . ' ');\n }\n echo('<br>');\n}",
"function cluster_status(){\n\n $info = shell_exec(EXE_INFO);\n $info = preg_split('/ +/', $info);\n\n if(! (count($info) > 1))\n {\n return \"busy\";\n }\n else\n {\n return \"avaliable\";\n }\n\n return $info;\n}",
"function getCpuCacheSize(&$errors)\n{\n $result = \"N/A\";\n\n if ($cpuinfo = shell_exec('cat /proc/cpuinfo')) {\n $processors = preg_split('/\\s?\\n\\s?\\n/', trim($cpuinfo));\n\n foreach ($processors as $processor) {\n $details = preg_split('/\\n/', $processor, -1, PREG_SPLIT_NO_EMPTY);\n\n foreach ($details as $detail) {\n list($key, $value) = preg_split('/\\s*:\\s*/', trim($detail));\n\n switch (strtolower($key)) {\n case 'cache size':\n case 'l2 cache':\n $result = $value;\n }\n }\n }\n\n if ($result === \"N/A\") {\n array_push($errors, \"CPU cache size could not be determined: output could not be parsed\");\n }\n } else {\n array_push($errors, \"CPU cache size could not be determined: command failed\");\n }\n\n return $result;\n}",
"function logParser($st_results, $dataType, $orderAsc)\n{\n\t$st_obj = new stdClass();\t\t\t\n\t$full_params = array('a','b','c','d','e','f','i','j','k','l','m','n','o','p','q','r','ci','ax','ay','az','mx','my','mz','bx','by','bz', 'lt');\n\t$last_params = array('a','b','c','d','e','f','h','i','j','k','l','m','n','o','p','q','r','s','t','u','ci','ax','ay','az','mx','my','mz','bx','by','bz', 'lt');\n\t$gps_params = ($dataType)?$full_params:$last_params;\n\t$paramSize = sizeof($gps_params);\n\t$resArray = ($orderAsc)?array_reverse($st_results):$st_results;\n\n\t$num = 0;\n\t//$TZDIFF = 19800;\t// Asia/Kolkata\n\t$TZDIFF = 0;\t\t// date takes system time zone\n\tforeach ($resArray as $row)\n\t{\n\t\t$st_obj->$num = new stdClass;\n\t\t$st_obj->$num->g = date('Y-m-d@H:i:s',$row['stime']/1000-$TZDIFF);\t// device time is stored as row key as timestamp in milisecond\n\t\tif ($dataType) $st_obj->$num->h = date('Y-m-d@H:i:s',$row['dtime']/1000-$TZDIFF);\t// device time is stored as row key as timestamp in milisecond\n\n\t\t$i = 0;\n\t\t\n\t\tforeach (str_getcsv($row['data'], \";\") as $gps_val)\n\t\t{\n\t\t\tif ($i == $paramSize)\n\t\t\t\tbreak; \n\t\t\t$st_obj->$num->$gps_params[$i++] = $gps_val;\n\t\t}\n\t\t$num++;\n\t}\n\t\n\treturn $st_obj;\n}",
"function parseCLine($str)\n{\n $_SESSION['C_LINE_ERR'] = array(\n \"NO_APOST\" => 'X',\n \"NO_PTR\" => 'X',\n \"COMMENTED\" => 'X',\n \"NO_SEMI_COLON\" => 'X'\n );\n\n // Clear whitespace before and after string\n $str = trim($str);\n\n $tokens = explode(' ', $str, 20);\n if(!cLineIsComment($tokens))\n {\n $_SESSION['C_LINE_ERR']['COMMENTED'] = 0;\n\n // Check if the last character is a semi-colon\n if(!strcmp(substr($str, -1, 1), ';'))\n $_SESSION['C_LINE_ERR']['NO_SEMI_COLON'] = 0;\n else\n $_SESSION['C_LINE_ERR']['NO_SEMI_COLON'] = 1;\n\n $array = explodeArrayKeepDelimeter('(',$tokens);\n $array = explodeArrayKeepDelimeter(')',$array);\n $array = explodeArrayKeepDelimeter(',',$array);\n $array = explodeArrayKeepDelimeter(';',$array);\n $array = explodePointer($array); // Lame way to test for up to a triple pointer, but it works\n $array = explodePointer($array);\n $array = explodePointer($array);\n }\n else\n {\n $array = array('The C line is commented out');\n $_SESSION['C_LINE_ERR']['COMMENTED'] = 1;\n }\n return $array;\n}",
"function convertLCCtoLL()\r\n\t{\r\n\t\t$e = sqrt($this->e2);\r\n\r\n\t\t$phi1\t= deg2rad($this->firstStdParallel);\t\t\t// Latitude of 1st std parallel\r\n\t\t$phi2\t= deg2rad($this->secondStdParallel);\t\t// Latitude of 2nd std parallel\r\n\t\t$phio\t= deg2rad($this->latOfOrigin);\t\t\t\t// Latitude of Origin\r\n\t\t$lamdao\t= deg2rad($this->longOfOrigin);\t\t\t\t// Longitude of Origin\r\n\t\t$E\t\t= $this->lccEasting;\r\n\t\t$N\t\t= $this->lccNorthing;\r\n\t\t$Ef\t\t= $this->falseEasting;\r\n\t\t$Nf\t\t= $this->falseNorthing;\r\n\r\n\t\t$m1 = cos($phi1) / sqrt(( 1 - $this->e2*sin($phi1)*sin($phi1)));\r\n\t\t$m2 = cos($phi2) / sqrt(( 1 - $this->e2*sin($phi2)*sin($phi2)));\r\n\t\t$t1 = tan((pi()/4)-($phi1/2)) / pow(( ( 1 - $e*sin($phi1) ) / ( 1 + $e*sin($phi1) )),$e/2);\r\n\t\t$t2 = tan((pi()/4)-($phi2/2)) / pow(( ( 1 - $e*sin($phi2) ) / ( 1 + $e*sin($phi2) )),$e/2);\r\n\t\t$to = tan((pi()/4)-($phio/2)) / pow(( ( 1 - $e*sin($phio) ) / ( 1 + $e*sin($phio) )),$e/2);\r\n\t\t$n\t= (log($m1)-log($m2)) / (log($t1)-log($t2));\r\n\t\t$F\t= $m1/($n*pow($t1,$n));\r\n\t\t$rf\t= $this->a*$F*pow($to,$n);\r\n\t\t$r_\t= sqrt( pow(($E-$Ef),2) + pow(($rf-($N-$Nf)),2) );\r\n\t\t$t_\t= pow($r_/($this->a*$F),(1/$n));\r\n\t\t$theta_ = atan(($E-$Ef)/($rf-($N-$Nf)));\r\n\r\n\t\t$lamda\t= $theta_/$n + $lamdao;\r\n\t\t$phi0\t= (pi()/2) - 2*atan($t_);\r\n\t\t$phi1\t= (pi()/2) - 2*atan($t_*pow(((1-$e*sin($phi0))/(1+$e*sin($phi0))),$e/2));\r\n\t\t$phi2\t= (pi()/2) - 2*atan($t_*pow(((1-$e*sin($phi1))/(1+$e*sin($phi1))),$e/2));\r\n\t\t$phi\t= (pi()/2) - 2*atan($t_*pow(((1-$e*sin($phi2))/(1+$e*sin($phi2))),$e/2));\r\n\t\t\r\n\t\t$this->lat \t= rad2deg($phi);\r\n\t\t$this->long = rad2deg($lamda);\r\n\t}",
"function iptcparse ($iptcblock) {}",
"public function parseResult()\n\t{\n\t}",
"public function parseResult()\n\t{\n\t}",
"function retrieveServiceDescription($SCPDURL){\n\n $strURL = trim($SCPDURL);\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_USERAGENT, \t'SKY');\n curl_setopt($ch, CURLOPT_URL, $strURL );\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );\n curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);\n\n $rtn = curl_exec($ch);\n\n if(($rtn) === false) {\n $err = 'Curl error: ' . curl_error($ch);\n die($err);\n }\n\n curl_close($ch);\n\n return simplexml_load_string($rtn);\n\n}",
"function print_info(){\r\n ?>\r\n This tool was originally created to reduce protein sequences by grouping the aminoacids in classes.\r\n During its development code to retrieve sequences with colours was added. Additionally, each aminoacid\r\n may be displayed with a distinct colour (without applying reductions).\r\n <p>\r\n The reduced aminoacid alphabets has been obtained from the references bellow:\r\n Li T, Fan K, Wang J, Wang W. Reduction of protein sequence\r\n complexity by residue grouping. Protein Eng 2003; 5:323-330.\r\n <a href=\"http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=12826723&dopt=Abstract\">PubMed</a>\r\n Murphy LR, Wallqvist A, Levy RM. Simplified amino acid alphabets\r\n for protein fold recognition and implications for folding.\r\n Protein Eng 2000; 13:149-152.\r\n <a href=\"http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=10775656&dopt=Abstract\">PubMed</a>\r\n Pommié C, Levadoux S, Sabatier R, Lefranc G & Lefranc MP.\r\n IMGT standardized criteria for statistical analysis of immunoglobulin\r\n V-REGION amino acid properties. Journal of Molecular Recognition 2004; 17:17-32.\r\n <a href=\"http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=14872534&dopt=Abstract\">PubMed</a>\r\n Spitzer M, Fuellen G, Cullen P, Lorkowski S.\r\n VisCoSe: visualization and comparison of consensus sequences.\r\n Bioinformatics 2004; 20:433-435.\r\n <a href=\"http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=14960475&dopt=Abstract\">PubMed</a>,\r\n <a href=http://viscose.ifg.uni-muenster.de/html/alphabets.html>Web</a>\r\n Wang J, Wang W. A computational approach to simplifying the protein\r\n folding alphabet. Nat Struct Biol 1999; 11:1033-1038. <a href=\"http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=10542095&dopt=Abstract\">PubMed</a>\r\n <p>The script has been created entirely with PHP scripting language, and source code is available at\r\n <a href=http://www.biophp.org/minitools/reduce_protein_alphabet>BioPHP.org</a></p>\r\n<?\r\n}",
"protected function extractInfo()\n {\n $this->info = curl_getinfo($this->CurlRequest);\n $this->status = $this->info['http_code'];\n if (curl_errno($this->CurlRequest)!== CURLE_OK) {\n $this->error = curl_error($this->CurlRequest);\n } else {\n $this->error = false;\n }\n }",
"function laInfo() {\n\t\t$this->result['format_name'] = 'La';\n\t}",
"function nagios_state() {\n\t$status = shell_exec('cat /usr/local/nagios/var/status.dat');\n\t\n\t$results = array();\n\tpreg_match_all('/hoststatus {(.*?)}/s', $status, $results);\n\t\n\t$entries = array();\n\tforeach ($results[1] as $result) {\n\t\t$lines = explode(\"\\n\", $result);\n\t\t$entry = array();\n\t\tforeach ($lines as $line) {\n\t\t\t$line = explode('=', $line);\n\t\t\tif (count($line) > 1) {\n\t\t\t\t$entry[trim($line[0])] = trim($line[1]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$entries[] = $entry;\n\t}\n\t\n\treturn $entries;\n}",
"public static function parse($data)\n {\n if (!preg_match('/^(?:CPU|SET)/', $data)) {\n return false;\n }\n \n // sorts results foreach processor, averaged later\n $user = array();\n $system = array();\n $nice = array();\n $idle = array();\n \n foreach(explode(\"\\n\", $data) as $line) {\n if ($matches = S($line)->rmatch(\n '/\\s+(?:[0-9]+)' # processor (set) ID\n . '\\s+(?:[0-9]+)' # minor faults\n . '\\s+(?:[0-9]+)' # major faults\n . '\\s+(?:[0-9]+)' # inter-processor cross-calls\n . '\\s+(?:[0-9]+)' # interrupts\n . '\\s+(?:[0-9]+)' # interrupts as threads\n . '\\s+(?:[0-9]+)' # context switches\n . '\\s+(?:[0-9]+)' # involuntary context switches\n . '\\s+(?:[0-9]+)' # thread migrations (to another processor)\n . '\\s+(?:[0-9]+)' # spins on mutexes\n . '\\s+(?:[0-9]+)' # spins on readers/writer locks\n . '\\s+(?:[0-9]+)' # system calls\n . '\\s+(?<user>[0-9]+)' # percent user time\n . '\\s+(?<system>[0-9]+)' # percent system time\n . '\\s+(?<nice>[0-9]+)' # no longer calculated, fake nice\n . '\\s+(?<idle>[0-9]+)' # percent idle time\n . '/')\n ) {\n array_push($user, $matches['user']);\n array_push($system, $matches['system']);\n array_push($nice, $matches['nice']);\n array_push($idle, $matches['idle']);\n }\n }\n \n return array(\n 'user' => (count($user) ? array_sum($user) / count($user) : 'U'),\n 'system' => (count($system) ? array_sum($system) / count($system)\n : 'U'),\n 'nice' => (count($nice) ? array_sum($nice) / count($nice) : 'U'),\n 'idle' => (count($idle) ? array_sum($idle) / count($idle) : 'U')\n );\n }",
"function get_cpu_info() {\n\t$cpu = file('/proc/cpuinfo');\n\t\t\n\t\tforeach ($cpu as &$value) {\n\t\t\t//read data\n\t\t\t$i = strpos($value,\":\",0);\n\t\t\t//$value = str_replace(' ','_',$value);\n\t\t\t//echo $value.PHP_EOL;\n $key = trim(substr($value,0,$i));\n $key = str_replace(' ','_',$key);\n\t\t if (strlen($key) === 0) {\n\t\t\t // only take the first processor\n\t\t\t break;\n\t\t }\n\t\t $cpu_info[$key] = trim(substr($value,$i+1));\n\t\t}\n\t\t$cpu_info['processors'] = trim(shell_exec(\" grep -c ^processor /proc/cpuinfo\")); // count processors\n\t\t$load = sys_getloadavg();\n\t\t$cpu_info['load'] = number_format($load[0],2).\" (1 min) \".number_format($load[1],2).\" (10 Mins) \".number_format($load[2],2).\" (15 Mins)\";\n\t\t$cpu_info['boot_time'] = get_boot_time();\n\t\t$local = shell_exec('hostname -I');\n\t\t$local = str_replace(' ', ', ',trim($local));\n\t\t$all_ip =explode(',',$local);\n\t\t//interfaces ! netstat -i |sed 1,2d\n\t\t// ip addr | grep \"^ *inet \" checks virtual adaptors\n\t\t$cpu_info['local_ip'] = $all_ip[0];\n\t\t$cpu_info['ips'] = $local;\n\t\t$cpu_info['process'] = trim(shell_exec(\"/bin/ps -e | wc -l\"));\n\t\tif (is_file('/var/run/reboot-required') === true) {\n\t\t\t$cpu_info['reboot'] ='yes';\n\t\t}\n\t\telse {\n\t\t\t$cpu_info['reboot'] ='no';\n\t\t}\n\t\treturn $cpu_info;\n}",
"function mpcInfo() {\n\t\t$this->result['format_name'] = 'Musepack';\n\t}",
"private function parseCounters($string)\n\t{\n\t\t$string = trim($string);\n\t\tif (!preg_match('/^\\[(?P<pc>\\d+):(?P<bc>\\d+)]$/', $string, $matches)) {\n\t\t\treturn NULL;\n\t\t}\n\t\t$return = array();\n\t\t$return['packet-counter'] = $matches['pc'];\n\t\t$return['byte-counter'] = $matches['bc'];\n return $return;\n\t}",
"function get_carp_if_status() {\n // Local variables\n global $err_lib, $config;\n $carp_if_stats = [];\n $carp_enabled = is_carp_enabled();\n foreach ($config['virtualip']['vip'] as $carp) {\n if ($carp['mode'] == \"carp\") {\n $carp_if_ent = [];\n $carp_if_ent[\"interface\"] = $carp[\"interface\"];\n $carp_if_ent[\"vhid\"] = $carp['vhid'];\n $carp_if_ent[\"subnet\"] = $carp['subnet'];\n $carp_if_ent[\"subnet_bits\"] = $carp['subnet_bits'];\n $status = get_carp_interface_status(\"_vip{$carp['uniqid']}\");\n if ($carp_enabled == false) {\n $carp_if_ent[\"status\"] = \"disabled\";\n } else {\n if ($status == \"MASTER\") {\n $carp_if_ent[\"status\"] = \"master\";\n } else if ($status == \"BACKUP\") {\n $carp_if_ent[\"status\"] = \"backup\";\n } else if ($status == \"INIT\") {\n $carp_if_ent[\"status\"] = \"init\";\n }\n }\n // Add config to our array\n $carp_if_stats[] = $carp_if_ent;\n }\n }\n // Return our status\n return $carp_if_stats;\n}",
"function linuxReadInterfaceStatus ($text)\n{\n\t$result = array();\n\t$iface = '';\n\t$status = 'down';\n\t$speed = '0';\n\t$duplex = '';\n\tforeach (explode (\"\\n\", $text) as $line)\n\t{\n\t\t$m = array();\n\t\tif (preg_match ('/^[^\\s].* (.*):$/', $line, $m))\n\t\t{\n\t\t\tif ($iface !== '')\n\t\t\t\t$result[$iface] = array ('status' => $status, 'speed' => $speed, 'duplex' => $duplex);\n\t\t\t$iface = $m[1];\n\t\t\t$status = 'down';\n\t\t\t$speed = 0;\n\t\t\t$duplex = '';\n\t\t}\n\t\telseif (preg_match ('/^\\s*Speed: (.*)$/', $line, $m))\n\t\t\t$speed = $m[1];\n\t\telseif (preg_match ('/^\\s*Duplex: (.*)$/', $line, $m))\n\t\t\t$duplex = $m[1];\n\t\telseif (preg_match ('/^\\s*Link detected: (.*)$/', $line, $m))\n\t\t\t$status = (($m[1] === 'yes') ? 'up' : 'down');\n\t}\n\tif ($iface !== '')\n\t\t$result[$iface] = array ('status' => $status, 'speed' => $speed, 'duplex' => $duplex);\n\treturn $result;\n}",
"function parse()\n {\n if(strlen($this->raw_response) < 5)\n {\n return 0; // Timeout\n }\n\n if(($field = strtok($this->raw_response, \";\")) == null)\n {\n return 0;\n }\n else\n {\n $this->country = substr($field,0,3);\n }\n\n if(($field = strtok(\";\")) == null)\n {\n return 0;\n }\n else\n {\n $this->region = substr($field,0,31);\n }\n\n if(($field = strtok(\";\")) == null)\n {\n return 0;\n }\n else\n {\n $this->city = substr($field,0,31);\n }\n\n if(($field = strtok(\";\")) == null)\n {\n return 0;\n }\n else\n {\n $this->connectionSpeed = substr($field, 0,10);\n }\n\n if(($field = strtok(\";\")) == null)\n {\n return 0;\n }\n else\n {\n $this->country_conf = $field;\n }\n\n if(($field = strtok(\";\")) == null)\n {\n return 0;\n }\n else\n {\n $this->region_conf = $field;\n }\n\n if(($field = strtok(\";\")) == null)\n {\n return 0;\n }\n else\n {\n $this->city_conf = $field;\n }\n\n if(($field = strtok(\";\")) == null)\n {\n return 0;\n }\n else\n {\n $this->metro_code = $field;\n }\n\n if(($field = strtok(\";\")) == null)\n {\n return 0;\n }\n else\n {\n $this->latitude = $field;\n }\n\n if(($field = strtok(\";\")) == null)\n {\n return 0;\n }\n else\n {\n $this->longitude = $field;\n }\n\n if ( ($field = strtok(\";\") ) == null)\n {\n return 1;\n }\n else\n {\n $this->countryCode = $field;\n }\n\n if ( ($field = strtok(\";\") ) == null)\n {\n return 0;\n }\n else\n {\n $this->regionCode = $field;\n }\n\n if ( ($field = strtok(\";\") ) == null)\n {\n return 0;\n }\n else\n {\n $this->cityCode = $field;\n }\n\n if ( ($field = strtok(\";\") ) == null)\n {\n return 0;\n }\n else\n {\n $this->continentCode = $field;\n }\n\n return 1;\n }",
"function getAllLLDPData() {\n\t\t$oldsnmp = snmp_get_valueretrieval();\n\t\t@snmp_set_valueretrieval(SNMP_VALUE_PLAIN);\n\n\t\t$result = array();\n\t\t$result['hostname'] = $this->host;\n\t\t$result['lldpLocChassisId'] = @snmpget($this->host, $this->community, '1.0.8802.1.1.2.1.3.2.0');\n\t\t$result['ports'] = array();\n\n\t\t$snmp_names = array('1' => 'lldpRemTimeMark',\n\t\t '2' => 'lldpRemLocalPortNum',\n\t\t '3' => 'lldpRemIndex',\n\t\t '4' => 'lldpRemChassisIdSubtype',\n\t\t '5' => 'lldpRemChassisId',\n\t\t '6' => 'lldpRemPortIdSubtype',\n\t\t '7' => 'lldpRemPortId',\n\t\t '8' => 'lldpRemPortDesc',\n\t\t '9' => 'lldpRemSysName',\n\t\t '10' => 'lldpRemSysDesc',\n\t\t '11' => 'lldpRemSysCapSupported',\n\t\t '12' => 'lldpRemSysCapEnabled');\n\n\t\t@snmp_set_oid_output_format(SNMP_OID_OUTPUT_NUMERIC);\n\n\t\t$walk_data = @snmprealwalk($this->host, $this->community, '1.0.8802.1.1.2.1.4.1.1');\n\t\tforeach ($walk_data as $oid => $val) {\n\t\t\t// TODO: Multiple devices can appear per port.\n\t\t\t// the \\.1 needs to be less-specific here.\n\t\t\tif (preg_match('#\\.8802\\.1\\.1\\.2\\.1\\.4\\.1\\.1\\.([0-9]+)\\.0\\.([0-9]+)\\.([0-9]+)#', $oid, $m)) {\n\t\t\t\t$memberID = $m[3];\n\t\t\t\t$portID = $m[2];\n\t\t\t\t$oidName = $snmp_names[$m[1]];\n\n\t\t\t\tif (!isset($result['ports'][$portID])) { $result['ports'][$portID] = array('devices' => array()); }\n\t\t\t\tif (!isset($result['ports'][$portID]['devices'][$memberID])) { $result['ports'][$portID]['devices'][$memberID] = array(); }\n\n\t\t\t\t$result['ports'][$portID]['devices'][$memberID][$oidName] = $val;\n\t\t\t}\n\t\t}\n\n\t\t$walk_desc = @snmprealwalk($this->host, $this->community, '1.0.8802.1.1.2.1.3.7.1.4');\n\t\tforeach ($walk_desc as $oid => $val) {\n\t\t\tif (preg_match('#\\.8802\\.1\\.1\\.2\\.1\\.3\\.7\\.1\\.4\\.([0-9]+)#', $oid, $m)) {\n\t\t\t\t$portID = $m[1];\n\t\t\t\tif (isset($result['ports'][$portID])) {\n\t\t\t\t\t$result['ports'][$portID]['lldpLocPortDesc'] = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$walk_name = @snmprealwalk($this->host, $this->community, '1.3.6.1.2.1.31.1.1.1.18');\n\t\tforeach ($walk_name as $oid => $val) {\n\t\t\tif (preg_match('#1\\.3\\.6\\.1\\.2\\.1\\.31\\.1\\.1\\.1\\.18\\.([0-9]+)#', $oid, $m)) {\n\t\t\t\t$portID = $m[1];\n\t\t\t\tif (isset($result['ports'][$portID])) {\n\t\t\t\t\t$result['ports'][$portID]['ifAlias'] = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$walk_remaddr = @snmprealwalk($this->host, $this->community, '1.0.8802.1.1.2.1.4.2.1.3.0');\n\t\tforeach ($walk_remaddr as $oid => $val) {\n\t\t\tif (preg_match('#\\.8802\\.1\\.1\\.2\\.1\\.4\\.2\\.1\\.3\\.0\\.([0-9]+)\\.([0-9]+)\\.1.4.([0-9.]+)#', $oid, $m)) {\n\t\t\t\t$portID = $m[1];\n\t\t\t\t$memberID = $m[2];\n\n\t\t\t\tif (isset($result['ports'][$portID])) {\n\t\t\t\t\t$result['ports'][$portID]['devices'][$memberID]['lldpRemManAddr'] = $m[3];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t@snmp_set_valueretrieval($oldsnmp);\n\t\treturn $result;\n\t}",
"private function parseOut()\n\t{\n\t\t$p_hm_num = \"[\\d\\-]+|\\d+\\-?\\w\";\n\t\t$p_dir = \"northeast|northwest|southeast|southwest|north|east|south|west|ne|nw|se|sw|e|n|s|w\";\n\t\t$p_street = \"[\\w ]+\";\n\t\t$p_unit = \"[\\w\\#\\- ]+\";\n\t\t$p_city = \"[\\w ]+\";\n\t\t$p_state = \"\\w{2,4}\";\n\t\t$p_postal = \"(\\d{5,9})|([\\w ]{6,8})\";\n\n\t\t// Street Suffix\n\t\t$p_suffix = \"None|Alley|Annex|Arcade|Avenue|Bayou|Beach|Bend|Bluff|Bluffs|Bottom|Boulevard|Branch|Bridge|Brook|Brooks|Burg|Burgs|Bypass|\";\n\t\t$p_suffix.= \"Camp|Canyon|Cape|Causeway|Center|Centers|Circle|Circles|Cliff|Cliffs|Club|Common|Corner|Corners|Course|Court|Courts|Cove|Coves|Creek|Crescent|Crest|\";\n\t\t$p_suffix.= \"Crossing|Curve|Crossroad|Dale|Dam|Divide|Drive|Drives|Expressway|Estate|Estates|Extension|Extensions|Fall|Falls|Ferry|Field|Fields|Flat|Flats|Ford|Fords|\";\n\t\t$p_suffix.= \"Forest|Forge|Forges|Fork|Forks|Fort|Freeway|Garden|Gardens|Gateway|Glen|Glens|Green|Greens|Grove|Groves|Harbor|Harbors|Haven|Heights|Highway|Hill|Hills|Hollow|\";\n\t\t$p_suffix.= \"Inlet|Island|Islands|Isle|Junction|Junctions|Key|Keys|Knoll|Knolls|Lake|Lakes|Land|Landing|Lane|Light|Lights|Loaf|Lock|Locks|Lodge|Loop|Mall|Manor|Manors|Meadow|\";\n\t\t$p_suffix.= \"Meadows|Mews|Mill|Mills|Mission|Motorway|Mount|Mountain|Mountains|Neck|Orchard|Oval|Overpass|Park|Parkway|Pass|Passage|Path|Pike|Pine|Pines|Place|Plain|Plains|\";\n\t\t$p_suffix.= \"Plaza|Point|Points|Port|Ports|Prairie|Radial|Ramp|Ranch|Rapid|Rapids|Rest|Ridge|Ridges|River|Road|Roads|Route|Row|Rue|Run|Shoal|Shoals|Shore|Shores|Skyway|Spring|\";\n\t\t$p_suffix.= \"Springs|Spur|Square|Squares|Station|Stravenue|Stream|Street|Streets|Summit|Terrace|Throughway|Trace|Track|Trafficway|Trail|Tunnel|Turnpike|Underpass|Union|Unions|\";\n\t\t$p_suffix.= \"Valley|Valleys|Viaduct|View|Views|Village|Villages|Ville|Vista|Walk|Wall|Way|Well|Wells|\";\n\t\t$p_suffix.= \"ave|blvd|cir|ct|dr|ln|pl|rd|st|terr\";\n\n\t\t$address = $this->__toString();\n\t\t$address = preg_replace(\"[\\.,\\\"]\",'',trim($address));\n\n\t\tif (preg_match(\"/($p_city), ($p_state) ($p_postal)/\",$address,$m))\n\t\t{\n\t\t\t$this->city = $m[1];\n\t\t\t$this->state = $m[2];\n\t\t\t$this->post_code = $m[3];\n\t\t}\n\t/*\n\t// Big Ass Pattern Testing\n\tif (preg_test(\"^(\" & P_HM_NUM & \") (\" & P_DIR & \") (\" & P_STREET & \") (\" & P_SUFFIX & \") (\" & P_UNIT & \")$\",address)) then\n\t m = preg_match(\"^(\" & P_HM_NUM & \") (\" & P_DIR & \") (\" & P_STREET & \") (\" & P_SUFFIX & \") (\" & P_UNIT & \")$\",address)\n\t hm_num = m(0)\n\t dir_pre = m(1)\n\t st_name = m(2)\n\t st_suf = m(3)\n\t hm_unit = m(4)\n\telseif (preg_test(\"^(\" & P_HM_NUM & \") (\" & P_DIR & \") (\" & P_STREET & \") (\" & P_SUFFIX & \")$\",address)) then\n\t m = preg_match(\"^(\" & P_HM_NUM & \") (\" & P_DIR & \") (\" & P_STREET & \") (\" & P_SUFFIX & \")$\",address)\n\t hm_num = m(0)\n\t dir_pre = m(1)\n\t st_name = m(2)\n\t st_suf = m(3)\n\telseif (preg_test(\"^(\" & P_HM_NUM & \") (\" & P_STREET & \") (\" & P_SUFFIX & \") (\" & P_DIR & \")$\",address)) then\n\t m = preg_match(\"^(\" & P_HM_NUM & \") (\" & P_STREET & \") (\" & P_SUFFIX & \") (\" & P_DIR & \")$\",address)\n\t hm_num = m(0)\n\t st_name = m(1)\n\t st_suf = m(2)\n\t dir_suf = m(3)\n\telseif (preg_test(\"^(\" & P_HM_NUM & \") (\" & P_STREET & \") (\" & P_SUFFIX & \") (\" & P_UNIT & \")$\",address)) then\n\t m = preg_match(\"^(\" & P_HM_NUM & \") (\" & P_STREET & \") (\" & P_SUFFIX & \") (\" & P_UNIT & \")$\",address)\n\t hm_num = m(0)\n\t st_name = m(1)\n\t st_suf = m(2)\n\t hm_unit = m(3)\n\telseif (preg_test(\"^(\" & P_HM_NUM & \") (\" & P_STREET & \") (\" & P_SUFFIX & \")$\",address)) then\n\t m = preg_match(\"^(\" & P_HM_NUM & \") (\" & P_STREET & \") (\" & P_SUFFIX & \")$\",address)\n\t hm_num = m(0)\n\t st_name = m(1)\n\t st_suf = m(2)\n\telseif (preg_test(\"^(\" & P_HM_NUM & \") (\" & P_DIR & \") (\" & P_STREET & \")$\",address)) then\n\t trigger_error(\"ContactAddress::parse() - Unhandled Pattern\");\n\telseif (preg_test(\"^(\" & P_HM_NUM & \") (\" & P_STREET & \")$\",address)) then\n\telseif (preg_test(\"^(\" & P_HM_NUM & \") (\" & P_STREET & \")$\",address)) then\n\t m = preg_match(\"^(\" & P_HM_NUM & \") (\" & P_STREET & \")$\",address)\n\t hm_num = m(0)\n\t st_name = m(1)\n\telse\n\t trigger_error \"Canont parse this address: \" & address\n\tend if\n\t*/\n\t}",
"abstract function getinfo();"
] | [
"0.5477309",
"0.5125598",
"0.502796",
"0.5026956",
"0.49300295",
"0.49268812",
"0.4925336",
"0.49048632",
"0.48289144",
"0.47525802",
"0.47081447",
"0.47077757",
"0.46880963",
"0.46510357",
"0.46510357",
"0.4636798",
"0.46122885",
"0.45953122",
"0.4583578",
"0.45835373",
"0.45803103",
"0.4576531",
"0.4574326",
"0.45439294",
"0.45344248",
"0.4528753",
"0.4523974",
"0.45239633",
"0.45235553",
"0.45214242"
] | 0.7199385 | 0 |
Tells whether the filename is a symbolic link | #[Pure(true)]
function is_link(string $filename): bool {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function is_link ($filename) {}",
"private function isSymlink(string $path): bool\n {\n if (!file_exists($path)) {\n return false;\n }\n if (Platform::isWindows()) {\n return $this->getFilesystem()->isJunction($path);\n }\n\n return is_link($path);\n }",
"protected function _symlink($target, $path, $name)\n {\n return false;\n }",
"public function isLink(): bool;",
"function symlink ($target, $link) {}",
"public function isExternalLink() {\n\t\treturn $this->libraryType == self::TYPE_LINK;\n\t}",
"public static function isLink($path)\n {\n return false;\n }",
"protected function isRemovableSymlink(string $link, bool $force): bool\n {\n return is_link($link) && $force;\n }",
"public static function is_type_link($path) {\n\t\t//--\n\t\t$path = (string) $path;\n\t\t//--\n\t\tif((string)trim((string)$path) == '') {\n\t\t\tself::log_warning(__METHOD__.'() // Skip: Empty Path');\n\t\t\treturn false;\n\t\t} //end if\n\t\t//--\n\t\tclearstatcache(true, $path);\n\t\t//--\n\t\treturn (bool) is_link($path);\n\t\t//--\n\t}",
"function symlink($originDir, $targetDir, $copyOnWindows = false);",
"public function isSymlink($dest)\n {\n $remoteCommand = sprintf(\"readlink %s\", $dest);\n $commandline = sprintf(\"ssh %s@%s \\\"%s\\\"\", $this->getUser(), $this->getHost(), $remoteCommand);\n\n if ($this->cli->execute($commandline)) {\n return false;\n }\n\n return ('' !== trim($this->cli->getOutput()));\n }",
"protected function _readlink($path) {\n\t\t$target = readlink ( $path );\n\t\tif ('/' != substr ( $target, 0, 1 )) {\n\t\t\t$target = dirname ( $path ) . DIRECTORY_SEPARATOR . $target;\n\t\t}\n\t\t$target = $this->_normpath ( $target );\n\t\t$root = $this->_normpath ( $this->_options ['root'] );\n\t\treturn $target && file_exists ( $target ) && 0 === strpos ( $target, $root ) ? $target : false;\n\t}",
"function isAbsolutePath($file);",
"public function isMetaImageFileLink()\n {\n if ($this->owner->hasMetaImage()) {\n return ($this->owner->getMetaImageLink() == $this->owner->getMetaImageURL());\n }\n \n return false;\n }",
"protected function _readlink($path)\n\t{\n\t\t$target = readlink($path);\n\t\tif ('/' != substr($target, 0, 1)) {\n\t\t\t$target = dirname($path).DIRECTORY_SEPARATOR.$target;\n\t\t}\n\t\t$target = $this->_normpath($target);\n\t\t$root = $this->_normpath($this->_options['root']);\n\t\treturn $target && file_exists($target) && 0 === strpos($target, $root) ? $target : false;\n\t}",
"public function pathExists($path)\n {\n return file_exists($path) || is_link($path);\n }",
"public static function createLink(string $target, string $link, bool $assertExists = true): bool\n {\n if ($assertExists) {\n static::assertExists($target);\n }\n // On Windows `symlink()` may require an absolute path\n if (@symlink($target, $link) || (DS === '\\\\' && @symlink(static::resolvePath($target), $link))) {\n return true;\n }\n throw new FileSystemException(sprintf('Cannot create symbolic link \"%s\": %s', $link, static::getLastErrorMessage()));\n }",
"public static function isExternalLink($path)\n {\n // Regular Expression for breaking down the URL\n $re = '/^(((http|https):)?\\\\/\\\\/)?((([a-z0-9][a-z0-9\\\\-]*[a-z0-9])\\\\.)?(([a-z0-9][a-z0-9\\\\-]*[a-z0-9])\\\\.([a-z]{2,}\\\\.)*([a-z]{2,})))(\\\\/.*)?$/i';\n if (preg_match($re, $path, $m)) {\n if(empty($m[6])){\n $path = $m[1].$m[7];\n }else{\n $path = $m[1].$m[6].'.'.$m[7];\n }\n $assetPath = $path .'/video/';\n if(static::LINK_ASSET == $assetPath){\n return true;\n }else{\n return false;\n }\n\n }\n }",
"function __link($type){\n\n\tglobal $_linksFiles;\n\n\t$files = $_linksFiles[$type];\n\t$_link = '';\n\n\tif (!empty($files) AND is_array($files)){\n\t\tforeach($files as $link){\n\t\t\tif (file_exists(APP . str_replace('/', DIRECTORY_SEPARATOR, $link))){\n\t\t\t\t$_link[] = LINK . $link;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $_link;\n}",
"public function readLink(string $path): string|bool;",
"public function ext_isLinkable($doktype, $uid)\n {\n return true;\n }",
"function ok_to_link(&sys1, &sys2) {\n\tglobal UNI;\n\n\t//linking to itself.\n\tif(sys1['num'] == sys2['num']) {\n\t\treturn false;\n\t}\n\n\tsys2_links = explode(',', sys2['links']);\n\n\t//return o.k. if target still has empty links || already linked.\n\tif((count(sys2_links) < UNI['maxlinks']) || in_array(sys1['num'], sys2_links)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}",
"protected function isRemoteLink($link)\n {\n return ('http://' === substr($link, 0, 7) or 'https://' === substr($link, 0, 8) or '//' === substr($link, 0, 2));\n }",
"public function testHasOptionSymlink()\n {\n $this->assertTrue($this->command->getDefinition()->hasOption('symlink'));\n }",
"function isFileRemote($url) {\n $context = stream_context_create(array('http' =>array('method'=>'HEAD')));\n $fd = @fopen($url, 'rb', false, $context);\n if ($fd!==false) {\n fclose($fd);\n $this->addLog( 'FILE_REMOTE_EXIST', $url );\n return true;\n }\n $this->addLog( 'FILE_REMOTE_NOT_EXIST', $url );\n return false;\n }",
"public function createLink($target, $link, $isDir = false, $force = false)\r\n {\r\n // Skip if target does not exist\r\n if (!file_exists($target)) {\r\n $this->printl('Target does not exist: ' . $target);\r\n return false;\r\n }\r\n\r\n // Remove old symlink if 'force' option is true\r\n if (file_exists($link)) {\r\n if ($force) {\r\n $this->printl('Removing old link: ' . $link);\r\n unlink($link);\r\n } else {\r\n if ($this->_debugLevel >= 3) {\r\n $this->printl('Link already exists (use force option to override): ' . $link);\r\n }\r\n return false;\r\n }\r\n }\r\n\r\n $command = $this->_getSymlinkCommand($target, $link, $isDir);\r\n\r\n $output = '';\r\n $exitCode = 0;\r\n if (DRY_RUN) {\r\n $output = $command;\r\n } else {\r\n $output = exec($command, $output, $exitCode);\r\n }\r\n\r\n if ($this->_debugLevel >= 3) {\r\n echo $this->printl($exitCode . ': ' . $output);\r\n }\r\n\r\n return $exitCode === 0;\r\n }",
"function url_exists($url)\n {\n $handle = @fopen($url,'r');\n return ($handle !== false);\n }",
"public function checkLink($link);",
"static protected function isLink($val)\n {\n return preg_match('/#[0-9]+:[0-9]+/', $val) !== 0;\n }",
"function is_file ($filename) {}"
] | [
"0.83254045",
"0.7334923",
"0.6649616",
"0.662543",
"0.6618092",
"0.6571683",
"0.6520477",
"0.6431269",
"0.643089",
"0.64258504",
"0.64179623",
"0.61708593",
"0.6162489",
"0.61425084",
"0.6088231",
"0.59733254",
"0.5954044",
"0.5838623",
"0.5810294",
"0.5809272",
"0.5798685",
"0.57861423",
"0.5781489",
"0.5750171",
"0.5737699",
"0.57324743",
"0.57306755",
"0.57297474",
"0.56897527",
"0.5687426"
] | 0.769395 | 1 |
Get the value of picpayToken | public function getPicpayToken()
{
return $this->picpayToken;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTokenValue();",
"function civicrm_api3_payment_token_get($params) {\n return _civicrm_api3_basic_get('CRM_Payment_BAO_PaymentToken', $params);\n}",
"protected function getPayButtonParams() {\n if (preg_match(\"/token\\\":\\\"(.*?)\\\"/\", $this->button_code, $matches)) {\n $token = $matches[1] ;\n }\n else {\n $token = \"null\";\n }\n return $token ;\n }",
"public function getToken() {\n return $this->get('token')->value;\n }",
"public function getToken() {\r\n\t\treturn $this->getProperty(\"token\");\r\n\t}",
"public function getToken(): string;",
"public function token(){\n\n\t\tif ( empty( $this->token ) ) {\n\t\t\t$this->request_checkout_token();\n\t\t}\n\n\t\treturn $this->token;\n\t}",
"public function get_token(){\n\t\treturn $this->token;\n\t}",
"public function getToken()\n {\n return $this->getParameter('token');\n }",
"static function getToken(){\n return 'b1e9ce5e3a97b02da706ccb739d0e2a7';\n }",
"public function getToken()\n {\n return $this->getParameter('token') ?? $this->getParameter('transactionReference');\n }",
"function getToken() {\n return $this->token;\n }",
"public function getTokenValue()\n\t{\n\t\t$tokenName = $this->getTokenName();\n\t\t$tokenValue = $_SESSION['token'][$tokenName];\n\t\tif(empty($tokenValue)) {\n\t\t\t$tokenValue = \\Imanager\\Util::randomToken(32);\n\t\t\t$_SESSION['token'][$tokenName] = $tokenValue;\n\t\t}\n\t\treturn $tokenValue;\n\t}",
"public function getToken();",
"public function getToken();",
"public function getToken();",
"public function getToken();",
"public function getToken();",
"public function getToken()\r\n {\r\n return $this->token;\r\n }",
"public function getSecurityToken();",
"public function getToken() {\n\t\treturn $this->token;\n\t}",
"public static function getToken()\n {\n return self::$token;\n }",
"public function getCreditCardToken()\n {\n return $this->creditCardToken;\n }",
"private function getTokenValue() {\n return '1';\n }",
"public function getToken()\n\t{\n\t\treturn $this->token;\n\t}",
"public static function getToken()\n\t{\n\t\treturn self::$token;\n\t}",
"public function getToken(): string\n {\n return $this->token;\n }",
"public function getToken(): string\n {\n return $this->token;\n }",
"public function getToken(): string\n {\n return $this->token;\n }",
"public function getToken(): string\n {\n return $this->token;\n }"
] | [
"0.6929579",
"0.687398",
"0.6827541",
"0.6695999",
"0.6623918",
"0.6587618",
"0.6571947",
"0.6497616",
"0.645371",
"0.6442076",
"0.63997245",
"0.6391289",
"0.63870066",
"0.63775724",
"0.63775724",
"0.63775724",
"0.63775724",
"0.63775724",
"0.6366745",
"0.6345919",
"0.6332625",
"0.63320225",
"0.632008",
"0.6287375",
"0.62842464",
"0.628216",
"0.6279888",
"0.6279888",
"0.6279888",
"0.6279888"
] | 0.82250464 | 0 |
Get the value of sellerToken | public function getSellerToken()
{
return $this->sellerToken;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getToken() {\n return $this->get('token')->value;\n }",
"public function getToken() {\r\n\t\treturn $this->getProperty(\"token\");\r\n\t}",
"public static function getMerchantToken()\n {\n return self::$merchantToken;\n }",
"public function getToken(): string\n {\n return $this->attributes['token'];\n }",
"public function getMerchantToken()\n {\n return $this->merchantToken;\n }",
"public function getToken()\r\n {\r\n return $this->token;\r\n }",
"public function getTokenValue()\n\t{\n\t\t$tokenName = $this->getTokenName();\n\t\t$tokenValue = $_SESSION['token'][$tokenName];\n\t\tif(empty($tokenValue)) {\n\t\t\t$tokenValue = \\Imanager\\Util::randomToken(32);\n\t\t\t$_SESSION['token'][$tokenName] = $tokenValue;\n\t\t}\n\t\treturn $tokenValue;\n\t}",
"function getToken() {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->attributes['token'] ?? null;\n }",
"public function getTokenValue();",
"public function getToken()\r\n {\r\n return $this->usuario_token;\r\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken() {\n return $this->token;\n }",
"public function getToken() {\n return $this->token;\n }",
"public function getToken(): string\n {\n return $this->token;\n }",
"public function getToken(): string\n {\n return $this->token;\n }",
"public function getToken(): string\n {\n return $this->token;\n }",
"public function getToken(): string\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }"
] | [
"0.7257542",
"0.7079011",
"0.7010675",
"0.68867457",
"0.68856543",
"0.68830705",
"0.6870767",
"0.68687105",
"0.6830072",
"0.68195266",
"0.68064135",
"0.6801291",
"0.6770017",
"0.6770017",
"0.67603",
"0.67603",
"0.67603",
"0.67603",
"0.675259",
"0.675259",
"0.675259",
"0.675259",
"0.675259",
"0.675259",
"0.675259",
"0.675259",
"0.675259",
"0.675259",
"0.675259",
"0.675259"
] | 0.81283456 | 0 |
Starts a data base request that ties in with $this>_items and adds the first item to thel ist | private function startRequest() {
$this->_currentResult = DataBase::query(
"SELECT item.id ".
$this->getQueryBase().
"LIMIT ".count($this->_items).",".self::ITEMS_PER_STEP);
if ($this->_currentResult->next()) {
$this->_currentResultCounter = 1;
$item = $this->getQueryList()->getModelType()->getByID(
$this->_currentResult->get('id'));
$this->_items[] = $item;
return $item;
} else {
// The end has been reached.
$this->_count = count($this->_items);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function fetch() {\n $result = WebApi::getJSONData('ITFItems_440', 'GetPlayerItems', 1, array('SteamID' => $this->steamId64));\n\n $this->items = array();\n foreach($result->items->item as $itemData) {\n if($itemData != null) {\n $item = new TF2Item($itemData);\n $this->items[$item->getBackpackPosition() - 1] = $item;\n }\n }\n\n $this->fetchDate = time();\n }",
"public function fetch() {\n $appId = $this->getAppId();\n $inventoryClass = new ReflectionClass(get_class($this));\n $itemClass = $inventoryClass->getConstant('ITEM_CLASS');\n $result = WebApi::getJSONData('IEconItems_' . $appId, 'GetPlayerItems', 1, array('SteamID' => $this->steamId64));\n\n $this->items = array();\n foreach($result->items as $itemData) {\n if($itemData != null) {\n $item = new $itemClass($this, $itemData);\n $this->items[$item->getBackpackPosition() - 1] = $item;\n }\n }\n\n $this->fetchDate = time();\n }",
"public function findFirst()\n {\n $select = $this->getSelect();\n $select->order('items.id ASC');\n $select->limit(1);\n return $this->fetchObject($select);\n }",
"protected function internalFetch() {\n $params = ['SteamID' => $this->steamId64];\n $result = WebApi::getJSONData(\"IEconItems_{$this->getAppId()}\", 'GetPlayerItems', 1, $params);\n\n $this->items = [];\n $this->preliminaryItems = [];\n foreach ($result->items as $itemData) {\n if ($itemData != null) {\n $inventoryClass = get_called_class();\n $itemClass = $inventoryClass::ITEM_CLASS;\n $item = new $itemClass($this, $itemData);\n if ($item->isPreliminary()) {\n $this->preliminaryItems[] = $item;\n } else {\n $this->items[$item->getBackpackPosition() - 1] = $item;\n }\n }\n }\n }",
"public function first(){\n $return = $this->limit(0,1)->getData();\n $this->reInit();\n return $return->fetch();\n }",
"public function addFirst(mixed $item): void;",
"private function loadItems()\n {\n\n $response = call_user_func_array($this->nextPage, [$this->page]);\n\n // If the response is empty, we don't have more pages to look for\n if (empty($response)) {\n $this->hasNextPage = false;\n return;\n }\n\n // Append the items to the current items\n $this->items = array_merge($this->items, $this->transformItems($response));\n\n $this->hasNextPage = $response['hasNext'];\n }",
"public function getByIndex($index) {\n\t\tif (!Types::isInteger($index))\n\t\t\tthrow new ArgumentException('index must be an integer', 'index');\n\t\tif ($index < 0)\n\t\t\tthrow new ArgumentOutOfRangeException('index', $index,\n\t\t\t\t'$index must not be negative');\n\t\t\t\n\t\tif ($this->_count !== null && $index > $this->_count)\n\t\t\tthrow new ArgumentOutOfRangeException('$index must be smaller than the '.\n\t\t\t\t'count of items ('.$this->_count.')', 'index');\n\t\t\t\t\t\t\n\t\tif ($index < count($this->_items))\n\t\t\treturn $this->_items[$index];\n\t\t\t\n\t\t// If the next item is accessed, the client probably goes through the items\n\t\t// in a loop, so we can use a global data base result\n\t\tif ($index == count($this->_items)) {\n\t\t\t// If there is a running query, use the result. Otherwise, start a new \n\t\t\t// query\n\t\t\tif ($this->_currentResult) {\n\t\t\t\t// Try to access the next item\n\t\t\t\tif ($this->_currentResult->next()) {\n\t\t\t\t\t$this->_currentResultCounter++;\n\t\t\t\t\t$item = $this->getQueryList()->getModelType()->getByID(\n\t\t\t\t\t\t$this->_currentResult->get('id'));\n\t\t\t\t\t$this->_items[] = $item;\n\t\t\t\t\treturn $item;\n\t\t\t\t} else if ($this->_currentResultCounter == self::ITEMS_PER_STEP) {\n\t\t\t\t\t// The last request returned as much items as requested, so there\n\t\t\t\t\t// might be more\n\t\t\t\t\tif ($item = $this->startRequest())\n\t\t\t\t\t\treturn $item;\n\t\t\t\t\telse\t\t\t\t\t\n\t\t\t\t\t\tthrow new ArgumentOutOfRangeException('$index must be smaller '.\n\t\t\t\t\t\t\t'than the count of items ('.$this->_count.')', $index, 'index');\n\t\t\t\t} else {\n\t\t\t\t\t// The last request returned less items as requested. This means that\n\t\t\t\t\t// the end has been reached\t\n\t\t\t\t\t$this->_count = count($this->_items);\n\t\t\t\t\tthrow new ArgumentOutOfRangeException('$index must be smaller '.\n\t\t\t\t\t\t'than the count of items ('.$this->_count.')', 'index');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($item = $this->startRequest())\n\t\t\t\t\treturn $item;\n\t\t\t\telse\t\t\t\t\t\n\t\t\t\t\tthrow new ArgumentOutOfRangeException('$index must be smaller '.\n\t\t\t\t\t\t'than the count of items ('.$this->_count.')', $index, 'index');\n\t\t\t}\n\t\t}\n\t\t\n\t\t// It looks like the item was not requested in a loop, at least not in a one\n\t\t// that begins at the index 0, so we have to access the item directly. We\n\t\t// nor can store the item somewhere because that would cause an empty range.\n\t\t$result = DataBase::query(\n\t\t\t\"SELECT item.id \".\n\t\t\t$this->getQueryBase().\n\t\t\t\"LIMIT $index,1\");\n\t\tif ($result->next()) {\n\t\t\treturn $this->getQueryList()->getModelType()->getByID($result->get('id'));\n\t\t} else\n\t\t\tthrow new ArgumentOutOfRangeException('$index must be smaller than the '.\n\t\t\t\t'count of items', $index, 'index');\n\t}",
"public function loadFirst()\n {\n return $this->limit(1)->load()->getFirst();\n }",
"private function initItem()\n {\n $user_id = $this->id;\n Item::create([\n 'item' => '餐費',\n 'ioID' => '1',\n 'user_id' => $user_id,\n ]);\n\n Item::create([\n 'item' => '交通',\n 'ioID' => '1',\n 'user_id' => $user_id,\n ]);\n\n Item::create([\n 'item' => '娛樂',\n 'ioID' => '1',\n 'user_id' => $user_id,\n ]);\n\n Item::create([\n 'item' => '其他支出',\n 'ioID' => '1',\n 'user_id' => $user_id,\n ]);\n\n Item::create([\n 'item' => '薪水',\n 'ioID' => '2',\n 'user_id' => $user_id,\n ]);\n\n Item::create([\n 'item' => '其他收入',\n 'ioID' => '2',\n 'user_id' => $user_id,\n ]);\n }",
"public function start()\n {\n if ($this->started) {\n return $this;\n }\n\n // If there are any range is asking\n if ($this->req_offset > 0) {\n $this->query->offset($this->req_offset);\n }\n\n if ($this->req_total > 0) {\n $this->query->limit($this->req_total);\n }\n\n $this->total_record = $this->driver->count($this->query);\n $this->index = $this->req_offset -1;\n $this->page = 0;\n $this->total_page = 0;\n\n $this->started = true;\n\n\n $this->updatePagedResult();\n\n // $this->dispatch('change', [ $this]);\n\n return $this;\n }",
"public function first() {\n $this->index = 0;\n }",
"private function initializeNextItem()\n {\n while (!$this->messagesToReturn->valid() && $this->dbCursor->hasNext()) {\n $cb = $this->callback;\n $this->messagesToReturn = new \\ArrayIterator(\n $cb($this->dbCursor->getNext(), $this->actualAggregateIdentifier)\n );\n }\n\n $this->next = $this->messagesToReturn->current();\n $this->messagesToReturn->next();\n }",
"function fetchItems() {\r\n\t\tif (count($this->auctions)) {\r\n\t\t\tforeach($this->auctions as $auction) {\r\n\t\t\t\t//ItemCollection::getInstance()->fetchItem($auction->item->id);\r\n\t\t\t\t$auction->fetchItem();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tthrow new NoAuctionsLoaded();\r\n\t\t}\r\n\t}",
"public function load()\n {\n $sql = \"SELECT itemId FROM `{$this->tbl}`\"\n . \"\\nWHERE itemType = \"\n . Claroline::getDatabase()->quote( $this->itemType );\n \n if( $this->listId )\n {\n $sql .= \"\\nAND listId = \"\n . Claroline::getDatabase()->escape( $this->listId );\n }\n \n $sql .= \"\\nORDER BY rank ASC\";\n \n $itemList = Claroline::getDatabase()->query( $sql );\n $this->itemList = array();\n \n if( $itemList->numRows() )\n {\n foreach( $itemList as $itemData )\n {\n $itemId = $itemData[ 'itemId' ];\n $this->itemList[ $itemId ] = new $this->itemClassName( $itemId );\n }\n }\n }",
"public function first()\n {\n return $this->items->first();\n }",
"public function first() {\n $class = $this->class;\n $argv = func_get_args();\n\n // If argument isnt passed and it isnt an integer, limit will be 1\n $limit = (isset($argv[0]) && is_int($argv[0])) ? $argv[0] : 1;\n\n $db = DB::connect();\n\n $obj = $db->prepare('SELECT * FROM ' . $class . ' ORDER BY id ASC LIMIT ' . $limit);\n $obj->execute();\n\n $result = $obj->fetchAll(PDO::FETCH_ASSOC);\n\n $items = new Model();\n\n // If more than one object is being looked for\n if (count($result) > 1) {\n foreach ($result as $key) {\n $item = new $class($key);\n $items[] = $item;\n }\n\n return $items;\n }\n\n // if there is only one object, return the only only object of the array\n return new $class($result[0]);\n }",
"public function prepare_items(){}",
"public function init() {\n\t\tif(!$this->inited) {\n\t\t\tif(!$this->item) return;\n\t\t\t$this->items = [];\n\t\t\t$this->inited = true;\n\t\t}\n\t}",
"public function first();",
"public function first();",
"public function first();",
"public function first();",
"public function first();",
"public function first();",
"public function first();",
"public function first();",
"public function first();",
"public function first();",
"public function firstItem()\n\t{\n\t\treturn $this->first;\n\t}"
] | [
"0.6109703",
"0.6015615",
"0.5896298",
"0.58889306",
"0.58429456",
"0.58006895",
"0.5755329",
"0.5719075",
"0.55972975",
"0.55810595",
"0.55316865",
"0.5496452",
"0.54932106",
"0.54703027",
"0.54693794",
"0.545235",
"0.54386306",
"0.5372317",
"0.5349632",
"0.53175205",
"0.53175205",
"0.53175205",
"0.53175205",
"0.53175205",
"0.53175205",
"0.53175205",
"0.53175205",
"0.53175205",
"0.53175205",
"0.5267704"
] | 0.7985018 | 0 |
The before() method is called before the controller action. In our template controller we override this method so that we can set up default values. These variables are then available to our controllers if they need to be modified. | public function before()
{
parent::before();
View::bind_global('current_role', $this->current_role);
$this->check_login();
if ($this->auto_render)
{
// keep the last url if it's not home/language
if (Request::current()->action() != 'language')
{
Session::instance()->set('controller', Request::current()->uri());
}
$this->template->title = 'Ko33 Kickstart';
$this->template->content = $this->set_default_template();
$this->template->header = new View('layouts/header');
$this->template->header->css = array();
$this->template->header->js = array();
$this->template->header->links = array();
$this->template->footer = new View('layouts/footer');
$this->template->footer->js = array();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function before() \n\t{\n $user = Auth::instance()->get_user();\n\t\t\n\t\t// if a user is not logged in, redirect to login page\n\t\tif (!$user)\n {\n HTTP::redirect(Controller_Cms_User::getProtocol() . $_SERVER['HTTP_HOST'] . '/cms/user/login');\n }\n\t\t\n\t\t// set standard variables \n\t\tparent::before();\n if ($this->auto_render) \n\t\t{\n $this->template->title \t= 'weirdbird cms';\n\t\t\t$this->template->content \t= '';\n $this->template->username\t= $user->username;\n\t\t\t$this->template->styles \t= array();\n $this->template->scripts\t= array();\n }\n }",
"public function before()\n\t{\n\t\tparent::before();\n\n\t\t// Provide global auth access\n\t\t$this->auth = Auth::instance();\n\n\t\t// Give all controllers session access\n\t\t$this->session = Session::instance();\n\t\t\n\t\t// Grab current action\n\t\t$this->action = $action = $this->request->action;\n\n\t\tif (($this->secure_controller !== FALSE AND $this->auth->logged_in($this->secure_controller) === FALSE)\n\t\t\tOR (is_array($this->secure_actions) AND array_key_exists($action, $this->secure_actions)\n\t\t\t\tAND $this->auth->logged_in($this->secure_actions[$action]) === FALSE))\n\t\t{\n\t\t\tif ($this->auth->logged_in())\n\t\t\t{\n\t\t\t\t// User doesn't have required roles\n\t\t\t\t$this->request->redirect('user/access_denied');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// User must logged in first\n\t\t\t\t$this->request->redirect('user/sign_in');\n\t\t\t}\n\t\t}\n\n\t\tif ($this->auto_render)\n\t\t{\n\t\t\t// Initialize empty vars\n\t\t\t$this->template->title = '';\n\t\t\t$this->template->content = '';\n\t\t}\n\t}",
"public function before()\n\t{\t\t\n\t\t// Run anything that need to run before this.\n\t\tparent::before();\t\t\n\n\t\t// Check user auth and role\n\t\t$action_name = Request::current()->action();\n\n\t\tif (($this->auth_required !== FALSE && Auth::instance()->logged_in($this->auth_required) === FALSE)// auth is required AND user role given in auth_required is NOT logged in\t\t\t\t\n\t\t\t|| (is_array($this->secure_actions) && array_key_exists($action_name, $this->secure_actions) && Auth::instance()->logged_in($this->secure_actions[$action_name]) === FALSE))// OR secure_actions is set AND the user role given in secure_actions is NOT logged in\n\t\t{\n\t\t\tif (Auth::instance()->logged_in())\n\t\t\t{\n\t\t\t\t// user is logged in but not on the secure_actions list\n\t\t\t\t$this->access_required();\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\t$this->login_required();\n\t\t\t}\n\t\t}\n\n\t\tif ($this->auto_render) \n\t\t{\n\t\t\n\t\t\t// Initialize empty values\n\t\t\t$this->template->title = DEFAULT_PAGE_TITLE;\n\t\t\t$this->template->styles = array('pcp-ui/jquery-ui-1.8.6.custom.css');\n\t\t\t$this->template->scripts = array('jquery-1.4.2.min.js','jquery-ui-1.8.6.custom.min.js');\t\t\t\n\t\t\t$this->template->theme_styles = array();\n\t\t\t$this->template->theme_scripts = array();\n\t\t\t$this->template->head = array();\n\t\t\t$this->template->header = '';\n\t\t\t$this->template->top_menu = '';\n\t\t\t$this->template->content = '';\n\t\t\t$this->template->bottom_menu = '';\n\t\t\t$this->template->footer = '';\n\t\t}\n\t\t\n\t}",
"public function beforeController()\n {\n }",
"protected function before()\n {\n }",
"protected function before()\n {\n }",
"protected function before()\n {\n }",
"public function before()\n\t{\n\t\t$this->session = Session::instance();\n\t\t\n\t\t// Auto login users if possible and cookie has been set\n\t\tif (! Auth::instance()->logged_in())\n\t\t{\n\t\t\ttry {\n\t\t\t\t$auth = Auth::instance()->auto_login();\n\t\t\t}\n\t\t\tcatch (Exception $e) {\n\t\t\t\t// Log error for investigation\n\t\t\t\tKohana::$log->add(Log::ERROR, 'Error on Auth::auto_login');\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Get our currently logged in user (or an empty user model for guest purposes)\n\t\tif (! isset($this->user))\n\t\t{\n\t\t\t$this->user = Auth::instance()->get_user();\n\t\t\tif ( ! isset($this->user->timezone))\n\t\t\t{\n\t\t\t\t$this->user->timezone = 'America/Chicago';\n\t\t\t\t\n\t\t\t\t$display_timezone_notice = Cookie::get('display_timezone_notice', TRUE);\n\t\t\t\t\n\t\t\t\tif ($display_timezone_notice)\n\t\t\t\t{\n\t\t\t\t\t// Don't spam users with this on every pageview\n\t\t\t\t\tCookie::set('display_timezone_notice', FALSE);\n\t\t\t\t\tNotices::info('Until you log in, all times are displayed in the America/Chicago timezone.', FALSE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Set default title and content views (path only)\n\t\t$directory = $this->request->directory();\n\t\t$controller = $this->request->controller();\n\t\t$action = $this->request->action();\n\n\t\t// Removes leading slash if this is not a subdirectory controller\n\t\t$controller_path = trim($directory.'/'.$controller.'/'.$action, '/');\n\n\t\ttry\n\t\t{\n\t\t\t$this->view = Kostache::factory('page/'.$controller_path)\n\t\t\t\t->assets(Assets::factory());\n\t\t}\n\t\tcatch (Kohana_Exception $x)\n\t\t{\n\t\t\t// The View class could not be found, so the controller action is repsonsible for making sure this is resolved.\n\t\t\t$this->view = NULL;\n\t\t}\n\n\t\treturn parent::before();\n\t}",
"public function before() {\r\n\t\t\r\n\t\t/** Load Access Controller List Class **/\r\n\t\t$this->acl\t\t\t= ACL::instance();\r\n\r\n\t\t/** Load Session Class **/\r\n\t\t$this->session\t\t= Session::instance('native');\t\t\t\t\t\r\n\t\t\r\n\t\t/** Set Initialize Variable **/\r\n\t\t$maintenance_mode\t= Model_Configuration::instance()->load('maintenance');\r\n\t\t\r\n\t\t/** Get User Id Session **/\r\n\t\t$member_id\t\t= ($this->session->get('member_id') != '') ? $this->session->get('member_id') : 0;\t\r\n\t\t\r\n\t\t/** Set User Member Data **/\r\n\t\t$this->member\t= !(empty($member_id)) ? Lib::to_object(get_object_vars(Model_User::instance()->load($member_id))) : '';\r\n\t\t\r\n\t\t/** SET MAINTENANCE MODE template **/\r\n\t\tif (!empty($maintenance_mode->value)) {\r\n\t\t\t$this->is_maintenance = TRUE;\r\n\t\t}\t\t\r\n\r\n\t\t/** SET IS MOBILE MODE template **/\r\n\t\tif (Request::$current->user_agent('mobile') && Session_Cookie::instance()->get('is_mobile') != '') {\r\n\t\t\t// Set Session cookies is_mobile to client\r\n\t\t\tSession_Cookie::instance()->set('is_mobile', 1);\r\n\t\t\t// Set is_mobile object to true\r\n\t\t\t$this->is_mobile\t= TRUE;\r\n\t\t\t// Set template for mobile\r\n\t\t\t$this->template\t\t= 'themes/defaultmobile';\r\n\t\t}\r\n\t\r\n\t\t/** Checking ajax requests **/\r\n\t\tif ($this->request->is_ajax()) {\r\n\t\t\t\r\n\t\t\t$this->auto_render = FALSE;\r\n $this->template = CP.'ajaxdefault';\r\n\t\t\t\t\r\n\t\t} else {\r\n\r\n\t\t\t// Run anything that need ot run before this after checking ajax requested\r\n\r\n\t\t\tparent::before();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// Set Site Counter\r\n\t\t\tif (!Session_Cookie::instance()->get('session')) Model_Setting::instance()->count_visitor();\r\n\t\t\t\r\n\t\t\t// Get Site Counter \r\n\t\t\t$counter = Model_Setting::instance()->load_by_parameter('counter');\r\n\t\t\t$this->data['counter']\t= Lib::_trim_strip($counter->value);\t\r\n\r\n\t\t\t// Site Title Default\r\n\t\t\t$titledefault = Model_Setting::instance()->load_by_parameter('title_default');\r\n\t\t\t$this->data['title_default']\t= Lib::_trim_strip($titledefault->value);\r\n\t\t\t\r\n\t\t\t// Set Site Copyright\r\n\t\t\t$copyright = Model_Setting::instance()->load_by_parameter('copyright');\r\n\t\t\t$this->data['copyright']\t= Lib::_trim_strip($copyright->value);\t\r\n\r\n\t\t\t// Set Site Copyright\r\n\t\t\t$registered = Model_Setting::instance()->load_by_parameter('registered_mark');\r\n\t\t\t$this->data['registered']\t= Lib::_trim_strip($registered->value);\r\n\t\t\t\r\n\r\n\t\t\t$page_title\t\t\t\t= i18n::get('page_title') != 'page_title' ? i18n::get('page_title') : 'Welcome to Kohana';\r\n\r\n\t\t\t$meta_keywords\t\t\t= '';\r\n\r\n\t\t\t$meta_description\t\t= '';\r\n\r\n\t\t\t$meta_copyright\t\t\t= i18n::get('meta_copyright') != 'meta_copyright' ? i18n::get('meta_copyright') : 'Kohana Developer Team';\r\n\t\t\t\r\n\t\t\t// Site Title Default\r\n\t\t\t$titledefault = Model_Setting::instance()->load_by_parameter('title_default');\r\n\t\t\t$this->data['title_default']\t= Lib::_trim_strip($titledefault->value);\r\n\t\t\t\r\n\t\t\t// Set Site Copyright\r\n\t\t\t$copyright = Model_Setting::instance()->load_by_parameter('copyright');\r\n\t\t\t$this->data['copyright']\t= Lib::_trim_strip($copyright->value);\t\r\n\r\n\t\t\t// Set initialize site counter\r\n\t\t\t$this->setting\t\t= Model_Setting::instance();\r\n\t\t\t$this->setting->counter();\r\n\t\t\t\r\n\t\t\tif($this->auto_render) :\r\n\r\n\t\t\t\t// Initialize default / empty values\r\n\t\t\t\t$this->template->page_title = $page_title;\r\n\t\t\t\t$this->template->meta_keywords = $meta_keywords;\r\n\t\t\t\t$this->template->meta_description = $meta_description;\r\n\t\t\t\t$this->template->meta_copyright = $meta_copyright;\r\n\t\t\t\t$this->template->header = '';\r\n\t\t\t\t$this->template->content = '';\r\n\t\t\t\t$this->template->footer = '';\r\n\t\t\t\t$this->template->styles = array();\r\n\t\t\t\t$this->template->scripts = array();\r\n\t\t\t\t$this->template->notemplate = false;\r\n\t\t\t\t$this->template->data\t\t\t\t = $this->data;\r\n\r\n\t\t\tendif;\r\n\r\n\t\t}\r\n\r\n\t}",
"public function before()\n {\n parent::before();\n\n if ($this->auto_render) {\n // Initialize empty values\n $this->template->title = '';\n $this->template->content = '';\n\n $this->template->styles = array();\n $this->template->scripts = array();\n }\n\n $session = Session::instance();\n $user = Auth::instance()->get_user();\n $title = 'Kohana Calendar';\n $mode = $session->get('mode');\n\n View::bind_global('user', $user);\n View::bind_global('title', $title);\n View::bind_global('mode', $mode);\n\n $login = $session->get('login');\n if ($login !== null)\n {\n View::bind_global('login', $login);\n $session->delete('login');\n }\n }",
"protected function before()\n {\n parent::before();\n\n $this->user = Auth::getUser();\n }",
"protected function before()\n {\n parent::before();\n\n $this->user = Auth::getUser();\n }",
"protected function before()\n {\n parent::before();\n\n $this->user = Auth::getUser();\n }",
"public function before()\n\t{\n\t\t\n\t}",
"public function before()\n {\n parent::before();\n //View::set_global('page_title','Персональный мобильный портал');\n //View::set_global('description', 'Самый лучший сайт');\n $this->template->page_title='Мобильная фотогалерея';\n $this->session = Session::instance();\n $this->template->styles=array('bootstrap','contextMenu','styles','bootstrap-social','font-awesome');\n //$this->template->content = '';\n $this->template->scripts = array('bootstrap.min','contextMenu','main','load-image.all.min');\n }",
"protected function before() {\r\n parent::before();\r\n }",
"public function before(){\n\t\tif(empty($this->fields)){\n\t\t\t$this->fields = $this->fieldsDefault;\n\t\t}\n\t\t\n\t\tparent::before();\n\t}",
"public function before()\n {\n parent::before();\n // define application root diskpath and tpl native directory\n $this->appRoot = realpath(__DIR__ . '/../../../');\n $this->tplDir = realpath($this->appRoot . '/Apps/View/Front/default/');\n $this->viewUri = App::$Alias->currentViewUrl;\n if ($this->appRoot !== root) {\n $this->viewUri = '/vendor/phpffcms/ffcms-weather/src/Apps/View/Front/default';\n }\n // load internalization package for current lang\n $langFile = $this->appRoot . '/I18n/Front/' . App::$Request->getLanguage() . '/Weather.php';\n if (App::$Request->getLanguage() !== 'en' && File::exist($langFile)) {\n App::$Translate->append($langFile);\n }\n }",
"public function before()\n\t{\n\t\t// Run anything that need to run before this.\n\t\tparent::before();\n\t}",
"protected function before()\n {}",
"public function before()\n\t{\n\t\t// Nothing by default\n\t}",
"public function before()\n\t{\n\t\t// Nothing by default\n\t}",
"public function before()\n {\n parent::before();\n\n if ( ! empty($this->template))\n {\n $this->_initialize();\n }\n }",
"protected function before(){}",
"public function before()\n {\n parent::before();\n if($this->auto_render)\n {\n // Initialize empty values\n $this->template->title = '';\n $this->template->content = ''; \n $this->template->styles = array();\n $this->template->scripts = array();\n }\n }",
"public function before()\n {\n //\n }",
"public function before()\n {\n //\n }",
"function beforeFilter() {\n\t\t// Mocking components\n\t\t$this->RequestHandler = new MockRequestHandlerFlash(); // Switching flash on/off\n\t\t$this->Caracole = new MockCaracoleNoFlashFix();\t// Do not fix flash session\n\t\t$this->CaracoleAuth = new MockCaracoleAuthComponent();\t// Do not ask for auth\n\n\t\t// Can switch flash on/off\n\t\tif (!empty($this->data['isFlash'])) {\n\t\t\t$this->RequestHandler->setReturnValue('isFlash', $this->data['isFlash']);\n\t\t}\n\n\t\t// Define if a file is uploaded or not\n\t\tif (!empty($this->data['uploadFile'])) {\n\t\t\t$this->params['form'] = array(\n\t\t\t\t'actionUrl' => '/admin/test_pages/edit/1',\n\t\t\t\t'fieldName' => 'data[TestPage][document_file]',\n\t\t\t\t'Filedata' => array('name' => 'bar')\n\t\t\t);\n\t\t}\n\n\t\t// Define what the insert method should return\n\t\tif (!empty($this->data['insert'])) {\n\t\t\t$this->model->setReturnValue('insert', $this->data['insert']);\n\t\t}\n\t}",
"public function before()\n {\n\t\t$this->app = new Model_App;\n \t$this->session = Session::instance();\n\n \t$identifier = $this->session->get('identifier');\n \t$page_title = $this->app->get_page_title();\n\t\t$label = $this->app->get_initials();\n\n // Not logged in\n if ((is_null($identifier)) AND ($this->request->action() !== 'login'))\n \t$this->redirect();\n\t\t\n // Logged in\n\t\telse\n\t\t{\n\t\t\t$this->view = View::factory('templates/template');\n\t\t\t$this->view->page_title = $page_title;\n\t\t\t\n\t\t\t// Admin\n\t\t\tif ($identifier == 'admin')\n\t\t\t{\n\t\t\t\t$fname = $this->session->get('fname');\n\t\t\t\t$messages = $this->app->get_messages_count();\n\n\t\t\t\t$this->view->navbar = View::factory('templates/fragments/admin')\n\t\t\t\t\t->bind('label', $label)\n\t\t\t\t\t->bind('messages', $messages['messages'])\n\t\t\t\t\t->bind('fname', $fname);\n\t\t\t}\n\t\t\t// Faculty\n\t\t\telse\n\t\t\t{\n\t\t\t\t$fcode = $this->session->get('fcode');\n\n\t\t\t\t$this->view->navbar = View::factory('templates/fragments/'.$identifier)\n\t\t\t\t\t->bind('label', $label)\n\t\t\t\t\t->bind('fcode', $fcode);\n\t\t\t}\n\t\t}\t\t\n }",
"public function before()\n {\n }"
] | [
"0.7492461",
"0.7302395",
"0.7216688",
"0.718404",
"0.71787405",
"0.71787405",
"0.71787405",
"0.7166114",
"0.7147442",
"0.710996",
"0.7089626",
"0.7089626",
"0.7089626",
"0.70749176",
"0.7072837",
"0.705581",
"0.70331407",
"0.7004368",
"0.6980419",
"0.6978926",
"0.6942765",
"0.6942765",
"0.69331145",
"0.69153106",
"0.6846588",
"0.684568",
"0.684568",
"0.68428576",
"0.6819117",
"0.6795595"
] | 0.7405759 | 1 |
Check user auth and role. If user hasn't got the right access level, redirect the user to the login or "no access" page | private function check_login()
{
if ($this->auth_required == TRUE AND Auth::instance()->logged_in($this->auth_role) == FALSE)
{
if (Auth::instance()->logged_in())
{
$this->redirect('pages/noaccess');
}
else
{
$this->redirect('login');
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function check_admin_access()\n {\n return;\n $role = self::_get_role();\n if ('admin' !== $role) {\n PeepSo::redirect(get_home_url());\n }\n\n // if it's a \"peepso_\" user, redirect to the front page\n//\t\t$sRole = self::get_user_role();\n//\t\tif (substr($sRole, 0, 7) == 'peepso_') {\n//\t\t\tPeepSo::redirect(get_home_url());\n//\t\t\tdie;\n//\t\t}\n }",
"public function checkAuth( array $_role = [] ) \n {\n global $router;\n if ( isset($_SESSION['userId']) )\n {\n $role = $_SESSION['userObject']->getRole();\n\n if ( in_array($role, $_role)) \n {\n return true;\n }\n else {\n header(\"HTTP/1.0 403 Forbidden\" );\n // display 404 view\n // $this->show('error/err403');\n exit();\n }\n }\n else {\n redirectTo('admin-login');\n \n exit();\n } \n }",
"private function checkAccessPrivilege() {\n \tif (!SecurityContext::getCurrentUser()) // 未登录,不处理请求,交给ControllerBase处理\n\t\t\treturn;\n\t\t\n\t\t$auth = SecurityContext::getAuthorizationData();\n\t\t\n\t\t// if no match, is public\n\t\t$matched_roles = NULL;\n\t\t$request_uri = $this->router->getRewriteUri();\n\t\tforeach ($auth as $url => $roles) {\n\t\t\t$test_uri = $request_uri;\n\t\t\t$antPathMatcher = new AntPathMatcher();\n\t\t\tif (substr($url,0, 4)==='http' || substr($url,0, 4)==='HTTP')\n\t\t\t\t$test_uri = \"http://$_SERVER[HTTP_HOST]\" . $request_uri; //补全地址用来匹配\n\t\t\tif ($url && strlen($url)>0 && $antPathMatcher->match($url, $test_uri)) {\n\t\t\t\t$matched_roles = $roles;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (isset($matched_roles)) {\n\t\t\t// get roles of the login user\n\t\t\n\t\t\t$roles = SecurityContext::getCurrentRoles();\n\t\t\t// login timeout\n\t\t\tif (!isset($roles))\n\t\t\t\t$this->accessDenied(\"http://$_SERVER[HTTP_HOST]\" . $request_uri);\n\t\t\t\n\t\t\t$granted = false;\n\t\t\tforeach ($matched_roles as $needed_role) {\n\t\t\t\tforeach ($roles as $user_role) {\n\t\t\t\t\tif ($user_role === $needed_role['attribute']) {\n\t\t\t\t\t\t$granted = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($granted==true)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\n\t\t\tif ($granted==false)\n\t\t\t\t$this->accessDenied(\"http://$_SERVER[HTTP_HOST]\" . $request_uri);\n\t\t}\n }",
"private function checkRoleAndRedirect($role) {\n switch($role){\n case '1':\n $_SESSION['admin_loggedin'] = true;\n header('Location: admin.php');\n break;\n case '2':\n $_SESSION['event_manager_loggedin'] = true;\n header('Location: admin.php');\n break;\n case '3':\n // regular user\n $_SESSION['attendee_loggedin'] = true;\n header('Location: events.php');\n break;\n default:\n header('Location: login.php');\n break;\n }\n }",
"private function checkRole() {\r\n\t\t$sudjelovanje = new \\model\\DBSudjelovanje();\r\n\t\tif (\\model\\DBOsoba::isLoggedIn() && (session(\"vrsta\") === \"S\" || session(\"vrsta\") === \"SV\" \r\n\t\t\t\t|| session(\"vrsta\") === \"O\" || session(\"vrsta\") === \"OV\")\r\n\t\t\t\t&& $sudjelovanje->isActiveContestant(session(\"auth\")))\r\n\t\t\treturn;\r\n\r\n\t\tpreusmjeri(\\route\\Route::get('d1')->generate() . \"?msg=accessDenied\");\r\n }",
"function check_access($p_access_level)\n{\n global $g_logout_page;\n\n # Administrators ALWAYS pass.\n if (get_current_user_field(\"access_level\") >= ADMINISTRATOR) {\n return;\n }\n if (!access_level_check_greater_or_equal($p_access_level)) {\n # need to replace with access error page\n print_header_redirect($g_logout_page);\n exit;\n }\n}",
"private function check_auth() {\n\t\t// list of $controller => ($actions) that are strictly public\n\t\t// they will not be available to logged in users\n\t\t$public_strict = [\n\t\t\t'account' => ['signin'],\n\t\t];\n\t\t// list of $controller => ($actions) that do not require a login session\n\t\t// to target all actions use $controller => true\n\t\t// they will be available to all users regardless of login\n\t\t$public = array_merge_recursive([\n\t\t\t'error' => true,\n\t\t\t'test' => true,\n\t\t], $public_strict);\n\t\t// list of $controller => ($actions) for which the referer url is ignored\n\t\t// login process keeps track of where the user came from\n\t\t// upon successful login user is redirected back to the attempted location\n\t\t// sometimes this feature is not desired\n\t\t$ignore_continue_to = [\n\t\t\t'account' => ['signout'],\n\t\t];\n\t\tif (!$this->in_list($public) && !Account::authenticated()) {\n\t\t\tif (!$this->in_list($ignore_continue_to) && !$this->_is_ajax()) {\n\t\t\t\tFlash::i('login/continue')->set($_SERVER['REQUEST_URI']);\n\t\t\t}\n\t\t\t$this->_redirect('/account/signin');\n\t\t} else if ($this->in_list($public_strict) && Account::authenticated()) {\n\t\t\t$this->_redirect('/');\n\t\t}\n\t}",
"public function checkAdminAuthentication(){\n\t\t\n\t\t// if user is not logged in or is not an admin\n\t\tif (!Session::userIsLoggedIn() || Session::get(Session::SESSION_USER_ACCOUNT_TYPE) != UserRole::ADMIN) {\n\t\t\t// ... then treat user as \"not logged in\", destroy session, redirect to login page\n\t\t\tSession::destroy();\n\t\n\t\t\t$this->redirectHome();\n\t\n\t\t\t// to prevent fetching views via cURL (which \"ignores\" the header-redirect above) we leave the application\n\t\t\t// the hard way, via exit(). @see https://github.com/panique/php-login/issues/453\n\t\t\t// this is not optimal and will be fixed in future releases\n\t\t\texit();\n\t\t}\n\t}",
"private function accessAllowed() {\n\n\t\tif(!isset($_SESSION['loggedIn']) || !isset($_SESSION['role'])) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif($_SESSION['loggedIn'] != 1) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->isAuthorized($_SESSION['role']);\n }",
"protected function checkLogin() {\r\n if (!$this->user->isLoggedInAdmin()) {\r\n $this->response->setRedirect('admin/login');\r\n exit();\r\n }\r\n }",
"public function checkRole(){\n\n try{\n $user = Auth::user();\n\n if($user){\n\n if($user->hasRole('admin'))\n {\n return redirect('/admin');\n }\n else{\n Auth::logout(); // Considering no room for other users in cms , only allows admin\n return 'Has no admin privillege'; // Considering there can be only admin role\n }\n }\n }\n catch(\\Exception $ex){\n\n }\n }",
"private function checkLogin()\n {\n if (isset($_SESSION['userName'])) {\n\n } else {\n edirect(base_url() . \"index.php/User/index\");\n }\n }",
"public function isAuthorized(){\n\t\tif($this->user_id == 0) $this->redirect(\"/user/login\");\n\t}",
"function checkAuthority(){\r\n\t$permit=getPermit();\r\n\tif($permit==0 || $permit==1 || $permit==2){\r\n\t\t// redirect(\"logout.php\");\r\n\t}else{\r\n\t\tredirect(\"logout.php\");\r\n\t}\r\n}",
"public function loginCheck() {\n\t\tif(!$this->user) {\n\t\t\tdie(\"Members only. <a href='/users/login'>Login</a>\");\n\t\t}\n\n\t}",
"protected function checklog()\n {\n \tif( $this->session->userdata('ROLECODE') == null )\n \t\tredirect( base_url('login') );\n }",
"public function access() {\n $current_user = \\Drupal::entityTypeManager() -> getStorage('user') -> load(\\Drupal::currentUser() -> id());\n $roles = $current_user -> getRoles(); // TRUE, getting only unlocked roles (authenticated is a locked role)\n\n if ($current_user -> hasRole('administrator', $roles) || $current_user -> hasRole('school', $roles)) {\n return AccessResult::allowed();\n }\n else if ($current_user -> hasRole('authenticated', $roles)) {\n return AccessResult::allowed();\n }\n\n drupal_set_message(t('Please watch full video to access this quiz.'));\n return AccessResult::forbidden();\n }",
"public function requireAdmin(): void {\n\t\t$this->user = Auth::getUser();\n\n\t\tif(! $this->user || $this->user->role !== '1') {\n\t\t\tif(! $this->user) {\n\t\t\t\tFlash::addMessage(\"Please sign in.\", Flash::INFO);\n\t\t\t} else if($this->user->role !== '1') {\n\t\t\t\tFlash::addMessage(\"You don't have permission to do that.\", Flash::INFO);\n\t\t\t}\n\n\t\t\tAuth::rememberRequestedPage();\n\t\t\tUtilities::redirect('/login');\n\t\t}\n\t}",
"protected function login_required() \n {\n $user = UserModel::singleton();\n $class_view = get_final_class_name('View');\n $view = $class_view::singleton();\n if (!$user->is_logged()) {\n $view->set_msg(\"You must be logged in to access this section.\", false);\n UserController::loginAction();\n exit();\n }\n }",
"public function check_user()\n {\n if(isset($_SESSION['user']) && !empty($_SESSION['user']))\n {\n $this->redirectni(array('admin','checker','login'));\n }\n }",
"public function authenticate(){\n\t\tif(isset($_SESSION['userLevel']) && $_SESSION['userLevel']=='normal'){\n\t\t\t;\n\t\t}\n\t\telse{\n\t\t\theader('Location:index.php');\n\t\t}\n\n\t}",
"function my_login_redirect( $redirect_to, $request, $user ) { if ( isset( $user->roles ) && is_array( $user->roles ) ) {\n //check for admins\n if ( in_array( 'administrator', $user->roles ) ) {\n // redirect them to the default place\n return $redirect_to;\n } else {\n return home_url();\n }\n } else {\n return $redirect_to;\n }\n}",
"function check_user_access() {\n\tif ( property_exists($this, 'allowed_roles') ) $allowed_roles = $this->allowed_roles;\n\telse $allowed_roles = array('administrator');\n\tglobal $user_ID;\n\tif ( !empty($user_ID) ) {\n\t\t$user = new WP_User($user_ID);\n\t\tif (!is_array($user->roles)) $user->roles = array($user->roles);\n\t\t\tforeach ($user->roles as $role) {\n\t \t\t\tif (in_array($role, $allowed_rows)) {\n\t\t\t\treturn $role;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}",
"function my_login_redirect( $redirect_to, $request, $user ) {\n\t//is there a user to check?\n\tif ( isset( $user->roles ) && is_array( $user->roles ) ) {\n\t\t//check for admins\n\t\tif ( in_array( 'administrator', $user->roles ) ) {\n\t\t\t// redirect them to the default place\n\t\t\treturn $redirect_to;\n\t\t} else {\n\t\t\treturn home_url().'/my-listings/';\n\t\t}\n\t} else {\n\t\treturn $redirect_to;\n\t}\n}",
"private function checkPermissions()\n {\n $userId = $_GET['id'] ?? $_POST['id'];\n\n $permissions = ($this->auth->isLoggedIn()) &&\n ($this->auth->getUserId() == $userId || $this->auth->hasRole(\\Delight\\Auth\\Role::ADMIN));\n\n if (!$permissions) {\n $this->flash->warning(\"Access denied.\");\n header('Location: /');\n exit;\n }\n }",
"function checkRole($allowRoles, $redirect=true) {\n global $login;\n global $L;\n global $syslog;\n\n $userRole = $login->role();\n if (in_array($userRole, $allowRoles)) {\n return true;\n }\n\n if ($redirect) {\n // Add to syslog\n $syslog->add(array(\n 'dictionaryKey'=>'access-denied',\n 'notes'=>$login->username()\n ));\n\n Alert::set($L->g('You do not have sufficient permissions'));\n Redirect::page('dashboard');\n }\n return false;\n}",
"function sos_login_redirect( $redirect_to, $request, $user ) {\n //is there a user to check?\n if ( isset( $user->roles ) && is_array( $user->roles ) ) {\n //check for admins\n if ( in_array( 'administrator', $user->roles ) ) {\n // redirect them to the default place\n return admin_url();\n } else {\n return admin_url();\n }\n } else {\n return $redirect_to;\n }\n}",
"public function requireauthAction()\n {\n if( !$this->_helper->requireUser()->isValid() ) return;\n $this->getResponse()->setRawHeader($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden');\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('You are not authorized to access this resource.');\n }",
"function index(){\n $user_obj = $this->m_user->get_user($this->session->userdata('user_name'));\n\n if($this->session->userdata('LOGGED_IN') && $user_obj['user_role'] == \"A\"){\n $this->user_management_list_load();\n }\n else{\n echo \"<script type='text/javascript'>window.location='\".base_url().\"c_user_auth/index'</script>\";\n }\n }",
"function checkPermission($area) {\n//check for admin status\nif ($area == 'admin') {\t\n\t//check to see if they have logged in and if they are able to access this area\n\tif (isset($_SESSION['user_level'])){\n\t\tif ($_SESSION['user_level'] != '1') {\n\t\t// Redirect the user\n\t\tredirect_user();\n\t\t}\n\t} else {\n\t\t// Redirect the user\n\t\tredirect_user();\n\t}\n//or check for logged in session variable\n} else {\n\tif (!isset($_SESSION['first_name'])) {\n\t// Redirect the user\n\tredirect_user();\n\t}\n}\n}"
] | [
"0.7455143",
"0.72085553",
"0.7177054",
"0.7036959",
"0.70220697",
"0.69578564",
"0.6907727",
"0.68566674",
"0.68415505",
"0.6818871",
"0.68055755",
"0.67741877",
"0.6771549",
"0.6753317",
"0.67444074",
"0.66624963",
"0.66587996",
"0.6657975",
"0.6654314",
"0.66377586",
"0.6632357",
"0.662951",
"0.66140765",
"0.65945905",
"0.6588735",
"0.65808016",
"0.6537715",
"0.6533234",
"0.65272677",
"0.6524421"
] | 0.7660124 | 0 |
Get user role. Make sure the role of the session is used, instead of the one set by the controller. In example: with this set, the user with role "admin" can go to (controller => pages, action => home) and all views have the variable $current_role set to "admin". | public function get_role()
{
if (Auth::instance()->logged_in() AND $this->current_role == '')
{
$this->current_role = Auth::instance()->get_user()->roles->where('name', '!=', 'login')->find()->name;
View::bind_global('current_role', $this->current_role);
}
return $this->current_role;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static function _get_role()\n {\n static $role = NULL;\n if (NULL !== $role)\n return ($role);\n\n if (!is_user_logged_in())\n return ($role = FALSE);\n\n $user = PeepSoUser::get_instance(get_current_user_id());\n return ($role = $user->get_user_role());\n }",
"public function getCurrentRole()\n {\n if ($this->_currentRole !== null) {\n return $this->_currentRole;\n }\n\n // Try to use Zend_Auth\n $roleField = $this->getAuthRoleField();\n\n if (!empty($roleField)) {\n // Use Zend_Auth\n $auth = Zend_Auth::getInstance();\n if ($auth->hasIdentity()) {\n $role = $auth->getIdentity()->$roleField;\n }\n }\n\n if (!isset($role) || empty($role)) {\n // Use default\n $role = $this->getDefaultRole();\n }\n\n $this->_currentRole = $role;\n return $role;\n }",
"private function getSessionRole() {\n\t\tif(!isset($_SESSION['loggedIn']) || !isset($_SESSION['role'])) {\n\t\t\treturn VISITOR;\n\t\t}\n\n\t\tif($_SESSION['loggedIn'] != 1) {\n\t\t\treturn VISITOR;\n\t\t}\n\n\t\treturn $_SESSION['role'];\n\t}",
"public function getUserRole() {\n\t\treturn $this->getSessionuserRole();\n\t}",
"public static function get_user_role()\n {\n // http://wordpress.org/support/topic/how-to-get-the-current-logged-in-users-role\n $role = NULL;\n if (function_exists('is_user_logged_in') && is_user_logged_in()) {\n $role = self::_get_role();\n//\t\t\tglobal $current_user;\n//\n//\t\t\t$aRoles = array_values($current_user->roles);\n//\t\t\tif (count($aRoles) > 0)\n//\t\t\t\t$sRet = $aRoles[0];\n }\n return ($role);\n }",
"public function getUserRole()\n {\n return $this->request->getAttribute('user_role');\n }",
"function current_role()\n\t{\n\t\t$CI =& get_instance();\n\t\treturn $CI->session->userdata('role');\n\t}",
"private function getLoggedUserRole() {\r\n // Current user data\r\n $current_user = wp_get_current_user();\r\n // Check\r\n if ( is_array($current_user->roles) && !empty($current_user->roles) ) {\r\n return $current_user->roles;\r\n } else {\r\n return false;\r\n }\r\n }",
"public function getUserRole()\n {\n return $this->userRole;\n }",
"public function getUserRole()\n {\n return $this->_userRole;\n }",
"public function getRole()\n {\n\t\tif (null === $this->_role) {\n\t\t\t$auth = Zend_Auth::getInstance();\n if ($auth->hasIdentity()) {\n\t\t\t\t$this->setRole($auth->getIdentity()); // TODO: Probably should do a little more error checking here\n } else {\n \t$this->setRole(self::getDefaultRole());\n }\n }\n\n return $this->_role;\n }",
"public function get_role(){\n $current_session = $this->setting_model->getCurrentSession();\n $userdata = $this->session->userdata();\n if(array_key_exists('student', $userdata)){\n $role = \"student\";\n }else{\n $role = \"admin\";\n }\n return $role;\n \n }",
"function get_current_user_role() {\n\tglobal $wp_roles;\n\t$current_user = wp_get_current_user();\n\t$roles = $current_user->roles;\n\t$role = array_shift($roles);\n\treturn isset($wp_roles->role_names[$role]) ? translate_user_role($wp_roles->role_names[$role] ) : false;\n}",
"function user_role()\n\t{\n\t\t$CI =& get_instance();\n\t\treturn $CI->session->userdata('user_role');\n\t}",
"public function role() {\n\t\ttry {\n\t\t\t\n\t\t\t$stmt = $this->_db->prepare('SELECT role FROM user WHERE username = :username');\n\t\t\t$stmt->execute(array('username' => $_SESSION['userName']));\n\t\t\t\t\t\n\t\t\t$row = $stmt->fetch();\n\n\t\t\treturn $row['role'];\n\t\t\t\n\t\t} catch(PDOException $e) {\n\t\t\techo '<p class=\"error\">'.$e->getMessage().'</p>';\n\t\t}\n\t}",
"public function role()\n\t{\n\t\t$id = $this->ci->session->userdata('id');\n\t\t$role = $this->ci->Pemilwa_model->get_akun($id, 'admin')->role;\n\t\treturn $role;\n\t}",
"function leadin_get_user_role ()\n{\n global $current_user;\n\n $user_roles = $current_user->roles;\n $user_role = array_shift($user_roles);\n\n return $user_role;\n}",
"function get_current_user_role() {\r\n\tglobal $wp_roles;\r\n\t$current_user = wp_get_current_user();\r\n\t$roles = $current_user->roles;\r\n\t$role = array_shift($roles);\r\n\treturn isset($wp_roles->role_names[$role]) ? translate_user_role($wp_roles->role_names[$role] ) : false;\r\n}",
"public function getRole()\n {\n return $this->role;\n }",
"public function getRole()\n {\n return $this->role;\n }",
"public function getRole()\n {\n return $this->role;\n }",
"public function getRole()\n {\n return $this->role;\n }",
"public function getRole()\n {\n return $this->role;\n }",
"public function getRole()\n {\n return $this->role;\n }",
"public function getRole()\n {\n return $this->role;\n }",
"public function getRole()\n {\n return $this->role;\n }",
"public function getRole()\n {\n return $this->role;\n }",
"public function getRole()\n {\n return $this->role;\n }",
"public function getRole()\n {\n return $this->role;\n }",
"public function getRole()\n {\n return $this->role;\n }"
] | [
"0.78971434",
"0.777085",
"0.76478827",
"0.73942477",
"0.7368967",
"0.7263582",
"0.7262653",
"0.72279435",
"0.7190788",
"0.7169185",
"0.712324",
"0.70705175",
"0.7066969",
"0.70667386",
"0.7053236",
"0.7012986",
"0.69549346",
"0.69100636",
"0.6891214",
"0.6891214",
"0.6891214",
"0.6891214",
"0.6891214",
"0.6891214",
"0.6891214",
"0.6891214",
"0.6891214",
"0.6891214",
"0.6891214",
"0.6891214"
] | 0.8100237 | 0 |
Get an object by id and type | public function get_object($id, $type)
{
$object = ORM::factory($type)->where('id', '=',(int)$id)->find();
if ( ! $object->loaded() )
{
$this->redirect('pages/404'); //throw new Kohana_Exception('Record not found');
}
return $object;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get($type, $id)\n {\n if ($object = $this->identifier->get($id)) {\n return $object;\n }\n\n $query = \"\n SELECT\n *\n FROM\n objects\n WHERE\n type = :type AND\n id = :id\n \";\n\n $statement = $this->conn->prepare($query);\n $statement->bindParam(':type', $type);\n $statement->bindParam(':id', $id);\n $statement->execute();\n\n $obj = $statement->fetch(PDO::FETCH_ASSOC);\n\n if ($obj === null) {\n return null;\n }\n\n $entity = new $type(json_decode($obj['data'], true));\n\n $this->identifier->set($id, $entity);\n\n return $entity;\n }",
"public function getObject($type);",
"final function fetchObject($id,&$type)\r\n {\r\n $object = $this->getObject($id, $type);\r\n if ($object === false) {\r\n $name = substr($id, 0, 2).\"/\".substr($id, 2);\r\n try {\r\n $this->getRemoteFile(\"objects/$name\");\r\n } catch (Exception $e) { \r\n $pack = $this->getRemoteFile(\"objects/info/packs\");\r\n $pack = $this->simpleParsing($pack);\r\n /* getting pack */\r\n $pack = \"objects/pack/\".$pack['P'];\r\n $this->getRemoteFile($pack);\r\n $this->getRemoteFile(substr($pack, 0, strlen($pack)-4).\"idx\");\r\n }\r\n $object = $this->getObject($id, $type);\r\n }\r\n if ($object === false) {\r\n $this->throwException(\"Error, object not found\");\r\n }\r\n \r\n return $object;\r\n }",
"public function getObject($id);",
"public function getObject($id);",
"public static function getTrackedObject($type, $id)\r\n {\r\n $tracker = Bebop\\Helpers\\ObjectTracker::getInstance();\r\n\r\n return $tracker->get($type, $id);\r\n }",
"public static function getObject($id)\r\n {\r\n }",
"public function read($type = null, $id = null) {\n\t\tif ($id == null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ($type == null) {\n\t\t\treturn $this->getEntity($this->invokeGet(\"_id/\".urlencode($id)), false);\n\t\t} else {\n\t\t\treturn $this->getEntity($this->invokeGet(urlencode($type).\"/\".urlencode($id)), false);\n\t\t}\n\t}",
"public function getbyId($id);",
"public function getOne($id);",
"public function getObjectFromID($id) {\n\t\treturn get_entity($id);\n\t}",
"function getById($id);",
"function getById($id);",
"public function getObject($type, $objectId);",
"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);",
"abstract public function get($id);",
"public function getById(String $id);",
"public function getBy($id);",
"public static function getObject($id)\n\t{\n\t\treturn self::search($id, true);\n\t}"
] | [
"0.800123",
"0.77840894",
"0.7649057",
"0.76383364",
"0.76383364",
"0.7433043",
"0.7332345",
"0.73160046",
"0.7310882",
"0.7284882",
"0.72735286",
"0.7224601",
"0.7224601",
"0.7221065",
"0.7173908",
"0.7173908",
"0.7173908",
"0.7173908",
"0.7173908",
"0.7173908",
"0.7173908",
"0.7173908",
"0.7173908",
"0.7173908",
"0.7173908",
"0.7173908",
"0.7129849",
"0.7124583",
"0.71167326",
"0.71131694"
] | 0.81630665 | 0 |
Get current logged in user, or redirect to the login page | public function current_user()
{
$user = Auth::instance()->get_user();
if ( ! $user )
{
Message::add('error', __('Please login to do that'));
$this->redirect('login');
}
return $user;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getCurrentUser() {\n if (SessionHelper::isLoggedIn()) {\n $current_uid = $_SESSION[\"user_id\"];\n return User::get_user($current_uid);\n } else {\n header(\"Location: ../View/login_formular.php?fehler=1\");\n }\n }",
"protected function current_user() {\r\n if ($this->logged_in()) {\r\n\t\t\treturn ClassRegistry::init('User')->findById($this->Auth->user('id'));\r\n }\r\n }",
"public function getLoggedUser();",
"public function getCurrentUser();",
"public function getTheLoggedInUser(){\n\n $user_id = null;\n\n $User = Auth::User();\n\n if($User != null) {\n $user = $User;\n }\n\n return $user;\n }",
"private function getLoggedInUser() {\n \tif($this->_auth->hasIdentity()) {\n\t\t\t$this->usersMapper = new Application_Model_Mapper_Users_UsersMapper;\n\t\t\t// get user info\n\t\t\t\t$this->user = $this->usersMapper->findByUsername($this->loggedInUser->username);\n\t\t}\n\t\telse throw new Exception ('No user is logged in');\n }",
"public static function checkLogged(){\n if(isset($_SESSION['user'])){\n return $_SESSION['user'];\n }\n header(\"Location: /user/login\");\n exit();\n }",
"abstract function getAuthenticatedUser();",
"public function current_user()\n\t{\n\t\treturn $this->get_user($this->ci->session->userdata('user_id'));\n\t}",
"public function getLoggedInUser() {\n $currentUser = $this->apiGet($this->endpoints[\"users\"] . \"current\");\n return $currentUser;\n }",
"private function getCurrentUser()\n {\n return $this->_authSession->getUser();\n }",
"function getCurrentUser();",
"function get_current_user () {}",
"public static function getLoggedInUser() {\n return SessionUtil::isLoggedIn() ?\n UserDao::getUserById($_SESSION[SessionUtil::USER_KEY]) : null;\n }",
"private function get_user() {\n // Check if session variable set\n if (session()->get('logged_in') != true) {\n return 0;\n } else {\n // Return user\n return User::where('id', Session::get('user_id'))->first();\n }\n }",
"function getUser( )\r\n {\r\n if (!isAuthenticated()) {\r\n \r\n return '';\r\n }\r\n\r\n return User::findorFail(Session::getValueFor('SESSION_USER_ID'));\r\n }",
"public function getLoggedUser(){\n if(!$this->isLogged()){\n return null;\n }\n return $_SESSION[LOGGED_USER];\n }",
"public function getLoggedInUser()\n\t{\n\t\tif( isset($_SESSION['user_openid_url'])){\n\t\t\treturn $_SESSION['user_openid_url'];\n\t\t}\n\t\treturn false;\n\t}",
"public function getCurrentUser()\n {\n if ($this->isLoggedIn()) {\n return $this->app['security.token_storage']->getToken()->getUser();\n }\n return null;\n }",
"public function getCurrentUser()\n {\n return $this->security->getUser();\n }",
"public function getCurrentUser(){\n return $this->session->user;\n }",
"static function sessionLogged() {\r\n\t\t\t$user = presentationLayer::getUser();\r\n\t\t\tif ($user == \"\") {\r\n\t\t\t\tutilities::redirect(PATH.\"index.php\");\t\r\n\t\t\t}\r\n\t\t\treturn ($user);\r\n\t\t}",
"static function getLoggedInUser() {\n global $logged_in_user;\n if (isset($logged_in_user)) {\n return $logged_in_user;\n }\n $user_guid = loggedIn();\n if ($user_guid) {\n $logged_in_user = getEntity($user_guid, true);\n return $logged_in_user;\n }\n return false;\n }",
"public function getCurrentUser()\r\n {\r\n $user = $this->loadUser(Yii::app()->user->id);\r\n return $user;\r\n }",
"public function getCurrentUser() {\n\t\ttry {\n\t\t\tif(!Yii::app()->user->isGuest) {\n\t\t\t\treturn User::model()->findByPk(Yii::app()->user->id);\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {\n\t\t\treturn null;\n\t\t}\n\t}",
"function GetCurrentUser() {\r\n\t\t//echo $this->usersessionmanager->getVar(\"CurrentUser\");\r\n\r\n\t\treturn $this->GetUser($this->usersessionmanager->getVar(\"CurrentUser\"));\t\r\n\t\t\r\n\t}",
"function el_loggedin_user() {\n\t\tif(el_isLoggedin()) {\n\t\t\t\treturn forceObject($_SESSION['EL_USER']);\n\t\t}\n\t\treturn false;\n}",
"public static function getLoggedUser(){\n self::session_start();\n if(!isset($_SESSION['user'])) return false;\n return $_SESSION['user'];\n }",
"function login_user() {\n\t\tif ( is_user_logged_in() ) {\n\t\t\t// Forward them off to their profile\n\t\t\theader( 'Location: ' . $this->profile_slug );\n\t\t}\n\t\tif ( $_POST && isset( $_POST['your_custom_login'] ) && wp_verify_nonce( $_POST['your_custom_login'], 'your_custom_login' ) ) {\n\t\t\tif ( ! empty( $_POST['log'] ) && ! empty( $_POST['pwd'] ) ) {\n\t\t\t\t// Sign in the user\n\t\t\t\t$user = wp_signon();\n\t\t\t\tif ( ! is_wp_error( $user ) ) {\n\t\t\t\t\t// Forward them off to their profile\n\t\t\t\t\theader( 'Location: ' . $this->profile_slug );\n\t\t\t\t}\n\t\t\t\treturn $user;\n\t\t\t}\n\t\t}\n\t}",
"protected function getCurrentUser() {\r\n if ($this->currentUser === NULL) {\r\n $userId = isset($_SESSION[SESSION_USER_ID]) ? $_SESSION[SESSION_USER_ID] : NULL;\r\n $this->currentUser = $this->getDao(DAO_USER)->getUserById($userId);\r\n }\r\n return $this->currentUser;\r\n }"
] | [
"0.7839268",
"0.76192033",
"0.75657594",
"0.74184775",
"0.7374828",
"0.7303596",
"0.7292016",
"0.7261566",
"0.7243549",
"0.7228142",
"0.72088814",
"0.72043735",
"0.71855116",
"0.7164072",
"0.71619695",
"0.7147974",
"0.7126278",
"0.7091335",
"0.708868",
"0.7058386",
"0.7056398",
"0.70411706",
"0.70279235",
"0.7020517",
"0.70200217",
"0.70137304",
"0.70036334",
"0.70030564",
"0.699586",
"0.69741625"
] | 0.7797725 | 1 |
Set the template automatically. Setting $this>template>content = View::factory('/'); for every action in every controller feels like recursion and is not necessary. Now the template is automatically set to: $this>template>content = View::factory('(/)/'); You can override this in the controller actions before binding/setting variables to $this>template>content | private function set_default_template()
{
$excluded_pages = array('delete', 'update', 'destroy', 'noaccess', 'logout','language');
if ( ! in_array( Request::current()->action(), $excluded_pages ) )
{
if (Request::current()->directory() )
{
return View::factory(Request::current()->directory().'/'.Request::current()->controller().'/'.Request::current()->action());
}
elseif (in_array(Request::current()->controller(), array('Pages','Account')) )
{
return View::factory(Request::current()->controller().'/'.Request::current()->action());
}
}
// else
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function template(){\n\n\t\tinclude \"views/template.php\";\n\t}",
"protected function _content_template() {\n\t}",
"protected function _content_template() {\n\t}",
"protected function content_template() {}",
"public function setTemplate()\n {\n $eApplication = Factory::getApplication();\n $Template = Factory::getTemplate();\n $ContentType = $eApplication->get('ContentType');\n $XHRequest = $eApplication->get('XHRequest');\n\n if ($ContentType == 'text/html' && !$XHRequest) {\n foreach ($Template->getPositions() as $p) {\n $this->setPosition($p);\n }\n\n foreach ($Template->getJavaScripts() as $v) {\n $this->setJavaScript($v);\n }\n\n foreach ($Template->getStyleSheets() as $v) {\n $this->setStyleSheet($v);\n }\n } else {\n $this->setPosition('XHRequest');\n }\n }",
"protected function _content_template()\n {\n\n }",
"protected function setTemplate()\n {\n $this->template = 'user/day.tpl';\n }",
"protected function _content_template()\n { }",
"public function template(){\n\n\t\tinclude_once \"views/template.php\";\n\n\t}",
"public function content_template()\n {\n }",
"public function view()\n {\n /* put stuff in main content section of the template*/\n \n\n }",
"public function init()\n\t{\n\t\t$this->view = new View();\n\t $this->request = \\Symfony\\Component\\HttpFoundation\\Request::createFromGlobals();\n\t\t$this->view->settings->action = $this->action;\n\t\t$this->view->settings->controller = strtolower(str_replace('Controller', '', get_class($this)));\n\t}",
"public function before()\n {\n parent::before();\n\n if ($this->auto_render === TRUE)\n {\n // Load the template\n $this->template = View::factory($this->template);\n }\n }",
"public function initializeTemplate()\n\t{\n\t\t$this->template = $this->app->getServices('template');\n\t}",
"protected\n\tfunction _content_template() {\n\n\t}",
"function set_template($template_view){\n\t\t$this->set_mode(self::OUTPUT_MODE_TEMPLATE);\n\t\t$template_view = str_replace(\".php\", \"\", $template_view);\n\t\t$this->_template = self::TEMPLATE_ROOT . $template_view;\n\t}",
"public function setTemplate($template)\r\n {\r\n $template = explode('controller', $template);\r\n $template = implode('', $template);\r\n $template = $template . '.phtml';\r\n\r\n try{\r\n ob_start();\r\n require $template;\r\n ob_end_clean();\r\n }catch(Exception $e){\r\n throw new ViewException('The specified view template: ' . $template . ' does not exist.'); \r\n }\r\n \r\n \r\n $this->_template = $template;\r\n }",
"public function content()\n\t{\n\t\t\n\t\t$currentClass = get_class($this);\n\n\t\t$currentClass = str_replace(\"App\\\\Controllers\\\\\", \"\", $currentClass);\n\t\t$currentClass = strtolower(str_replace(\"Controller\", \"\", $currentClass));\n\t\trequire_once \"../App/Views/$currentClass/{$this->view->page}.php\";\n\t\t// require_once \"../bludv/App/Views/$currentClass/{$this->view->page}.php\";\n\t}",
"public function Template()\n\t{\n\t\t#Atravez del metodo 'Include' icluimos Template \n\t\trequire_once \"views/template.php\";\n\t}",
"public function setTemplate($action, $controller = null)\n\t{\n\t\t$req = $this->_request;\n\t\tif ($controller == null) {\n\t\t\t$controller = $req->getController();\n\t\t\tif ($req->getControllerSubDirectory()) {\n\t\t\t\t$controller = $req->getControllerSubDirectory() . '/' . $controller;\n\t\t\t}\n\t\t}\n\t\t$ext = NameManager::getTemplateExtension();\n\t\t$action = preg_replace('/\\.' . $ext . '$/', '', $action);\n\t\t$this->_template = sprintf('%s/%s', $controller, $action);\n\t}",
"public function index() {\n\n $this->addView($this->action,null);\n\n $this->loadTemplate(parent::getTemplateData(),$this->action);\n\n }",
"public function views_template_controller(){\n\n return require_once \"./views/template.php\";\n \n }",
"public function initContent()\n {\n FrontController::initContent();\n\n /* Handle brute force attacks */\n if (count($this->errors)) {\n sleep(1);\n }\n\n if (count($this->order_collection) > 0) {\n $this->setTemplate('customer/guest-tracking.tpl');\n } else {\n $this->setTemplate('customer/guest-login.tpl');\n }\n }",
"public function setView()\r\n {\r\n $this->view->header = $this->getHeader();\r\n $this->view->subHeader = $this->getSubHeader();\r\n $this->view->content = $this->getContent();\r\n if (empty($this->view->hrClasses)) {\r\n $this->view->hrClasses = $this->getHRClasses();\r\n }\r\n }",
"private function dispatch()\r\n {\r\n\r\n //Set the default page title if no title is defined in the data\r\n $this->title = SITE_NAME;\r\n\r\n //Set the default page meta description if no meta description is defined in the data\r\n $this->meta_description = SITE_DESCRIPTION;\r\n\r\n //Set default page keywords is no meta keywords are defined in the data\r\n $this->meta_keywords = SITE_KEYWORDS;\r\n\r\n\r\n\r\n $data = facile_get_file($this->route().EXT);\r\n\r\n //check to see if the page uses special template\r\n\r\n $user_page_template = isset($data['template']) ? $data['template'] : null;\r\n\r\n\r\n //Send each variable in the page to the template\r\n foreach($data as $data_key=>$data_value)\r\n {\r\n $this->$data_key=$data_value;\r\n }\r\n\r\n //Generate the view\r\n\r\n return $this->make($user_page_template);\r\n\r\n }",
"public function comment_template_manager()\n {\n $data['body'] = 'comment_automation/auto_comment_reply_template';\n $data['page_title'] = $this->lang->line('Auto Comment Template Manager');\n \n $this->_viewcontroller($data);\n }",
"public function before()\n\t{\n\t\tif ($this->auto_render === TRUE)\n\t\t{\n\t\t\t// Load the template\n\t\t\t$this->template = \\Mooo\\System\\Core\\View::Factory($this->template);\n\t\t}\n\n\t\treturn parent::before();\n\t}",
"function initTemplate()\r\n\t{\r\n\t\tob_start();\r\n\t\tinclude('templates/' . $this->mc->config['template'] . '/main.html');\r\n\t\t$this->template = ob_get_contents();\r\n\t\tob_clean();\r\n\t}",
"public function __construct()\n {\n $this->setTemplate('index');\n }",
"public function before($template = NULL)\n {\n parent::before();\n\n if($this->auto_render===TRUE)\n {\n \t// Load the template\n if ($template!==NULL)\n $this->template= $template; \n \t$this->template = View::factory($this->template);\n \t\n // Initialize template values\n $this->template->title = 'Geo - An Open Source World Locations DataBase and API';\n $this->template->meta_keywords = '';\n $this->template->meta_description = '';\n $this->template->meta_copyright = 'OpenClassifieds LTD';\n $this->template->meta_copywrite = $this->template->meta_copyright;//legacy for old themes\n $this->template->content = '';\n\n $this->template->header = View::factory('header');\n $this->template->footer = View::factory('footer');\n\n\n }\n }"
] | [
"0.65781856",
"0.65719265",
"0.65719265",
"0.6557813",
"0.6555573",
"0.6493736",
"0.6477211",
"0.6476317",
"0.64012384",
"0.63965875",
"0.62830645",
"0.6223564",
"0.62184817",
"0.6185848",
"0.6184393",
"0.6177558",
"0.6157604",
"0.6137592",
"0.61266905",
"0.6114477",
"0.60922086",
"0.6073499",
"0.6071709",
"0.60598254",
"0.6058403",
"0.60455096",
"0.60275656",
"0.601621",
"0.6002196",
"0.59877354"
] | 0.6692758 | 0 |
Set the links for the mainmenu. Depending on the role, set the (titles => links) in the mainmenu For submenu's, start the key with "sub" and an array as value. i.e.: / 'Home' => '/', 'sub' => array( array('link' => 'Title1', 'url' => '/example1', 'img' => 'example1.png'), array('link' => 'Title2', 'url' => '/example2', 'img' => 'example2.png'), ), | private function set_links()
{
switch ($this->get_role()) {
case 'user':
$links = array(
__('Home') => '/',
__('About') => 'pages/about',
//__('FAQ') => 'pages/faq',
__('Documentation') => 'pages/docs',
__('Dashboard') => 'user',
);
break;
case 'admin':
$links = array(
__('Home') => '/',
__('About') => 'pages/about',
//__('FAQ') => 'pages/faq',
__('Documentation') => 'pages/docs',
__('Dashboard') => array(
'url' => 'admin',
'controllers' => array('Admin')
),
__('Users') => array(
'parent' => array(
'url' => 'admin/users',
'controllers' => array('Users','Roles')
),
'sub' => array(
array('link' => 'Show users', 'url' => 'admin/users/role/2', 'img' => 'user.png'),
array('link' => 'Show admins', 'url' => 'admin/users/role/3', 'img' => 'user_red.png'),
)
),
__('Profiles') => array(
'url' => 'admin/profiles',
'controllers' => array('Profiles')
),
);
break;
default:
$links = array(
__('Home') => '/',
__('About') => 'pages/about',
//__('FAQ') => 'pages/faq',
__('Documentation') => 'pages/docs',
);
}
return $links;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setupMenus() {\n foreach ($this->menus as $menu) {\n $menu['link'] = st($menu['title']);\n menu_save($menu);\n }\n // Create the main menu links.\n $this->buildMenu($this->menu_items);\n menu_rebuild();\n }",
"function SetupMenu() {\n\t\tif ( !empty($this->menu) ) return;\n\n\t\t/*$this->menu = array(\n\t\t\t'url' => array(\n\t\t\t\t0 => array(\n\t\t\t\t\t'id' => 0, // >39 = right-hand side\n\t\t\t\t\t'title' => 'Title',\n\t\t\t\t\t'url' => 'http://.../',\n\t\t\t\t),\n\t\t\t\t//1 => array(...) - submenu\n\t\t\t),\n\t\t\t'eh' => array(\n\t\t\t\t0 => array(\n\t\t\t\t\t'id' => 40, // >39 = right-hand side\n\t\t\t\t\t'title' => 'Title',\n\t\t\t\t\t'url' => 'http://.../',\n\t\t\t\t),\n\t\t\t\t//1 => array(...) - submenu\n\t\t\t),\n\t\t);*/\n\n\t\tglobal $wpdb;\n\n\t\t$this->menu['switch'] = array(0 => array(\n\t\t\t'id' => 0,\n\t\t\t'title' => 'Switch Theme Preview',\n\t\t\t'url' => '#'\n\t\t));\n\t\tforeach(get_blog_list() as $blog) {\n\t\t\t$this->menu['switch'][] = array(\n\t\t\t\t'id' => $blog['blog_id'],\n\t\t\t\t'title' => get_blog_option( $blog['blog_id'], \"blogname\"),\n\t\t\t\t'url' => 'http://' . $blog['domain'] . $blog['path']\n\t\t\t);\n\t\t}\n\t}",
"public function set_demo_menus(){\n\n\t\t\t// Menus to Import and assign - you can remove or add as many as you want\n\t\t\t$top_menu = get_term_by('name', 'Top Menu', 'nav_menu');\n\t\t\t$main_menu = get_term_by('name', 'Main Menu', 'nav_menu');\n\n\t\t\tset_theme_mod( 'nav_menu_locations', array(\n\t\t\t\t\t'top-bar-menu' => $top_menu->term_id,\n\t\t\t\t\t'main-menu' => $main_menu->term_id,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Set options for front page and blog page\n\t\t\t$front_page_id = get_page_by_title( 'Front Page' )->ID;\n\t\t\t$blog_page_id = get_page_by_title( 'Blog' )->ID;\n\n\t\t\tupdate_option( 'page_on_front', $front_page_id );\n\t\t\tupdate_option( 'page_for_posts', $blog_page_id );\n\t\t}",
"public static function setMainMenuTitles () {\n foreach (self::$menu['main'] as &$val) {\n $val['title'] = lang::translate($val['title']);\n if (!empty($val['title_human'])) { \n $val['title'] = $val['title_human'];\n }\n }\n \n if (session::isAdmin()) {\n foreach (self::$menu['admin'] as &$val) {\n $val['title'] = lang::translate($val['title']);\n } \n }\n }",
"public function getMenus() {\n $menu = [\n \"admin\" => [\n \"body_class\" => \"admin-menu\",\n \"acl\" => \"menuAdmin\",\n \"links\" => [\n \"home\" => [\n \"faicon\" => \"home\",\n \"href\" => \"\",\n ],\n \"logout\" => [\n \"faicon\" => \"sign-out\",\n \"href\" => \"user/logout\",\n \"return\" => true,\n ],\n \"settings\" => [\n \"faicon\" => \"cog\",\n \"href\" => \"user/settings\",\n ],\n \"user\" => [\n \"title\" => t(\"Users\"),\n \"href\" => \"user/list\",\n \"links\" => [\n \"user-add\" => [\n \"title\" => t(\"Add user\"),\n \"href\" => \"user/add\",\n ],\n ],\n ],\n \"content\" => [\n \"title\" => t(\"Content\"),\n \"href\" => \"content/list\",\n \"links\" => [\n \"content-add\" => [\n \"title\" => t(\"Add content\"),\n \"href\" => \"content/add\",\n ],\n ],\n ],\n \"system\" => [\n \"title\" => t(\"System\"),\n \"links\" => [\n \"alias\" => [\n \"title\" => t(\"Aliases\"),\n \"href\" => \"alias/list\",\n \"links\" => [\n \"alias-add\" => [\n \"title\" => t(\"Add alias\"),\n \"href\" => \"alias/add\",\n ],\n ],\n ],\n \"redirect\" => [\n \"title\" => t(\"Redirects\"),\n \"href\" => \"redirect/list\",\n \"links\" => [\n \"redirect-add\" => [\n \"title\" => t(\"Add redirect\"),\n \"href\" => \"redirect/add\",\n ],\n ],\n ],\n \"l10n\" => [\n \"title\" => t(\"Localization\"),\n \"href\" => \"l10n/list\",\n \"links\" => [\n \"scan\" => [\n \"title\" => t(\"Scan code\"),\n \"href\" => \"l10n/scan\",\n ],\n \"export\" => [\n \"title\" => t(\"Export\"),\n \"href\" => \"l10n/export\",\n ],\n \"import\" => [\n \"title\" => t(\"Import\"),\n \"href\" => \"l10n/import\",\n ],\n ],\n ],\n \"logs\" => [\n \"title\" => t(\"Logs\"),\n \"href\" => \"log/list\",\n ],\n \"cache\" => [\n \"title\" => t(\"Cache\"),\n \"href\" => \"cache/list\",\n \"links\" => [\n \"clear\" => [\n \"title\" => t(\"Clear all\"),\n \"href\" => \"cache/clear\",\n \"return\" => true,\n ],\n \"clear-data\" => [\n \"title\" => t(\"Clear data\"),\n \"href\" => \"cache/clear/data\",\n \"return\" => true,\n ],\n \"clear-images\" => [\n \"title\" => t(\"Clear images\"),\n \"href\" => \"cache/clear/images\",\n \"return\" => true,\n ],\n ],\n ],\n \"cron-run\" => [\n \"title\" => t(\"Run cron\"),\n \"href\" => \"cron\",\n \"return\" => true,\n ],\n \"user-clear-flood\" => [\n \"title\" => t(\"Clear login attempts\"),\n \"href\" => \"user/clear-flood\",\n ],\n ],\n ],\n ],\n ],\n ];\n return $menu;\n }",
"private function _getNavigationLinks()\n {\n $admin_links['admin'] = array(\n 'url' => yourls_admin_url('index.php'),\n 'title' => yourls__('Go to the admin interface'),\n 'anchor' => yourls__('Admin interface')\n );\n\n if (defined('YOURLS_USER')) {\n $admin_links['tools'] = array(\n 'url' => yourls_admin_url('tools.php'),\n 'anchor' => yourls__('Tools')\n );\n $admin_links['plugins'] = array(\n 'url' => yourls_admin_url('plugins.php'),\n 'anchor' => yourls__('Manage Plugins')\n );\n $admin_sublinks['plugins'] = yourls_list_plugin_admin_pages();\n }\n\n $admin_links = yourls_apply_filter('admin_links', $admin_links);\n $admin_sublinks = yourls_apply_filter('admin_sublinks', $admin_sublinks);\n\n// $admin_links['help'] = array(\n// 'url' => yourls_site_url(false) .'/admin/plugins.php?page=laemmi_admin_help',\n// 'anchor' => yourls__('Help')\n// );\n\n if (defined('YOURLS_USER') && yourls_is_private()) {\n $admin_links['logout'] = array(\n 'url' => '#',\n 'anchor' => YOURLS_USER\n );\n $admin_sublinks['logout'] = array(\n 'logout' => array(\n 'url' => '?action=logout',\n 'anchor' => yourls__('Logout')\n )\n );\n }\n\n return array(\n 'admin_links' => $admin_links,\n 'admin_sublinks' => $admin_sublinks,\n );\n }",
"private function setMenus()\n { \n $this->menus = [\n \"locations\" => [],\n \"icon\" => null\n ];\n\n $menus = isset($this->settings->menus ) \n ? (object) $this->settings->menus \n : (object) [];\n\n // var_dump($menus);\n\n if (isset($menus->admin) && true === $menus->admin) array_push($this->menus['locations'], \"admin\");\n if (isset($menus->action) && true === $menus->action) array_push($this->menus['locations'], \"action\");\n if (isset($menus->settings) && true === $menus->settings) array_push($this->menus['locations'], \"settings\");\n\n if (isset($menus->icon))\n {\n if (preg_match(\"/^image:/\", $menus->icon))\n {\n $this->menus['icon'] = $this->getUrl().\"assets/images/\".preg_replace(\"/^image:/\", null, $menus->icon);\n }\n else \n {\n $this->menus['icon'] = $menus->icon;\n }\n }\n }",
"public function register_nav_menus() {\n\t\t\tregister_nav_menus([\n 'primary_logged_in' => __( 'Primary Menu for Logged in Users', 'mama-codes' ),\n \t]);\n\t\t}",
"public function set_menu(){\n \t$this->_main_menu = array();\n \n $this->_main_menu['index'] = new Model_Ui_Menuitem(\n \t \"View My Entries\" ,\n \t \"/user/\");\n $this->_main_menu['create'] = new Model_Ui_Menuitem(\n \t\"Upload Content\",\n \t\"/user/create\");\n $this->_main_menu['drafts'] = new Model_Ui_Menuitem(\n \t\"My Drafts\" ,\n \t\"/user/drafts\");\n $this->_main_menu['trash'] = new Model_Ui_Menuitem(\n \t\"Trash\" ,\t\n \t\"/user/trash\");\n $this->_main_menu['edit'] = new Model_Ui_Menuitem(\n \t\"Edit Profile\" ,\n \t\"/user/edit\");\n /*\n $this->_main_menu['my_files'] = new Model_Ui_Menuitem(\n \t\"My Files\" ,\n \t\"/user/my_files\");\n */\n \n $action = $this->request->action();\n $this->_main_menu[$action]->active = true;\n\t\n }",
"public function admin_menu()\n {\n global $menu, $submenu;\n $labels = $this->get_labels();\n\n foreach ($menu as &$item) {\n if (isset($item[0]) && 'Posts' === $item[0]) {\n $item[0] = $labels['name'];\n break;\n }\n }\n\n $submenu['edit.php'][5][0] = $labels['all_items'];\n $submenu['edit.php'][10][0] = $labels['add_new'];\n }",
"public function setmenuNav(){\r\n //set the menu item data\r\n if($this->loggedin){//these page options are only available to logged in users\r\n if($this->session->getUserAuthorisation()==1){ //authorisation level = 1 - Administrator\r\n switch ($this->pageID) {\r\n case \"home\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[1]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=planes\">Planes</a>';\r\n $this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=enthusiasts\">Enthusiasts</a>';\r\n $this->menuNav[4]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=messages\">My Messages</a>';\r\n // $this->menuNav[5]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=gallery\">Gallery</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break;\r\n //PLANES MENU ITEMS\r\n case \"planes\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=list_all_planes\">List all planes</a>';\r\n $this->menuNav[3]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=new_plane\">Add a plane</a>';\r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break;\r\n case \"list_all_planes\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n // $this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=list_all_planes\">List all planes</a>';\r\n $this->menuNav[3]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=new_plane\">Add a plane</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break;\r\n case \"new_plane\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=list_all_planes\">List all planes</a>';\r\n //$this->menuNav[3]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=new_plane\">Add a plane</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break;\r\n //ENTHUSIAST MENU ITEMS\r\n case \"enthusiasts\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=enthusiasts\">Enthusiasts</a>';\r\n $this->menuNav[4]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=enthusiast_query\">Enthusiast Query</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break;\r\n case \"enthusiast_query\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[4]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=enthusiast_query\">Enthusiast Query</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break;\r\n case \"enthusiast_query_result\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[4]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=enthusiast_query\">Enthusiast Query</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break;\r\n case \"enthusiast_account_result\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break; \r\n //Default Menu\r\n default:\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[1]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=planes\">Planes</a>';\r\n $this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=enthusiasts\">Enthusiasts</a>';\r\n $this->menuNav[4]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=messages\">My Messages</a>';\r\n // $this->menuNav[5]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=gallery\">Gallery</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break; \r\n } \r\n }\r\n else if($this->session->getUserAuthorisation()==2){ //authorisation level = 2 - Moderator\r\n switch ($this->pageID) { \r\n //HOME Menu items\r\n case \"home\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[1]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=planes\">Planes</a>';\r\n $this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=enthusiasts\">Enthusiasts</a>';\r\n $this->menuNav[4]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=messages\">My Messages</a>';\r\n //$this->menuNav[5]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=gallery\">Gallery</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break;\r\n //PLANES MENU ITEMS\r\n case \"planes\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=list_all_planes\">List all planes</a>';\r\n $this->menuNav[3]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=new_plane\">Add a plane</a>';\r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break;\r\n case \"list_all_planes\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=list_all_planes\">List all planes</a>';\r\n $this->menuNav[3]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=new_plane\">Add a plane</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break;\r\n case \"new_plane\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=list_all_planes\">List all planes</a>';\r\n $this->menuNav[3]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=new_plane\">Add a plane</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break;\r\n //ENTHUSIAST MENU ITEMS\r\n case \"enthusiasts\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=enthusiasts\">Enthusiasts</a>';\r\n $this->menuNav[4]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=enthusiast_query\">Enthusiast Query</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break;\r\n case \"enthusiast_query\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[4]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=enthusiast_query\">Enthusiast Query</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break;\r\n case \"enthusiast_query_result\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[4]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=enthusiast_query\">Enthusiast Query</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break;\r\n case \"enthusiast_account_result\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break; \r\n //Default Menu\r\n default:\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[1]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=planes\">Planes</a>';\r\n $this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=enthusiasts\">Enthusiasts</a>';\r\n $this->menuNav[4]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=messages\">My Messages</a>';\r\n // $this->menuNav[5]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=gallery\">Gallery</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break; \r\n } \r\n }\r\n else if($this->session->getUserAuthorisation()==3){//authorisation level = 3 - registerd user\r\n switch ($this->pageID) { \r\n //HOME Menu items\r\n case \"home\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[1]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=planes\">Planes</a>';\r\n $this->menuNav[4]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=messages\">My Messages</a>';\r\n //$this->menuNav[5]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=gallery\">Gallery</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break; \r\n //PLANES menu items\r\n case \"planes\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[1]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=list_all_planes\">View Planes</a>';\r\n //$this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=plane_query\">Plane Query</a>';\r\n $this->menuNav[3]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=new_plane\">Add Plane</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break;\r\n case \"new_plane\";\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[1]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=list_all_planes\">View Planes</a>';\r\n //$this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=plane_query\">Plane Query</a>';\r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break;\r\n case \"process_new_plane\";\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[1]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=list_all_planes\">View Planes</a>';\r\n //$this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=plane_query\">Plane Query</a>';\r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break;\r\n case \"list_all_planes\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n // $this->menuNav[1]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=list_all_planes\">View Planes</a>';\r\n //$this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=plane_query\">Plane Query</a>';\r\n $this->menuNav[3]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=new_plane\">Add Plane</a>';\r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break;\r\n /* case \"plane_query //not used\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[1]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=list_all_planes\">View Planes</a>';\r\n $this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=new_plane\">Add Plane</a>';\r\n //$this->menuNav[5]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=account\">My Account</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break;\r\n case \"plane_query_result\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[1]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=plane_query\">Plane Query</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>'; \r\n break;\r\n case \"plane_transcript_result\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>'; \r\n break; */\r\n case \"messages\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[4]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=messages\">My Messages</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break; \r\n case \"message_submit\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[4]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=messages\">My Messages</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break; \r\n //Default Menu\r\n default:\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[1]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=planes\">Planes</a>';\r\n $this->menuNav[4]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=messages\">My Messages</a>'; \r\n $this->menuNav[6]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=logout\">Log Out</a>';\r\n break; \r\n } \r\n }\r\n else{ //no authorisation to view pages\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[1]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=register\">Register</a>';\r\n $this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=login\">Login</a>';\r\n } \r\n }\r\n else{ //not logged in menu items\r\n switch ($this->pageID) {\r\n //Not logged in Menu items\r\n case \"home\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[1]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=register\">Register</a>';\r\n //$this->menuNav[3]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=register_admin\">Moderator Register</a>'; --Not allowed to register as staff\r\n $this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=login\">Login</a>';\r\n break;\r\n case \"register\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[1]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=register\">Register</a>';\r\n //$this->menuNav[3]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=register_admin\">Moderator Register</a>';\r\n $this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=login\">Login</a>';\r\n break;\r\n /*case \"register_admin\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[1]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=register\">Register</a>';\r\n // $this->menuNav[3]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=register_admin\">Admin Register</a>';\r\n $this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=login\">Login</a>';\r\n break;*/\r\n case \"login\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[3]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=login_enthusiast\">Enthusiast Login</a>';\r\n $this->menuNav[4]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=login_admin\">Staff Login</a>';\r\n break;\r\n case \"logout\":\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[1]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=register\">Register</a>';\r\n $this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=login\">Login</a>';\r\n break; \r\n default:\r\n $this->menuNav[0]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=home\">Home</a>';\r\n $this->menuNav[1]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=register\">Register</a>';\r\n $this->menuNav[2]='<a href=\"'.$_SERVER['PHP_SELF'].'?pageID=login\">Login</a>';\r\n break;\r\n }\r\n }\r\n }",
"function create_a_menu(){\n\t\t\t/*\n\t\t\tadd_menu_page(__('get clicky into your site'),__('Outbound Links'),'activate_plugins','wp_clicky_links',array($this,'OptionsPage'));\t\t\t\n\t\t\tadd_submenu_page('wp_clicky_links',__('add or edit'),__('Add New Link'),'activate_plugins','wp_clicky_addnew',array($this,'add_new'));\t\t\n\t\t\t//add_submenu_page('wp_clicky_links',__('clicky information'),__('Clicky Info'),'activate_plugins','clicky-import-result-information',array($this,'import_result_cicky_info'));\n\t\t\tadd_submenu_page('wp_clicky_links',__('Log Goals Into GetClikcy'),__('Log SIDs'),'activate_plugins','clicky-stats',array($this,'clicky_log'));\n\t\t\tadd_submenu_page('wp_clicky_links',__('Adjust GetClicky Settings in ClickyPlus'),__('Settings'),'activate_plugins','clicky-import-result-information',array($this,'import_result_cicky_info'));\n\t\t\t*/\n\t\t\t\n\t\t\tadd_menu_page(__('get clicky into your site'),__('ClickyPlus Settings'),'activate_plugins','wp_clicky_links',array($this,'import_result_cicky_info'));\n\t\t\t\n\t\t\tadd_submenu_page('wp_clicky_links',__('get clicky into your site'),__('Outbound Links'),'activate_plugins','wp_clicky_outbound_links',array($this,'OptionsPage'));\t\t\t\n\t\t\tadd_submenu_page('wp_clicky_links',__('add or edit'),__('Add New Link'),'activate_plugins','wp_clicky_addnew',array($this,'add_new'));\t\t\n\t\t\t//add_submenu_page('wp_clicky_links',__('clicky information'),__('Clicky Info'),'activate_plugins','clicky-import-result-information',array($this,'import_result_cicky_info'));\n\t\t\tadd_submenu_page('wp_clicky_links',__('Log Goals Into GetClikcy'),__('Log SIDs'),'activate_plugins','clicky-stats',array($this,'clicky_log'));\n\t\t\t\n\t\t}",
"public function add_menu_pages() {\n\t\t$title = \\esc_html__( 'Enrollment Comparison Tool', 'sensei-enrollment-comparison-tool' );\n\t\t\\add_submenu_page( 'sensei', $title, $title, 'manage_sensei', 'enrollment-comparison', [ $this, 'output_admin_page' ] );\n\t}",
"private function set_admin_menus() {\n\t\tif ( ! is_null( $this->admin_menus ) ) {\n\t\t\tforeach ( $this->admin_menus as $admin_menu ) {\n\t\t\t\t$admin_menu->register_add_action();\n\t\t\t}\n\t\t}\n\n\t\tif ( ! is_null( $this->admin_sub_menus ) ) {\n\t\t\tforeach ( $this->admin_sub_menus as $admin_sub_menu ) {\n\t\t\t\t$admin_sub_menu->register_add_action();\n\t\t\t}\n\t\t}\n\t}",
"public function admin_menus(){\n\t\t\t\n\t\t\t\t \t\n\t\t\t\n\t\t}",
"public static function addMenu(){\n add_submenu_page(\n avimayeur_customtheme::GROUP, // slug parent\n self::SUB3_TITLE, // page_title\n self::SUB3_MENU, // menu_title\n self::PERMITION, // capability\n self::SUB3_GROUP, // slug_menu\n [self::class, 'render'] // CALLBACK\n );\n }",
"public static function addMenu(){\n add_submenu_page(\n tablebouddha_customtheme::GROUP, // slug parent\n self::SUB3_TITLE, // page_title\n self::SUB3_MENU, // menu_title\n self::PERMITION, // capability\n self::SUB3_GROUP, // slug_menu\n [self::class, 'render'] // CALLBACK\n );\n }",
"public function configureMenuItems(): iterable\n {\n // yield MenuItem::linkToCrud('The Label', 'icon class', EntityClass::class);\n yield MenuItem::section('Administration');\n yield MenuItem::linkToCrud('Utilisateurs', null, Users::class);\n yield MenuItem::linkToCrud('Conseiller', null, Advisors::class);\n yield MenuItem::section('Gestion des catégories');\n yield MenuItem::linkToCrud('Categories', null, Categories::class);\n yield MenuItem::linkToCrud('SubCategories', null, SubCategories::class);\n yield MenuItem::section('Retours terrain');\n yield MenuItem::linkToCrud('Choices', null, Choices::class);\n }",
"public function admin_menu() {\n global $submenu, $menu;\n\n $perms = 'manage_options';\n add_menu_page( 'VALA 2.0', 'VALA', $perms, 'vala2api', array($this, 'admin_page'), '', 83.3 ); \n add_submenu_page( 'vala2api', __('Import Gallery', self::TEXT_DOMAIN), __('Import Gallery', self::TEXT_DOMAIN), $perms, 'vala2_winners_circle', array($this,'ngg_import_gallery_page') );\n }",
"function blog_admin_menu( $items, $url ){\n\n\t$Template = Template::getInstance( );\n\n\t$menu = array( );\n\n\tforeach( $items as $item => $val ){\n\t\tif( $item == 'menu_users_groups' ){\n\t\t\t$menu[ 'menu_blog' ] = array(\n\t\t\t\t'name' => $Template->e( 'menu_blog' ),\n\t\t\t\t'url' => $url,\n\t\t\t);\n\t\t}\n\t\t$menu[ $item ] = $val;\n\t}\n\n\treturn $menu;\n}",
"public function admin_menu() {\n\n\t\t\tif (is_array($this->options) && count($this->options) >= 8 && $this->options['slug'] !== '') {\n\n\t\t\t\tif ($this->options['parent'] === '') {\n\n\t\t\t\t\tadd_menu_page($this->options['title'], $this->options['name'], $this->options['capability'], $this->options['slug'], array($this, 'setup_menu_page'), $this->options['icon'], $this->options['position']);\n\t\t\t\t}\n\t\t\t\telse {\n\n\t\t\t\t\tadd_submenu_page($this->options['parent'], $this->options['title'], $this->options['name'], $this->options['capability'], $this->options['slug'], array($this, 'setup_menu_page'));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"private static function navMenus(){\n register_nav_menus([\n 'main-nav' => 'Main Navigation Menu',\n 'policy-menu' => 'Footer Policy Menu',\n 'footer-nav' => 'Footer Nav Menu'\n ]);\n }",
"public function register_sub_menu() {\n\t\tadd_submenu_page(\n\t\t\t'machete',\n\t\t\t$this->params['full_title'],\n\t\t\t$this->params['title'],\n\t\t\t$this->params['role'],\n\t\t\t'machete-' . $this->params['slug'],\n\t\t\tarray( $this, 'submenu_page_callback' )\n\t\t);\n\t}",
"public static function registerWtMenuForExtraLinks()\n {\n foreach (\\WTThemePlugin::$menu_items_to_be_registered as $menu_item) {\n register_nav_menu($menu_item['location'], __($menu_item['description'][0], $menu_item['description'][1]));\n }\n }",
"public function customize_main_navigation() {\n global $menu, $submenu;\n //unset($menu[2]);\n }",
"public function menu() {\n\t\t$return = array(\n\t\t\t\t\t\t\"title\" => \"Users\", \n\t\t\t\t\t\t\"submenu\" => array(\n\t\t\t\t\t\t\t\t\t\t\"levels\" => \"Levels\", \n\t\t\t\t\t\t\t\t\t\t\"privileges\" => \"Privileges\", \n\t\t\t\t\t\t\t\t\t\t\"add\" => \"Add User\"\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\treturn $return;\n\t}",
"public static function create_menus()\n {\n // Main menu item\n add_menu_page (\n 'Mindbody Pro',\n 'Mindbody Pro',\n 'manage_options',\n 'settings',\n '', \n NULL, // Icon\n '76'\n );\n\n foreach( self::$pages as $slug )\n {\n $class = '\\\\Mindbody\\\\Admin\\\\' . ucfirst($slug);\n\n self::$_pages[$slug] = new $class();\n }\n }",
"function venus_multipage_menu_links( $menus, $args ) {\n\n\t$multipages_menu = wp_get_nav_menu_items( 'multipage' );\n\n\tif ( is_front_page() && isset( $args ) && $multipages_menu ) {\n\n\t\tif ( isset( $args->theme_location ) || $args->theme_location !== '' ) {\n\n\n\t\t\t$multipages_urls = array_map( function ( $menu ) {\n\t\t\t\treturn $menu->url;\n\t\t\t}, $multipages_menu );\n\n\n\t\t\tforeach ( $menus as &$menu ) {\n\t\t\t\tif ( in_array( $menu->url, $multipages_urls ) ) {\n\t\t\t\t\t$page = get_post( $menu->object_id );\n\t\t\t\t\tif ( $page !== null ) {\n\n\t\t\t\t\t\t$menu->url = '#' . sanitize_title_with_dashes( $page->post_title );\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\treturn $menus;\n}",
"public function instagram_menu() {\n\t\tadd_submenu_page('options-general.php', 'Instagram Settings', 'Instagram Settings', 'manage_options', 'instagram-menu', array($this,'instagram_admin_view'));\n\t}",
"function register_menus() {\n register_nav_menus(array(\n 'primary' => 'header',\n 'footer' => 'footer'\n ));\n }"
] | [
"0.69127786",
"0.68180513",
"0.66531366",
"0.6639679",
"0.65802795",
"0.65701306",
"0.65384656",
"0.6527179",
"0.65043014",
"0.646443",
"0.63831824",
"0.6337142",
"0.6311365",
"0.63024735",
"0.6278408",
"0.62764704",
"0.62596214",
"0.62283343",
"0.62042606",
"0.6198617",
"0.6195846",
"0.6195807",
"0.6190998",
"0.6176865",
"0.6175928",
"0.6164967",
"0.6150701",
"0.61461204",
"0.61453325",
"0.61338377"
] | 0.75115436 | 0 |
TODO: Implement sendNewFriendNotification() method. | public function sendNewFriendNotification()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function invitefriend()\r\n\t{\r\n\t\t$this->autoRender = false;\r\n\t\t\r\n\t\tif (!empty($this->data))\r\n\t\t{\r\n\t\t\t$sentEmails = $this->Mail->inviteFriends ( $this->data,$this );\r\n\t\t\t\r\n\t\t\t$inviteData['FriendInvitaion']['user_id'] = $this->Session->read(\"Auth.Member.id\");\r\n\t\t\t$inviteData['FriendInvitaion']['emails'] = implode(\",\", $sentEmails['emails']);\r\n\t\t\t$inviteData['FriendInvitaion']['message'] = $sentEmails['message'];\r\n\t\t\t$inviteData['FriendInvitaion']['code'] = $sentEmails['code'];\r\n\t\t\t\r\n\t\t\t$this->FriendInvitaion->create();\r\n\t\t\t$this->FriendInvitaion->save($inviteData);\r\n\t\t}\r\n\t}",
"protected function getNewFriends(){\n $snapchat_engine = $this->snapchat_engine;\n $thisCouldBeFalse = $snapchat_engine->getAddedFriends();\n if($thisCouldBeFalse === false){$thisCouldBeFalse = Array();}\n return $thisCouldBeFalse;\n }",
"public function addFriend() {\n return \"$this->email added a new friend\";\n }",
"function labels_add_friend($friend) {\n\t$user = elgg_get_logged_in_user_entity();\n\tif (!$user) {\n\t\treturn false;\n\t}\n\n\t// if not a friend already, add as friend\n\tif (!$user->isFriendsWith($friend->guid)) {\n\t\t$errors = false;\n\n\t\t// \tGet the user\n\t\ttry {\n\t\t\tif (!$user->addFriend($friend->guid)) {\n\t\t\t\t$errors = true;\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\tregister_error(elgg_echo(\"friends:add:failure\", array($friend->name)));\n\t\t\t$errors = true;\n\t\t}\n\t\tif (!$errors) {\n\t\t\t// \tadd to river\n\t\t\t// add to river\n\t\t\telgg_create_river_item(array(\n\t\t\t\t'view' => 'river/relationship/friend/create',\n\t\t\t\t'action_type' => 'friend',\n\t\t\t\t'subject_guid' => $user->guid,\n\t\t\t\t'object_guid' => $friend->guid,\n\t\t\t));\n\t\t\tsystem_message(elgg_echo(\"friends:add:successful\", array($friend->name)));\n\t\t}\n\t}\n}",
"public function add_friend_save()\n\t{\n\t\t// Require user\n\t\tif (!$user = $this->_requireUser('Please sign in, or sign up, to add a friend.')) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get friend details\n\t\t$friendId = Request::getInt('friendid');\n\t\t$personModel = $this->getModel('person');\n\t\t$friend = $personModel->getPerson(array('member' => $friendId));\n\n\t\t// Get personal message\n\t\t$message = Request::getString('message');\n\n\t\t// Already have request?\n\t\tif ($personModel->hasFriendRequest($user, $friend)){\n\t\t\tMessages::addMessage('You already have a pending friend request with <em>' . $friend->name . '</em>.');\n\n\t\t// Add new friend request\n\t\t} else {\n\t\t\t$success = $personModel->createFriendRequest($user->userid, $friend->userid, $message);\n\n\t\t\t// Add status message\n\t\t\t$message = $success ? 'You have sent <em>' . $friend->name . '</em> a network request.' : BluApplication::getSetting('errorMessage');\n\t\t\t$messageType = $success ? 'info' : 'error';\n\t\t\tMessages::addMessage($message, $messageType);\n\t\t}\n\n\t\t// Redirect back to the person's page\n\t\t$this->_redirect('/profile/'.$friend->username);\n\t}",
"public static function createFriendRequest(Event $event) {\n\t\t\n\t\t$relationship = $event->getObject();\n\t\t\n\t\tif (!$relationship instanceof \\ElggRelationship) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ($relationship->relationship !== 'friendrequest') {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$requester = get_user($relationship->guid_one);\n\t\t$new_friend = get_user($relationship->guid_two);\n\t\t\n\t\tif (empty($requester) || empty($new_friend)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Notify target user\n\t\t$subject = elgg_echo('friend_request:newfriend:subject', [$requester->getDisplayName()], $new_friend->language);\n\t\t$message = elgg_echo('friend_request:newfriend:body', [\n\t\t\t$requester->getDisplayName(),\n\t\t\telgg_generate_url('collection:user:user:friend_request', ['username' => $new_friend->username]),\n\t\t], $new_friend->language);\n\t\t\n\t\t$params = [\n\t\t\t'action' => 'friend_request',\n\t\t\t'object' => $requester,\n\t\t];\n\t\tnotify_user($new_friend->guid, $requester->guid, $subject, $message, $params);\n\t}",
"public function add_friend()\n\t{\n\t\t// Require user\n\t\tif (!$user = $this->_requireUser('Please sign in, or sign up, to add a friend.')) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get friend details\n\t\tif (!isset($this->_args[0])) {\n\t\t\treturn $this->_errorRedirect();\n\t\t}\n\t\t$friendUsername = urldecode($this->_args[0]);\n\t\t$personModel = $this->getModel('person');\n\t\t$friend = $personModel->getPerson(array('username' => $friendUsername));\n\n\t\t// Get personal message\n\t\t$message = Request::getString('message');\n\t\t\n\t\t/* Set header ad */\n\t\t$this->_doc->setAdPage(OpenX::PAGE_PROFILE);\n\n\t\t// Load template\n\t\tinclude(BLUPATH_TEMPLATES.'/profile/add_friend.php');\n\t}",
"public function addFriend() {\n\n\t\t$user= $this->username;// the $this keyword helps us to gain access to the property of a class\n\n\t\treturn \" $user added a new friend\";\n\t}",
"public function friend_add(){\n\t\tif($this->input->post()){\n\t\t\t$receiver;\n\t\t\t$actor;\n\t\t\tif($this->input->post('user_id_1') && $this->input->post('user_id_2')){\n\t\t\t\t$data = array(\n\t\t\t\t\t'user_id_1' => $this->input->post('user_id_1'),\n\t\t\t\t\t'user_id_2' => $this->input->post('user_id_2'),\n\t\t\t\t\t'current_user' => $this->session->userdata('user_data')['id'],\n\t\t\t\t\t'isNew' => 0,\n\t\t\t\t);\n\t\t\t\t$receiver = $this->input->post('user_id_2');\n\t\t\t\t$actor = $this->input->post('user_id_1');\n\t\t\t}else{\n\t\t\t\t$data = array(\n\t\t\t\t\t'user_id_1' => $this->session->userdata('user_data')['id'],\n\t\t\t\t\t'user_id_2' => $this->input->post('target'),\n\t\t\t\t\t'isNew' => 1,\n\t\t\t\t);\n\t\t\t\t$receiver = $this->input->post('target');\n\t\t\t\t$actor = $this->session->userdata('user_data')['id'];\n\t\t\t}\n\t\t\t\n\t\t\t$addFriend = $this->postPatients('addFriend', $data);\n\t\t\t//notification\n\t\t\t$this->load->library('notification');\n\t\t\t$res = $this->notification->friend_request_made($receiver,$actor);\t\n\t\t\t//notification\n\t\t\t$this->redirect(true,$this->input->post('username'));\n\t\t}else{\n\t\t\t$this->denyAccess();\n\t\t}\n\t}",
"public function created(FriendRequest $friendRequest)\n {\n Log::info(__CLASS__.' :: '.__FUNCTION__.' : '.'friendrequest_id='.$friendRequest->id);\n $user = $friendRequest->user;\n $from_id = $friendRequest->request;\n $user->notify(new FRN($from_id, $friendRequest));\n }",
"public function addFriend($id){\n\t\tFriendship::where('first_user', $id)->where('second_user', Auth::id())->update(['status' => 'confirmed', 'acted_user' => Auth::id()]);\n\t\t//Auth::user() will be the user accepting the request\n\t\t//User with $id will be the one who had sent the request and receiving this notification\n\t\t$user = User::find($id);\n\t\t$user->notify(new FriendRequestAccepted(Auth::id(), Auth::user()->name));\n\t\treturn true;\n\t}",
"public function testAddFriendPending()\n {\n $friendEntity = new Entity\\Friend($this->friend, $this->user);\n $entityManager = $this->getEntityManager($friendEntity);\n $pendingRequest = new FriendService($entityManager);\n /** @var Entity\\Friend $lastInsert */\n $lastInsert = $pendingRequest->addFriend($this->friend, $this->user);\n $lastInsert->setId(1);\n $friendAddRequest = new FriendService($entityManager);\n $friendAddRequest->addFriend($this->user, $this->friend);\n $response = $friendAddRequest->getStatus();\n $this->assertEquals(Entity\\Friend::FRIEND_ADD_STATUS_COMPLETED, $response);\n }",
"private static function get_notification_add_friend($notification, $user) {\n\t\t$notification->image = $user->image;\n\t\t$notification->action = '<a href=\"#\">'.$user->name.'</a> đã gửi lời mời kết bạn tới bạn';\n\t\t$notification->info = '';\n\t\treturn $notification;\n\t}",
"public function friend($friend_user_id = NULL) {\n\t\n\t\t# Create an array of the user's and other user's IDs.\n\t\t$data['user_id'] = $this->user->user_id;\n\t\t$data['recipient_id'] = $friend_user_id;\n\t\n\t\t$user_recipient = DB::instance(DB_NAME)->insert(\"users_recipients\", $data);\n\t\t\n\t\t# Create a relationship between the recipient and the occasion\n\t\t# Temporary: the db contains one occasion, Christmas. Hard-coded for now.\n\t\t$recip_occasion = array(\"user_recipient_id\" => $user_recipient, \"occasion_id\" => '2');\n\t\tDB::instance(DB_NAME)->insert('recipients_occasions', $recip_occasion);\n\t\n\t\tRouter::redirect(\"/gifts/find_friends\");\n\t}",
"public function addFriend($username, $friend);",
"function accept_chat_request_by_sender_add_friend($sender_userid)\n {\n //\n $this->db->select('friends');\n // $this->db->where('user_id', $sender_userid);\n $array = array('user_id' => $sender_userid, 'friends!=' => '');\n $this->db->where($array);\n $data_Array = $this->db->get('users')->result_array();\n // if (empty($data_Array)) {\n // return $data_Array;\n // }\n //instead of foreach i used array_shift\n $user_details = array_shift($data_Array);\n\n //getting one freind\n $old_friend_id = $user_details['friends'];\n $user = $this->session->userdata('user');\n $userid = $user['user_id'];\n //if already they are freind then it will check for unique friend\n if (strpos($old_friend_id, $userid) !== false) {\n return;\n }\n //echo \"Word Found!\";\n //concat with old friend with semicolon \n\n $new_friend_id = \"{$old_friend_id},{$userid}\";\n $new_friend_id = ltrim($new_friend_id, ',');\n\n //update with new friend request accepted\n $this->db->where('user_id', $sender_userid);\n $this->db->set('friends', $new_friend_id);\n $this->db->update('users');\n }",
"public function pendingFriendship(Model $friend)\n {\n $this->friends()->attach($friend->id, ['status' => Status::AWAITING_APPROVAL]);\n }",
"private function notification(){\n\t\n\t}",
"function accept_chat_request_add_friend($sender_userid)\n {\n $user = $this->session->userdata('user');\n $userid = $user['user_id'];\n $this->db->select('friends');\n $array = array('user_id' => $userid, 'friends!=' => '');\n $this->db->where($array);\n //$this->db->where('user_id', $userid);\n $data_Array = $this->db->get('users')->result_array();\n // if (empty($data_Array)) {\n // return $data_Array;\n // }\n //instead of foreach i used array_shift\n $user_details = array_shift($data_Array);\n\n //getting one freind\n $old_friend_id = $user_details['friends'];\n //if already they are freind then it will check for unique friend\n if (strpos($old_friend_id, $sender_userid) !== false) {\n return;\n }\n //echo \"Word Found!\";\n //concat with old friend with semicolon \n $new_friend_id = \"{$old_friend_id},{$sender_userid}\";\n $new_friend_id = ltrim($new_friend_id, ',');\n\n //update with new friend request accepted\n $this->db->where('user_id', $userid);\n $this->db->set('friends', $new_friend_id);\n $this->db->update('users');\n }",
"function buddyboss_new_group_invite_friend_list() {\n\techo buddyboss_get_new_group_invite_friend_list();\n}",
"public function notification(){\n\t}",
"public function lists_friends_from_gmail()\n {\n }",
"function friends(){\r\n\t\t$this->checkLogin();\r\n\t\t$this->template\r\n\t\t->title($GLOBALS['global']['HOME_PAGE']['site_title'])\r\n\t\t->build('friends/friends');\r\n\t}",
"public function getFriendLink()\n\t{\n\t\t$img = Image::getImage(\"b.gif\", Core::getLanguage()->getItem(\"ADD_TO_BUDDYLIST\"));\n\t\treturn Link::get(\"game/\".SID.\"/Friends/Add/\".$this->getUserid(), $img);\n\t}",
"public function addNotification($user_id, $note, $template, $data) {\n\t\tglobal $user, $sql;\n\t\t$ret = -1;\n\n\t\t$template = \"/notifications/{$template}.php\";\n\t\tif(!file_exists($this->templateDir.$template) || !(include $this->templateDir.$template))\n\t\t\treturn -1;\n\n\t\t//user_id is the person I want to add and friend_id is me\n\t\t//$vals = array(\"user_id\"=>$user_id,\"friend_id\"=>$user->get(\"id\"),\"type\"=>Manager::NEW_CONTACT, \"message\"=> \"{$user->get(\"first\")} {$user->get(\"last\")} wants to be friends\");// \"viewed\"=>\"0\");\n\n\t\t$msg = \"\";\n\t\t$vals = array(\"notification_type\"=>Manager::NEW_CONTACT, \"user_id\"=>$user_id, \"message\"=>$msg);// \"viewed\"=>\"0\");\n\t\t//insert notification to DB\n\t\t$note = $sql->insert(\"notifications\", $vals);\n\t\t$msg = \"{$user->get(\"first\")} {$user->get(\"last\")} wants to be friends </br><span id=\\\"requestID-accept-{$user->get(\"id\")}-{$note}\\\" class=\\\"fake-link\\\">Accept</span> | <span id=\\\"requestID-ignore-{$user->get(id)}-{$note}\\\" class=\\\"fake-link\\\">Ignore</span>\";\n\t\t$sql->update(\"notifications\",\"`message`='{$msg}'\",\"WHERE `notification_id`='{$note}'\");\n\n\n\t\t// Add notifications to users if it is a \"onsite\" notification\n\t\t// if($noteData != \"\") {\n\t\t// \t$ret = 0;\n\t\t// \t$noteData = '{\"n\":'.$note.',\"d\":'.$noteData.',\"v\":0,\"t\":'.time().'}';\n\t\t// \t$set = \"`user_notifications` = CASE\n\t\t// \tWHEN `user_notifications`=''\n\t\t// \tTHEN '{$noteData}'\n\t\t// \tELSE CONCAT(`user_notifications`, ',{$noteData}')\n\t\t// \tEND\";\n\t\t// \tif(($ret = $sql->update(\"users\", $set, \"WHERE `user_id` IN({$users})\")) == FALSE)\n\t\t// \t\treturn -1;\n\t\t// }\n\n\t\t// Send an email if an email field exists\n\t\tif($subject != \"\") {\n\t\t\t$sql->select(\"users\", \"`user_first`,`user_last`,`user_email`,`user_prefs`\", \"WHERE `user_id` IN({$user_id})\");\n\t\t\t$ret = 0;\n\t\t\twhile(($usr = $sql->fetch()) !== FALSE) {\n\t\t\t\t// Check if they have opted into these notifications by email\n\t\t\t\t$prefs = decbin($usr[\"user_prefs\"]);\n\t\t\t\tif($prefs[$note-1]!=\"1\")\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$replace = Array(\"{USER_FIRST}\", \"{USER_LAST}\");\n\t\t\t\t$with = Array($usr[\"user_first\"], $usr[\"user_last\"]);\n\t\t\t\t$plain_text = str_replace($replace, $with, $plain_text);\n\t\t\t\t$html = str_replace($replace, $with, $html);\n\n\t\t\t\t// Add the email theme\n\t\t\t\tif(file_exists($this->templateDir.\"/emails/email_template.php\"))\n\t\t\t\t\tinclude $this->templateDir.\"/emails/email_template.php\";\n\n\t\t\t\tif($plain_text != \"\")\n\t\t\t\t\t$ret = $ret + $this->sendMail($usr[\"user_email\"], $subject, $plain_text, $html);\n\t\t\t}\n\t\t}\n\n\t\treturn $ret;\n\t}",
"public static function inviteFriend() {\n\t\t\t// Add Classes\n\t\t\t$RepQuestion\t= new RepQuestion();\t\n\t\t\t$ModAlert\t\t= new ModAlert();\n\t\t\t// Initialize variables\n\t\t\t$email\t\t\t= (isset($_POST['email'])) ? trim($_POST['email']) : false;\n\t\t\t$user\t\t\t= Session::getVar('user');\n\t\t\t// If values were sent\n\t\t\tif (($user) && ($email)) {\n\t\t\t\t// Fetch content\n\t\t\t\t$email_content\t= $ModAlert->inviteFriendEmail($user['vc_user'], $user['vc_email'], $email);\n\t\t\t\t// If email was sent\n\t\t\t\tif (mail($email, 'You were invited to play Knowledge Question Adventure', $email_content, \"From:\".$user['vc_email'])) {\n\t\t\t\t\t// Register it on database\n\t\t\t\t\t$return\t\t= ($RepQuestion->logInviteFriend($user['id'], $email)) ? 'ok' : 'Most likely you have invited that person already.';\n\t\t\t\t\t// Prepare return\n\t\t\t\t// If email was not sent\n\t\t\t\t} else {\n\t\t\t\t\t// Prepare return\n\t\t\t\t\t$return\t\t= 'mail object error: email not sent';\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Print return on screen\n\t\t\techo $return;\n\t\t}",
"public function confirm_friend() {\n\t\tif ($this->request->is('post')) {\n\t\t\t$headers = apache_request_headers();\n\t\t\tif(isset($headers['token'])){\n\t\t\t\t$token = $headers['token'];\n\t\t\t\t$user = $this->User->find('first', array(\n\t\t\t\t\t\t'conditions' => array('User.token' => $token),\n\t\t\t\t\t\t'recursive' => 0));\n\t\t\t\tif(isset($user['User']['id'])) {\n\t\t\t\t\t$friend = $this->request->data;\n\t\t\t\t\t$conditions = array('UserFriend.user_id' => $friend['UserFriend']['id'],\n\t\t\t\t\t\t\t\t\t\t'UserFriend.friend_user_id' => $user['User']['id']);\n\t\t\t\t\tif($this->UserFriend->hasAny($conditions)) {\n\t\t\t\t\t\tif($friend['UserFriend']['status'] == \"accept\") {\n\t\t\t\t\t\t\t$record = $this->UserFriend->find('first', array(\n\t\t\t\t\t\t\t\t'conditions' => $conditions,\n\t\t\t\t\t\t\t\t'recursive' => 0));\n\t\t\t\t\t\t\t$this->UserFriend->id = $record['UserFriend']['id'];\n\t\t\t\t\t\t\tif($this->UserFriend->saveField('status', 0)) {\n\t\t\t\t\t\t\t\t$conditions = array('UserFriend.user_id' => $record['UserFriend']['friend_user_id'],\n\t\t\t\t\t\t\t\t\t'UserFriend.friend_user_id' => $record['UserFriend']['user_id']);\n\t\t\t\t\t\t\t\t$get_id = $this->UserFriend->find('first',array('conditions' => $conditions));\n\t\t\t\t\t\t\t\t$this->UserFriend->id = $get_id['UserFriend']['id'];\n\t\t\t\t\t\t\t\tif($this->UserFriend->saveField('status', 0)) {\n\t\t\t\t\t\t\t\t\t$result = \"Success\";\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$this->UserFriend->deleteAll($conditions);\n\t\t\t\t\t\t\t$conditions = array('UserFriend.user_id' => $user['User']['id'],\n\t\t\t\t\t\t\t\t\t\t'UserFriend.friend_user_id' => $friend['UserFriend']['id']);\n\t\t\t\t\t\t\t$this->UserFriend->deleteAll($conditions);\n\t\t\t\t\t\t\t$result = \"Success\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$result = \"Failure-Invalid Action\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$result = \"Failure-Invalid token\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$result = \"Failure-Valid token required\";\n\t\t\t}\n\t\t\t$this->set('result', $result);\n\t\t\t$this->set('_serialize', array('result'));\n\t\t}\n\t}",
"public function sendFriendRequest($id){\n\t\t$friendship = new Friendship;\n\t\t$friendship->first_user = Auth::id();\n\t\t$friendship->second_user = $id;\n\t\t$friendship->acted_user = Auth::id();\n\t\t$friendship->status = 'pending';\n\t\t$friendship->save();\n\t\ttry{\n\t\t\t//Notify the user with id => $id about the Friend Request\n\t\t\t//Auth::user() will be the user sending the friend request and user with $id will the user receiving request\n\t\t\t$user = User::find($id);\n\t\t\t$user->notify(new FriendRequestSent(Auth::id(), Auth::user()->name));\n\t\t}catch(Exception $e){\n\t\t\treturn back()->withError(\"Something went Wrong while Finishing Request\")->withInput();\n\t\t}\n\t\t\n\t\treturn redirect('/showProfile/' . $id);\n\t}",
"public function sendToTelegramAboutNewUser()\n {\n $text = \"#newuser\\n\";\n $title = \"Yangi foydalanuvchi\";\n $text .= \"<b>$title</b>\\n\";\n\n $id = \"🆔 $this->id \\n\";\n $user = \"👤 $this->fullname \\n\";\n $phone = \"☎ $this->phone \\n\";\n $date = \"📅 \" . Yii::$app->formatter->asDateTimeUz($this->created_at) . \" \\n\";\n $count = \"🎯 Bugungi ro'yxatdan o'tganlar soni: \" . self::countTodayUsers() . \"\\n\";\n\n $text .= $id . $user . $phone . $date . $count;\n\n $chat_id = Yii::$app->help->virtualdarsTelegramAkkountId();\n Yii::$app->telegram->sendMessage([\n 'chat_id' => $chat_id,\n 'text' => $text,\n 'parse_mode' => 'html'\n ]);\n\n }",
"public function notifications()\r\n\t{\r\n\r\n\t\t$this->template->id = $this->userid;\r\n\t\t$this->template->my_friends = $this->profile->my_friends($this->userid,1);\r\n\t\t$this->template->suggest_friends = $this->profile->suggest_friends($this->userid,1);\r\n\t\t//\r\n\t\t$this->note_comments = $this->model->get_notisfiction($this->userid);\r\n\t\t$this->note_like = $this->model->get_note_like($this->userid);\r\n\t\t//\t\t\r\n\t\t$this->template->title = \"Notifications\"; \r\n\t\t$this->left = new View(\"template/left_menu\");\r\n\t\t$this->center = new View(\"profile/note\");\r\n\t\t$this->right = new View(\"profile/profile_right\");\r\n\t\t$this->title_content = \"Notifications\";\r\n\t\t$this->template->content = new View(\"/template/template3\");\r\n\t}"
] | [
"0.67286444",
"0.6607267",
"0.65002906",
"0.6473673",
"0.6386398",
"0.6374829",
"0.619099",
"0.61812323",
"0.6176398",
"0.6171285",
"0.6116508",
"0.6062864",
"0.605268",
"0.60518754",
"0.60289466",
"0.60287493",
"0.59724915",
"0.5948202",
"0.5946906",
"0.594137",
"0.59386885",
"0.5873274",
"0.5861166",
"0.5856709",
"0.5839944",
"0.5838451",
"0.5789536",
"0.57870287",
"0.57754016",
"0.5771574"
] | 0.906729 | 0 |
check eligibilty for claiming the reward points | public function eligible_check($insert)
{
$this->db->select('SUM(reward_points) AS reward_points FROM referral');
$this->db->where('agent_id', $insert['agent_id']);
$this->db->where('referee_status', '1');
$this->db->where('reward_expiry_date >=', date('Y-m-d'));
$query = $this->db->get()->result();
if (!empty($query)) {
$data = $this->claimed_point($insert['agent_id']);
foreach ($query as $key => $value) {
}
if ($insert['claimed_points'] <= ($value->reward_points - $data)) {
return true;
}else{
return false;
}
}else{
return 'error';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function canAddRewardPoints()\n {\n $frequency = $this->_rewardData->getPointsConfig(\n 'invitation_order_frequency',\n $this->getReward()->getWebsiteId()\n );\n if ($frequency == '*') {\n return !$this->isRewardLimitExceeded();\n } else {\n return parent::canAddRewardPoints();\n }\n }",
"public function hasEverreward(){\n return $this->_has(3);\n }",
"public function hasReward(){\n return $this->_has(5);\n }",
"public function checkRewardAmount() {\n\n\t\t$config = SiteConfig::current_site_config();\n\n\t\tif ($this->owner->RewardAmount >= $config->RewardThreshold && $config->RewardThreshold > 0) {\n\t\t\t//work out how many rewards they got for this order\n\t\t\t$noRewards = floor($this->owner->RewardAmount / $config->RewardThreshold);\n\t\t\t//remove the amount which got used for the reward\n\t\t\t$this->owner->RewardAmount = $this->owner->RewardAmount - ($config->RewardThreshold * $noRewards);\n\n\t\t\t$this->giveReward($noRewards);\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"protected function _isAllowed()\n\t{\n\t\treturn df_mage()->admin()->session()->isAllowed('df_reward/rates');\n\t}",
"private function forgive() {\n if ($this->node->choice_multi == 1) {\n for ($i = 0; isset($this->node->alternatives[$i]); $i++) {\n $short = &$this->node->alternatives[$i];\n // If the scoring data doesn't make sense, use the data from the\n // \"correct\" checkbox to set the score data.\n if ($short['score_if_chosen'] == $short['score_if_not_chosen'] || !is_numeric($short['score_if_chosen']) || !is_numeric($short['score_if_not_chosen'])) {\n if (!empty($short['correct'])) {\n $short['score_if_chosen'] = 1;\n $short['score_if_not_chosen'] = 0;\n }\n else {\n if (variable_get('multichoice_def_scoring', 0) == 0) {\n $short['score_if_chosen'] = -1;\n $short['score_if_not_chosen'] = 0;\n }\n elseif (variable_get('multichoice_def_scoring', 0) == 1) {\n $short['score_if_chosen'] = 0;\n $short['score_if_not_chosen'] = 1;\n }\n }\n }\n }\n }\n else {\n // For questions with one, and only one, correct answer, there will be\n // no points awarded for alternatives not chosen.\n for ($i = 0; isset($this->node->alternatives[$i]); $i++) {\n $short = &$this->node->alternatives[$i];\n $short['score_if_not_chosen'] = 0;\n if (isset($short['correct']) && $short['correct'] == 1 && !_quiz_is_int($short['score_if_chosen'], 1)) {\n $short['score_if_chosen'] = 1;\n }\n }\n }\n }",
"private function checkLimitations()\n {\n// @todo : build this out into a service\n if ($this->checkLocomotion()) {\n return true;\n }\n return false;\n }",
"public function calculateExemptionsGranted()\r\n\t{\r\n\t $total = 0;\r\n\t $status = \"granted\";\r\n\t $query = Doctrine_Manager::getInstance()->getCurrentConnection()->fetchAssoc(\"select count(*) as total from tax_exemption_details where status = ' $status' \");\r\n\t foreach($query as $q)\r\n\t {\r\n\t $total = $q['total'];\r\n\t }\r\n\t //\r\n\t return $total;\r\n\t}",
"function checkEligibility($mark){\n if($mark >= 35){\n return true;\n }\n elseif($mark < 35){\n return false;\n }\n}",
"function is_eligible(){\n\treturn is_admin() && is_loggedin();\n}",
"function calculate_reward($AI_type, $AI_contribution, $target_contribution, $ECU_available) {\n elseif ($AI_type == \"lazy\") {\n $reward = 0;\n if (($target_contribution - $AI_contribution) <= -6) {\n $reward = rand(-8, -14);\n }\n elseif (($target_contribution - $AI_contribution) <= -3) {\n $reward = rand(-2, -6);\n }\n elseif (($target_contribution - $AI_contribution) <= 3 && ($target_contribution - $AI_contribution) >= -3) {\n $reward = 0;\n }\n elseif (($target_contribution - $AI_contribution) >= 3) {\n $reward = rand(6, 10);\n }\n elseif (($target_contribution - $AI_contribution) >= 6) {\n $reward = rand(12, 16);\n }\n }\n //normal AI. Rewards and Punishes\n elseif ($AI_type == \"normal\") {\n if (($target_contribution - $AI_contribution) <= -6) {\n $reward = rand(-6, -8);\n }\n elseif (($target_contribution - $AI_contribution) <= -3) {\n $reward = rand(-2, -4);\n }\n elseif (($target_contribution - $AI_contribution) <= 3 && ($target_contribution - $AI_contribution) >= -3) {\n $reward = 0;\n }\n elseif (($target_contribution - $AI_contribution) >= 3) {\n $reward = rand(2, 4);\n }\n elseif (($target_contribution - $AI_contribution) >= 6) {\n $reward = rand(4, 10);\n }\n }\n //mean AI. Only punishes\n elseif ($AI_type == \"mean\") {\n if (($target_contribution - $AI_contribution) <= -6) {\n $reward = rand(-8, -14);\n }\n elseif (($target_contribution - $AI_contribution) <= -3) {\n $reward = rand(-2, -6);\n }\n elseif (($target_contribution - $AI_contribution) > -3) {\n $reward = 0;\n }\n }\n else {\n throw new Exception(\"AI Type not recognized/contributions are wrong\");\n }\n\n if ($reward > $ECU_available) {\n return $ECU_available;\n }\n else{\n return $reward;\n }\n }",
"public function able();",
"function check_permit()//TB02\n\t{\n\t\t$fPM\t= $this->check_permit_level();\n\t\t//neu co loi thi thong bao\n\t\tif(!$fPM)\n\t\t{\n\t\t\t$this->alert_to_back(\"Error code: TB02.\\\\nSorry, this area is limited.\");\n\t\t}\n\t\telse\n\t\t{// ghi log\n\t\t\tif($this->write_log) $this->write_log();\n\t\t}\n\t}",
"public function checkForLose() {\n\n if ($this->lives <= 0) {\n return true;\n } else {\n return false;\n }\n\n }",
"private function check(): void\n {\n if ($this->ratingStruct->score < 0 || $this->ratingStruct->score > 40) {\n throw new InvalidArgumentException('Invalid score. It must be between 0.0 and 40.0.');\n }\n }",
"function was_granted()\n {\n return $this->get_decision() == self::DECISION_GRANTED;\n }",
"public function checkPermission()\n {\n $this->checkIaoModulePermission('tl_iao_credit');\n }",
"public function check_member($babID){\n if ($this->check_akses_learning_line()=='free') {\n //select statusAksesLearningLine yang babini.\n $status_akses_line = $this->Mlinetopik->get_akses_learning_line($babID);\n // kalo statusAksesLearningLine 1, forbiden akses.\n if ($status_akses_line == 1) {\n redirect(base_url().\"linetopik/member_area\");\n }\n }\n}",
"public function has_defense_break(){\n if ($this->robot_defense <= 0){ return true; }\n else { return false; }\n }",
"public function eligibility(Request $request) {\n $this->validate($request, [\n 'id' => 'required'\n ]);\n\n $customer_id = $request->input('id');\n $response = [\n 'status' => false,\n 'message' => 'You are not eligible to participate in this campaign'\n ];\n\n // Check if customer_id is eligible to participate\n try {\n $customer = Customer::find($customer_id);\n $response['total_transaction'] = count($customer->purchaseInMonth);\n $response['total_spent'] = $customer->sumPurchaseInMonth();\n\n if ($response['total_transaction'] < 3) {\n return $response;\n }\n if ($response['total_spent'] <= 100) {\n return $response;\n }\n if ($response['total_spent'] <= 100) {\n return $response;\n }\n if (Voucher::where('customer_id', $customer_id)->first()) {\n $response['message'] = \"You already have locked voucher\";\n return $response;\n }\n\n // Lock the voucher\n $voucher = Voucher::where([['customer_id', null], ['locked_at', null], ['expired_at', null]])->first();\n $voucher->customer_id = $customer_id;\n $voucher->locked_at = Carbon::now()->toDateTimeString();\n $voucher->expired_at = Carbon::now()->addMinute(10)->toDateTimeString();\n $voucher->save();\n\n $response['status'] = true;\n $response['message'] = \"The voucher has been locked for you, please take a selfie with the product in 10 minutes to get the voucher code\";\n return $response;\n } catch (Throwable $e) { \n $response['message'] = \"Customer not found\";\n return $response;\n }\n }",
"private function checkForLose()\n {\n if ($this->scoreBoard->getRemainingLives() == 0) {\n return true;\n }\n return false;\n }",
"public function checkForLose()\n {\n return $this->lives < 1;\n }",
"function match_aceptar_validate($form, &$form_state) {\n global $user;\n $node = node_load(array('nid' => arg(1)));\n $away_team = node_load(array('nid' => $node->nid_Equipo_Visitante));\n \n //Revisa que el estado del desafio tenga el estado de creado y manda error en caso contrario\n if ($node->Estado != CREADO)\n\tform_set_error($form, 'El desafio no admite esta operacion');\n\t\n //Revisa que el usuario ejecutando la acción sea capitán del equipo retado\n if (!team_user_is_team_capitan($user->uid, $away_team->nid))\n\t form_set_error($form, 'Solo el capitan del equipo '. $away_team->title .' puede aceptar este reto');\n \n}",
"function check_akses_learning_line(){\n $session = $this->utilities_library->get_session();\n if ($session['member']==1) {\n return 'member';\n }else{\n return 'free';\n }\n}",
"function checkRent($rent){\n if($rent >= 0){\n return TRUE;\n }\n else return FALSE;\n }",
"public function isGranted(): bool;",
"public function is_essential();",
"public function testEvaluationNotComplete()\n {\n $placementTestService = new LevelAssessmentService();\n\n $result = $placementTestService->calculateLevel($this->exercisesDataProviderSet1());\n\n $this->assertFalse($result);\n }",
"private function checkIfUserCanVote() {\n $wrapper = entity_metadata_wrapper('user', $this->account);\n $points = $wrapper->field_reputation->value();\n\n if (!$this->account->uid) {\n throw new \\RestfulBadRequestException(\"Anonymous users can't vote. Please login.\");\n }\n\n if (user_access('can bypass vote limitation', $this->account)) {\n // This user can by pass the voting limitation.\n return;\n }\n\n if ($this->type == 'down' && variable_get('drupalhub_min_points_downvote', 20) >= $points) {\n // User under 20 points cannot vote against something.\n throw new \\RestfulBadRequestException(\"You need at lest 20 points for down voting.\");\n }\n\n if ($this->type == 'up' && variable_get('drupalhub_max_points_upvote', 5) >= $points) {\n // User with less than 5 points cannot vote for a question.\n throw new \\RestfulBadRequestException(\"You need at lest 5 points for up voting.\");\n }\n }",
"public function subtractPoints(): bool\n {\n // TODO: Subtract points from the user here, return true if the result is correct.\n $this->account;\n $this->price;\n return true;\n }"
] | [
"0.62173206",
"0.6128473",
"0.6121974",
"0.60778636",
"0.60735893",
"0.5953255",
"0.5914065",
"0.5815383",
"0.5786132",
"0.57201445",
"0.56630725",
"0.5640921",
"0.5623153",
"0.5600849",
"0.5591878",
"0.5504016",
"0.54956",
"0.548984",
"0.54839885",
"0.54749817",
"0.5462596",
"0.54424375",
"0.54089546",
"0.5406373",
"0.5404553",
"0.5397204",
"0.5391869",
"0.53860754",
"0.53789526",
"0.537553"
] | 0.61895937 | 1 |
insert reward claim request | public function insert_claimrequest($insert)
{
$this->db->where('uniq', $insert['uniq']);
$query = $this->db->get('claim_reward');
if ($query->num_rows() > 0) {
$this->db->where('uniq', $insert['uniq']);
return $this->db->update('claim_reward', $insert);
} else {
return $this->db->insert('claim_reward', $insert);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _recordAcctgTransaction($reward)\n {\n $this->_accounting_service->allocateDRBonus($reward->product_id, $reward->drpv);\n }",
"public function reward($rewardObject);",
"public function addClaim($claim);",
"public function newCampaignReward($post){\n\t\t$account_id = $this->account_id;\n\t\t$api_key = $this->api_key;\n\t\t$user_id = $this->user_id;\n\t\t\n\t\tif(empty($post['campaign_id'])){\n \t\tthrow new Exception('campaign_id field is Required');\n\t } elseif(empty($post['reward_level'])){\n \t\tthrow new Exception('reward_level field is Required');\n\t } elseif(empty($post['reward_description'])){\n \t\tthrow new Exception('reward_description field is Required');\n\t }\t\n\t\t\n\t\t$fields = array(\n\t\t\t'user_id'\t\t\t=> $user_id,\n\t\t\t'user_password'\t\t=> $api_key,\n\t\t\t'account_id'\t\t=> $account_id,\n\t\t\t'action'\t\t\t=> 'reward',\n\t\t\t'type'\t\t\t\t=> 'campaign_new',\n\t\t\t'campaign_id'\t\t=> $post['campaign_id'],\n\t\t\t'reward_level'\t\t=> $post['reward_level'],\n\t\t\t'reward_description'=> $post['reward_description']\n\t\t);\n\t\tif(!empty($post['reward_identifier'])) $fields['reward_identifier'] = $post['reward_identifier'];\n\t\treturn $this->sendData($fields);\n\t}",
"public function reward(int $item): void\n {\n // TODO: Make a prize here, e.g. put data in MySQL\n }",
"public function approve_rewards($resn = '')\n {\n $ap_password = $this->input->post('ap_password');\n $approve = $this->input->post('approve');\n $claimid = $this->input->post('claimid');\n $noti_to = $this->input->post('noti_to');\n $smart_code = $this->input->post('smart_code');\n $Date = date(\"Y-m-d\");\n\n if ($this->checkpsw_check($ap_password)) {\n $change = array('claim_status' => $approve, 'coupon_code' => $smart_code,'validated_on' => date(\"Y-m-d h:i:s\"));\n $output = $this->reward_model->claim_change($change,$claimid);\n $notification = array(\n 'notification_subject' => 'Claim reward point success',\n 'notification_description' => 'your request for claim reward point is succesfull.',\n 'added_by' => $this->session->userdata('unique_id'),\n 'thing_id' => $claimid,\n 'notification_type' => '2',\n 'uniq' => random_string('alnum', 10),\n 'noti_to' => $noti_to,\n 'added_by_type' => 'admin',\n 'noti_to_type' => 'agent',\n );\n if ($output != '') {\n $this->insert_notification($notification);\n $this->session->set_flashdata('success', 'Claim Reward Point request has been Approved Successfully');\n }\n\n echo $output;\n } else {\n echo \"wrong password\";\n }\n }",
"function add_requisition($point_of_use, $narrative, $details)\n{\n\t$sql = \"INSERT INTO \".TB_PREF.\"requisitions (point_of_use, narrative, details) VALUES (\".\n\t\tdb_escape($point_of_use).\",\".db_escape($narrative).\",\".db_escape($details).\")\";\n\n\tdb_query($sql, \"could not add requisitions\");\n}",
"public function submitMyGameClaim2 ( $post ) {\n \t$gameId = $post['gameId'];\n \t$playerId = $post['playerId'];\n \t$mnt =\" player 2 has submitted his claim\";\n \t$claimNow = $post['claimNow'];\n \techo $gameId.\"\".$playerId;\n \t$sql = new MYSQL;\n \t$query = $sql->update(' game g , gaming_player2 gp2 ');\n \t$query .= $sql->set(\" g.player_2_result ='\". $claimNow .\"', gp2.player_result ='\". $claimNow .\"' \");\n \t$query .= $sql->where( 'g.id='. $gameId);\n \t$rows = DBASE::mysqlUpdate($query);\n \t\n \t//update alert\n \t$sql = new MYSQL;\n \t$query = $sql->insert(' gaming_alerts ');\n \t$query .= $sql->columns(' usr_id, date_created, description, alert_type, read_status ' );\n \t$query .= $sql->values( \" '\".$playerId.\"', '\".date(\"Y-m-d H:i:s\").\"', '\".$mnt.\"', 'Claim Prize', '0'\");\n \t$rows = DBASE::mysqlUpdate($query);\n \t\n \techo '<script>self.location=\"index.php?acc=gamesactive\"</script>';\n }",
"static public function addRewardUser()\n {\n register_rest_route(self::ROUTE_NAME, '/addrewarduser', [\n 'methods' => 'POST',\n 'callback' => function (WP_REST_Request $request) {\n $current_user = wp_get_current_user();\n $userid = $current_user->data->ID;\n $rewardid = $request->get_param(\"rewardid\");\n\n if ($userid === null || $rewardid === null) {\n return new WP_Error('400', 'error');\n } else {\n Database::addRewardByUser($userid, $rewardid);\n $response = new WP_REST_Response('reward added');\n return $response;\n }\n }\n ]);\n }",
"public function approveRequest_post(){\n\t\t$this->db->trans_begin();\n\t\ttry {\n\t\t\t\n\t\t\t// code here\n\t\t\t\n\t\t}catch(Exception $e){\n\t\t\t$this->db->trans_rollback();\n\t\t\t$this->response(array(\n\t\t\t\t'status' => 'FALSE',\n\t\t\t\t'message' => $e->getMessage(),\n\t\t\t));\n\t\t}\n\t}",
"public function store(RewardAdminRequest $request)\n {\n try {\n $attributes = $request->all();\n $reward = $this->model->create($attributes);\n return $this->success(trans('messages.success.created', ['Module' => trans('reward::reward.name')]));\n } catch (Exception $e) {\n return $this->error($e->getMessage());\n }\n }",
"public function create (Request $request)\r\n {\r\n\r\n //extract 20% retainment\r\n \r\n\r\n\r\n //Cond 1: user cannot RS untill he clears his depth\r\n $achievedSmiles=Gsmile::where('user_id', Auth::user()->id)->get();\r\n $leftAmountArray=[];\r\n foreach ($achievedSmiles as $key => $smile) {\r\n if($smile->left_amount == 0){$status=true;}else{$status=false;}\r\n $leftAmountStatusArray[$key]=$status;\r\n }\r\n \r\n if(in_array(false, $leftAmountStatusArray)){\r\n return Redirect::to('/rsmile/create')->with('notification','You must fufill all previous GS requests before making an RS request')->withInput();\r\n }else{\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n //get gmsile amount plus ROI\r\n $achievedSmiles=Gsmile::where('id', $request['smileId'])->first();\r\n $investedAmount=$achievedSmiles->amount;\r\n $ROI=$achievedSmiles->growth;\r\n\r\n //cond 2 : subtract 20% recommitment and GS it\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n if(Auth::user()->is_pioneer == '1'){\r\n\r\n\r\n //if pioneer already has RS on rsmile table\r\n $alreadyRS=Rsmile::where('gsmile_id', $request['$smileId'])->first();\r\n if(!empty($alreadyRS)){\r\n //update reap status in GS table for participant\r\n Gsmile::where('id', $request['smileId'])->update(['reap_status'=>1]);\r\n //update reap status in GS table for participant\r\n return Redirect::to('/rsmile/create')->with('notification','Your RS request has been received. 20% recommitment GS on your RS has been made. Your RS request(80%) will be matched within soon.');\r\n\r\n }else{\r\n //create new rs for him\r\n $recommitmentAmount=floor((20/100)*($investedAmount*2));\r\n\r\n $leftAmountAfterRecommitment=floor(($investedAmount) - $recommitmentAmount); //80%\r\n\r\n //GS 20% recommitment \r\n $createSmile=new Gsmile;\r\n $createSmile->user_id=Auth::user()->id;\r\n $createSmile->left_amount=$recommitmentAmount; //initializing left_amount\r\n $createSmile->amount=$recommitmentAmount;\r\n $createSmile->remember_token=$request->_token;\r\n $track_token=mt_rand(10000, 1000000);\r\n $createSmile->track_token=$track_token;\r\n $createSmile->save();\r\n //GS 20% recommitment\r\n\r\n\r\n //RS 80% left\r\n $rsmile=new rsmile;\r\n $rsmile->user_id=Auth::user()->id;\r\n $rsmile->gsmile_id=$request->smileId;\r\n $rsmile->amount=$leftAmountAfterRecommitment;\r\n $rsmile->left_amount=$leftAmountAfterRecommitment;\r\n $rsmile->remember_token= $request->_token;\r\n $rsmile->save();\r\n\r\n //update reap status in GS table for participant\r\n Gsmile::where('id', $request['smileId'])->update(['reap_status'=>1]);\r\n //update reap status in GS table for participant\r\n \r\n return Redirect::to('/rsmile/create')->with('notification','Your RS request has been received. 20% recommitment GS on your RS has been made. Your RS request(80%) will be matched within soon.');\r\n }\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n }else{\r\n\r\n //for ordinary user\r\n $alreadyRS=Rsmile::where('gsmile_id', $request['$smileId'])->first();\r\n\r\n if(empty($already)){\r\n\r\n $recommitmentAmount=floor((20/100)*($investedAmount*2));\r\n\r\n $leftAmountAfterRecommitment=floor(($investedAmount) - $recommitmentAmount); //80%\r\n }else{\r\n //user has already RS : notification\r\n return Redirect::to('/rsmile/create')->with('notification','Already requested smile.')->withInput();\r\n }\r\n \r\n\r\n\r\n\r\n //GS 20% recommitment \r\n $createSmile=new Gsmile;\r\n $createSmile->user_id=Auth::user()->id;\r\n $createSmile->left_amount=$recommitmentAmount; //initializing left_amount\r\n $createSmile->amount=$recommitmentAmount;\r\n $createSmile->remember_token=$request->_token;\r\n $track_token=mt_rand(10000, 1000000);\r\n $createSmile->track_token=$track_token;\r\n $createSmile->save();\r\n //GS 20% recommitment\r\n\r\n\r\n //RS 80% left\r\n $rsmile=new rsmile;\r\n $rsmile->user_id=Auth::user()->id;\r\n $rsmile->gsmile_id=$request->smileId;\r\n $rsmile->amount=$leftAmountAfterRecommitment;\r\n $rsmile->left_amount=$leftAmountAfterRecommitment;\r\n $rsmile->remember_token= $request->_token;\r\n $rsmile->save();\r\n\r\n //update reap status in GS table for participant\r\n Gsmile::where('id', $request['smileId'])->update(['reap_status'=>1]);\r\n //update reap status in GS table for participant\r\n \r\n return Redirect::to('/rsmile/create')->with('notification','Your RS request has been received. 20% recommitment GS on your RS has been made. Your RS request(80%) will be matched within soon.');\r\n\r\n\r\n \r\n }\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n }\r\n\r\n }",
"public function addAction()\n {\n $price = $this->apiRequest->getPrice();\n if (!is_numeric($price)) {\n $price = 0.0;\n }\n\n $qty = $this->apiRequest->getQty();\n if (!is_numeric($qty)) {\n $qty = 1;\n }\n\n $redemptionId = intval($this->apiRequest->getRedemptionId());\n $pointsUsed = intval($this->apiRequest->getPointsUsed());\n\n // TODO: implement parameter validation\n $quote = Mage::getSingleton('swell/quote');\n $quote = $quote->add(\n $this->apiRequest->getSharedSecret(),\n $this->apiRequest->getQuoteId(),\n $this->apiRequest->getSku(),\n $price,\n $qty,\n $redemptionId,\n $pointsUsed\n );\n\n $this->sendResponse($quote);\n }",
"public function store(Request $request)\n {\n if (! Gate::allows('amc_manage')) {\n return abort(401);\n }\n\n $member_id = $request->input('member_id');\n $name = $request->input('name');\n $email = $request->input('email');\n $mobile = $request->input('mobile');\n $amount = $request->input('amount');\n $dsa_assigned = $request->input('dsa_assigned');\n $txnID = $request->input('txnID');\n $save = substr($txnID, 0,6);\n $word = $save.rand(000000000,999999999);\n $amcDate =$request->input('amcDate'); \n\n $data=Amc::create([\n 'member_id' => $member_id,\n 'name' => $name,\n 'email' => $email,\n 'mobile' => $mobile,\n 'amount' => $amount,\n 'dsa_assigned' => $dsa_assigned,\n 'txnID' => $word,\n 'amcDate' => $amcDate,\n ]);\n return redirect()->route('amc.index'); \n\n /*$data = DB::Insert(\"INSERT INTO `amcs`(`member_id`, `name`, `email`, `mobile`, `amount`, `dsa_assigned`, `txnID`, `amcDate`) VALUES ('$member_id','$name', '$email', '$mobile', '$amount', '$dsa_assigned','$word', '$amcDate'); \");*/\n \n \n // return $this->paymentReceipt($word);\n }",
"public function insert($cardSkill);",
"function add_advance() {\n //print_r($_POST);\n $booking_id = $_POST['booking_id'];\n $amount_op = $_POST['amount_op'];\n $session_data = $this->session->userdata('logged_in');\n $session_data['username'];\n \n \n $this->db->query(\"UPDATE booking SET security_money = security_money + '$amount_op' WHERE booking_id = $booking_id\");\n if ($this->db->affected_rows() >= 0) {\n $this->db->query(\"update setting_account set amount = amount + $amount_op WHERE (`attribute`= 'cash_in_hand')\");\n $data = array(\n 'tenant_id' => $_POST['tenant_id'],\n 'amount' => $amount_op,\n 'pay_date' => date('d-m-Y'),\n 'recived_by_id'=> $session_data['id'],\n 'type' => 'cash',\n 'note' => 'New Advance amount Added.',\n );\n $this->db->insert('tenant_invoice', $data);\n echo $this->db->insert_id();\n //echo \"Advanced Add Successfully\";\n } else {\n echo \"Sorry Advanced Cannot Add\";\n }\n }",
"public function placeRequestToReviewer()\n {\n }",
"public function store(StoreRecruitRewardRequest $request)\n {\n AchievementReward::create($request->input('data.RecruitReward'));\n return redirect()->route('recruit_reward.index')->with('status', '作成しました!');\n }",
"public function updateCampaignReward($post){\n\t\t$account_id = $this->account_id;\n\t\t$api_key = $this->api_key;\n\t\t$user_id = $this->user_id;\n\t\t\n\t\tif(empty($post['campaign_id'])){\n \t\tthrow new Exception('campaign_id field is Required');\n\t } elseif(empty($post['reward_id'])){\n \t\tthrow new Exception('reward_id field is Required');\n\t }\n\t\t\n\t\t$fields = array(\n\t\t\t'user_id'\t\t\t=> $user_id,\n\t\t\t'user_password'\t\t=> $api_key,\n\t\t\t'account_id'\t\t=> $account_id,\n\t\t\t'action'\t\t\t=> 'reward',\n\t\t\t'type'\t\t\t\t=> 'campaign_update',\n\t\t\t'campaign_id'\t\t=> $post['campaign_id'],\n\t\t\t'reward_id'\t\t\t=> $post['reward_id']\n\t\t);\n\t\tif(!empty($post['new_reward_level'])) $fields['new_reward_level'] = $post['new_reward_level'];\n\t\tif(!empty($post['new_reward_description'])) $fields['new_reward_description'] = $post['new_reward_description'];\n\t\tif(!empty($post['new_reward_identifier'])) $fields['new_reward_identifier'] = $post['new_reward_identifier'];\n\t\treturn $this->sendData($fields);\n\t}",
"function add_request($sender_id, $receiver_id, $demand, $offer, $msg, $demand_value, $offer_value) {\r\n\t\t//get the current date from server\r\n\t\t$cur_date = date('Y-m-d H:i:s');\r\n\t\t\r\n\t\t$data = array(\r\n\t\t\t'sender_id' => $sender_id,\r\n\t\t\t'receiver_id' => $receiver_id,\r\n\t\t\t'request_demand' => $demand,\r\n\t\t\t'request_offer' => $offer,\r\n\t\t\t'message' => $msg,\r\n\t\t\t'status' => 1, // should be the value of the active state\r\n\t\t\t'request_date' => $cur_date,\r\n\t\t\t'demand_value' => $demand_value,\r\n\t\t\t'offer_value' => $offer_value\r\n\t\t);\r\n\t\t$this->db->insert('request', $data);\r\n\t\treturn $this->db->affected_rows();\r\n\t}",
"public function addReward(\\RO\\Cmd\\AERewardInfo $value){\n return $this->_add(5, $value);\n }",
"public function testShouldCreateDailyRewards()\n {\n $parameters = [\n 'starting_value' => 20000,\n ];\n $this->post('daily-rewards/add', $parameters, []);\n $this->seeStatusCode(200);\n $this->seeJson(\n [\n 'starting_value' => 20000,\n 'current_value' => 20000\n ]\n );\n }",
"public function store(Request $request)\n {\n $this->validate($request,[\n 'brand_id_for_debit' => 'required|integer|max:1000',\n 'claimable_amount' => 'required|numeric',\n 'debit_received' => 'required|numeric',\n 'remaining_claim' => 'required|numeric',\n ]);\n\n $data = $request->all();\n $data[\"brand_id\"] = $data[\"brand_id_for_debit\"];\n\n try\n {\n DebitClaim::create($data);\n\n $damage = AccBrandTotal::where('brand_id','=',$data['brand_id'])->firstOrFail();\n $damage_data[\"total_claim_amount\"] = $damage[\"total_claim_amount\"] - $data[\"debit_received\"];\n $damage->update($damage_data);\n\n DB::commit();\n Session::flash('success_message', 'Debit Successfully Claimed');\n }\n catch(\\Exception $ex)\n {\n DB::rollback();\n Session::flash('error_message', $ex->getMessage());\n }\n\n return redirect()->back();\n }",
"public function store(Request $request)\n {\n try{\n $user = Auth::user();\n if ($user->role != 'Administrador'){\n return response()->json(['Message' => 'Unauthorized'], 401);\n }\n else\n {\n $req = Req::where('id',$request->id_req)->get();\n Log::channel('stdout')->info($req[0]->id_aid);\n $aid = Aid::where('id',$req[0]->id_aid)->get();\n if ($aid[0]->unit <= $request->unit){\n return response()->json([\n 'Error' => 'La Cantidad Asignada Excede al Disponible'], 400);\n }\n }\n $resp = new Resp();\n $resp->approved = $request->approved;\n $resp->unit = $request->unit;\n $resp->id_req = $request->id_req;\n $resp->created_at = date('Y-m-d');\n $resp->save();\n if ($request->approved == true){\n $aid[0]->unit = $aid[0]->unit - $request->unit;\n $aid[0]->save();\n }\n } catch (Exception $e)\n {\n return response()->json([\n 'Error' => 'Error al Registrar Respuesta a Solicitud'], 400);\n }\n return $resp->id;\n }",
"public function store(Request $request)\n {\n // dd($request);\n $request->validate([\n 'user_id' => 'required',\n 'cach' => 'required',\n 'Date' => 'required',\n 'typeofreward' => 'required',\n \n ]);\n \n \n $bonus = Bonus::create($request->all());\n $x=0;\n $user=User::find($request->user_id);\n \n if($user->hasRole('Doctor')){\n $x=1;\n }else{\n $x=0;\n }\n \n \n session()->flash('success',__('site.added_successfully'));\n if($x==1){\n return redirect()->route('users.doctors.index');\n }\n return redirect()->route('users.employees.index');\n\n\n }",
"public function addRewardPoints($runningServiceId,$points,$rewardId,$period){\n try {\n $pCriteria = new \\stdClass();\n $pCriteria->runningServiceId = $runningServiceId;\n $pCriteria->points = $points;\n $pCriteria->rewardId = $rewardId;\n\t\t\t$pCriteria->period=$period;\n $result=$this->client->addRewardPoints($pCriteria);\n return $result;\n }\n catch(Exception $fault){\n echo $fault;\n echo \"ERROR IN WS addRewardPoints()\";\n }\n }",
"public function store_mom(Request $request)\n {\n\n $requestData = $request->all();\n $requestData['beneficiaries'] = isset($requestData['beneficiaries'])?json_decode($requestData['beneficiaries'],true):'';\n $request->replace($requestData);\n\n $request->validate([\n 'id_card' => 'required|image',\n 'firstname'=>'required',\n 'surname'=>'required',\n 'civil_status'=>'required|in:Single,Married,Widowed,Separated',\n 'contact_no'=>'required',\n 'address'=>'required',\n 'email'=>'required|email',\n 'birth_date'=>'required|date',\n 'beneficiaries' => 'required|array|min:1',\n 'beneficiaries.*.first_name' => 'required|distinct',\n 'beneficiaries.*.last_name' => 'required',\n 'beneficiaries.*.relation' => 'required',\n 'ob_gyne'=>'required',\n 'ob_email'=>'required|email',\n ]);\n\n try{\n\n $assured = new Assured($request->all());\n $assured->user_id = auth('api')->user()->id;\n $assured->agent_id = auth('api')->user()->id;\n $assured->entity_id = auth('api')->user()->entity_id;\n $assured->gender = \"Female\";\n $assured->policy_type_id = 4;\n $assured->policy_no = $this->new_policy_number(4);\n $assured->age = floor((time() - strtotime($request->birth_date)) / 31556926);\n\n if($assured->age<= 19 || $assured->age >= 46){\n return response([\n 'message'=>'The given data was invalid.',\n 'errors'=>[\n 'birth_date'=> [\"Ages 19 below and 46 above is not allowed\"]\n ]]);\n }else{\n if($assured->age >= 20 & $assured->age <= 29) {\n $assured->net_premium = 1400;\n $assured->premium = 1788;\n $assured->vat = 168;\n $assured->dst = 175;\n $assured->lgt = 7;\n $assured->misc = 38;\n }else if($age >= 30 & $age <= 39){\n $assured->net_premium = 1600;\n $assured->premium = 2088;\n $assured->vat = 192;\n $assured->dst = 200;\n $assured->lgt = 8;\n $assured->misc = 88;\n }else if($age >= 40 & $age <= 45){\n $assured->net_premium = 1800;\n $assured->premium = 2288;\n $assured->vat = 216;\n $assured->dst = 225;\n $assured->lgt = 9;\n $assured->misc = 38;\n }\n }\n\n //Save id card image\n if($request->hasfile('id_card')) {\n $file = $request->file('id_card');\n //$extension = $file->getClientOriginalExtension();\n $filename = time().'_'.$file->getClientOriginalName();\n $file->move('uploads/id_card/', $filename);\n $assured->id_card = 'uploads/id_card/' . $filename;\n }\n\n if($assured->save()){\n\n //Saving Beneficiaries\n if(count($request->beneficiaries)>0){\n $assured->beneficiaries()->createMany($request->beneficiaries);\n }\n\n return response([\n 'message'=>'Record saved.',\n 'data'=>[\n 'policy_no'=> $assured['policy_no']\n ],\n ]);\n }\n\n \n }\n catch(\\Exception $e){\n return $e->getMessage();\n }\n \n }",
"public function store(Request $request)\n {\n\n\n Auth::user()->claims()->create($request->all());\n\n Session::flash('create-message', 'Claim was sent');\n\n\n return redirect()->route('home');\n\n\n\n\n\n }",
"function agent_post()\n { \n $agent = new agent();\n\n $agent->date_created = date('Y-m-d H:i:s');\n $agent->createdbypk = $this->get_user()->user_id;\n $agent->date_modified = date('Y-m-d H:i:s');\n $agent->modifiedbypk = $this->get_user()->user_id;\n $agent->hash = md5(microtime() . uniqid() . date('Y-m-d H:i:s'));\n\n $this->response($this->_agent_save($agent, 'post'));\n }",
"public function store_payassured(Request $request)\n {\n\n $requestData = $request->all();\n $requestData['beneficiaries'] = isset($requestData['beneficiaries'])?json_decode($requestData['beneficiaries'],true):'';\n $request->replace($requestData);\n\n $request->validate([\n 'id_card' => 'required|image',\n 'firstname'=>'required',\n 'surname'=>'required',\n 'civil_status'=>'required|in:Single,Married,Widowed,Separated',\n 'contact_no'=>'required',\n 'address'=>'required',\n 'gender'=>'required|in:Male,Female',\n 'email'=>'required|email',\n 'birth_date'=>'required|date',\n 'beneficiaries' => 'required|array|min:1',\n 'beneficiaries.*.first_name' => 'required|distinct',\n 'beneficiaries.*.last_name' => 'required',\n 'beneficiaries.*.relation' => 'required',\n 'employer'=>'required',\n 'employer_email'=>'required|email',\n 'ape'=>'integer',\n ]);\n\n try{\n\n $assured = new Assured($request->all());\n $assured->user_id = auth('api')->user()->id;\n $assured->agent_id = auth('api')->user()->id;\n $assured->entity_id = auth('api')->user()->entity_id;\n $assured->policy_type_id = 1;\n $assured->policy_no = $this->new_policy_number(1);\n $assured->age = floor((time() - strtotime($request->birth_date)) / 31556926);\n\n if(!$request->ape){\n $assured->premium = 1000;\n $assured->net_premium = 800;\n $assured->med_exp = 0;\n }else{//Payassured plus\n $assured->premium = 2000;\n $assured->net_premium = 1200;\n $assured->med_exp = 500;\n }\n \n $assured->lgt = $assured->net_premium * .005; \n $assured->vat = $assured->net_premium * .12; \n $assured->dst = $assured->net_premium * .125;\n $assured->misc = $assured->premium - ($assured->net_premium + $assured->dst + $assured->vat + $assured->lgt + $assured->med_exp);\n\n //Save id card image\n if($request->hasfile('id_card')) {\n $file = $request->file('id_card');\n //$extension = $file->getClientOriginalExtension();\n $filename = time().'_'.$file->getClientOriginalName();\n $file->move('uploads/id_card/', $filename);\n $assured->id_card = 'uploads/id_card/' . $filename;\n }\n\n if($assured->save()){\n\n //Saving Beneficiaries\n if(count($request->beneficiaries)>0){\n $assured->beneficiaries()->createMany($request->beneficiaries);\n }\n\n return response([\n 'message'=>'Record saved.',\n 'data'=>[\n 'policy_no'=> $assured['policy_no']\n ],\n ]);\n }\n\n \n }\n catch(\\Exception $e){\n return $e->getMessage();\n }\n \n }"
] | [
"0.63825554",
"0.60036",
"0.5870595",
"0.57718486",
"0.56879985",
"0.5655063",
"0.5637849",
"0.5621223",
"0.55705374",
"0.5555332",
"0.55051047",
"0.5486451",
"0.5478065",
"0.54575235",
"0.5401073",
"0.5372586",
"0.5340881",
"0.5328934",
"0.5325966",
"0.5277438",
"0.52661246",
"0.5233313",
"0.52175504",
"0.52061164",
"0.52037567",
"0.51873577",
"0.5184987",
"0.5173408",
"0.5154233",
"0.51437783"
] | 0.6628334 | 0 |
Updates the "installed" file with the new version. | public function updateVersionFile()
{
Storage::disk('general')->put('installed', config('app.version'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function installed() {\r\n include(BASE_PATH.'installer/installed.php');\r\n }",
"public static function Install() \n\t{ \n\t\tself::setInstalled(true); \n\t}",
"protected function writeVersion()\n {\n file_put_contents($this->getVersionFile(), self::VERSION, LOCK_EX);\n }",
"function update_config_installed()\r\n{\r\n $CI =& get_instance();\r\n $config_path = APPPATH . 'config/config.php';\r\n $CI->load->helper('file');\r\n\r\n @chmod($config_path, FILE_WRITE_MODE);\r\n $config_file = read_file($config_path);\r\n $config_file = trim($config_file);\r\n $config_file = str_replace(\"\\$config['installed'] = false;\", \"\\$config['installed'] = true;\", $config_file);\r\n $config_file = str_replace(\"\\$config['base_url'] = '';\", \"\\$config['base_url'] = '\".site_url().\"';\", $config_file);\r\n\r\n if (!$fp = fopen($config_path, FOPEN_WRITE_CREATE_DESTRUCTIVE)) {\r\n return FALSE;\r\n }\r\n\r\n flock($fp, LOCK_EX);\r\n fwrite($fp, $config_file, strlen($config_file));\r\n flock($fp, LOCK_UN);\r\n fclose($fp);\r\n\r\n @chmod($config_path, FILE_READ_MODE);\r\n return TRUE;\r\n}",
"function do_fresh_install() {\n\n\t// Remove the 1.x option.\n\tdelete_option( 'sc_version' );\n\n\t// Mark all upgrades as complete so they are not asked for again.\n\tupgrade_complete( array(\n\t\t'20_fresh',\n\t\t'20_migration',\n\t\t'206_migration'\n\t) );\n}",
"public function install () {\n\t\t$this->_log_version_number();\n\t}",
"protected function updateUpdatingFile() {\n }",
"public function install() {\n\t\t$this->_log_version_number();\n\t}",
"public function install() {\n\t\t$this->_log_version_number();\n\t}",
"public function install() {\n\t\t$this->_log_version_number();\n\t}",
"public function setAsInstalled()\n {\n $this->registerStep(self::MODULE_INSTALLED);\n $this->setSetupCheckWidget(self::SETUP_CHECK_WIDGET_INSTALLATION_DATE, time());\n }",
"private function readAndLatestVersionInfo()\n {\n $vcs = new VersionCheckService();\n if ($version = $vcs->getLatestVersion()) { // Only update the cache file if we was able to contact the version checker service!\n file_put_contents($this->basePath . '/storage/version.cache', $vcs->getLatestVersion());\n }\n }",
"function setInstalledAs($file, $path)\n {\n if ($path) {\n return $this->_packageInfo['filelist'][$file]['installed_as'] = $path;\n }\n unset($this->_packageInfo['filelist'][$file]['installed_as']);\n }",
"public function install() {\n $this->_log_version_number();\n }",
"function update_config_installed()\r\r\n{\r\r\n $CI =& get_instance();\r\r\n $config_path = APPPATH . 'config/config.php';\r\r\n $CI->load->helper('file');\r\r\n @chmod($config_path, FILE_WRITE_MODE);\r\r\n $config_file = read_file($config_path);\r\r\n $config_file = trim($config_file);\r\r\n $prefix = \"http://\";\r\r\n if (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {\r\r\n $prefix = 'https://';\r\r\n }\r\r\n $base_url = $prefix . $_SERVER['HTTP_HOST'];\r\r\n $base_url .= preg_replace('@/+$@', '', dirname($_SERVER['SCRIPT_NAME'])) . '/';\r\r\n $config_file = str_replace(\"\\$config['installed'] = false;\", \"\\$config['installed'] = true;\", $config_file);\r\r\n $config_file = str_replace(\"\\$config['base_url'] = '';\", \"\\$config['base_url'] = '\" . $base_url . \"';\", $config_file);\r\r\n if (!$fp = fopen($config_path, FOPEN_WRITE_CREATE_DESTRUCTIVE)) {\r\r\n return FALSE;\r\r\n }\r\r\n flock($fp, LOCK_EX);\r\r\n fwrite($fp, $config_file, strlen($config_file));\r\r\n flock($fp, LOCK_UN);\r\r\n fclose($fp);\r\r\n @chmod($config_path, FILE_READ_MODE);\r\r\n return TRUE;\r\r\n}",
"public function update() {\n\t\t\t$version = get_option( 'pk_sak_version' );\n\t\t\tif ($version <> self::VERSION) {\n\t\t\t\tupdate_option( 'pk_sak_version', self::VERSION );\n\t\t\t}\n\t\t}",
"public function install()\n {\n $this->_log_version_number();\n }",
"public function update() {\n //Check for latest version\n if ((is_null($this->latestVersion)) or (is_null($this->latestUpdate))) {\n $this->checkUpdate();\n }\n\n if ((is_null($this->latestVersion)) or (is_null($this->latestUpdate))) {\n return false;\n }\n\n //Update\n if ($this->latestVersion > $this->currentVersion) {\n $this->log('Updating...');\n\n //Add slash at the end of the path\n if ($this->tempDir[strlen($this->tempDir)-1] != DS);\n $this->tempDir = $this->tempDir.DS;\n\n if ((@!is_dir($this->tempDir)) and (!mkdir($this->tempDir, DIR_WRITE_MODE, true))) {\n $this->log('Temporary directory `'.$this->tempDir.'` does not exist and could not be created!');\n return false;\n }\n\n if (!is_writable($this->tempDir)) {\n $this->log('Temporary directory `'.$this->tempDir.'` is not writeable!');\n return false;\n }\n\n //$updateFile = $this->tempDir.'/'.$this->latestVersion.'.zip';\n $updateFile = $this->tempDir.$this->latestVersion.'.zip';\n\n if( $this->latestUpdate != null ) {\n $updateUrl = $this->latestUpdate;\n } else {\n $updateUrl = $this->updateUrl.'/'.$this->latestVersion.'.zip';\n }\n\n //Download update\n if (!is_file($updateFile)) {\n if (!$this->downloadUpdate($updateUrl, $updateFile)) {\n $this->log('Failed to download update!');\n return false;\n }\n\n $this->log('Latest update downloaded to `'.$updateFile.'`.');\n }\n else {\n $this->log('Latest update already downloaded to `'.$updateFile.'`.');\n }\n\n //Unzip\n return $this->install($updateFile);\n }\n else {\n $this->log('No update available!');\n return false;\n }\n }",
"public function add_version() {\n if ( ! get_option( '_my_github_installed' ) ) {\n update_option( '_my_github_installed', time() );\n }\n update_option( '_my_github_version', MY_GITHUB_VERSION );\n }",
"public static function update()\r\n {\r\n if (!self::$_instance) {\r\n self::_loadFiles();\r\n\r\n self::$_instance = new Rootd_Installer();\r\n \r\n self::$_instance\r\n ->addStep('Rootd_Installer_Update_Step1')\r\n ->addStep('Rootd_Installer_Update_Step2');\r\n\r\n self::$_instance->route();\r\n }\r\n }",
"function sync(){\n\t\t$todo = $this->getTODO();\n\t\t$installed = false;\n\t\t\n\t\tforeach ($todo as $class => $_){\n\t\t\tlist($iver, $cver)=$_;\n\t\t\t$history = $this->getHystory($class);\n\t\t\tif ($history){\n\t\t\t\t$history->migrate($iver, $cver);\n\t\t\t}\n\t\t\t$this->installed[$class]=$cver;\n\t\t\t$this->saveInstalled();\n\t\t}\n\t}",
"function install(){\r\n $options = $this->get_options();\r\n if(!$options['version'] || version_compare($options['version'],$this->version,'<')){\r\n // make any changes to this new versions options if needed and update\r\n $options['version'] = $this->version;\r\n update_option($this->db_option,$options);\r\n }\r\n }",
"public function onInstall() {\n }",
"public function refresh_installation_data() {\n\n\t\t// bail if not connected\n\t\tif ( ! $this->is_connected() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// only refresh once a day\n\t\tif ( get_transient( 'wc_facebook_connection_refresh' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\n\t\t\t$this->update_installation_data();\n\n\t\t} catch ( SV_WC_API_Exception $exception ) {\n\n\t\t\tif ( $this->get_plugin()->get_integration()->is_debug_mode_enabled() ) {\n\t\t\t\t$this->get_plugin()->log( 'Could not refresh installation data. ' . $exception->getMessage() );\n\t\t\t}\n\t\t}\n\n\t\tset_transient( 'wc_facebook_connection_refresh', time(), DAY_IN_SECONDS );\n\t}",
"public function ensure_version() {\n $installed_version = $this->options['version'];\n if ($installed_version !== $this->version) {\n $this->_update_database();\n }\n }",
"public function update()\n\t{\n\t\t// Set the overwrite setting\n\t\t$this->parent->setOverwrite(true);\n\t\t$this->parent->setUpgrade(true);\n\n\t\t// And make sure the route is set correctly\n\t\t$this->setRoute('update');\n\n\t\t// Now jump into the install method to run the update\n\t\treturn $this->install();\n\t}",
"public function activate() \n {\n $installed = get_option(\"WD_MY_META_installed\");\n if( ! $installed ) {\n update_option('WD_MY_META_installed', time());\n }\n update_option('WD_MY_META_version', WD_MY_META_VERSION);\n }",
"abstract public function update($packagePath);",
"public function action_update_check()\n\t{\n\t \tUpdate::add( 'Silencer', 'fdb7e18c-f883-4456-a55d-b8e5c8c9ffaa', $this->info->version );\n\t}",
"public static function after_install() {\n\n\t\tif ( ! is_admin() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$already_installed = get_option( '_pum_installed' );\n\n\t\t// Exit if not in admin or the transient doesn't exist\n\t\tif ( false === $already_installed ) {\n\t\t\tdo_action( 'pum_after_install' );\n\n\t\t\tupdate_option( '_pum_installed', true );\n\t\t}\n\t}"
] | [
"0.6606721",
"0.62530965",
"0.6181962",
"0.61112374",
"0.60747343",
"0.6062693",
"0.6059532",
"0.60471743",
"0.60471743",
"0.60471743",
"0.6046071",
"0.59640753",
"0.59374005",
"0.59365696",
"0.59224385",
"0.5915114",
"0.5893286",
"0.58000165",
"0.5774172",
"0.57490706",
"0.57473594",
"0.5725661",
"0.5705988",
"0.57050043",
"0.56380427",
"0.5623344",
"0.5607307",
"0.56068045",
"0.5603188",
"0.5591768"
] | 0.8292663 | 0 |
Update the server by migrating the database and returing Artisan's output. | public function update()
{
$outputLog = new BufferedOutput;
Artisan::call('migrate', ['--force' => true], $outputLog);
/* To be determined, see InstallService */
//Artisan::call('route:cache', [], $outputLog);
//Artisan::call('view:cache', [], $outputLog);
return $outputLog->fetch();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionMigrate() {\n $this->runMigrationTool();\n }",
"public function dbUpgrade()\n\t{\n\t\t$migrate = \\Config\\Services::migrations();\n\n\t\ttry\n\t\t{\n\t\t\t$migrate->latest();\n\n\t\t\t$migration = \\Arifrh\\DynaModel\\DB::table('migrations');\n\t\t\t$status = $migration->last();\n\n\t\t\t$migrationStatus = \"<h3>Migration Status</h3>Latest version ({$status['id']}) - {$status['version']}\";\n\n\t\t\t$this->themes::render($migrationStatus);\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\t// Do something with the error here...\n\t\t}\n\t}",
"public function dbMigrate(): void {\n $this->initUliCMS();\n\n Database::setEchoQueries(true);\n\n $additionalSql = isset($_ENV['DBMIGRATOR_INITIAL_SQL_FILES']) ? StringHelper::splitAndTrim($_ENV['DBMIGRATOR_INITIAL_SQL_FILES']) : [];\n $additionalSql = array_map('trim', $additionalSql);\n\n Database::setupSchemaAndSelect(\n $_ENV['DB_DATABASE'],\n $additionalSql\n );\n }",
"public static function update_database() {\n\t\tif ( self::is_latest_version() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$version_from_db = self::get_version();\n\n\t\tif ( version_compare( $version_from_db, '1.0.0', '<' ) ) {\n\t\t\tself::migrate_to_1_0_0();\n\t\t}\n\n\t\tupdate_option( 'webmention_db_version', self::$target_version );\n\t}",
"public function migrateDatabase() {\n\t\ttry {\n\t\t\t$this->databaseMigrator->migrate();\n\t\t} catch(NotAllowedCommandException $ex) {\n\t\t\t$this->manualMigrate();\n\t\t}\n\t}",
"public function migrate()\n {\n $intTimeBegin = time();\n $this->log(\n PHP_EOL . \"\\t\" . '\"FromMySqlToPostgreSql\" - the database migration tool' .\n PHP_EOL . \"\\tCopyright 2015 Anatoly Khaytovich <[email protected]>\" .\n PHP_EOL . \"\\t-- Migration began...\" .\n ($this->isDataOnly ? PHP_EOL . \"\\t-- Only data will migrate.\" : '') .\n PHP_EOL\n );\n\n ini_set('memory_limit', '-1');\n\n /*\n * Create a database schema.\n */\n if (!$this->createSchema()) {\n $this->log('-- Script is terminated.' . PHP_EOL);\n exit;\n } else {\n $this->log('-- New schema \"' . $this->strSchema . '\" was successfully created...' . PHP_EOL);\n }\n\n if (!$this->loadStructureToMigrate()) {\n $this->log('-- Script is terminated.' . PHP_EOL);\n exit;\n } else {\n $intTablesCnt = count($this->arrTablesToMigrate);\n $this->log('-- ' . $intTablesCnt . ($intTablesCnt === 1 ? ' table ' : ' tables ') . 'detected' . PHP_EOL);\n }\n\n if (!$this->createAndPopulateTables()) {\n $this->log('-- Script is terminated.' . PHP_EOL);\n exit;\n }\n\n if (!$this->isDataOnly) {\n $this->createConstraints();\n $this->createForeignKeysAndRunVacuumFullAndAnalyze();\n $this->createViews();\n }\n\n /*\n * Remove the temporary directory.\n */\n if (!rmdir($this->strTemporaryDirectory)) {\n $this->log('-- NOTE: directory \"' . $this->strTemporaryDirectory . '\" was not removed!' . PHP_EOL);\n }\n\n $intTimeEnd = time();\n $intExecTime = $intTimeEnd - $intTimeBegin;\n $intHours = floor($intExecTime / 3600);\n $intMinutes = ($intExecTime / 60) % 60;\n $intSeconds = $intExecTime % 60;\n\n $this->log(\n $this->generateReport() . PHP_EOL\n . '-- Migration was successfully accomplished!' . PHP_EOL\n . '-- Total time: ' . ($intHours < 10 ? '0' . $intHours : $intHours)\n . ':' . ($intMinutes < 10 ? '0' . $intMinutes : $intMinutes)\n . ':' . ($intSeconds < 10 ? '0' . $intSeconds : $intSeconds)\n . ' (hours:minutes:seconds)' . PHP_EOL . PHP_EOL\n );\n\n unset($intTimeBegin, $intTimeEnd, $intExecTime, $intHours, $intMinutes, $intSeconds);\n }",
"public function migrate()\n\t{\n\t\t$this->process( $this->mysql );\n\t}",
"public function migrationUpdated()\n {\n }",
"private function forceMigrations() {\n $databaseManager = new DatabaseManager();\n $response = $databaseManager->migrateAndSeed();\n exit('DB AGGIORNATO! RIPETERE OPERAZIONE');\n }",
"public function migrate()\n {\n $fileSystem = new Filesystem;\n $classFinder = new ClassFinder;\n\n foreach($fileSystem->files(__DIR__ . \"/migrations\") as $file)\n {\n $fileSystem->requireOnce($file);\n $migrationClass = $classFinder->findClass($file);\n\n (new $migrationClass)->up();\n }\n foreach($fileSystem->files(__DIR__ . \"/seeds\") as $file)\n {\n $fileSystem->requireOnce($file);\n $migrationClass = $classFinder->findClass($file);\n\n (new $migrationClass)->run();\n }\n }",
"public function runMigrations()\n {\n Artisan::call('admin:migrate', [\n '--force' => true,\n '--no-interaction' => true,\n '--auto-drop' => true,\n ]);\n\n //Run other migrations\n Artisan::call('migrate', [\n '--no-interaction' => true,\n ]);\n }",
"public function migrate();",
"public function runDatabaseMigrations()\n {\n $this->artisan('migrate');\n\n $this->app[Kernel::class]->setArtisan(null);\n }",
"public function do_migrations() {\n\t\tglobal $wpdb;\n\n\t\t$current_migration = get_option( 'glossary_by_arteeo_current_migration' );\n\n\t\tif ( false === $current_migration ) {\n\t\t\tadd_option( 'glossary_by_arteeo_current_migration', 0 );\n\t\t\t$current_migration = 0;\n\t\t}\n\n\t\tif ( $this->migrations->get_latest_timestamp() <= $current_migration ) {\n\t\t\t// No new migrations.\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $this->migrations as $migration ) {\n\t\t\tif ( $current_migration < $migration->get_timestamp() ) {\n\t\t\t\t$migration->up( $wpdb );\n\t\t\t\t$current_migration = $migration->get_timestamp();\n\t\t\t}\n\t\t}\n\n\t\tupdate_option( 'glossary_by_arteeo_current_migration', $current_migration );\n\t}",
"public function migrate() {\n\n $this->scan_migration_files();\n $this->is_non_migration_file_exist();\n $this->filter_nonmigrated_files();\n\n $this->execute();\n }",
"private function migrateDB() : void\n {\n if (! request('db_imported')) {\n \\Artisan::call('migrate', ['--force' => true]);\n }\n \n \\Artisan::call('key:generate', ['--force' => true]);\n }",
"public function test_refresh_database()\n {\n Artisan::call('migrate:fresh');\n }",
"public function run()\n {\n // Populate the 'siskiyou_general' database with a raw database dump from the old website\n DB::connection('etl_source')->unprepared(file_get_contents('app/Console/ETL/siskiyou_general.sql'));\n\n // ETL the old data into the new database\n Artisan::call('etl:run');\n }",
"abstract public function migrate();",
"protected function refreshTestDatabase()\n {\n if (! RefreshDatabaseState::$migrated) {\n $this->artisan('migrate:fresh');\n $this->seed();\n $this->setupPassportOAuth2();\n\n $this->app[Kernel::class]->setArtisan(null);\n\n RefreshDatabaseState::$migrated = true;\n }\n\n $this->beginDatabaseTransaction();\n }",
"public function migrate()\n {\n $output = $this->getOutput();\n\n # Sendmail\n if ($this->startStep('sendmail')) {\n\n Sendmail::model();\n\n $this->execute('UPDATE '.TABLE_MASSEND.' SET status = 1 WHERE status = 0');\n\n $this->table(TABLE_MASSEND)\n ->addColumn('pid', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'default' => 0, 'signed' => false])\n ->update();\n\n $this->table(TABLE_MASSEND_RECEIVERS)\n ->addColumn('processed', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'default' => 0, 'signed' => false])\n ->update();\n }\n\n # bbsVirtualCatsFix\n if ($this->startStep('bbsVirtualCatsFix')) {\n $this->table(TABLE_BBS_CATEGORIES)\n ->dropForeignKey('virtual_ptr')\n ->addForeignKey('virtual_ptr', TABLE_BBS_CATEGORIES, 'id', ['delete'=> 'SET_NULL', 'update'=> 'NO_ACTION', 'constraint' => 'virtual_ptr'])\n ->update();\n }\n\n # bbsItemsIndexes\n if ($this->startStep('bbsItemsIndexes')) {\n # поля для новых индексов:\n $this->table(TABLE_BBS_ITEMS)\n ->addColumn('is_publicated', 'integer', ['after' => 'shop_id', 'limit' => MysqlAdapter::INT_TINY, 'default' => 0, 'signed' => false])\n ->addColumn('is_moderating', 'integer', ['after' => 'is_publicated', 'limit' => MysqlAdapter::INT_TINY, 'default' => 0, 'signed' => false])\n ->addColumn('cat_path', 'string', ['after' => 'cat_type', 'default' => '', 'limit' => 40 /* 40 ('{4}-' x 8) */])\n ->addColumn('reg_path', 'string', ['after' => 'reg3_city', 'default' => '', 'limit' => 70 /* 70 ('{12}-' x 5) */])\n ->update();\n $output->writeln('Finished: create index fields');\n\n # deleted=1 => status = STATUS_DELETED\n $this->execute('UPDATE '.TABLE_BBS_ITEMS.'\n SET status = '.BBS::STATUS_DELETED.'\n WHERE deleted = 1');\n $output->writeln('Finished: deleted=1 => status=STATUS_DELETED');\n\n # конвертируем данные\n BBS::model()->itemsIndexesUpdate(array(), 'is_publicated');\n $output->writeln('Finished: itemsIndexesUpdate + is_publicated');\n BBS::model()->itemsIndexesUpdate(array(), 'is_moderating');\n $output->writeln('Finished: itemsIndexesUpdate + is_moderating');\n BBS::model()->itemsIndexesUpdate(array(), 'cat_path');\n $output->writeln('Finished: itemsIndexesUpdate + cat_path');\n BBS::model()->itemsIndexesUpdate(array(), 'reg_path');\n $output->writeln('Finished: itemsIndexesUpdate + reg_path');\n\n # список полей дин.свойств\n $dp = BBS::i()->dp();\n $prefix = $dp->datafield_prefix;\n $last = $dp->datafield_int_last;\n if ($last > 16) {\n $last = 16; # ограничение MySQL не более 16 полей в индексе\n }\n $fieldsDP = array();\n for ($i = 1; $i <= $last; $i++) {\n $fieldsDP[] = $prefix.$i;\n }\n\n # создаем индексы\n $this->table(TABLE_BBS_ITEMS)\n # search_simple:\n ->addIndex(['is_publicated','status','cat_path','reg_path','cat_type','publicated_order'], ['name' => 'search_simple', 'unique' => false])\n # search:\n ->addIndex(['is_publicated','status','cat_path','reg_path','cat_type','imgcnt','owner_type','price_search','addr_lat','district_id','metro_id','svc_fixed','svc_fixed_order','publicated_order'], ['name' => 'search', 'unique' => false])\n # search_dp:\n ->addIndex($fieldsDP, ['name' => 'search_dp', 'unique' => false])\n # search_svc:\n ->addIndex(['svc'], ['name' => 'search_svc', 'unique' => false])\n # search_press:\n ->addIndex(['svc_press_status','svc_press_date','svc_press_date_last'], ['name' => 'search_press', 'unique' => false])\n # users:\n ->addIndex(['user_id','shop_id','is_publicated','status','cat_path','reg_path','publicated_order'], ['name' => 'users', 'unique' => false])\n # moderating:\n ->addIndex(['is_moderating'], ['name' => 'moderating', 'unique' => false])\n ->update();\n $output->writeln('Finished: create indexes');\n }\n \n # Shops\n if (bff::moduleExists('shops') && $this->startStep('shopsLang')) {\n bff::module('shops');\n if ( ! $this->hasTable(TABLE_SHOPS_LANG)) {\n $this->table(TABLE_SHOPS_LANG, ['id' => false])\n ->addColumn('id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'default' => 0, 'signed' => false])\n ->addColumn('lang', 'char', ['limit' => 2, 'default' => ''])\n ->addColumn('title', 'string', ['limit' => 150, 'default' => ''])\n ->addColumn('title_edit', 'string', ['limit' => 100, 'default' => ''])\n ->addColumn('descr', 'text', ['null' => true, 'default' => null])\n ->addColumn('addr_addr', 'string', ['limit' => 400, 'default' => ''])\n ->addIndex(['id', 'lang'], ['unique' => true, 'name' => 'lang'])\n ->addForeignKey('id', TABLE_SHOPS, 'id', ['delete' => 'CASCADE'])\n ->create();\n } else {\n $this->table(TABLE_SHOPS_LANG)\n ->addColumn('lang', 'char', ['limit' => 2, 'default' => ''])\n ->addColumn('title', 'string', ['limit' => 150, 'default' => ''])\n ->addColumn('title_edit', 'string', ['limit' => 100, 'default' => ''])\n ->addColumn('descr', 'text', ['null' => true, 'default' => null])\n ->addColumn('addr_addr', 'string', ['limit' => 400, 'default' => ''])\n ->addIndex(['id', 'lang'], ['unique' => true, 'name' => 'lang'])\n ->addForeignKey('id', TABLE_SHOPS, 'id', ['delete' => 'CASCADE'])\n ->update();\n }\n\n $lang = bff::locale()->getLanguages();\n foreach ($lang as $l) {\n $this->execute('INSERT INTO ' . TABLE_SHOPS_LANG . ' SELECT id, '.$this->db->str2sql($l).', title, title_edit, descr, addr_addr FROM '.TABLE_SHOPS);\n }\n\n// $this->table(TABLE_SHOPS)\n// ->removeColumn('title')\n// ->removeColumn('title_edit')\n// ->removeColumn('descr')\n// ->removeColumn('addr_addr')\n// ->update();\n }\n\n if ($this->startStep('usersSocial')) {\n Users::model();\n $this->table(TABLE_USERS_SOCIAL)\n ->changeColumn('provider_id', 'string', ['limit' => 100, 'default' => ''])\n ->update();\n }\n\n if ($this->startStep('contentPlus')) {\n # Blog\n if (bff::moduleExists('blog')) {\n bff::module('blog');\n\n $columns = $this->table(TABLE_BLOG_POSTS)->getColumns();\n $fields = array('content');\n foreach ($columns as $v) {\n $name = $v->getName();\n if ( ! in_array($name, $fields)) continue;\n if ( $v->getLimit() < MysqlAdapter::TEXT_LONG ) {\n $this->table(TABLE_BLOG_POSTS)\n ->changeColumn($name, 'text', ['limit' => MysqlAdapter::TEXT_LONG, 'null' => true, 'default' => null])\n ->update();\n }\n }\n }\n\n # Help\n if (bff::moduleExists('help')) {\n bff::module('help');\n\n $columns = $this->table(TABLE_HELP_QUESTIONS)->getColumns();\n $fields = array('content');\n foreach($columns as $v) {\n $name = $v->getName();\n if ( ! in_array($name, $fields)) continue;\n if ( $v->getLimit() < MysqlAdapter::TEXT_LONG ) {\n $this->table(TABLE_HELP_QUESTIONS)\n ->changeColumn($name, 'text', ['limit' => MysqlAdapter::TEXT_LONG, 'null' => true, 'default' => null])\n ->update();\n }\n }\n }\n }\n\n # Sphinx Wordforms\n if ($this->startStep('sphinxWordforms')) {\n if ( ! $this->hasTable(\\bff\\db\\Sphinx::TABLE_WORDFORMS) ) {\n $this->table(\\bff\\db\\Sphinx::TABLE_WORDFORMS, ['engine' => 'InnoDB', 'id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'integer', ['signed' => false, 'identity' => true])\n ->addColumn('module', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'default' => 0, 'null'=>false, 'signed' => false])\n ->addColumn('src', 'string', ['limit' => 250, 'default' => ''])\n ->addColumn('dest', 'string', ['limit' => 250, 'default' => ''])\n ->addColumn('created', 'datetime')\n ->create();\n }\n }\n\n # Таблица изображений объявлений + внешний ключ\n if ($this->startStep('bbsItemsImagesFK')) {\n $this->table(TABLE_BBS_ITEMS_IMAGES)\n ->dropForeignKey('item_id')\n ->update();\n }\n\n }",
"public function _migrate() {\n\n // verifica se as migracoes estao ativadas\n if ( !USE_DATABASE_VERSIONS ) return;\n \n // carrega a library de migracao\n $this->load->library( 'Migration' );\n\n // inicia a migracao\n $this->migration->start();\n }",
"public function updateMigrationTable()\n {\n $this->command->table()->updateMigrationVersion($this);\n }",
"public function run()\n {\n $this->command->info('Please wait updating the data...');\n\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n SettingSeeder::class,\n MenuSeeder::class,\n ]);\n\n $this->command->info('Updating the data completed !');\n }",
"public function run()\n {\n if ($this->command->confirm('Want to refresh database?', true)) {\n $this->command->call('migrate:refresh');\n $this->command->info('Database is seeded');\n }\n\n Cache::tags(['product'])->flush();\n Cache::tags(['user'])->flush();\n\n $this->call([\n UserSeeder::class,\n ProductSeeder::class,\n TagSeeder::class,\n ProductTagSeeder::class\n ]);\n }",
"public function runDatabaseMigrations()\n {\n $this->baseRunDatabaseMigrations();\n $this->artisan('db:seed');\n }",
"public function runDatabaseMigrations()\n {\n $this->baseRunDatabaseMigrations();\n $this->artisan('db:seed');\n }",
"public function handle(): void\n {\n $app = app();\n\n $rollback = (bool) $this->option('rollback');\n\n $repository = new DatabaseMigrationRepository(\n $app['db'],\n config('directus.databases.system.options.prefix', '').'migrations'\n );\n\n // Since we have our own migrations, this avoids triggering migration related events\n // inside to application code.\n $events = new Dispatcher();\n\n $migrator = new Migrator(\n $repository,\n $app['db'],\n $app['files'],\n $events\n );\n\n $migrator->setOutput($this->getOutput());\n $migrator->path(__DIR__.'/../../database/migrations');\n\n $migrator->usingConnection(\n directus()->databases()->system()->connectionName(),\n function () use ($migrator, $rollback): void {\n if (!$migrator->repositoryExists()) {\n $this->warn('Is Directus installed? We couldn\\'t find migrations table.');\n $this->warn('Upgrades are only for existing Directus installations.');\n\n return;\n }\n\n if ($rollback) {\n $migrator->rollback($migrator->paths(), [\n 'pretend' => false,\n 'step' => false,\n ]);\n } else {\n $migrator->run($migrator->paths(), [\n 'pretend' => false,\n 'step' => false,\n ]);\n }\n }\n );\n }",
"private function run() {\n $tableDefination = array(\n \"type\" => $this->migration_type,\n \"table\" => $this->table(), \n \"columns\" => $this->columns(), \n );\n try{\n uimodel::migrate( $tableDefination );\n } catch ( Exception $e ) {\n echo $e->getMessage();\n }\n }",
"public function update()\n\t{\n\t\t$currentVersion = Config::get('internal', 'version');\n\t\tif ($currentVersion === self::version)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\tif (substr($currentVersion, 0, strpos($currentVersion, '.')) !== substr(self::version, 0, strpos(self::version, '.')))\n\t\t{\n\t\t\tthrow new Exception('Major version upgrade not handled for now...');\n\t\t}\n\t\t$nextVersion = explode('.', $currentVersion);\n\t\t$nextVersion[1] ++;\n\t\t$nextVersion = implode('.', $nextVersion);\n\t\t/* Install/update database */\n\t\t$databaseScript = __DIR__.'/../resources/schema-'.$currentVersion.'-'.$nextVersion.'.sql';\n\t\tif (file_exists($databaseScript))\n\t\t{\n\t\t\tforeach (file($databaseScript) as $sql)\n\t\t\t{\n\t\t\t\t$sql = trim($sql);\n\t\t\t\tif (substr($sql, -1) === ';')\n\t\t\t\t{\n\t\t\t\t\t$sql = substr($sql, 0, -1);\n\t\t\t\t}\n\t\t\t\tif (!empty($sql))\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t$result = $this->db->insert($sql);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception $ex)\n\t\t\t\t\t{\n\t\t\t\t\t\t$result = false;\n\t\t\t\t\t}\n\t\t\t\t\tif ($result === false)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception('Updating database failed.<br/>You may not have sufficient privileges (ALTER, CREATE, INDEX...) with the current user.<br/>Step #1: manually run the script: resources/schema-'.$currentVersion.'-'.$nextVersion.'.sql<br/>Step #2: run the bots\\' script: resources/bots.sql<br/>Step #3: update your config.ini.php, by changing the [internal].version to '.$nextVersion.'<br/>Step #4: reload this page!');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/* Update bots' definitions */\n\t\t$botsScript = __DIR__.'/../resources/bots.sql';\n\t\tforeach (file($botsScript) as $sql)\n\t\t{\n\t\t\t$sql = trim($sql);\n\t\t\tif (substr($sql, -1) === ';')\n\t\t\t{\n\t\t\t\t$sql = substr($sql, 0, -1);\n\t\t\t}\n\t\t\tif (!empty($sql))\n\t\t\t{\n\t\t\t\tif ($this->db->insert($sql) === false)\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception('Updating bots failed...');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* Store the new version number */\n\t\tConfig::set('internal', 'version', $nextVersion);\n\n\t\t/* Run the next update if any */\n\t\treturn $this->update();\n\t}"
] | [
"0.67130107",
"0.67009753",
"0.6497866",
"0.64868885",
"0.64656985",
"0.6425218",
"0.63976485",
"0.63847363",
"0.6362596",
"0.6317201",
"0.62933594",
"0.6218864",
"0.6202972",
"0.62021995",
"0.61962485",
"0.61945426",
"0.6148613",
"0.6113342",
"0.6096071",
"0.60799223",
"0.6031569",
"0.5988772",
"0.5952348",
"0.59386975",
"0.5932348",
"0.5921897",
"0.5921897",
"0.59089357",
"0.5888266",
"0.5886745"
] | 0.68026847 | 0 |
get HTML to show the user, that he is connected with his dropbox account | public function getHtmlForConnected($accessToken)
{
/** @var \TYPO3\CMS\Fluid\View\StandaloneView $view */
$view = GeneralUtility::makeInstance(StandaloneView::class);
$view->setTemplatePathAndFilename(
GeneralUtility::getFileAbsFileName(
'EXT:fal_dropbox/Resources/Private/Templates/ShowAccountInfo.html'
)
);
try {
/** @var DropboxApp $dropboxClient */
$dropboxApp = GeneralUtility::makeInstance(DropboxApp::class, '', '', $accessToken);
/** @var Dropbox $dropbox */
$dropbox = GeneralUtility::makeInstance(Dropbox::class, $dropboxApp);
$view->assign('account', $dropbox->getCurrentAccount());
$view->assign('quota', $dropbox->getSpaceUsage());
$content = $view->render();
} catch (\Exception $e) {
$content = 'Please setup access token first to see your account info here.';
}
return $content;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Show_DropBox_Login_Link($Call_Back_URL){\r\n\r\n// Create login link\r\n$login_link=REMOTE_AUTH_PATH.$Call_Back_URL;\r\n\r\n// Get DropBox login oauth link with login token and call back url\r\n$load_link=file_get_contents($login_link);\r\nreturn($load_link);\r\n}",
"public function connexion()\n {\n echo $this->twig->render('login.html.twig', array('blogURL' => $this->blog));\n }",
"function imagepicker_user_browse() {\n $content = _imagepicker_browse(\"account\");\n return $content;\n}",
"public static function showSignUpPage(){\n InscriptionVue::getHtml();\n }",
"public function showOAuthDetails() {\n// print_r($this->_oauthData);\n// die(\"Line 113\");\n if (is_object($this->_oauthData)) {\n $var_retstr = '<h2>Hello ' . $this->_oauthData->name . '</h2>' .\n '<img src=\"' . $this->_oauthData->imageUrl . '\">';\n $gravatar_link = 'http://www.gravatar.com/avatar/' . md5($this->_oauthData->email) . '?s=32';\n $var_retstr .= '<img src=\"' . $gravatar_link . '\" />';\n } else\n $var_retstr = '';\n \n $this->$this->_html['oauthHTML']=$var_retstr;\n return $var_retstr;\n }",
"function auth()\n{\n $dropdown = '';\n\n if (isset($_SESSION['id']) and isset($_SESSION['pseudo'])) {\n ob_start(); ?>\n\r\n <a class=\"dropdowntexte\" href=\"/Arffornia/Profil\">Profil</a> <br>\r\n <a class=\"dropdowntexte\" href=\"/Arffornia/Deconnexion\">Déconnexion</a>\r\n\r\n<?php\n\n $dropdown = ob_get_clean();\n } else {\n ob_start(); ?>\n\r\n <a class=\"dropdowntexte\" href=\"/Arffornia/Inscription\">Inscription</a> <br>\r\n <a class=\"dropdowntexte\" href=\"/Arffornia/Connexion\">Connexion</a>\r\n\r\n<?php\n\n $dropdown = ob_get_clean();\n }\n return $dropdown;\n}",
"public static function displayConnexionPage() {\n ConnexionVue::getHtml();\n }",
"protected function text(){\n global $user;\n $output = parent::text();\n $account = user_load($user->uid);\n if($this->values['show_avatar']){\n $output['image'] = $this->userImage();\n }\n $output['name']['#markup'] = '<span class=\"theforce-text\">' . $account->name . '</span>';\n return $output;\n }",
"public function getView() {\n $reqUserId = getSessionUserId();\n $user = new User();\n if ($reqUserId > 0) {\n $user->findUserById($reqUserId);\n } else {\n echo \"You have to be logged in to access user info!\";\n }\n include(dirname(__FILE__) . \"/BudgetInfo/popup-give-budget.inc\");\n exit(0);\n }",
"public function forgetUser();",
"public function forgetUser();",
"private function generateAuthTags()\n {\n return \"<username>{$this->username}</username>\"\n . \"<password>{$this->password}</password>\"\n . \"<outbox-name>{$this->outboxName}</outbox-name>\";\n }",
"function show_less_login_info() {\n return \"<strong>Oups</strong>: y a comme un souci !\";\n}",
"public function loggedIn()\n {\n\t\t$username = $this->cookieService->load('inputUsername');\n\n\t\tif (!$username)\n {\n\t\t\t$username = $this->model->getUsername();\n\t\t}\n\n\t\t$body = \"\n\t\t\t<h1>L2 - Login [kl222jy]</h1>\n\t\t\t<h2>$username är inloggad</h2>\n\t\t\t<a href='?action=logout'>Logga ut</a>\";\n\t\t\n\t\treturn $body;\n\t}",
"function login_html($tourl, $context)\n {\n echo('<a href=\"'.$this->cas->getServerLoginURL().'\">'.qa_opt('cas_login_link_text').'</a>');\n }",
"function get_html($cb,$id,$protected,$text) {\n if ($protected != 1) {\n $reply_embed = (array) $cb->statuses_oembed(\"id=\" . $id . \"&omit_script=true\");\n if ($reply_embed['httpstatus'] == 200 && $reply_embed['html']) {\n return $reply_embed['html'];\n } else {\n $html = \" <blockquote class=\\\"twitter-tweet\\\">\";\n $html .= \"<p class=\\\"error\\\">\" . $text . \"</p>\";\n $html .= \"</blockquote>\";\n return $html;\n } \n } else {\n $html = \" <blockquote class=\\\"twitter-tweet\\\">\";\n $html .= \"<p class=\\\"protected\\\">\" . $text . \"</p>\";\n $html .= \"</blockquote>\";\n return $html;\n }\n}",
"static function url_auth()\n {\n $js = '';\n $js .= \"const point = Cataviz.chart.form.lastElementChild;\\n\";\n $js .= \"let el = null;\\n\";\n $terms = http::pars('auth');\n $sql = \"SELECT * FROM auth WHERE id = ?\";\n $stmt = Cataviz::prepare($sql);\n foreach($terms as $auth_id) {\n $stmt->execute([$auth_id]);\n $auth_row = $stmt->fetch();\n if (!$auth_row) continue;\n $label = addslashes(Cataviz::auth_label($auth_row));\n $js .= \"el = Suggest.input('auth', '$auth_id', '$label', Cataviz.chartUp);\\n\";\n $js .= \"point.parentNode.insertBefore(el, point);\\n\";\n }\n return $js;\n }",
"public function getUserInfo(): string {\n return $this->components->userinfo;\n }",
"public function get_html()\n { \n $response_data = $this->getAPIResponse();\n $response = json_decode($response_data['data']);\n $records = $this->toArray($response);\n $split = $this->getSplittedUsers($records);\n $html = '';\n $html .= \"<br><span class='html_users_headings'>Engineers</span><br>\";\n $html .= $this->makeHTMLTable($response_data['engineers_fields'],$split['engineers']); \n $html .= \"<br><span class='html_users_headings'>Internal</span><br>\";\n $html .= $this->makeHTMLTable($response_data['internal_fields'],$split['internal']); \n $html .= \"<br><span class='html_users_headings'>External</span><br>\";\n $html .= $this->makeHTMLTable($response_data['external_fields'],$split['external']); \n echo $html;\n }",
"function show_users($mysql) {\n\t$dbResult = $mysql->query(\"SELECT * FROM users ORDER BY id DESC\");\n\t\tforeach($dbResult as $row) {\n\t\techo (base64_decode($row['username'])).\"<br />\";\n\t\t}\n\t}",
"protected function displayContent()\n {\n\n $html = '<div id=\"register\">' . \"\\n\";\n\n $html .= '<h1>' . $this->pageInfo['pageHeading'] . '</h1>';\n\n if ($this->model->userLoggedIn) {\n header('Location: index.php?page=home');\n }\n\n $html .= '<h3 for=\"user-type\">Choose your user type</h3>' . \"\\n\";\n\n $html .= '<p class=\"form-description\">Don\\'t know which one to choose? Please <a href=\"index.php?page=about\">visit our about page</a> to find out more.</p>' . \"\\n\";\n $html .= '<br />' . \"\\n\";\n\n $html .= '<h2 class=\"buttons\"><a href=\"index.php?page=registerSeek\">Seek</a></h2>';\n\n $html .= '<h2 class=\"buttons\"><a href=\"index.php?page=registerLance\">Lance</a></h2>';\n\n $html .= '</div>' . \"\\n\";\n\n return $html;\n\n }",
"function userWidget()\n {\n $identity = Zend_Auth::getInstance()->getIdentity(); /* @var $identity User_Model_User */\n $service = User_Service_User::getInstance();\n $view = $this->view;\n \n $output = '';\n \n if (!$identity)\n {\n $loginForm = $service->getForm('login');\n $loginForm->setAction($view->url(array('module' => 'user', 'controller' => 'index', 'action' => 'login'), 'default'));\n $loginForm->setAttrib('class', 'form-vertical');\n $loginForm->getElement('user_name')->setAttrib('class', 'span3');\n $loginForm->getElement('user_password')->setAttrib('class', 'span3');\n \n $output.= '<h3>' . $view->translate('heading_user_user_loggedin') . '</h3>';\n $output.= $loginForm->render();\n } else {\n $output.= '<h3>' . $view->translate('heading_user_user_loggedout') . '</h3>';\n $output.= '<p><i class=\"icon-user icon-white\"></i> ' . $identity->getName() . '</p>';\n $output.= '<p><i class=\"icon-envelope icon-white\"></i> ' . $identity->getEmail() . '</p>';\n $output.= '<p><a href=\"' . $view->url(array('module' => 'user', 'controller' => 'index', 'action' => 'logout'), 'default') . ' \" class=\"btn btn-success\">' . $view->translate('action_user_user_logout') . '</a></p>';\n }\n \n return $output;\n }",
"function mbtng_login_head() {\r\n\techo \"<style type=\\\"text/css\\\">#realname, #tree { font-size: 24px; width: 97%; padding: 3px; margin-top: 2px; margin-right: 6px; margin-bottom: 16px; border: 1px solid #e5e5e5; background: #fbfbfb; }</style>\\n\";\r\n}",
"public function getHtml(){\n\t\tglobal $canwrite;\n\t\t$class = ($canwrite) ? \"enabled\" : \"disabled\";\n\t\t$out = \"<div class='\".$class.\"' id=\\\"\".$this->upload_div.\"\\\">\".$this->hubtext.\"</div>\\n\";\n\t\t$out .= \"<div class='\".$class.\"' id=\\\"\".$this->thumbnail_div.\"\\\">\".$this->thumbnails.\"</div>\\n\";\n\t\treturn $out;\n\t}",
"private function privateProfile()\n {\n ?>\n <div class=\"private\">\n <h1>\n <strong>The Profile is set to private :(</strong>\n </h1>\n\n <h2>\n <strong>SteamCompletionist.net</strong> can only display the games if the profile is set to\n \"public\".<br>\n <a href=\"steam://url/SteamIDEditPage\">Click here to go to your profile settings in the steam client</a>\n -> <a href=\"\">Then click here to retry</a><br>\n Here is a picture to illustrate:\n </h2>\n <img src=\"../../../img/profile.png\"/>\n </div>\n <?PHP\n }",
"public function getUser()\n {\n return View::make('install.user', [\n 'progress' => 90,\n 'step' => 5,\n 'title' => trans('install.user.title'),\n ]);\n }",
"function enterSecuredArea() {\r\necho \"<h1>Welcome, \". $_SESSION['username'] .\"</h1>\";\r\n\r\n//echo getUserContent($username);\r\necho $_SESSION['usercontent'];\r\n\r\n}",
"function printActivationNeeded() {\n printLoginForm();\n print <<<EOT\n <div class=\"jumbotron\">\n <div class=\"container\">\n <h1></h1>\n <p>You have not yet activated your account. Please check your email for an authentication link.</p> \n </div>\n </div>\nEOT;\n}",
"function wq_show_less_login_info()\n{\n return '<strong>ERROR</strong>: Stop guessing!';\n}",
"public function showUserDetails(): Response\n {\n //TODO modify after injecting the Session class in Controller\n return $this->renderer->renderView(\"admin-user-details.phtml\", [\n 'username' => $this->userService->getName(),\n 'path' => 'create'\n ]);\n }"
] | [
"0.6378492",
"0.5943301",
"0.58240366",
"0.5814053",
"0.57835555",
"0.56684124",
"0.5660526",
"0.5653889",
"0.5626398",
"0.5568567",
"0.5568567",
"0.5556363",
"0.55513054",
"0.55251193",
"0.54990196",
"0.5454599",
"0.54351556",
"0.54230404",
"0.5412",
"0.54087573",
"0.5390783",
"0.5381312",
"0.537768",
"0.53155744",
"0.5308018",
"0.53075093",
"0.5305431",
"0.5299446",
"0.52963555",
"0.5295064"
] | 0.5971757 | 1 |
============================================================== show new task form in the view | public function new_task()
{
return view('new_task_form');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function newtask() {\n require APP . 'view/_templates/header.php';\n if ($this->validate_task($_POST)) {\n $clean_task_params = $_POST;\n $Task = new Task();\n $task = $Task->createTask($clean_task_params);\n require APP . 'view/tasks/taskcreated.php';\n } else {\n require APP . 'view/tasks/new.php';\n }\n require APP . 'view/_templates/footer.php';\n }",
"public function create()\n {\n return view('adminPanel.page.task.create');\n }",
"public function create()\n {\n return view('tasks.new');\n }",
"public function newTask()\n\t{\n\t\tif (!User::authorise('core.edit', $this->_option))\n\t\t{\n\t\t\tApp::abort(403, Lang::txt('JERROR_ALERTNOAUTHOR'));\n\t\t}\n\n\t\t// Load the project\n\t\t$project_id = Request::getInt('project', 0);\n\n\t\t$model = new Project($project_id);\n\n\t\t// Output the HTML\n\t\t$this->view\n\t\t\t->set('model', $model)\n\t\t\t->display();\n\t}",
"public function actionCreate(): string\n {\n $createTaskForm = new CreateTaskForm();\n\n if (Yii::$app->request->getIsPost()) {\n $request = Yii::$app->request->post();\n\n\n if ($createTaskForm->load($request) && $createTaskForm->createTask()) {\n $this->redirect(['tasks/view', 'id' => $createTaskForm->newTask->id]);\n }\n }\n\n return $this->render('create', [\n 'createTaskForm' => $createTaskForm,\n ]);\n\n }",
"public function create() {\n return view(\"task.create\");\n }",
"public function create() \n\t{\n\t\treturn view('tasks.create');\n\t}",
"public function create()\n {\n return view('model_create_task.create');\n }",
"public function create()\n {\n return view('admin.task.create');\n }",
"public function create()\n {\n return view('admin.task.create');\n }",
"public function create()\n {\n \treturn view('task.create');\n }",
"public function create()\n {\n return view('tasks.create');\n }",
"public function addtask()\n {\n\n return view('addtask');\n }",
"public function create()\n {\n //\n $precarga = new Task;\n return view('precargas.form',['titulo'=>$this->titulo, 'edit'=>false,'guardar'=>$this->guardar, 'precarga'=>$precarga]);\n }",
"public function create()\n {\n return view('tasks.create');\n }",
"public function create()\n {\n return view('todo::task.create');\n }",
"public function create() : void\n\t{\n\t\t// EXPLAIN: ...\n\t\tif (!empty($_POST) && $this->validate()) \n\t\t{\n\t\t\t$task = new Task();\n\n\t\t\tif ($task->create($_POST))\n\t\t\t{\n\t\t\t\t$_SESSION['flash']['message'] = 'Task has been successfully created';\n\t\t\t\t$_SESSION['args']['sort'] = '-id';\n\t\t\t\t$this->redirect();\n\t\t\t}\n\t\t}\n\n\t\t// EXPLAIN: ...\n\t\t$data = [\n\t\t\t'message' => empty($_SESSION['flash']['message']) ? null : $_SESSION['flash']['message'],\n\t\t\t'form_action' => Url::getCurrentPath(),\n\t\t\t'basepath' => Url::getBasePath(),\n\t\t];\n\n\t\t$this->view('create', $data);\n\t}",
"public function create() {\n return view('tasks.create');\n }",
"public function create()\n {\n return view('tasks.create');\n }",
"public function create()\n {\n return view('tasks.create');\n }",
"public function create()\n {\n return view('tasks.create');\n }",
"public function create()\n {\n return view('tasks.create');\n }",
"public function create()\n {\n return view('tasks.create');\n }",
"public function actionShowCreate()\n {\n $this->navs[self::NAV_NAME_CREATE][self::NAV_IS_ACTIVE] = true;\n\n $this->content = $this->build('task/create');\n }",
"public function create()\n {\n $tasks = Task::all();\n $maintasks = Maintask::all();\n $getstatus = Status::all();\n\n return view('task.add', compact('tasks','getstatus','maintasks'));\n }",
"public function actionCreate()\n {\n $model = new Task();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', ['model' => $model,]);\n }\n }",
"public function create()\n {\n\t $data['breadcrumbPages'] = [\n\t\t ['name' => 'task', 'link' => route('task.index')],\n\t\t ['name' => 'create task']\n\t ];\n\n\t $data['taskTypes'] = TaskType::lists('name', 'id');\n\t $data['taskMembers'] = $this->user->household->getHouseholdMembers($this->user->id);\n\n\t return view('members.tasks.create', $data);\n }",
"public function create()\n {\n $tasks = Task::all();\n return view('timesheet-mgmt/create', ['tasks' => $tasks]);\n }",
"public function create()\n {\n $task = new Task();\n $params = $this->getViewParams();\n\n return view('task.create', compact('task', 'params'));\n }",
"public function create()\n {\n //TODO this should be dinamic some how (?)\n $project_id = 1;\n //List of available features\n $features = Feature::all();\n //List of available status Default to New\n $status = Task_status::where('task_status.name', '=', 'TO DO');\n //List of available members (based on project_id)\n $members = $this->getMembersByProject($project_id);\n return View::make('create.createtask')\n ->with('status', $status)\n ->with('members', $members)\n ->with('features', $features);\n }"
] | [
"0.8156877",
"0.8028942",
"0.79327863",
"0.7905898",
"0.7850565",
"0.7825552",
"0.7811631",
"0.7757591",
"0.77494943",
"0.77494943",
"0.77430385",
"0.7643806",
"0.7632696",
"0.76228946",
"0.7617811",
"0.7614323",
"0.76063764",
"0.76041913",
"0.76041865",
"0.76041865",
"0.76041865",
"0.76041865",
"0.76041865",
"0.76001847",
"0.74954784",
"0.745356",
"0.7441851",
"0.7436631",
"0.7414134",
"0.73804945"
] | 0.8783065 | 0 |
==================================================================== display update task form | public function update_task($id)
{
//get selected task
$task = Task::find($id);
//display the update task form
return view('update_task_form',['newdata'=>$task]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionUpdateTask()\n {\n $model = new AddTaskForm();\n $id = Yii::$app->request->get('id');\n $taskService = new TaskService();\n\n try {\n if (!$id || !$taskService->findById($id)) {\n return $this->render('error');\n }\n } catch (Exception $e) {\n Yii::$app->session->setFlash('error', \"Something wrong\");\n }\n\n if ($model->load(Yii::$app->request->post())) {\n try {\n $taskService->updateTask(\n $id,\n $model->type,\n $model->title,\n $model->description,\n $model->status,\n $model->executor,\n $model->serviceClass\n );\n\n Yii::$app->session->setFlash('success', 'task updated');\n } catch (Exception $e) {\n Yii::$app->session->setFlash('error', \"Something wrong\");\n }\n\n return $this->redirect(['task/full-task/' . $id]);\n }\n\n $types = Type::find()->all();\n $users = User::find()->all();\n $statuses = Status::find()->all();\n $serviceClasses = ServiceClass::find()->all();\n\n $tasks = Task::find()->all();\n\n return $this->render('update-task', [\n 'model' => $model,\n 'types' => $types,\n 'users' => $users,\n 'statuses' => $statuses,\n 'tasks' => $tasks,\n 'serviceClasses' => $serviceClasses\n ]);\n }",
"public function edit()\n\t{\n\t\tsession_start();\n\t\tif(isset($_SESSION[\"UserID\"])) {\n\t\t\t$Result = $this->showTasks();\n\t\t\t$this->data[\"Record\"] = \\utility\\table::TableEdit($Result[\"Record\"]);\n\t\t\t$this->template = 'edit_task';\n\t\t} else {\n\t\t\theader('Location: index.php');\n\t\t}\n\t}",
"public function editAction()\n {\n $tctaskId = $this->getRequest()->getParam('id');\n $tctask = $this->_initTctask();\n if ($tctaskId && !$tctask->getId()) {\n $this->_getSession()->addError(\n Mage::helper('bs_report')->__('This tc task no longer exists.')\n );\n $this->_redirect('*/*/');\n return;\n }\n $data = Mage::getSingleton('adminhtml/session')->getTctaskData(true);\n if (!empty($data)) {\n $tctask->setData($data);\n }\n Mage::register('tctask_data', $tctask);\n $this->loadLayout();\n $this->_title(Mage::helper('bs_report')->__('Report'))\n ->_title(Mage::helper('bs_report')->__('TC Tasks'));\n if ($tctask->getId()) {\n $this->_title($tctask->getTctaskName());\n } else {\n $this->_title(Mage::helper('bs_report')->__('Add tc task'));\n }\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n $this->renderLayout();\n }",
"public function update()\r\n {\r\n if($this->getSessionHandler()->isLoggedIn())\r\n {\r\n $id = $this->getRequestObject()->getParameter('id');\r\n $todo = todo::findOne($id);\r\n $todo->message = $this->getRequestObject()->getParameter('message');\r\n $todo->isdone = $this->getRequestObject()->getParameter('isdone');\r\n $todo->ownerid = $this->getRequestObject()->getParameter('ownerid');\r\n $todo->owneremail = $this->getRequestObject()->getParameter('owneremail');\r\n $todo->createddate = $this->getRequestObject()->getParameter('createddate');\r\n $todo->duedate = $this->getRequestObject()->getParameter('duedate');\r\n \r\n //validate\r\n if($todo->validate() !== true)\r\n {\r\n //returns array of error messages\r\n $errors = $todo->validate();\r\n $v = new ValidationView();\r\n $v->injectData(array('messages' => $errors));\r\n echo $v->render();\r\n die(); //halt execution if it's invalid\r\n }\r\n \r\n $todo->save();\r\n header(\"Location: index.php?page=tasks&action=show&id=$id\");\r\n }\r\n else\r\n {\r\n $this->displayMessage('You must login to view this area!');\r\n }\r\n }",
"public function update($id = null)\n {\n require_once \"models/task_DB.php\";\n $model = new Task_DB();\n $tasks = $model->getById($id);\n $this->View->task = $tasks;\n $this->View->render('tasks/update','dashboard');\n }",
"public function edit()\r\n {\r\n if($this->getSessionHandler()->isLoggedIn())\r\n {\r\n $id = $this->getRequestObject()->getParameter('id');\r\n $record = todos::create()->findOne($id);\r\n \r\n $v = new EditTaskView();\r\n $v->injectData(array('data' => $record, 'id' => $id));\r\n echo $v->render();\r\n }\r\n else\r\n {\r\n $this->displayMessage('You must login to view this area!');\r\n }\r\n\r\n }",
"public function update_task_submit(Request $request)\n {\n //get form inputs\n $id_task = $request->input('id_task');\n $edit_task = $request->input('text_update_task');\n //update task\n $task = Task::find($id_task);\n //find the column in the database\n $task->task= $edit_task;\n $task->save();\n\n //display tasks table\n\n return redirect()->route('home');\n\n }",
"function showAdmin_updateAdminTask() {\n if (!Session::has('adminid')) {\n return Redirect::to('/admin/login');\n }\n\n $taskId = 0;\n\n $input = Input::all();\n if (!empty($input)) {\n $taskName = $input['task_name'];\n $boardId = $input['board_id'];\n $taskId = $input['id'];\n } else {\n return Redirect::to('/');\n }\n\n if (empty($taskId)) {\n echo '2';\n exit;\n }\n\n $saveList = array(\n 'task_name' => $taskName,\n 'modified' => date('Y-m-d H:i:s')\n );\n\n\n $adminBoards = DB::table('admintasks')\n ->where('id', $taskId)\n ->update($saveList);\n\n echo 1;\n exit;\n }",
"public function actionEdit()\n {\n $id = $_POST[$this->model::ID];\n $status = $_POST[$this->model::STATUS] ? 1 : 0;\n $text = $_POST[$this->model::CONTENT];\n\n $text = trim(htmlspecialchars($text));\n\n if (empty($text)) {\n // error\n die('Error field with deskription of task do not must empty!');\n }\n\n if (!is_numeric($id)) {\n // error\n die('Error ID incorrect '.$id);\n }\n\n $isSuccess = $this->model->updateById($id, [\n $this->model::STATUS => $status,\n $this->model::CONTENT => $text\n ]);\n\n if ($isSuccess) redirect('/');\n\n // error\n die('An error occurred while trying to update the data!');\n }",
"public function edit(){\n $response = [\n 'status' =>'error',\n 'message' => 'Something went wrong.Error code: TCCD1'\n ];\n if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST') {\n if(!empty($_POST[\"id\"])){\n $id = filter_var($_POST[\"id\"], FILTER_VALIDATE_INT);\n $title = trim(htmlspecialchars($_POST[\"title\"]));\n $time = date('Y-m-d h:i:s');\n $model_task =$this->model;\n $response = $model_task->updateTask($id,['title' => $title,'modified' => $time]);\n }\n }else{\n $response['message'] = 'Method should be post.Error code: TCD2';\n }\n rtn:\n $this->utilityObject->jsonResponse($response);\n }",
"function showAdmin_updateAdminTaskDescriptionData() {\n if (!Session::has('adminid')) {\n return Redirect::to('/admin/login');\n }\n\n $taskId = 0;\n\n $input = Input::all();\n if (!empty($input)) {\n $taskDesc = $input['task_description'];\n $taskId = $input['task_id'];\n } else {\n return Redirect::to('/');\n }\n\n if (empty($taskId)) {\n echo '2';\n exit;\n }\n\n $saveList = array(\n 'task_description' => $taskDesc,\n 'modified' => date('Y-m-d H:i:s')\n );\n\n\n $boards = DB::table('admintasks')\n ->where('id', $taskId)\n ->update($saveList);\n\n echo 1;\n exit;\n }",
"public function actionUpdate($id)\n {\n $model=$this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if(isset($_POST['Task']))\n {\n $model->attributes=$_POST['Task'];\n if($model->save())\n $this->redirect(array('view','id'=>$model->id));\n }\n\n $this->render('update',array(\n 'model'=>$model,\n ));\n }",
"public function postEditTask()\n {\n extract($_POST);\n\n $data = array();\n $arr_list_id = array();\n\n if ($list_id) {\n $str_list_id = trim($list_id, ',');\n $arr_list_id = explode(',', $str_list_id);\n }\n $arr_date_range = explode(' - ', $date_range);\n $data['name'] = $task_name;\n $data['date_from'] = Carbon::createFromFormat('d/m/Y', $arr_date_range[0])->format('Y-m-d');\n $data['date_to'] = Carbon::createFromFormat('d/m/Y', $arr_date_range[1])->format('Y-m-d');\n $data['performer_id'] = json_encode($arr_list_id);\n $data['note'] = $des;\n\n $update = ProjectPlan::where('id', $task_id)->update($data);\n if ($update) {\n return 1;\n }\n\n }",
"public function editTask($data);",
"public function displayTaskDetails($task, $location){\n if($task){\n echo '<form method=\"post\" action=\"../Controller/taskController.php\">';\n\n echo '<input type=\"text\" class=\"form-control hidden\" name=\"id\" value=\"'.$task->getTaskId().'\" readonly>'; //TASK ID\n echo //TASK NAME\n '<div class=\"form-group row\">\n <label for=\"tName\" class=\"col-form-label\">Task Name: <p id=\"tNameChars\"></p></label>\n <div class=\"col-10\">\n <input class=\"form-control userInput taskInput\" type=\"text\" name=\"tName\" id=\"tName\" maxlength=\"150\" value=\"'.$task->getTaskName().'\">\n </div>\n </div>';\n\n echo //MODULE ASSIGNMENT\n '<div class=\"form-row\">\n <div class=\"form-group row\">\n <label for=\"module\" id=\"moduleLabel\" class=\"col-form-label\">Assign to Module: <label>\n <div class=\"col-auto\">\n <select class=\"form-control\" name=\"module\" id=\"module\">';\n $this->displayModuleChoices();\n echo '</select></div></div>';\n\n echo //TASK CATEGORY\n '<div class=\"form-group row\">\n <label for=\"category\" id=\"categoryLabel\" class=\"col-form-label\">Task Category: <label>\n <div class=\"col-auto\">\n <select class=\"form-control\" name=\"category\" id=\"category\">';\n echo '<option value=\"'.$task->getTaskCategory().'\">'.$task->getTaskCategory().'</option>';\n echo '<option value=\"General\">General</option>\n <option value=\"Revision\">Revision</option>\n <option value=\"Coursework\">Coursework</option>\n </select>\n </div></div>';\n\n echo //PRIORITY LEVEL\n '<div class=\"form-group row\">\n <label for=\"priority\" class=\"col-form-label\">Priority Level: <label>\n <div class=\"col-auto\">\n <select class=\"form-control\" name=\"priority\" id=\"priority\">';\n echo '<option value=\"'.$task->getPriorityLevel().'\">'.$task->getPriorityLevel().'</option>';\n echo\n '<option value=\"Low\">Low</option>\n <option value=\"Medium\">Medium</option>\n <option value=\"High\">High</option>\n </select>\n </div></div></div>';\n\n echo //DEADLINE\n ' <div class=\"form-group row\">\n <label class=\"col-form-label\">Due Deadline: <label>';\n\n //CHECK IF DUE ANYTIME\n $d = date(\"Y\", strtotime($task->getDueDate()));\n if($d == \"9999\")\n {\n $due = 'Due Anytime';\n }else{\n $due = $task->getDueDate().' - '.$task->getDueTime();\n }\n echo '<div class=\"row\">';\n\n //Change id of date field and pop up page depending on from current web page\n if($location == \"Module Page\"){\n $fieldId = \"currentDue\";\n $popUp = \"changeDateTimeModal\";\n }else{\n $fieldId = \"currentDate\";\n $popUp = \"changeDateTimeModalFromHome\";\n }\n echo'<div class=\"col\"><input id=\"'.$fieldId.'\" name=\"currentDue\" type=\"text\" size=\"50\" class=\"currentDue form-control\" value=\"'.$due.'\" readonly></div>';\n echo '<div class=\"col\"><button type=\"button\" class=\"btn btn-info\" id=\"changeDeadline\" data-toggle=\"modal\" data-target=\"#'.$popUp.'\">Edit Deadline</button></div>';\n echo '</div>';\n echo '</div>';\n\n echo '<div style=\"margin-left: 60%\" class=\"row\"><button type=\"submit\" class=\"btn btn-dark\" id=\"editTaskBtn\" name=\"editTaskBtn\">Update Task</button></form>';\n echo //DELETE TASK BTN\n '<button style=\"margin-left:20px;\" type=\"button\" class=\"btn btn-danger deleteTask\" id=\"'.$task->getTaskId().'\">Delete Task</button>';\n echo //COMPLETE TASK BTN\n '<button style=\"margin-left:20px;\" type=\"button\" class=\"btn btn-success completeTask\" id=\"'.$task->getTaskId().'\">Complete Task</button></div><br><br>';\n\n //JQUERY EVENTS RELATED TO DYNAMIC FIELDS ABOVE\n echo '<script>\n //BTN to delete task\n $(\".deleteTask\").click(function(){\n let delTaskId = this.id; //Get id of task\n window.location.href = \"../Controller/taskController.php?delTaskId=\"+delTaskId; //Send to controller \n });\n \n //BTN to change task status to complete\n $(\".completeTask\").click(function(){\n let completeTaskId = this.id; //Get id of task\n window.location.href = \"../Controller/taskController.php?completeTaskId=\"+completeTaskId; //Send to controller \n });\n \n </script>';\n }\n }",
"public function edit(Task $task)\n {\n //\n return view('precargas.form',['precarga'=>$task, 'titulo'=>$this->titulo, 'edit'=>true,'edit'=>$this->actualizar]);\n }",
"public function edit($id)\n {\n\n $tasks = Task::find($id);\n $maintasks = Maintask::all();\n $getstatus = Status::all();\n return view('task.update', compact('maintasks','getstatus','tasks'));\n }",
"public function actionUpdate($id)\n {\n $this->accessUser();\n\n if($_SERVER['REQUEST_METHOD'] == 'POST' && !empty($_POST)) {\n\n $formData = $_POST;\n\n if($formData['fulfilled'] == 'on') {\n $formData['fulfilled'] = 1;\n\n }else if(!isset($formData['fulfilled'])) {\n $formData['fulfilled'] = 0;\n }\n\n if (TaskModel::updateTask($id, $formData)) {\n header('Location: /');\n }\n }\n\n $this->render('task/update', [\n 'data' => TaskModel::getTaskByid($id)\n ]);\n }",
"function modulePDPTaskLibrary_editTask($selected_task_id) {\n $objResponse = new xajaxResponse();\n if (PamApplication::hasValidSession($objResponse) && PermissionsService::isEditAllowed(PERMISSION_PDP_TASK_LIBRARY)) {\n\n $sql = 'SELECT\n *\n FROM\n pdp_task\n WHERE\n ID_PDPT = ' . $selected_task_id . '\n AND customer_id = ' . CUSTOMER_ID;\n $queryResult = BaseQueries::performQuery($sql);\n $queryResult_row = @mysql_fetch_assoc($queryResult);\n\n $task_id = $queryResult_row['ID_PDPT'];\n $task = trim($queryResult_row['task']);\n $task_description = trim($queryResult_row['task_description']);\n\n $safeFormHandler = SafeFormHandler::create(SAFEFORM_PDPTASKLIBRARY__EDIT_TASK);\n\n $safeFormHandler->addStringInputFormatType('task');\n $safeFormHandler->addStringInputFormatType('task_description');\n $safeFormHandler->storeSafeValue('id_pdpt', $task_id);\n\n $safeFormHandler->finalizeDataDefinition();\n\n $html = '\n <form id=\"pdp_tasklibEditForm\" name=\"pdp_tasklibEditForm\" onsubmit=\"submitSafeForm(\\'' . $safeFormHandler->getFormIdentifier() . '\\', this.name); return false;\">';\n\n $html .= $safeFormHandler->getTokenHiddenInputHtml();\n\n $html .= '\n <p>' . TXT_UCW('EDIT') . ' ' . TXT_UCW('TASK') . ' : ' . $task . '</p>\n <table width=\"600\" cellspacing=\"0\" cellpadding=\"2\" class=\"border1px\">\n <tr>\n <td width=\"10%\" class=\"bottom_line\">' . TXT_UCF('TASK') . ':</td>\n <td width=\"30%\" align=\"left\"><input type=\"text\" size=\"40\" name=\"task\" value=\"' . $task . '\"/></td>\n </tr>\n <tr>\n <td>' . TXT_UCF('DESCRIPTION') . ' :</td>\n <td align=\"left\">\n <textarea name=\"task_description\" cols=\"40\" rows=\"6\">' . $task_description . '</textarea>\n </td>\n </tr>\n </table>\n <br>\n <input type=\"submit\" id=\"submitButton\" value=\"' . TXT_BTN('SAVE') . '\" class=\"btn btn_width_80\">\n <input type=\"button\" value=\"' . TXT_BTN('CANCEL') . '\" class=\"btn btn_width_80\" onclick=\"xajax_modulePDPTaskLibrary_displayTask(' . $task_id . ');return false;\">\n </form>';\n\n $objResponse->assign('mod_pdp_tasklib_right', 'innerHTML', $html);\n }\n return $objResponse;\n}",
"public function show()\n\t{\n\n\t\t//Check whether there is UserID in session to edit your account\n\t\tsession_start();\n\t\tif(isset($_SESSION[\"UserID\"])) {\n\n\t\t\t$Result = $this->showTasks();\n\n\t\t\tif($Result[\"isOK\"]) {\t\t\n\t\t\t\t$data[\"Record\"] = \\utility\\table::tablecontect($Result[\"Record\"]);\n\t\t\t} else {\n\t\t\t\t$data[\"Record\"] = \"You have no task.<hr>\";\n\t\t\t}\n\n\t\t\t$ishave_task = $Result[\"isOK\"];\n\n\t\t\t$isshow = \\httprequest\\request::BoolToStyle_yesORnone(!$ishave_task);\n\t\t\t$data[\"istask\"] = $isshow;\n\n\t\t\t$noisshow = \\httprequest\\request::BoolToStyle_yesORnone($ishave_task);\n\t\t\t$data[\"!istask\"] = $noisshow;\n\n\t\t\t$this->data = $data;\n\t\t\t$this->template = 'show_task';\n\t\t} else {\n\t\t\theader('Location: index.php');\n\t\t}\n\t}",
"public function displayUpdate() {\n $postManager = new PostManager();\n\n $post = $postManager->getPostUpdate($_GET['id']);\n require(__DIR__ . '/../View/backend/updatePost.php');\n }",
"public function actionUpdate($id)\r\n\t{\r\n\t\t$model = $this->loadTaskModel($id);\r\n\r\n\t\t// Uncomment the following line if AJAX validation is needed\r\n\t\t// $this->performAjaxValidation($model);\r\n\r\n\t\tif(isset($_POST['Task']))\r\n\t\t{\r\n\t\t\tif($model->updateTask($_POST['Task'])) {\r\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->pageTitle = 'Edit Task';\r\n\r\n\t\t$this->render('update',array(\r\n\t\t\t'model'=>$model,\r\n\t\t));\r\n\t}",
"function edit()\n\t{\n\t if (JRequest::getVar('task') == 'add') {\n\t \n\t }\n\t\tparent::display();\n\t}",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }"
] | [
"0.7591453",
"0.73322237",
"0.72049737",
"0.7196977",
"0.7171651",
"0.7072057",
"0.70196646",
"0.69094497",
"0.68281007",
"0.68142176",
"0.675758",
"0.67542064",
"0.670314",
"0.6691279",
"0.66813225",
"0.6648867",
"0.6641367",
"0.65845823",
"0.6570862",
"0.6564773",
"0.65410376",
"0.6536346",
"0.6531881",
"0.65307474",
"0.65307474",
"0.65307474",
"0.65307474",
"0.65307474",
"0.65307474",
"0.65307474"
] | 0.75179446 | 1 |
this behavior handles the saving of the addon's specific settings works with adminEventHandlerSettings | public static function adminEventHandlerSettingsSave() {
global $s;
$ehdummy_active = !empty($_POST['ehdummy_active']);
$s->put('ehdummy_active', $ehdummy_active, 'boolean');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function save_settings()\n\t{\n\t\tif (empty($_POST))\n\t\t{\n\t\t\tshow_error(lang('unauthorized_access'));\n\t\t}\n\n\t\tunset($_POST['submit']);\n\n\t\tee()->db->where('class', 'Unique_channel_titles_ext');\n\t\tee()->db->update('extensions', array('settings' => serialize($_POST)));\n\n\t\tee()->session->set_flashdata(\n\t\t\t'message_success',\n\t\t\tlang('preferences_updated')\n\t\t);\n\n\t\tee()->functions->redirect(ee('CP/URL', 'addons/settings/'.$this->class_name));\n\t}",
"public function save_admin_settings() {\n \n (new MidrubBaseAdminCollectionSettingsHelpers\\Settings)->save_admin_settings();\n \n }",
"public static function save_settings() {\n\n\t\t// Only admins can save settings.\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tself::save_common_settings();\n\t\tself::save_debug_settings();\n\t\tself::save_permalink_settings();\n\t\tself::save_facebook_settings();\n\n\t\t// Let extensions hook into saving.\n\t\tdo_action( 'cartflows_admin_settings_save' );\n\t}",
"function save_settings()\n\t {\n\t if (empty($_POST))\n\t {\n\t show_error(lang('unauthorized_access'));\n\t }\n\t \n\t unset($_POST['submit']);\n\t \n\t ee()->lang->loadfile('gdtindex');\n\t \n\t $len = ee()->input->post('channel_id');\n\t \n\t foreach($this->settings as $key=>$row)\n\t {\n\t \t $this->settings[$key] = ee()->input->post($key);\n\t }\n\t \n\t ee()->db->where('class', __CLASS__);\n\t ee()->db->update('extensions', array('settings' => serialize($this->settings)));\n\t \n\t ee()->session->set_flashdata(\n\t 'message_success',\n\t lang('preferences_updated')\n\t \n\t );\n\t \n\t \t// Since we're updating the channel_id data, we'll need to initialize the Shared class properties.\n\t\t\t \tee()->shared->initialize();\n\n\t \n\t // Build and populate the options table based on the current settings.\n\t if($this->build_index())\n\t {\n\t\t \n\t\t // Seed the table from existing entries.\n\t\t $this->populate_index();\n\t\t \n\t\t // Create db table indexes\n\t\t $this->index_fields();\n\t\t \n\t \n\t };\n\n\t }",
"function save_settings()\n\t{\n\t\tif (empty($_POST)) {\n\t\t\tshow_error($this->EE->lang->line('unauthorized_access'));\n\t\t}\n\n\t\t$data = array();\n\n\t\tforeach ($this->channels AS $key => $val) {\n\t\t\t$channel_id = $val['channel_id'];\n\n\t\t\t$data[$channel_id] = array(\n\t\t\t\t'url' => $this->EE->input->post('channel_' . $channel_id . '_url'),\n\t\t\t);\n\t\t}\n\n\t\t$this->EE->db->where('class', __CLASS__);\n\t\t$this->EE->db->update('extensions', array('settings' => serialize($data)));\n\n\t\t$this->EE->session->set_flashdata(\n\t\t\t'message_success',\n\t\t\t$this->EE->lang->line('preferences_updated')\n\t\t);\n\t}",
"function beaver_extender_settings_save() {\r\n\t\r\n\tcheck_ajax_referer( 'plugin-settings', 'security' );\r\n\t\r\n\t$update = $_POST['extender'];\r\n\tupdate_option( 'beaver_extender_settings', $update );\r\n\r\n\tbeaver_extender_get_settings( null, $args = array( 'cached' => false, 'array' => false ) );\r\n\t\r\n\tbeaver_extender_write_files( $css = true, $custom = false );\r\n\t\r\n\techo 'Plugin Settings Updated';\r\n\texit();\r\n\t\r\n}",
"public function saveSettings()\n {\n $this->getStore()->save($this->data);\n }",
"function _save_settings()\n\t{\n\t\t$this->EE->load->helper('loader');\n\t\t$post_data['settings']\t\t\t\t\t= $this->EE->input->post('settings', FALSE); // FALSE to keep style=\"\", but concerned...\n\t\t$post_data['copy_to_members']\t\t\t= $this->EE->input->post('copy_to_members', TRUE);\n\t\t$post_data['members']\t\t\t\t\t= $this->EE->input->post('members', TRUE);\n\t\t$post_data['clear_individual_settings']\t= $this->EE->input->post('clear_individual_settings', TRUE);\n\t\t$post_data['enable_module']\t\t\t\t= $this->EE->input->post('enable_module', FALSE);\n\t\t$installed_addons\t\t\t\t\t\t= $this->EE->zenbu_get->_get_installed_addons();\n\t\t\n\t\t/**\n\t\t*\t----------------------------------------------------------\n\t\t*\tBuild the extra settings labels array\n\t\t*\teg. text_option_1, text_option_2, my_fieldtype_option_1...\n\t\t*\t----------------------------------------------------------\n\t\t*\tGo through all fields, load fieldtype classes and fetch\n\t\t*\teach extra settings label.\n\t\t*/\n\t\t\n\t\t// Determine non-fieldtype extra settings labels\n\t\t$non_ft_option_labels = $this->non_ft_extra_options;\n\n\t\t// Add Pages extra option if available\n\t\tif(in_array('Pages', $installed_addons['modules']))\n\t\t{\n\t\t\t$non_ft_option_labels['livelook_option_4'] = 'livelook_option_4';\n\t\t}\n\t\t\n\t\t// Get field information\n\t\t$fields = $this->EE->zenbu_get->_get_field_ids();\n\t\tif( ! empty($fields) && isset($fields['id'], $fields['field'], $fields['fieldtype']) )\n\t\t{\n\t\t\t$field_label_array = $fields['field'];\n\t\t\t$field_type_array = $fields['fieldtype'];\n\t\t\t$field_id_array = $fields['id'];\n\t\t}\n\t\t\n\t\t$ft_option_labels_array = array();\n\t\t\n\t\tif(isset($field_id_array))\n\t\t{\n\t\t\tforeach($field_id_array as $key => $field_id)\n\t\t\t{\n\t\t\t\t$ft_class = $field_type_array[$field_id].'_ft';\n\t\t\t\tload_ft_class($ft_class);\n\t\t\t\t\n\t\t\t\tif(class_exists($ft_class))\n\t\t\t\t{\t\t\t\n\t\t\t\t\n\t\t\t\t\t// Retrieve extra settings short names\n\t\t\t\t\t// Parameters are empty as we just want to retrieve third-party array keys\n\t\t\t\t\t$ft_object = create_object($ft_class);\n\t\t\t\t\t$extra_settings_array = (method_exists($ft_object, 'zenbu_field_extra_settings')) ? $ft_object->zenbu_field_extra_settings(\"\", \"\", array()) : array();\n\t\n\t\t\t\t\t// Create a simple list of \"extra option\" short names\n\t\t\t\t\t// Used to loop through short names when saving data\n\t\t\t\t\tif( ! empty($extra_settings_array))\n\t\t\t\t\t{\n\t\t\t\t\t\t$extra_settings_name_array = array_keys($extra_settings_array);\n\t\t\t\t\t\tforeach($extra_settings_name_array as $key => $extra_settings_name)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif( ! isset($ft_option_labels_array))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$ft_option_labels_array = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(isset($ft_option_labels_array) && ! in_array($extra_settings_name, $ft_option_labels_array))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$ft_option_labels_array[] = $extra_settings_name;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$ft_option_labels_array = array_merge($ft_option_labels_array, $non_ft_option_labels);\n\n\t\t//\tEND building extra settings labels array\n\t\t\n\t\t\n\t\t/**\n\t\t*\t---------------------------------------------\n\t\t*\tProcess POST variables for saving in database\n\t\t*\t---------------------------------------------\n\t\t*/\n\t\t$data = array();\n\t\tif($post_data['settings'] !== FALSE)\n\t\t{\t\t\n\t\t\tforeach($post_data['settings'] as $channel_id => $settings)\n\t\t\t{\n\t\t\t\tif($channel_id == \"general\" && $channel_id != \"0\")\n\t\t\t\t{\n\t\t\t\t\t$settings['max_results_per_page'] = (int)$settings['max_results_per_page'];\n\t\t\t\t\t$db_data['general_settings'] = serialize($settings);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$form_channel_id =& $channel_id;\n\t\t\t\t\t$data['show_std_fields'] = array();\n\t\t\t\t\t$data['show_custom_fields'] = \"\";\n\t\t\t\t\t$data['field_order'] = array();\n\t\t\t\t\t$data['extra_options'] = array();\n\t\t\t\t\t$order_array = array();\n\t\t\t\t\t$extra_option_array = array();\n\t\t\t\t\n\t\t\t\t\tforeach($settings as $col => $setting)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(substr($col, 0, 6) == 'field_' && isset($setting['show']) && $setting['show'] == 'y' && isset($col))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$data['show_custom_fields'] .= substr($col, 6).'|';\n\t\t\t\t\t\t} elseif(substr($col, 0, 6) != 'field_' && isset($setting['show'])) {\n\t\t\t\t\t\t\t$data['show_std_fields'][$col] = $setting['show'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Prepare ordering\n\t\t\t\t\t\tif(isset($setting['field_order']) && is_numeric($setting['field_order']) && ! isset($order_array[$setting['field_order']]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$order_array[$setting['field_order']] = $col;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//\t--------------\n\t\t\t\t\t\t//\tExtra options\n\t\t\t\t\t\t//\t--------------\n\t\t\t\t\t\t//\tFetch validation method for each field if available\n\t\t\t\t\t\t//\tIf not simply process the settings for update\n\t\t\t\t\t\t$field_id = (substr($col, 0, 6) == 'field_') ? substr($col, 6) : 0;\n\t\t\t\t\t\t$fieldtype_name = ($field_id != 0) ? $field_type_array[$field_id] : '';\n\t\t\t\t\t\t$ft_class = 'Zenbu_'.$fieldtype_name.'_ft';\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(class_exists($ft_class) && method_exists($ft_class, 'zenbu_field_validation'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$ft_object = create_object($ft_class);\n\t\t\t\t\t\t\tif(method_exists($ft_object, 'zenbu_field_validation'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Custom field validation\n\t\t\t\t\t\t\t\t$extra_option_array[$col] = $ft_object->zenbu_field_validation($setting);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// If no custom validation, go ahead with preparing settings\n\t\t\t\t\t\t\tforeach($ft_option_labels_array as $key => $label)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(isset($setting[$label]) && ! isset($extra_option_array[$setting[$label]]))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$extra_option_array[$col][$label] = $setting[$label];\n\n\t\t\t\t\t\t\t\t\t// Special validation for non-ft field who accepts numerical value (category limit)\n\t\t\t\t\t\t\t\t\t$extra_option_array[$col][$label] = $label == 'category_option_1' && ! is_numeric($setting[$label]) ? '' : $extra_option_array[$col][$label];\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\t\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tksort($order_array);\n\t\t\t\t\t$order_array = array_flip($order_array);\n\t\t\t\t\t\n\t\t\t\t\t$output_data_show_fields[$channel_id] = $data['show_std_fields'];\n\t\t\t\t\t$output_data_show_custom_fields[$channel_id]['show_custom_fields'] = (strlen($data['show_custom_fields']) > 0) ? substr($data['show_custom_fields'], 0, -1) : '';\n\t\t\t\t\t$output_data_field_order[$channel_id]['field_order'] = $order_array;\n\t\t\t\t\t$output_data_extra_options[$channel_id]['extra_options'] = $extra_option_array;\t\n\t\t\t\t} // END if\n\t\t\t} // END foreach\n\t\t\t\n\t\t\t//\t----------------------------------------\n\t\t\t//\tGet previous setting data and plug in new data\n\t\t\t//\t----------------------------------------\n\n\t\t\t$pre_save_settings = $this->EE->zenbu_get->_get_settings('pre_save');\n\n\t\t\t$setting_cols = array(\n\t\t\t\t'show_fields'\t\t\t=> 'output_data_show_fields',\n\t\t\t\t'show_custom_fields'\t=> 'output_data_show_custom_fields',\n\t\t\t\t'field_order'\t\t\t=> 'output_data_field_order',\n\t\t\t\t'extra_options'\t\t\t=> 'output_data_extra_options',\n\t\t\t\t);\n\n\t\t\tforeach($setting_cols as $col => $v)\n\t\t\t{\n\t\t\t\t// Plug in new values if present inside of $pre_save_settings\n\n\t\t\t\tforeach($pre_save_settings['setting'][$col] as $ch_id => $arr)\n\t\t\t\t{\n\t\t\t\t\t$db_data[$col][$ch_id] = isset(${$v}[$ch_id]) ? ${$v}[$ch_id] : $arr;\n\t\t\t\t}\n\n\t\t\t\t// What if it's a new channel? It won't be in $pre_save_settings,\n\t\t\t\t// so create this array and add it to data to be saved.\n\n\t\t\t\tif( ! isset($pre_save_settings['setting'][$col][$form_channel_id]) && isset($form_channel_id) )\n\t\t\t\t{\n\t\t\t\t\t$db_data[$col][$form_channel_id] = isset(${$v}[$form_channel_id]) ? ${$v}[$form_channel_id] : array();\n\t\t\t\t}\n\n\t\t\t\t$db_data[$col] = serialize($db_data[$col]);\t\t\t\t\t\t\t\n\n\t\t\t}\n\n\t\t\t/**\n\t\t\t*\tSave setting for single member\n\t\t\t*\t==============================\n\t\t\t*/\n\t\t\t$db_data['member_id'] = $this->member_id;\n\t\t\t$db_data['site_id'] = $this->site_id;\n\t\t\t$this->EE->db->from($this->addon_short_name . '_member_settings');\n\t\t\t$this->EE->db->where('member_id', $this->member_id);\n\t\t\t$this->EE->db->where('site_id', $this->site_id);\n\t\t\t$results = $this->EE->db->get();\n\t\t\tif($results->num_rows() > 0)\n\t\t\t{\n\t\t\t\t// If row exists, update\n\t\t\t\t$sql = $this->EE->db->update_string($this->addon_short_name . '_member_settings', $db_data, \"member_id = \".$this->EE->db->escape_str($this->member_id).\" AND site_id = \".$this->EE->db->escape_str($this->site_id));\n\t\t\t\t$this->EE->db->query($sql);\n\t\t\t} else {\n\t\t\t\t// If row doesn't exist, insert new row\n\t\t\t\t$sql = $this->EE->db->insert_string($this->addon_short_name . '_member_settings', $db_data);\n\t\t\t\t$this->EE->db->query($sql);\n\t\t\t}\n\n\t\t\t\n\t\t\t// ... then update with correct settings\n\t\t\t// for each member group (if any are selected, of course)\n\t\t\tif($post_data['copy_to_members'] !== FALSE)\n\t\t\t{\n\t\t\t\tunset($db_data['member_id']);\n\t\t\t\tforeach($post_data['copy_to_members'] as $key => $m_group_id)\n\t\t\t\t{\n\t\t\t\t\t$db_data['member_group_id'] = $m_group_id;\n\t\t\t\t\t$db_data['site_id'] = $this->site_id;\n\t\t\t\t\t\n\t\t\t\t\t$this->EE->db->from($this->addon_short_name);\n\t\t\t\t\t$this->EE->db->where('member_group_id', $m_group_id);\n\t\t\t\t\t$results = $this->EE->db->get();\n\t\t\t\t\tif($results->num_rows() > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t// If row exists, update\n\t\t\t\t\t\t$sql = $this->EE->db->update_string($this->addon_short_name, $db_data, \"member_group_id = \".$this->EE->db->escape_str($m_group_id).\" AND site_id = \".$this->EE->db->escape_str($this->site_id));\n\t\t\t\t\t\t$this->EE->db->query($sql);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If row doesn't exist, insert new row\n\t\t\t\t\t\t$sql = $this->EE->db->insert_string($this->addon_short_name, $db_data);\n\t\t\t\t\t\t$this->EE->db->query($sql);\n\t\t\t\t\t}\n\n\t\t\t\t\t//\n\t\t\t\t\t//\tIf clear individual settings is enabled\n\t\t\t\t\t//\tFind users in each member group and remove settings in\n\t\t\t\t\t//\texp_zenbu_member_settings\n\t\t\t\t\t//\n\t\t\t\t\tif($post_data['clear_individual_settings'] !== FALSE)\n\t\t\t\t\t{\n\t\t\t\t\t\t$clear_members = array();\n\t\t\t\t\t\t$m_query = $this->EE->db->query('SELECT member_id FROM exp_members WHERE group_id = ' . $this->EE->db->escape_str($m_group_id));\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($m_query->num_rows() > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach($m_query->result_array() as $row)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$clear_members[] = $row['member_id'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif( ! empty($clear_members) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->EE->db->where_in('member_id', $clear_members);\n\t\t\t\t\t\t\t$this->EE->db->delete($this->addon_short_name . '_member_settings');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} // END if $post_data['settings'] !== FALSE\n\t\t\t\n\t\t//\t----------------------------------------\t\n\t\t// \tIf post data is available to save/copy admin settings,\n\t\t// \tdo the appropriate queries here for each member group\n\t\t//\t----------------------------------------\n\t\tif($post_data['members'] !== FALSE)\n\t\t{\n\t\t\tforeach($post_data['members'] as $member_gr_id => $set)\n\t\t\t{\n\t\t\t\tforeach($this->permissions as $permission)\n\t\t\t\t{\n\t\t\t\t\tswitch($permission)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'can_admin': \n\t\t\t\t\t\tcase 'can_copy_profile': \n\t\t\t\t\t\tcase 'can_access_settings':\n\t\t\t\t\t\t\t$setting[$permission] = ((isset($set[$permission]) && $set[$permission] == 'y') || $member_gr_id == 1) ? 'y' : 'n';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$setting[$permission] = (isset($set[$permission]) && $set[$permission] == 'y') ? 'y' : 'n';\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\t// Update\n\t\t\t\t$sql = $this->EE->db->update_string($this->addon_short_name, $setting, \"member_group_id = \".$this->EE->db->escape_str($member_gr_id).\" AND site_id = \".$this->EE->db->escape_str($this->site_id));\n\t\t\t\t$this->EE->db->query($sql);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * \t----------------------------------------\n\t\t * For Super Admins, save data to enable the module for selected member groups.\n\t\t * A lot handier than viting each member group settings and enabling the add-on.\n\t\t * ----------------------------------------\n\t\t */\n\t\tif($post_data['enable_module'])\n\t\t{\n\t\t\t$module_id = array_search(ZENBU_NAME, $installed_addons['modules']);\n\n\t\t\t// Remove all member_group module access settings for this module\n\t\t\t// Will add new settings based on submitted data later\n\t\t\t$this->EE->db->delete('exp_module_member_groups', array('module_id' => $module_id)); \n\n\t\t\tforeach($post_data['enable_module'] as $key => $group_id)\n\t\t\t{\n\t\t\t\tif( $group_id != 1)\n\t\t\t\t{\n\t\t\t\t\t// Add member group to be allowed access to Zenbu\n\t\t\t\t\t$enable_data['group_id'] = $group_id;\n\t\t\t\t\t$enable_data['module_id'] = $module_id;\n\t\t\t\t\t$sql = $this->EE->db->insert_string('exp_module_member_groups', $enable_data);\n\t\t\t\t\t$this->EE->db->query($sql);\n\n\t\t\t\t\t// Turn on ADD-ONS and ADD-ONS => Modules options for the group.\n\t\t\t\t\t// I'll never understand this requirement.\n\t\t\t\t\t$enable_access['can_access_addons'] = 'y';\n\t\t\t\t\t$enable_access['can_access_modules'] = 'y';\n\t\t\t\t\t$this->EE->db->where('group_id', $group_id);\n\t\t\t\t\t$this->EE->db->update('member_groups', $enable_access);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tif($post_data['members'] !== FALSE || $post_data['settings'] !== FALSE)\n\t\t{\n\t\t// Display success message\n\t\t$this->EE->javascript->output('\n \t\t\t$.ee_notice(\"'.$this->EE->lang->line(\"message_settings_saved\").'\", {\"type\" : \"success\"});\n\t\t\t');\n\t\t}\n\t}",
"function settings_page_save() {\n\t\t// Check for permission\n\t\tif ( !current_user_can( 'manage_options' ) ) {\n\t\t\twp_die( __( 'You do not have sufficient permissions to access this page.' ) );\n\t\t}\n\n\t\tif ( empty( $_POST[ 'woo_goget_settings' ] ) ) {\n\t return;\n\t }\n\n\t $options = WooGogetUtil::request( 'woo_goget_settings' );\n\n\t // Update options\n\t update_option( self::OPTIONS_KEY, $options );\n\n\t // Reset options\n\t $this->set_options();\n\n\t return [\n\t \t'status' => 'success',\n\t \t'message' => __( 'Settings saved' )\n\t ];\n\t}",
"function monsterinsights_settings_save_support() {\n\n}",
"public function settings_save() {\n\t\tcheck_admin_referer( 'fusion_builder_save_fb_settings', 'fusion_builder_save_fb_settings' );\n\n\t\tupdate_option( 'fusion_builder_settings', $_POST );\n\t\twp_safe_redirect( admin_url( 'admin.php?page=fusion-builder-settings' ) );\n\t\texit;\n\t}",
"public function settings_save() {\n\t\tcheck_admin_referer( 'fusion_builder_save_fb_settings', 'fusion_builder_save_fb_settings' );\n\n\t\tupdate_option( 'fusion_builder_settings', $_POST );\n\t\twp_safe_redirect( admin_url( 'admin.php?page=fusion-builder-settings' ) );\n\t\texit;\n\t}",
"public function theme_customizer_save()\n\t{\n\t\t$settings = $this->get_settings();\n\t\t$this->save( $settings[$this->number] );\n\t}",
"public function save()\n\t{\n\t $this->saveSettings( $this->settings );\n\t}",
"public function save_settings() {\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Check the nonce\n\t\tif (\n\t\t\t ! isset( $_POST[ m_chart()->slug ] )\n\t\t\t|| ! wp_verify_nonce( $_POST[ m_chart()->slug ]['nonce'], m_chart()->slug . '-save-settings' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t$validated_settings = array();\n\t\t$submitted_settings = $_POST[ m_chart()->slug ];\n\n\t\t$default_settings = apply_filters( 'm_chart_default_settings', m_chart()->settings );\n\n\t\tforeach ( $default_settings as $setting => $default ) {\n\t\t\tif ( ! isset( $submitted_settings[ $setting ] ) ) {\n\t\t\t\t$validated_settings[ $setting ] = $default;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( isset( $this->safe_settings[ $setting ] ) ) {\n\t\t\t\t// If we've got an array of valid values lets check against that\n\t\t\t\t$safe_setting = $this->safe_settings[ $setting ];\n\n\t\t\t\tif ( in_array( $submitted_settings[ $setting ], $safe_setting, true ) ) {\n\t\t\t\t\t$validated_settings[ $setting ] = $submitted_settings[ $setting ];\n\t\t\t\t} else {\n\t\t\t\t\t$validated_settings[ $setting ] = $default;\n\t\t\t\t}\n\t\t\t} elseif ( 'lang_settings' == $setting ) {\n\t\t\t\t// The language settinsg require a bit more checking\n\t\t\t\tforeach ( $default_settings['lang_settings'] as $lang_setting => $lang_default ) {\n\t\t\t\t\t$lang_value = $submitted_settings['lang_settings'][ $lang_setting ];\n\n\t\t\t\t\tif ( 'numericSymbols' == $lang_setting ) {\n\t\t\t\t\t\t// The numeric symbols are input as a comma seperated string so we'll deal with that here\n\t\t\t\t\t\t$numeric_symbols = explode( ',', $lang_value );\n\t\t\t\t\t\t$safe_symbols = array();\n\n\t\t\t\t\t\tforeach ( $numeric_symbols as $symbol ) {\n\t\t\t\t\t\t\t$safe_symbols[] = trim( $symbol );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$validated_settings[ $setting ][ $lang_setting ] = $safe_symbols;\n\t\t\t\t\t} elseif ( 'numericSymbolMagnitude' == $lang_setting ) {\n\t\t\t\t\t\t// Only want positive numbers for the numericSymbolMagnitude value\n\t\t\t\t\t\tif ( is_numeric( $lang_value ) && 0 < $lang_value ) {\n\t\t\t\t\t\t\t$validated_settings[ $setting ][ $lang_setting ] = absint( $lang_value );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$validated_settings[ $setting ][ $lang_setting ] = $lang_default;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// The rest of the language settings are all single character values\n\t\t\t\t\t\t$validated_settings[ $setting ][ $lang_setting ] = sanitize_text_field( substr( $lang_value, 0, 1 ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Make sure the value is safe before attempting to save it\n\t\t\t\tif ( preg_match('#^[a-zA-Z0-9-_]+$#', $submitted_settings[ $setting ] ) ) {\n\t\t\t\t\t$validated_settings[ $setting ] = $submitted_settings[ $setting ];\n\t\t\t\t} else {\n\t\t\t\t\t$validated_settings[ $setting ] = $default;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Allow third party libraries to further validate the settings\n\t\t$validated_settings = apply_filters( 'm_chart_validated_settings', $validated_settings, $submitted_settings );\n\n\t\tupdate_option( m_chart()->slug, $validated_settings );\n\n\t\t// Make sure the embed endpoint makes it into the rewrite rules\n\t\tflush_rewrite_rules();\n\n\t\tadd_action( 'admin_notices', array( $this, 'save_success' ) );\n\t}",
"function _save_settings() {\r\n if ( ! fs_request_is_action( 'save_settings' ) ) {\r\n return;\r\n }\r\n\r\n check_admin_referer( 'save_settings' );\r\n\r\n $this->update_developer(\r\n fs_request_get( 'fs_id' ),\r\n fs_request_get( 'fs_public_key' ),\r\n fs_request_get( 'fs_secret_key' )\r\n );\r\n }",
"public function actionSaveSettings()\n {\n PermissionsHelper::requirePermission(PermissionsHelper::PERMISSION_SETTINGS);\n\n $this->requirePostRequest();\n $postData = craft()->request->getPost('settings', array());\n $updateLayout = craft()->request->getPost('update_layout', false);\n\n if ($updateLayout) {\n $this->savePostedLayout();\n }\n\n $this->handleIcsFields($postData);\n\n $plugin = craft()->plugins->getPlugin('calendar');\n craft()->plugins->savePluginSettings($plugin, $postData);\n\n craft()->userSession->setNotice(Craft::t('settings_saved'));\n $this->redirectToPostedUrl();\n }",
"function _saveSettings()\n {\n global $objDatabase, $_CONFIG, $_ARRAYLANG;\n\n // Store settings\n if (isset($_GET['act']) && $_GET['act'] == 'settings' && isset($_POST['store'])) {\n // save multilanguage news_feed_title and news_feed_description\n $this->storeFeedLocales('news_feed_title', $_POST['newsFeedTitle']);\n $this->storeFeedLocales('news_feed_description', $_POST['newsFeedDescription']);\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings\n SET value='\".intval($_POST['newsFeedStatus']).\"'\n WHERE name = 'news_feed_status'\");\n\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings\n SET value='\".contrexx_input2db($_POST['newsFeedImage']).\"'\n WHERE name='news_feed_image'\");\n\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings\n SET value='\".intval($_POST['headlinesLimit']).\"'\n WHERE name = 'news_headlines_limit'\");\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".intval($_POST['recentNewsMessageLimit']).\"' WHERE name = 'recent_news_message_limit'\");\n // Notify-user. 0 = disabled.\n $this->_store_settings_item('news_notify_user', intval($_POST['newsNotifySelectedUser']));\n // Notify-Group. 0 = disabled.\n $this->_store_settings_item('news_notify_group', intval($_POST['newsNotifySelectedGroup']));\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='1' WHERE name = 'news_settings_activated'\");\n $submitNews = isset($_POST['newsSubmitNews']) ? intval($_POST['newsSubmitNews']) : 0;\n $submitNewsCommunity = isset($_POST['newsSubmitOnlyCommunity']) ? intval($_POST['newsSubmitOnlyCommunity']) : 0;\n $activateSubmittedNews = isset($_POST['newsActivateSubmittedNews']) ? intval($_POST['newsActivateSubmittedNews']) : 0;\n $newsCommentsAllow = isset($_POST['newsCommentsAllow']) ? intval($_POST['newsCommentsAllow']) : 0;\n $newsCommentsAllowAnonymous = isset($_POST['newsCommentsAllowAnonymous']) ? intval($_POST['newsCommentsAllowAnonymous']) : 0;\n $newsCommentsAutoActivate = isset($_POST['newsCommentsAutoActivate']) ? intval($_POST['newsCommentsAutoActivate']) : 0;\n $newsCommentsNotification = isset($_POST['newsCommentsNotification']) ? intval($_POST['newsCommentsNotification']) : 0;\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".$submitNews.\"' WHERE name='news_submit_news'\");\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".$submitNewsCommunity.\"' WHERE name='news_submit_only_community'\");\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".$activateSubmittedNews.\"' WHERE name='news_activate_submitted_news'\");\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".!empty($_POST['newsMessageProtection']).\"' WHERE name='news_message_protection'\");\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".!empty($_POST['newsMessageProtectionRestricted']).\"' WHERE name='news_message_protection_restricted'\");\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".$newsCommentsAllow.\"' WHERE name='news_comments_activated'\");\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".$newsCommentsAllowAnonymous.\"' WHERE name='news_comments_anonymous'\");\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".$newsCommentsAutoActivate.\"' WHERE name='news_comments_autoactivate'\");\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".$newsCommentsNotification.\"' WHERE name='news_comments_notification'\");\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".(!empty($_POST['newsCommentsTimeout']) ? abs(intval($_POST['newsCommentsTimeout'])) : 30).\"' WHERE name='news_comments_timeout'\");\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".!empty($_POST['newsUseTop']).\"' WHERE name='news_use_top'\");\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".!empty($_POST['newsUseTeaserText']).\"' WHERE name = 'news_use_teaser_text'\");\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".!empty($_POST['newsUseTags']).\"' WHERE name = 'news_use_tags'\");\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".!empty($_POST['useRelatedNews']).\"' WHERE name = 'use_related_news'\");\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".!empty($_POST['newsUseTypes']).\"' WHERE name = 'news_use_types'\");\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".!empty($_POST['newsUseTop']).\"' WHERE name='news_use_top'\");\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".(!empty($_POST['newsTopDays']) ? intval($_POST['newsTopDays']) : 10).\"' WHERE name = 'news_top_days'\");\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".(!empty($_POST['newsTopLimit']) ? intval($_POST['newsTopLimit']) : 10).\"' WHERE name = 'news_top_limit'\");\n \n $newsFilterPublisher = isset($_POST['newsFilterPublisher']) ? intval($_POST['newsFilterPublisher']) : 0;\n $newsFilterAuthor = isset($_POST['newsFilterAuthor']) ? intval($_POST['newsFilterAuthor']) : 0;\n \n $assignedPublisherGroups = (isset($_POST['newsAssignedPublisherGroups']) && $newsFilterPublisher) ? implode(',', contrexx_input2db($_POST['newsAssignedPublisherGroups'])) : 0;\n $assignedAuthorGroups = (isset($_POST['newsAssignedAuthorGroups']) && $newsFilterAuthor) ? implode(',', contrexx_input2db($_POST['newsAssignedAuthorGroups'])) : 0;\n \n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".$assignedPublisherGroups.\"' WHERE name = 'news_assigned_publisher_groups'\");\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\".$assignedAuthorGroups.\"' WHERE name = 'news_assigned_author_groups'\");\n \n // save default teasers\n $defaultTeasers = array();\n if (isset($_POST['newsDefaultTeaserSelected'])) {\n foreach ($_POST['newsDefaultTeaserSelected'] as $key => $value) {\n if (!empty($value)) {\n $defaultTeasers[] = intval($key);\n }\n }\n }\n $objDatabase->Execute(\"UPDATE \".DBPREFIX.\"module_news_settings SET value='\" . implode(\";\", $defaultTeasers) . \"' WHERE name='news_default_teasers'\");\n \\Cx\\Core\\Setting\\Controller\\Setting::init('Config', 'component','Yaml');\n $newsUseTeasers = isset($_POST['newsUseTeasers']) ? intval($_POST['newsUseTeasers']) : 0;\n if (!\\Cx\\Core\\Setting\\Controller\\Setting::isDefined('newsTeasersStatus')) {\n \\Cx\\Core\\Setting\\Controller\\Setting::add('newsTeasersStatus', $newsUseTeasers, 1, \\Cx\\Core\\Setting\\Controller\\Setting::TYPE_RADIO, '1:TXT_ACTIVATED,0:TXT_DEACTIVATED', 'component');\n } else {\n \\Cx\\Core\\Setting\\Controller\\Setting::set('newsTeasersStatus', $newsUseTeasers );\n \\Cx\\Core\\Setting\\Controller\\Setting::update('newsTeasersStatus');\n }\n $this->strOkMessage = $_ARRAYLANG['TXT_NEWS_SETTINGS_SAVED'];\n $this->getSettings();\n $this->createRSS();\n }\n }",
"public function update_settings() {\n\n\t\tcheck_ajax_referer( 'mi-admin-nonce', 'nonce' );\n\n\t\tif ( ! current_user_can( 'monsterinsights_save_settings' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isset( $_POST['setting'] ) ) {\n\t\t\t$setting = sanitize_text_field( wp_unslash( $_POST['setting'] ) );\n\t\t\tif ( isset( $_POST['value'] ) ) {\n\t\t\t\t$value = $this->handle_sanitization( $setting, $_POST['value'] );\n\t\t\t\tmonsterinsights_update_option( $setting, $value );\n\t\t\t\tdo_action( 'monsterinsights_after_update_settings', $setting, $value );\n\t\t\t} else {\n\t\t\t\tmonsterinsights_update_option( $setting, false );\n\t\t\t\tdo_action( 'monsterinsights_after_update_settings', $setting, false );\n\t\t\t}\n\t\t}\n\n\t\twp_send_json_success();\n\n\t}",
"protected function _saveSettings()\n {\n $this->_cache->save($this->_settings, 'settings');\n }",
"public function save()\n {\n if ($this->isDirty) {\n $this->backend->save($this->settingsValues);\n\n $this->isDirty = false;\n\n Backend\\Cache::clearCache();\n }\n }",
"function save_settings()\n {\n if (empty($_POST)) {\n show_error(lang('unauthorized_access'));\n }\n\n ee()->lang->loadfile('cp_css_js');\n\n ee('CP/Alert')->makeInline('cp_css_js_save')\n ->asSuccess()\n ->withTitle(lang('message_success'))\n ->addToBody(lang('preferences_updated'))\n ->defer();\n\n ee()->db->where('class', __CLASS__);\n ee()->db->update('extensions', array('settings' => serialize($_POST)));\n\n ee()->functions->redirect(ee('CP/URL')->make('addons/settings/cp_css_js'));\n }",
"public function saveSettings() {\n //Get database handle\n $db = $this->getDbo();\n\n //Read Settings\n $settings = JRequest::getVar('settings');\n $settings['horizontalArticles'] = (sizeof(JRequest::getVar('horizontalArticles')) > 0 ? serialize(JRequest::getVar('horizontalArticles')) : \"\");\n $settings['verticalArticles'] = (sizeof(JRequest::getVar('verticalArticles')) > 0 ? serialize(JRequest::getVar('verticalArticles')) : \"\");\n \n $sql = \"DELETE FROM #__oss_share_settings\";\n $db->setQuery($sql);\n $db->query();\n\n //Insert new settings\n foreach ($settings as $k => $v) {\n $sql = \"INSERT INTO #__oss_share_settings ( setting, value )\" . \" VALUES ( \" . $db->Quote($k) . \", \" . $db->Quote($v) . \" );\";\n $db->setQuery($sql);\n $db->query();\n }\n $result['status'] = \"message\";\n $result['message'] = JText::_('COM_SOCIAL_SHARE_SETTING_SAVED');\n return $result;\n }",
"public static function adminEventHandlerSettings() {\n\n\t\tglobal $active, $core, $s;\n\n\t\t$ehdummy_active = (boolean) $s->ehdummy_active;\n\n\t\tinclude(dirname(__FILE__) . '/tpl/settings.tpl');\n\t}",
"function save_settings()\n\t{\n\t\tglobal $DB, $IN, $LANG, $PREFS, $SESS;\n\n\t\t$site_id = $PREFS->core_ini['site_id'];\n\t\t$notify = $IN->GBL('mu_notify', 'POST');\n\t\t$recipients = $IN->GBL('mu_recipients', 'POST');\n\t\t$subject = $IN->GBL('mu_subject', 'POST');\n\t\t$template = $IN->GBL('mu_template', 'POST');\n\n\t\t$settings = array();\n\n\t\t$settings[$site_id] = array(\n\t\t\t'notify' => $notify,\n\t\t\t'recipients' => explode(',', $recipients),\n\t\t\t'subject' => $subject,\n\t\t\t'template' => $template\n\t\t);\n\n\t\t$query = $DB->update_string('exp_pur_member_utilities_settings', array('settings' => addslashes(serialize($settings))), \"id = '1'\");\n\n\t\t$DB->query($query);\n\n\t\t$this->home_page($msg = $LANG->line('pur_member_utilities_saved'));\n\n\t}",
"function save_settings($data)\n { \n return $this->_save_settings($data);\n }",
"private function save_settings()\n\t{\n\t\tupdate_option('jammycakes_comment_locking', $this->settings);\n\t\tupdate_option('close_comments_for_old_posts', $this->wp_active);\n\t\tupdate_option('close_comments_days_old', $this->wp_timeout);\n\t}",
"public function loadSaveSettings()\n\t{\n\t\tif(isset($_POST['posted']))\n\t\t{\n\t\t\t$settings = $_POST['settings'];\n\t\t\t$source = $_POST['source'];\n\n\t\t\tforeach($settings as $key => $value)\n\t\t\t{\n\t\t\t\t$setting = new CmsSetting();\n\t\t\t\t$setting->initWithKey($key);\n\t\t\t\t$setting->setSettingValue($value);\n\t\t\t\t$setting->save();\n\t\t\t}\n\n\t\t\tCmsActivityLogCollection::addSiteActivity('settings', 'updated', json_encode($settings));\n\n\t\t\t$this->loadModule('cms_admin', 'settings', $source, true, true, array('saved' => true));\n\t\t}\n\n\t\treturn false;\n\t}",
"function ajax_save_settings() {\n\n\t\tutils::ajax_call_init($this->nonce_name);\n\t\t$response = '';\n\n\t\t// ignore the request if the current user doesn't have\n\t\t// sufficient permissions\n\t\tif ( current_user_can( 'edit_posts' )) {\n\t\t\t//TODO update config\n\t\t\tforeach ($this->config as $key => $value ){\n\t\t\t\t$subfield = $value;\n\t\t\t\tforeach ($subfield as $sub_key => $sub_value ){\n\t\t\t\t\t\tif(isset($_POST[$key][$sub_key])){\n\t\t\t\t\t\t\t$x = filter_var($_POST[$key][$sub_key], FILTER_SANITIZE_STRING);\n\t\t\t\t\t\t\t$this->config[$key][$sub_key] = utils::on_off_true_false($x);\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tutils::saveConfig($this->config);\n\t\t\t$response = json_encode( array( 'status' => \"success\", \"config\" => $this->config ) );\n\t\t} else {\n\t\t\theader( 'HTTP/1.1 401 Unauthorized', true, 401 );\n\t\t\t$response = json_encode( array( 'error' => \"not allowed\" ) );\n\t\t}\n\n\n\t\tutils::ajax_call_finish($this->nonce_name, $response);\n\t}",
"function grid_save_settings($data)\n { \n return $this->_save_settings($data, true);\n }"
] | [
"0.74968994",
"0.7413949",
"0.74071336",
"0.7187607",
"0.7176637",
"0.712072",
"0.7005165",
"0.69469255",
"0.69284207",
"0.692431",
"0.69231874",
"0.69231874",
"0.68969536",
"0.6884311",
"0.68657994",
"0.6846706",
"0.68271405",
"0.6767094",
"0.6758083",
"0.6727682",
"0.67264974",
"0.67200476",
"0.67189485",
"0.67152673",
"0.66542846",
"0.6625766",
"0.6620857",
"0.6605725",
"0.6556792",
"0.6542381"
] | 0.7596364 | 0 |
this behavior displays a custom filter on the Events page works with adminEventHandlerEventsPageCustomize | public static function adminEventHandlerEventsCustomFilterDisplay() {
global $dummy, $dummy_combo;
?>
<p><label for="status" class="ib"><?php echo __('Dummy:'); ?></label>
<?php echo form::combo('dummy', $dummy_combo, $dummy); ?>
</p>
<?php
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function adminEventHandlerEventsPageCustomize($args) {\n\t\t\tforeach ($args as $v => $k)\n\t\t\t\t$$v = &$args[$v];\n\n\t\t\tglobal $dummy, $core;\n\t\t\t$dummy = !empty($_GET['dummy']) ? $_GET['dummy'] : '';\n\t\t\tif (!$core->error->flag()) {\n\t\t\t\tglobal $dummy_combo;\n\t\t\t\t$dummy_combo = array('-' => '', __('Not dummy') => 0, __('Dummy') => 1);\n\t\t\t}\n\n\t\t\t# - Selected filter\n\t\t\tif ($dummy !== '' && in_array($dummy, $dummy_combo)) {\n\t\t\t\t$params['dummy'] = $dummy;\n\t\t\t\t$show_filters = true;\n\t\t\t}\n\n\t\t\t$redir = $redir . '&dummy=' . $dummy;\n\n\t\t\t$hidden_fields = $hidden_fields . form::hidden(array('dummy'), $dummy);\n\n\t\t\t$sortby_combo[__('Dummy')] = 'dummy';\n\t\t}",
"function dbem_filter_events_page($data) {\r\n\t\r\n\t// $table_name = $wpdb->prefix .EVENTS_TBNAME;\r\n\t// \t$start = strpos($data, DBEM_PAGE);\r\n\t\r\n\r\n\t$is_events_post = (get_the_ID () == get_option ( 'dbem_events_page' ));\r\n\t$events_page_id = get_option ( 'dbem_events_page' );\r\n\tif (is_page ( $events_page_id ) && $is_events_post) {\r\n\t\treturn dbem_events_page_content ();\r\n\t} else {\r\n\t\treturn $data;\r\n\t}\r\n}",
"function article_filters() {\n\t\torbiter::add_filter( 'render_article_html_args', array( $this, 'filters' ), 5 );\n\n\t}",
"public function admin_add_filters() {\n\t\t\n\t}",
"public function only_fc_actions(){\n\t\t\tadd_filter('eventon_cal_class', array($this, 'eventon_cal_class'), 10, 1);\t\t\n\t\t\tadd_action('eventon_below_sorts',array( $this, 'content_below_sortbar_this' ), 10,1);\n\n\t\t}",
"function wpabstracts_events_dropdown_filter(){\n $type = 'post';\n if (isset($_GET['post_type'])) {\n $type = $_GET['post_type'];\n }\n //only add filter to post type you want\n //if ('POST_TYPE' == $type){\n //change this to the list of values you want to show\n //in 'label' => 'value' format\n $events = wpabstracts_getEvents('all','',NULL);\n ?>\n <select name=\"ABSTRACTS_EVENT_FILTER\">\n <option value=\"\"><?php _e('All events', 'wpabstracts'); ?></option>\n <?php\n $current_id = isset($_GET['ABSTRACTS_EVENT_FILTER'])? $_GET['ABSTRACTS_EVENT_FILTER']:'';\n foreach ($events as $key => $row) {\n printf\n (\n '<option value=\"%s\"%s>%s</option>',\n $row->event_id,\n $row->event_id == $current_id? ' selected=\"selected\"':'',\n $row->name\n );\n }\n ?>\n </select>\n <?php\n //}\n}",
"public function admin_beforeFilter($event)\n {\n\n $this->Controller->Menu->add('Users', [\n 'url' => [\n 'plugin' => 'CakeManager',\n 'prefix' => 'admin',\n 'controller' => 'users',\n 'action' => 'index',\n ],\n 'weight' => 0,\n ]);\n\n $this->Controller->Menu->add('Roles', [\n 'url' => [\n 'plugin' => 'CakeManager',\n 'prefix' => 'admin',\n 'controller' => 'roles',\n 'action' => 'index',\n ],\n 'weight' => 1,\n ]);\n\n $this->Controller->Menu->add('Plugins', [\n 'url' => [\n 'plugin' => 'CakeManager',\n 'prefix' => 'admin',\n 'controller' => 'pages',\n 'action' => 'display', 'plugins',\n ],\n 'weight' => 1,\n ]);\n\n $this->Controller->theme = $this->config('adminTheme');\n\n $this->Controller->layout = $this->config('adminLayout');\n }",
"public function actionEvents()\n {\n $this->provideTemplate('events');\n }",
"function displayDashboard($filter)\n{\n $events = null;\n $result = \"\";\n if ($filter === true) {\n $events = EventManager::getUserEvents(SessionManager::getNickname(), true);\n if ($events != null) {\n foreach ($events as $value) {\n $isVisibleContent = $value->isVisible == 1 ? \"<img src='../images/isVisible.png' width='30px' height='30px' title='Visible event'>\" : \"\";\n $modifyBtn = $value->state === \"Not Started Yet\" ? \"<button type=\\\"button\\\" class=\\\"btn btn-primary\\\" onclick=\\\"window.location.href='../pages/editEvent.php?eventId=\" . $value->id . \"'\\\">Modify</button>\" : \"\";\n $result .= \"<tr>\n <td>\" . $value->title . \"</td>\n <td>\" . $value->startDateTime . \"</td>\n <td>\" . $value->country . \"</td>\n <td>\" . $value->state . \"</td>\n <td class='tdButtons'><button type=\\\"button\\\" class=\\\"btn btn-primary\\\" onclick=\\\"window.location.href='../pages/manageEvent.php?eventId=\" . $value->id . \"'\\\">Manage</button></td> <td class='tdButtons'>\" . $modifyBtn . \"</td><td class='tdButtons'>\" . $isVisibleContent . \"</td>\n </tr>\";\n }\n }\n }\n\n if ($filter === false) {\n $events = EventManager::getUserEvents(SessionManager::getNickname(), false);\n if ($events != null) {\n foreach ($events as $value) {\n $isVisibleContent = $value->isVisible == 1 ? \"<img src='../images/isVisible.png' width='30px' height='30px' title='Visible event'>\" : \"\";\n $result .= \"<tr>\n <td>\" . $value->title . \"</td>\n <td>\" . $value->startDateTime . \"</td>\n <td>\" . $value->endDateTime . \"</td>\n <td>\" . $value->country . \"</td>\n <td class='tdButtons'><button type=\\\"button\\\" class=\\\"btn btn-primary\\\" onclick=\\\"window.location.href='../pages/manageEvent.php?eventId=\" . $value->id . \"'\\\">View</button></td><td class='tdButtons'>\" . $isVisibleContent . \"</td>\n </tr>\";\n }\n }\n }\n return $result;\n}",
"public function beforeFilter(Event $event) {\n\t\tparent::beforeFilter($event);\n\t\n\t}",
"public function events() {\n $storage = $this->entityTypeManager->getStorage('taxonomy_term');\n\n // Get options from Event Type taxonomy vocabulary.\n $type_query = $storage->getQuery()->accessCheck(TRUE);\n $type_query->condition('vid', \"rec_event_type\");\n $type_tids = $type_query->execute();\n\n // Create an array in which to store our term names.\n $type_term_names = [];\n foreach ($type_tids as $type_tid) {\n\n /** @var \\Drupal\\taxonomy\\TermInterface */\n $type_term = $storage->load($type_tid);\n\n /*\n * We need option value to equal term tid, but Drupal will convert any\n * integer we provide as an option into a sequential integer starting with\n * 0. So we make it a string by prefixing it with term, which we strip on\n * page load using jQuery replace.\n */\n $type_filter_key = 'term' . $type_tid;\n\n // Gets taxonomy term name.\n $type_filter_name = $type_term->getName();\n\n // Add name to array.\n $type_term_names[$type_filter_key] = $type_filter_name;\n }\n // Add All option to start of array.\n array_unshift($type_term_names, \"All Events\");\n\n $element = [\n // Select list for js filtering of events by type.\n $form['event_type'] = [\n '#type' => 'select',\n '#prefix' => '<div class=\"grid-x grid-margin-x calendar-filters\"><span class=\"filters-wrapper\">',\n '#multiple' => FALSE,\n '#options' => $type_term_names,\n '#attributes' => [\n 'id' => 'event_type',\n 'class' => [\n 'cell',\n 'small-12',\n 'medium-4',\n ],\n ],\n ],\n\n // Select list for js filtering of events by month and year.\n $form['event_date'] = [\n '#type' => 'select',\n '#multiple' => FALSE,\n '#attributes' => [\n 'id' => 'event_date',\n 'class' => [\n 'cell',\n 'small-12',\n 'medium-4',\n ],\n ],\n '#suffix' => '</span></div>',\n ],\n $form['meeting_calendar'] = [\n '#markup' => '<div id=\"calendar\"> </div>',\n ],\n ];\n\n return $element;\n }",
"public function register_filters() {\n\t\t\t// add_filter( 'embed_oembed_html', array( $this, 'wrap_embeds' ), 99, 4 );\n\t\t}",
"public static function adminEventHandlerMinilistCustomize($args) {\n\t\t\tforeach ($args as $v => $k)\n\t\t\t\t$$v = &$args[$v];\n\n\t\t\t#$params['dummy']=1; This would filter the events displayed on the dummy==1 criteria\n\t\t}",
"function hook_date_ical_feed_ical_vevent_render_alter($vevent, $view, $event_array) {\n\n}",
"function _show_filter () {\n\t\t$OBJ = $this->_load_sub_module(\"articles_filter\");\n\t\treturn is_object($OBJ) ? $OBJ->_show_filter() : \"\";\n\t}",
"protected function filters(){\n\n }",
"public function beforeFilter(CakeEvent $e)\n\t{\n\t\t// and attach an event to the advanced filter object to additionally make changes to the final query\n\t\t$AdvancedFiltersObject = $e->subject->AdvancedFiltersObject;\n\t\t$this->attachListener($AdvancedFiltersObject);\n\t}",
"function page_events_list() {\n $f3=$this->framework;\n\t\tinclude( \"programmeRenderer.php\" );\t\n\t\t$progr = new ProgrammeRenderer( $this->programme() );\n\t\t$title = \"All Events\";\n\t\t$f3->set('content','content.html');\n\t\t$f3->set('html_content', $progr->render_list());\n\t\t$f3->set('html_title', $title );\n\t\tprint Template::instance()->render( \"page.html\" );\n\t}",
"public function beforeRender(CakeEvent $e)\n\t{\n\t}",
"function restrict_manage_html_filters() {\n\t\tglobal $post_type_object, $cat;\n\t\t\n\t\tif ( in_array( $post_type_object->name, apply_filters( $this->filter_name, $this->included_post_types ) ) ) {\n\t\t\t\n\t\t\tif ( ! isset( $_GET['global-featured-vc'] ) )\n\t\t\t\techo \" <input type=\\\"submit\\\" class=\\\"button-secondary\\\" name=\\\"global-featured-vc\\\" value=\\\"Display Global Featured\\\" /> \";\n\t\t\telse\n\t\t\t\techo \" <a style=\\\"display:inline !important;\\\" class=\\\"button-secondary\\\" href=\\\"\" . home_url() . \"/wp-admin/edit.php?post_type=\" . $post_type_object->name . \"\\\">Display All</a> \";\n\t\t\t\n\t\t} // end if ( in_array () )\n\t\t\n\t}",
"function SetupCustomFilters() {\n\n\t// 1. Register your custom filter below (see example)\n\t// 2. Write your custom filter function (see example fucntions: GetLastMonthFilter, GetStartsWithAFilter)\n\n}",
"private function action_filters() {\n\t\t\tadd_action( 'current_screen', array( $this, 'conditional_hooks' ) );\n\t\t\tadd_action( 'admin_menu', array( $this, 'admin_menu' ) );\n\t\t\tadd_action( 'tve_after_db_migration', array( $this, 'insert_default_data' ), 10, 1 );\n\t\t\tadd_action( 'rest_api_init', array( $this, 'create_initial_rest_routes' ) );\n\n\t\t\tadd_filter( 'tve_dash_filter_features', array( $this, 'smart_site_feature' ) );\n\t\t\tadd_filter( 'tcb_inline_shortcodes', array( $this, 'smart_site_tcb_shortcodes' ), 10, 1 );\n\t\t\tadd_filter( 'tcb_dynamiclink_data', array( $this, 'smart_site_links_shortcodes' ) );\n\t\t\tadd_filter( 'tcb_content_allowed_shortcodes', array( $this, 'allowed_shotcodes' ) );\n\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'frontend_enqueue_scripts' ), 11 );\n\t\t}",
"public function beforeFilter(Event $event)\n {\n parent::beforeFilter($event);\n $this->viewBuilder()->setLayout('logged');\n\n }",
"protected function filters()\n {\n }",
"function eventclass_Viewer()\n\t{\n\t\t$this->events[\"CopyOnLoad\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"BeforeProcessList\"]=true;\n\n\n//\tonscreen events\n\t\t$this->events[\"Viewer_snippet4\"] = true;\n\t\t$this->events[\"surat_snippet191\"] = true;\n\t\t$this->events[\"suratview_snippet15\"] = true;\n\t\t$this->events[\"suratview_snippet23\"] = true;\n\t\t$this->events[\"suratview_snippet33\"] = true;\n\n\t}",
"public function hookAdminItemsShow()\n {\n }",
"function beforeFilter() {\n\n\t}",
"public function beforeFilter(Event $event) {\n parent::beforeFilter($event);\n $this->Auth->allow([\"add\", \"manage\", 'changeStatus', 'deleteRecord', 'edit']);\n }",
"public function actionEvents() {\n $content = array();\n $url = html_entity_decode(\\app\\components\\Utilities::getPageUrl());\n $url_sections = explode('/', $url);\n if (isset($url_sections[1]) && isset($url_sections[2]) && ($url_sections[1] == 'centres' OR $url_sections[1] == 'centres' )) {\n ///getting pgae details\n $unit_abbreviation = trim($url_sections[2]);\n if (!empty($unit_abbreviation)) {\n $Academic_unit_details = \\app\\models\\AcademicAdministrativeUnit::find()->where(array('UnitAbreviationCode' => $unit_abbreviation, 'ParentUnitId' => 0))->one();\n if ($Academic_unit_details) {\n ////getting sie menu if any\n $content['side_menus'] = MenuItem::getActiveMenuItemsByMenuTypeRegionAndTemplateByUnitID(Menu::MENU_TYPE_SIDE_MENU, SiteRegions::CUSTOM_PAGE_CONTENT_SIDE_MENU, $Academic_unit_details->Id, $url);\n //var_dump($content['side_menus']);\n $content['side_blocks'] = CustomBlocks::getActiveBlocksByRegionId(SiteRegions::CUSTOM_PAGE_CONTENT_SIDE_MENU, CustomBlocks::BLOCK_TYPE_CUSTOM_PAGE, $url, $Academic_unit_details->Id);\n $language = Yii::$app->language;\n $content['unit_details'] = $Academic_unit_details;\n ///getting the lates 20 news to display\n $page_content = \\app\\models\\Events::getLatestEventsByStatusAndUnit(Events::EVENT_STATUS_PUBLISHED, $Academic_unit_details->Id, 20);\n $content['page_content'] = $page_content;\n\n ////////////////\n } else {\n $content['no_details'] = 'The requested page or section is not found';\n }\n } else {\n $content['no_details'] = 'The requested page or section is not found';\n }\n }\n return $this->render('//site/college/events_list', $content);\n }",
"function custom_post_event() {\n\t// creating (registering) the custom type\n\tregister_post_type( 'event', /* (http://codex.wordpress.org/Function_Reference/register_post_type) */\n\t\t// let's now add all the options for this post type\n\t\tarray( 'labels' => array(\n\t\t\t'name' => __( 'Event', 'iii' ), /* This is the Title of the Group */\n\t\t\t'singular_name' => __( 'Event', 'iii' ), /* This is the individual type */\n\t\t\t'all_items' => __( 'All Event', 'iii' ), /* the all items menu item */\n\t\t\t'add_new' => __( 'Add New', 'iii' ), /* The add new menu item */\n\t\t\t'add_new_item' => __( 'Add New Event', 'iii' ), /* Add New Display Title */\n\t\t\t'edit' => __( 'Edit', 'iii' ), /* Edit Dialog */\n\t\t\t'edit_item' => __( 'Edit Event', 'iii' ), /* Edit Display Title */\n\t\t\t'new_item' => __( 'New Event', 'iii' ), /* New Display Title */\n\t\t\t'view_item' => __( 'View Event', 'iii' ), /* View Display Title */\n\t\t\t'search_items' => __( 'Search Event', 'iii' ), /* Search Custom Type Title */\n\t\t\t'not_found' => __( 'Nothing found in the Database.', 'iii' ), /* This displays if there are no entries yet */\n\t\t\t'not_found_in_trash' => __( 'Nothing found in Trash', 'iii' ), /* This displays if there is nothing in the trash */\n\t\t\t'parent_item_colon' => ''\n\t\t\t), /* end of arrays */\n\t\t\t'description' => __( 'Event', 'iii' ), /* Custom Type Description */\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'show_ui' => true,\n\t\t\t'query_var' => true,\n\t\t\t'menu_position' => 7, /* this is what order you want it to appear in on the left hand side menu */\n\t\t\t'menu_icon' => 'dashicons-calendar', /* the icon for the custom post type menu */\n\t\t\t'rewrite'\t=> array( 'slug' => 'event', 'with_front' => false ), /* you can specify its url slug */\n\t\t\t'has_archive' => 'agenda', /* you can rename the slug here */\n\t\t\t'capability_type' => 'post',\n\t\t\t'hierarchical' => false,\n\t\t\t/* the next one is important, it tells what's enabled in the post editor */\n\t\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'custom-fields', 'revisions', 'sticky')\n\t\t) /* end of options */\n\t); /* end of register post type */\n\n\t/* this adds your post categories to your custom post type */\n\t// register_taxonomy_for_object_type( 'category', 'event' );\n\t/* this adds your post tags to your custom post type */\n\t// register_taxonomy_for_object_type( 'post_tag', 'event' );\n\n}"
] | [
"0.68589985",
"0.6461946",
"0.6386428",
"0.63350457",
"0.6310511",
"0.62596494",
"0.6246811",
"0.6230953",
"0.610937",
"0.6106254",
"0.6044434",
"0.6022208",
"0.6019334",
"0.5996468",
"0.5968017",
"0.59265375",
"0.59128076",
"0.58600736",
"0.5842075",
"0.58353657",
"0.581719",
"0.57966727",
"0.57807773",
"0.5771734",
"0.5759993",
"0.5757701",
"0.57564753",
"0.57423186",
"0.5708907",
"0.5707659"
] | 0.67716485 | 1 |
this behavior allows to customize several aspects of the Events page : $args is an array of by reference parameters : $params, $sortby_combo, $show_filters, $redir, $hidden_fields other variables can be created as global for later use filtercombos to use in adminEventHandlerEventsCustomFilterDisplay e.g. | public static function adminEventHandlerEventsPageCustomize($args) {
foreach ($args as $v => $k)
$$v = &$args[$v];
global $dummy, $core;
$dummy = !empty($_GET['dummy']) ? $_GET['dummy'] : '';
if (!$core->error->flag()) {
global $dummy_combo;
$dummy_combo = array('-' => '', __('Not dummy') => 0, __('Dummy') => 1);
}
# - Selected filter
if ($dummy !== '' && in_array($dummy, $dummy_combo)) {
$params['dummy'] = $dummy;
$show_filters = true;
}
$redir = $redir . '&dummy=' . $dummy;
$hidden_fields = $hidden_fields . form::hidden(array('dummy'), $dummy);
$sortby_combo[__('Dummy')] = 'dummy';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function adminEventHandlerMinilistCustomize($args) {\n\t\t\tforeach ($args as $v => $k)\n\t\t\t\t$$v = &$args[$v];\n\n\t\t\t#$params['dummy']=1; This would filter the events displayed on the dummy==1 criteria\n\t\t}",
"function MyEvents($args=array())\n {\n $this->Hash2Object($args);\n $this->AlwaysReadData=array(\"Unit\",\"Name\",\"Status\",\"StartDate\",\"EndDate\");\n $this->Sort=array(\"Name\");\n $this->IDGETVar=\"Event\";\n $this->NonGetVars=array(\"Event\",\"CreateTable\");\n \n $this->MyEvents_CellMethods_Init();\n }",
"function article_filters() {\n\t\torbiter::add_filter( 'render_article_html_args', array( $this, 'filters' ), 5 );\n\n\t}",
"public function ez_slider_1_fields_ezfilter($arr_args = array()){\n\t\n\t return $arr_args;\n\t}",
"function tbcf_query_events( $args = array() ) {\n\n\treturn apply_filters( 'tbcf_query_events', new WP_Query( array_merge( array(\n\t\t'post_type' => 'ctc_event',\n\t\t'paged' => tbcf_page_num(),\n\t\t'order' => 'ASC',\n\t\t'orderby' => 'meta_value',\n\t\t'meta_key' => '_ctc_event_start_date_start_time',\n\t\t'meta_type' => 'DATETIME',\n\t\t'meta_query' => array(\n\t\t\tarray(\n\t\t\t\t'key' => '_ctc_event_end_date',\n\t\t\t\t'value' => date_i18n( 'Y-m-d' ),\n\t\t\t\t'compare' => '>=',\n\t\t\t\t'type' => 'DATE'\n\t\t\t)\n\t\t)\n\t), $args ) ) );\n\n}",
"public static function coreEventHandlerBeforeGetEvents($eh, $args) {\n\t\t\tforeach ($args as $v => $k) {\n\t\t\t\t$$v = &$args[$v];\n\t\t\t} #Recreates the byref args.\n\t\t\t$col = (array) $params['columns'];\n\t\t\t$col[] = 'dummy';\n\t\t\t$params['columns'] = $col;\n\n\t\t\tif (!empty($params['dummy'])) {\n\t\t\t\t$params['sql'] .= \"AND EH.dummy = '\" . $eh->con->escape($params['dummy']) . \"' \";\n\t\t\t}\n\t\t}",
"public function setArguments() {\n\n $theme = wp_get_theme(); // For use with some settings. Not necessary.\n\n $this->args = array(\n 'opt_name' => 'business_review_config',\n 'display_name' => __( 'Business Reviews Settings', 'business-review' ),\n 'display_version' => __('Business Reviews', 'business-review' ),\n 'page_slug' => 'business_reviews_options',\n 'page_title' => __( 'Business Reviews Settings', 'business-review' ),\n 'update_notice' => true,\n 'menu_type' => 'submenu',\n 'menu_title' => __( 'Settings', 'business-review' ),\n 'allow_sub_menu' => false,\n 'page_parent' => 'edit.php?post_type=business_review',\n 'page_parent_post_type' => 'business_review',\n 'customizer' => true,\n 'default_show' => true,\n 'default_mark' => '*',\n 'dev_mode' => false,\n 'admin_bar' => false,\n 'hints' => \n array(\n 'icon' => 'el-icon-info-sign',\n 'icon_position' => 'right',\n 'icon_size' => 'normal',\n 'tip_style' => \n array(\n 'color' => 'light',\n ),\n 'tip_position' => \n array(\n 'my' => 'top left',\n 'at' => 'bottom right',\n ),\n 'tip_effect' => \n array(\n 'show' => \n array(\n 'duration' => '500',\n 'event' => 'mouseover',\n ),\n 'hide' => \n array(\n 'effect' => 'fade',\n 'duration' => '500',\n 'event' => 'mouseleave unfocus',\n ),\n ),\n ),\n 'output' => true,\n 'output_tag' => true,\n 'compiler' => true,\n 'page_icon' => 'icon-themes',\n 'page_permissions' => 'manage_options',\n 'save_defaults' => true,\n 'show_import_export' => true,\n 'open_expanded' => true,\n 'transient_time' => '3600',\n 'network_sites' => true,\n );\n\n // SOCIAL ICONS -> Setup custom links in the footer for quick links in your panel footer icons.\n // $this->args['share_icons'][] = array(\n // 'url' => 'https://github.com/ReduxFramework/ReduxFramework',\n // 'title' => 'Visit us on GitHub',\n // 'icon' => 'el-icon-github'\n // //'img' => '', // You can use icon OR img. IMG needs to be a full URL.\n // );\n // $this->args['share_icons'][] = array(\n // 'url' => 'https://www.facebook.com/pages/Redux-Framework/243141545850368',\n // 'title' => 'Like us on Facebook',\n // 'icon' => 'el-icon-facebook'\n // );\n // $this->args['share_icons'][] = array(\n // 'url' => 'http://twitter.com/reduxframework',\n // 'title' => 'Follow us on Twitter',\n // 'icon' => 'el-icon-twitter'\n // );\n // $this->args['share_icons'][] = array(\n // 'url' => 'http://www.linkedin.com/company/redux-framework',\n // 'title' => 'Find us on LinkedIn',\n // 'icon' => 'el-icon-linkedin'\n // );\n }",
"public function setFilters()\n\t{\n\t\t$filters =& $this->conf('filters');\n\t\t$filters = (array) @func_get_args();\n\t}",
"abstract protected function getEventAdapter(EventArgs $args);",
"public function beforeFilter(CakeEvent $e)\n\t{\n\t\t// and attach an event to the advanced filter object to additionally make changes to the final query\n\t\t$AdvancedFiltersObject = $e->subject->AdvancedFiltersObject;\n\t\t$this->attachListener($AdvancedFiltersObject);\n\t}",
"public function admin_add_filters() {\n\t\t\n\t}",
"function template_reports_filters(&$args)\n{\n?>\n<input type=hidden name='filters_def' value =\"\">\n<table id='filters_top'>\n<tbody id='filters'>\n\n</table>\n<table width=\"100%\">\n<tr>\n<td align=center>\n<input class=button type=button onClick='addFilter()' name='Add Filter' value='Add Filter'>\n</td>\n</tr>\n</table>\n\n<?php\n}",
"function activity_filter_options()\n {\n }",
"private function updateArgs()\n {\n $this->updatePostTypes();\n $this->updateTaxonomies();\n \n foreach ($this->types as $type) {\n $this->args['location'][] = [\n [\n 'param' => 'post_type',\n 'operator' => '==',\n 'value' => $type,\n ],\n ];\n }\n \n foreach ($this->taxonomies as $taxonomy) {\n $this->args['location'][] = [\n [\n 'param' => 'taxonomy',\n 'operator' => '==',\n 'value' => $taxonomy,\n ],\n ];\n }\n \n $this->args = apply_filters('cgit_seo_field_args', $this->args);\n }",
"static function add_filters(): void {\n add_action('acf/init', [__CLASS__, 'add_group']);\n add_action('acf/init', [__CLASS__, 'add_authors']);\n add_action('acf/init', [__CLASS__, 'add_notes_contributors']);\n add_action('acf/init', [__CLASS__, 'add_photographers']);\n \n add_action('acf/init', [__CLASS__, 'add_outside_photo_sources']);\n add_action('acf/init', [__CLASS__, 'add_outside_photo_source']);\n \n add_action('acf/init', [__CLASS__, 'add_videographers']);\n }",
"public function READ_args() {\n\t\treturn array(\n\t\t\t'page' => array(\n\t\t\t\t'required' => false,\n\t\t\t\t'validate_callback' => array( $this->validator, 'is_positive_int' ),\n\t\t\t\t'default' => 1,\n\t\t\t\t'description' => __( 'The archive page to return', 'the-events-calendar' ),\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t\t'per_page' => array(\n\t\t\t\t'required' => false,\n\t\t\t\t'validate_callback' => array( $this->validator, 'is_positive_int' ),\n\t\t\t\t'sanitize_callback' => array( $this, 'sanitize_per_page' ),\n\t\t\t\t'default' => $this->get_default_posts_per_page(),\n\t\t\t\t'description' => __( 'The number of event tags to return on each page', 'the-events-calendar' ),\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t\t'search' => array(\n\t\t\t\t'required' => false,\n\t\t\t\t'validate_callback' => array( $this->validator, 'is_string' ),\n\t\t\t\t'description' => __( 'Limit results to those matching a string', 'the-events-calendar' ),\n\t\t\t\t'type' => 'string',\n\t\t\t),\n\t\t\t'exclude' => array(\n\t\t\t\t'required' => false,\n\t\t\t\t'validate_callback' => array( $this->validator, 'is_post_tag' ),\n\t\t\t\t'description' => __( 'Ensure result set exclude specific IDs', 'the-events-calendar' ),\n\t\t\t\t'swagger_type' => 'array',\n\t\t\t\t'items' => array( 'type' => 'integer' ),\n\t\t\t),\n\t\t\t'include' => array(\n\t\t\t\t'required' => false,\n\t\t\t\t'validate_callback' => array( $this->validator, 'is_post_tag' ),\n\t\t\t\t'description' => __( 'Limit result set to specific IDs', 'the-events-calendar' ),\n\t\t\t\t'swagger_type' => 'array',\n\t\t\t\t'items' => array( 'type' => 'integer' ),\n\t\t\t),\n\t\t\t'order' => array(\n\t\t\t\t'required' => false,\n\t\t\t\t'validate_callback' => array( $this->validator, 'is_string' ),\n\t\t\t\t'description' => __( 'Order sort attribute ascending or descending', 'the-events-calendar' ),\n\t\t\t\t'type' => 'string',\n\t\t\t),\n\t\t\t'orderby' => array(\n\t\t\t\t'required' => false,\n\t\t\t\t'validate_callback' => array( $this->validator, 'is_string' ),\n\t\t\t\t'description' => __( 'Sort collection by term attribute', 'the-events-calendar' ),\n\t\t\t\t'type' => 'string',\n\t\t\t),\n\t\t\t'hide_empty' => array(\n\t\t\t\t'required' => false,\n\t\t\t\t'description' => __( 'Whether to hide terms not assigned to any posts', 'the-events-calendar' ),\n\t\t\t\t'type' => 'boolean',\n\t\t\t\t'default' => '1',\n\t\t\t),\n\t\t\t'post' => array(\n\t\t\t\t'required' => false,\n\t\t\t\t'validate_callback' => array( $this->validator, 'is_event_id' ),\n\t\t\t\t'description' => __( 'Limit result set to terms assigned to a specific post', 'the-events-calendar' ),\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t\t'event' => array(\n\t\t\t\t'required' => false,\n\t\t\t\t'validate_callback' => array( $this->validator, 'is_event_id' ),\n\t\t\t\t'description' => __( 'Limit result set to terms assigned to a specific event (an alias of the \"post\" parameter)',\n\t\t\t\t\t'the-events-calendar' ),\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t\t'slug' => array(\n\t\t\t\t'required' => false,\n\t\t\t\t'validate_callback' => array( $this->validator, 'is_string' ),\n\t\t\t\t'description' => __( 'Limit result set to terms with a specific slug', 'the-events-calendar' ),\n\t\t\t\t'type' => 'string',\n\t\t\t),\n\t\t);\n\t}",
"static function add_filters(): void {\n add_action('acf/init', [__CLASS__, 'add_updates']);\n add_action('acf/init', [__CLASS__, 'add_update_date']);\n add_action('acf/init', [__CLASS__, 'add_update_nature']);\n \n // Add validation function\n add_filter(sprintf('acf/validate_value/key=%s',\n self::qualify_field(self::update_date)),\n [__CLASS__, 'validate_update_date'], 10, 4);\n }",
"public function onPageInit($sender, $args)\n\t\t{\n\t\t}",
"protected function event($event_name){\n\t\t$args = func_get_args();\n\t\tarray_shift($args);\n\t\t$this->event_vars_array($event_name, $args);\n\t}",
"public function hookConfig($args)\n {\n $post = $args['post'];\n foreach ($this->_options as $optionKey => $optionValue) {\n if (in_array($optionKey, array(\n 'history_log_display',\n ))) {\n $post[$optionKey] = json_encode($post[$optionKey]) ?: json_encode(array());\n }\n if (isset($post[$optionKey])) {\n set_option($optionKey, $post[$optionKey]);\n }\n }\n }",
"public function init($args){\n $path = get_stylesheet_directory_uri();\n\n add_action(\"wp_enqueue_scripts\", array($this, \"enqueueCss\"));\n add_action(\"wp_enqueue_scripts\", array($this, \"enqueueJs\"));\n\n add_filter( 'get_search_form', array($this, 'halo1SearchForm') );\n add_filter( 'the_content', array($this, 'theContentFilter'), 9);\n add_filter( 'embed_oembed_html',array( $this, 'embedContainer' ) );\n\n add_filter( 'widget_text', 'do_shortcode');\n\n add_filter( 'post_gallery', array($this, 'manageGallery'), 10, 4 );\n\n add_filter('comment_form_defaults', array($this,'custom_fields'));\n add_filter('comment_reply_link', array($this,'replace_reply_link_class'));\n\n $this->setProperty('page_model', $args['page_model']);\n $this->setProperty('socials_theme_config_model', $args['socials_model']);\n $this->setProperty('contacts_theme_config_model', $args['contacts_model']);\n $this->setProperty('view', $args['view']);\n\n $this->getPageData();\n return;\n }",
"public function peepso_widget_args_internal( $args )\n {\n $args['before_widget'] = str_replace('widget ','', $args['before_widget']);\n $args['after_widget'] = '</div>';\n $args['before_title'] = str_replace('widgettitle','', $args['before_title']);\n $args['after_title'] = '</h2>';\n\n return $args;\n }",
"private function action_filters() {\n\t\t\tadd_action( 'current_screen', array( $this, 'conditional_hooks' ) );\n\t\t\tadd_action( 'admin_menu', array( $this, 'admin_menu' ) );\n\t\t\tadd_action( 'tve_after_db_migration', array( $this, 'insert_default_data' ), 10, 1 );\n\t\t\tadd_action( 'rest_api_init', array( $this, 'create_initial_rest_routes' ) );\n\n\t\t\tadd_filter( 'tve_dash_filter_features', array( $this, 'smart_site_feature' ) );\n\t\t\tadd_filter( 'tcb_inline_shortcodes', array( $this, 'smart_site_tcb_shortcodes' ), 10, 1 );\n\t\t\tadd_filter( 'tcb_dynamiclink_data', array( $this, 'smart_site_links_shortcodes' ) );\n\t\t\tadd_filter( 'tcb_content_allowed_shortcodes', array( $this, 'allowed_shotcodes' ) );\n\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'frontend_enqueue_scripts' ), 11 );\n\t\t}",
"public function hookAdminItemsBrowse($args) {\n echo '<style>.iiifitems-action-links { list-style-type: none; margin: 0; padding: 0; }</style>';\n }",
"public static function adminEventHandlerEventsCustomFilterDisplay() {\n\t\tglobal $dummy, $dummy_combo;\n\t\t?>\n\t\t<p><label for=\"status\" class=\"ib\"><?php echo __('Dummy:'); ?></label>\n\t\t<?php echo form::combo('dummy', $dummy_combo, $dummy); ?>\n\t\t</p>\n\t\t\t<?php\n\t\t}",
"public function add_filters()\n {\n // add_filter('wp_save_post_revision_post_has_changed', [$this, '_wp_check_revisioned_meta_fields_have_changed'], 10, 3);\n\n add_filter('get_post_metadata', [$this, 'inject_metadata_timeshift'], 1, 4);\n add_filter('update_post_metadata', [$this, 'update_post_metadata'], 1, 5);\n }",
"public function hookConfigForm($args)\n {\n $view = get_view();\n echo $view->partial(\n 'plugins/history-log-config-form.php'\n );\n }",
"protected function add_filters() {\n\t\tadd_filter( 'query_vars', [ $this, 'filter_add_custom_query_vars' ] );\n\t}",
"function events_listing_admin_init() {\n\tadd_meta_box( 'events_listing_details_meta_box', __( 'Event Details', 'events-listing-widget' ), 'events_listing_display_meta_box', 'events_listing', 'normal', 'high' );\n\tadd_action( 'admin_post_save_events_listing_options', 'process_events_listing_options' );\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// Prepare boxes\n\t\t$this->_boxes = array_merge((array)$this->_boxes, array(\n\t\t\t\"refresh_timeout\"\t=> 'select_box(\"refresh_timeout\",\t$this->_refresh_timeout,\t$selected, 0, 2, \"\", false)',\n\t\t\t\"task_id\"\t\t\t=> 'select_box(\"task_id\",\t\t\t$this->task_name,\t\t\t$selected, 0, 2, \"\", false)',\n\t\t\t\"sort_by\"\t\t\t=> 'select_box(\"sort_by\",\t\t\t$this->_sort_by,\t\t\t$selected, 0, 2, \"\", false)',\n\t\t\t\"sort_order\"\t\t=> 'select_box(\"sort_order\",\t\t$this->_sort_orders,\t\t$selected, 0, 2, \"\", false)',\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\"user_id\",\n\t\t\t\"add_date\",\n\t\t\t\"task_id\",\n\t\t\t\"add_points\",\n\t\t);\n\t\t// Fields in the filter\n\t\t$this->_fields_in_filter = array(\n\t\t\t\"user_id\",\n\t\t\t\"task_id\",\n\t\t\t\"refresh_timeout\",\n\t\t\t\"sort_by\",\n\t\t\t\"sort_order\",\t\n\t\t);\n\t}"
] | [
"0.67517996",
"0.6160006",
"0.59215105",
"0.58690137",
"0.57933384",
"0.55508536",
"0.55019647",
"0.54076636",
"0.5391481",
"0.5384409",
"0.5374436",
"0.5368985",
"0.535928",
"0.5357402",
"0.53244334",
"0.53100944",
"0.52597696",
"0.5246517",
"0.5239873",
"0.52392566",
"0.5238135",
"0.5229905",
"0.5228249",
"0.52112484",
"0.5204436",
"0.5201122",
"0.5199759",
"0.5193628",
"0.51898706",
"0.5175879"
] | 0.78340614 | 0 |
this behavior is used to customize the event mini list displayed during event binding to posts process. the parameter is array('params'=>&$params) | public static function adminEventHandlerMinilistCustomize($args) {
foreach ($args as $v => $k)
$$v = &$args[$v];
#$params['dummy']=1; This would filter the events displayed on the dummy==1 criteria
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getEventList() { \t\treturn array('QuickMenu','PostAddItem','AddItemFormExtras','EditItemFormExtras','PostUpdateItem','PrepareItemForEdit', 'BookmarkletExtraHead', 'RetrieveTrackback', 'SendTrackback', 'InitSkinParse'); }",
"public function get_appended_events();",
"public static function adminEventHandlerEventsPageCustomize($args) {\n\t\t\tforeach ($args as $v => $k)\n\t\t\t\t$$v = &$args[$v];\n\n\t\t\tglobal $dummy, $core;\n\t\t\t$dummy = !empty($_GET['dummy']) ? $_GET['dummy'] : '';\n\t\t\tif (!$core->error->flag()) {\n\t\t\t\tglobal $dummy_combo;\n\t\t\t\t$dummy_combo = array('-' => '', __('Not dummy') => 0, __('Dummy') => 1);\n\t\t\t}\n\n\t\t\t# - Selected filter\n\t\t\tif ($dummy !== '' && in_array($dummy, $dummy_combo)) {\n\t\t\t\t$params['dummy'] = $dummy;\n\t\t\t\t$show_filters = true;\n\t\t\t}\n\n\t\t\t$redir = $redir . '&dummy=' . $dummy;\n\n\t\t\t$hidden_fields = $hidden_fields . form::hidden(array('dummy'), $dummy);\n\n\t\t\t$sortby_combo[__('Dummy')] = 'dummy';\n\t\t}",
"public static function adminEventHandlerEventsListBody($rs,$args,$ismini=false) {\n\t\t\t$columns=&$args['columns'];\n\t\t\tforeach ($args as $v => $k) {\n\t\t\t\t$$v = &$args[$v];\n\t\t\t} #Recreates the byref args.\n\t\t\t$num = 3; //Insert a new column header @3rd position.\n\t\t\tif ($ismini)\n\t\t\t\t$num++;#Minilist adds a 'period' column so we increase $num\n\t\t\t$columns = array_merge(array_slice($columns, 0, $num), array(\"<td>\" . form::checkbox('dummy[' . $rs->post_id . ']', '1', (boolean) $rs->dummy, '', '', true) . \"</td>\"), array_slice($columns, $num));\n\t\t}",
"function eventclass_admin_members()\n\t{\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\n//\tonscreen events\n\n\t}",
"function __construct()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"BeforeShowList\"]=true;\n\n\n\t\t$this->events[\"BeforeDelete\"]=true;\n\n\n\t}",
"function __construct()\n\t{\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t\t$this->events[\"BeforeShowAdd\"]=true;\n\n\n\t}",
"public function hookAdminItemsShow()\n {\n }",
"public static function onAdminMenuInit($event)\n {\n $event->sender->addItem(array(\n 'label' => Yii::t('NewsModule.base', 'News Management'),\n 'icon' => 'hacker-news',\n 'url' => '#',\n 'sortOrder' => 3,\n 'items' => [\n ['label' => Yii::t('NewsModule.base', 'News Category Management'), 'icon' => 'bars', 'url' => ['/news/admin/category'],],\n ['label' => Yii::t('NewsModule.base', 'News List'), 'icon' => 'bullhorn', 'url' => ['/news/admin/news'],],\n ],\n ));\n }",
"function event_PreItem($data){\n\t\tif ($this->getOption('AppendTag') == 'no'){\n\t\t\treturn;\n\t\t}\n\t\t$tags = $this->getTags($data['item']->itemid);\n\t\tif (count($tags) > 0){\n\t\t\tif (count($tags) == 1 && $tags[0]== ''){\n\t\t\t\t$this->originalPost = NULL;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ($data['item']->more == \"\")\n\t\t\t\t$body = &$data['item']->body;\n\t\t\telse\n\t\t\t\t$body = &$data['item']->more;\n\t\t\t$content = $this->getOption('ListLook');\n\t\t\t$itemlook = $this->getOption('TagLook');\n\t\t\t$separator = $this->getOption('TagSeparator');\n\t\t\t$list = \"\";\n\t\t\tfor($i = 0 ; $i<count($tags) ; $i++){\n\t\t\t\t$t = $tags[$i];\n\t\t\t\tif ($t == '') continue;\n\t\t\t\tif ($this->getOption('PlusSwitch') == 'yes'){\n\t\t\t\t\t$displayed_tag = str_replace('+',' ',$t);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$displayed_tag = $t;\n\t\t\t\t}\n\t\t\t\t$tag=str_replace('%t',$t,$itemlook);\n\t\t\t\t$tag=str_replace('%d',$displayed_tag,$tag);\n\t\t\t\t$list.=$tag;\n\t\t\t\t/* If this isn't the last tag, append the seperator */\n\t\t\t\tif ($i < count($tags)-1){\n\t\t\t\t\t$list.=$separator;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$content = str_replace('%l',$list,$content);\n if ($this->getOption('AppendTagType') == 0) {\n $content = str_replace('%TAGURL%',$this->technoratiurl, $content);\n }\n else {\n $content = str_replace('%TAGURL%',$this->deliciousurl, $content);\n }\n\t\t\t$body = $body.$content;\n\t\t}\n\t\telse {\n\t\t\t$this->originalPost = NULL;\n\t\t}\n\t}",
"function doAppend($event)\n {\n //override me \n }",
"function get_event_list_new( $newargs = array()){\n\n\twp_reset_postdata();\n\twp_reset_query();\n\n\n\t$result = '';\t\n\t\n\t$args = array(\n\t\t'post_type' => 'event',\n\t\t'meta_key' => EVENT_PREFIX.'date',\n\t\t'orderby' => 'meta_value',\n 'order' => 'ASC',\n 'posts_per_page'=>'1'\n\n\t);\n\n\t//array_merge($args,$newargs);\n\n\n\t$query = new WP_Query( $args );\n/*\n\tfunction pgp(){\n\t\t$query->set( 'posts_per_page','2' );\n\t}\n\tadd_action( 'pre_get_posts', 'pgp' , 0 );\n\n*/\n\t//global $post;\n\t$resarray = array();\n\t$query->set( 'posts_per_page','2' );\n\twhile ( $query->have_posts() ):\n\t\t$query->the_post();\n\t\tsetup_postdata( $post );\n\t\t$url = '';\n\t\tif ( $thumb = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array(60,60) ) ) \t\n\t\t{\n\t\t\t$url = $thumb['0'];\n\t\t} \n\t\t$resarray[] = array(\n\t\t\t'id' => $post->ID,\n\t\t\t'date' => get_post_meta($post->ID,EVENT_PREFIX.'date',true),\n\t\t\t'location' => get_post_meta($post->ID,EVENT_PREFIX.'location',true),\n\t\t\t'street' => get_post_meta($post->ID,EVENT_PREFIX.'street',true),\n\t\t\t'city' => get_post_meta($post->ID,EVENT_PREFIX.'city',true),\n\t\t\t'permalink' => get_permalink($post->ID),\n\t\t\t'title' => $post->post_title,\n\t\t\t'thumb' => $url\n\t\t);\n\tendwhile;\n\twp_reset_postdata();\n\twp_reset_query();\n\treturn $resarray;\n}",
"function events_listing_admin_init() {\n\tadd_meta_box( 'events_listing_details_meta_box', __( 'Event Details', 'events-listing-widget' ), 'events_listing_display_meta_box', 'events_listing', 'normal', 'high' );\n\tadd_action( 'admin_post_save_events_listing_options', 'process_events_listing_options' );\n}",
"function page_events_list() {\n $f3=$this->framework;\n\t\tinclude( \"programmeRenderer.php\" );\t\n\t\t$progr = new ProgrammeRenderer( $this->programme() );\n\t\t$title = \"All Events\";\n\t\t$f3->set('content','content.html');\n\t\t$f3->set('html_content', $progr->render_list());\n\t\t$f3->set('html_title', $title );\n\t\tprint Template::instance()->render( \"page.html\" );\n\t}",
"public function hookPublicItemsShow()\n {\n }",
"function mes_register_event() {\n\n \t$labels = array(\n \t\t'name' => _x( 'Events RSVP', 'Post Type General Name', 'max-event' ),\n \t\t'singular_name' => _x( 'Event RSVP', 'Post Type Singular Name', 'max-event' ),\n \t\t'menu_name' => __( 'Events RSVP', 'max-event' ),\n \t\t'name_admin_bar' => __( 'Events RSVP', 'max-event' ),\n \t\t'archives' => __( 'Event RSVP Archives', 'max-event' ),\n \t\t'attributes' => __( 'Event RSVP Attributes', 'max-event' ),\n \t\t'parent_item_colon' => __( 'Parent Event RSVP:', 'max-event' ),\n \t\t'all_items' => __( 'All Events RSVP', 'max-event' ),\n \t\t'add_new_item' => __( 'Add New Event RSVP', 'max-event' ),\n \t\t'add_new' => __( 'Add New', 'max-event' ),\n \t\t'new_item' => __( 'New Event RSVP', 'max-event' ),\n \t\t'edit_item' => __( 'Edit Event RSVP', 'max-event' ),\n \t\t'update_item' => __( 'Update Event RSVP', 'max-event' ),\n \t\t'view_item' => __( 'View Event RSVP', 'max-event' ),\n \t\t'view_items' => __( 'View Events RSVP', 'max-event' ),\n \t\t'search_items' => __( 'Search Event RSVP', 'max-event' ),\n \t\t'not_found' => __( 'Not found', 'max-event' ),\n \t\t'not_found_in_trash' => __( 'Not found in Trash', 'max-event' ),\n \t\t'featured_image' => __( 'Featured Image', 'max-event' ),\n \t\t'set_featured_image' => __( 'Set featured image', 'max-event' ),\n \t\t'remove_featured_image' => __( 'Remove featured image', 'max-event' ),\n \t\t'use_featured_image' => __( 'Use as featured image', 'max-event' ),\n \t\t'insert_into_item' => __( 'Insert into Event RSVP', 'max-event' ),\n \t\t'uploaded_to_this_item' => __( 'Uploaded to this Event RSVP', 'max-event' ),\n \t\t'items_list' => __( 'Events RSVP list', 'max-event' ),\n \t\t'items_list_navigation' => __( 'Events RSVP list navigation', 'max-event' ),\n \t\t'filter_items_list' => __( 'Filter Events RSVP list', 'max-event' ),\n \t);\n \t$args = array(\n \t\t'label' => __( 'Event RSVP', 'max-event' ),\n \t\t'description' => __( 'Event RSVP', 'max-event' ),\n \t\t'labels' => $labels,\n \t\t'supports' => array( 'title', 'editor', 'thumbnail' ),\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' => IMAGES . 'event.svg',\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' => 'post',\n \t);\n \tregister_post_type( 'event', $args );\n\n }",
"function imic_event($atts, $content = null) {\n extract(shortcode_atts(array(\n \"number\" => 10,\n \"title\" => \"\",\n \"category\" => \"\",\n \"style\" => \"\",\n \"type\" => \"\",\n ), $atts));\n $output = '';\n\t\t$number = ($number=='')?10:$number;\nif($type=='future')\n{\n\t$future_events = imic_recur_events(\"future\", \"\", $category, \"\");\n\t$google_events = getGoogleEvent();\n\t$events = $future_events+$google_events;\n\tksort($events);\n}\nelse\n{\n\t$events = imic_recur_events(\"past\", \"\", $category, \"\");\n\tkrsort($events);\n}\nif($style==\"list\")\n{\n\t$count = 1;\n\t$output .= '<div class=\"listing events-listing\">\n\t<header class=\"listing-header\">\n \t<div class=\"row\">\n \t<div class=\"col-md-12 col-sm-12\">\n \t\t\t\t<h3>'.esc_attr($title).'</h3>\n </div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</header>';\n\t\t$output .= '<section class=\"listing-cont\">\n <ul>';\n\tif(!empty($events))\n\t{\n\tforeach($events as $key=>$value)\n\t{\n\t\tif(preg_match('/^[0-9]+$/',$value))\n\t\t{\n\t\t\t$eventStartTime = strtotime(get_post_meta($value, 'imic_event_start_tm', true));\n\t\t\t$eventStartDate = strtotime(get_post_meta($value, 'imic_event_start_dt', true));\n\t\t\t$eventEndTime = strtotime(get_post_meta($value, 'imic_event_end_tm', true));\n\t\t\t$eventEndDate = strtotime(get_post_meta($value, 'imic_event_end_dt', true));\n\t\t\t$evstendtime = $eventStartTime.'|'.$eventEndTime;\n\t\t\t$evstenddate = $eventStartDate.'|'.$eventEndDate;\n\t\t\t$date_converted = date('Y-m-d',$key );\n\t\t\t$custom_event_url = imic_query_arg($date_converted,$value);\n\t\t\t$event_dt_out = imic_get_event_timeformate( $evstendtime,$evstenddate,$value,$key);\n\t\t\t$event_dt_out = explode('BR',$event_dt_out);\n\t\t\tif($eventStartTime!='') \n\t\t\t{ \n\t\t\t\t$eventStartTime = date(get_option('time_format'),$eventStartTime);\n\t\t\t}\n\t\t\t$custom_event_url = imic_query_arg($date_converted,$value);\n\t\t\t$event_title=get_the_title($value);\n\t\t\t$stime = ''; \n\t\t\tif($eventStartTime!='') \n\t\t\t{ \n\t\t\t\t$stime = ' | '.$eventStartTime;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$google_data =(explode('!',$value));\n\t\t\t$event_title=$google_data[0];\n\t\t\t$custom_event_url=$google_data[1];\n\t\t\t$options = get_option('imic_options');\n \t\n\t\t\t$eventTime =$key;\n\t\t\tif($eventTime!='') \n\t\t\t{ \n\t\t\t\t$eventTime = date_i18n( get_option( 'time_format' ),$key); \n\t\t\t}\n\t\t\t$eventEndTime =$google_data[2];\n\t\t\tif($eventEndTime!='')\n\t\t\t{\n\t\t\t\t$eventEndTime = ' - '.date_i18n( get_option( 'time_format' ),strtotime($eventEndTime));\n\t\t\t}\n\t\t\t$eventAddress=$google_data[3];\n\t\t\t$event_dt_out = imic_get_event_timeformate($key.'|'.strtotime($google_data[2]),$key.'|'.$key,$value,$key);\n\t\t\t$event_dt_out = explode('BR',$event_dt_out);\n\t\t}\n\t\t$output .= '<li class=\"item event-item\">\t\n \t\t\t<div class=\"event-date\"> \n\t\t\t\t\t\t\t\t\t\t<span class=\"date\">'.date_i18n('d',$key).'</span>\n <span class=\"month\">'.imic_global_month_name($key).'</span>\n\t\t\t\t\t\t\t\t\t</div>\n \t<div class=\"event-detail\">\n \t\t\t\t<h4>\n \t\t\t<a href=\"'.$custom_event_url.'\">\n\t\t\t\t\t '.$event_title.' </a>'.imicRecurrenceIcon($value).'\n \t\t</h4>\n \t<span class=\"event-dayntime meta-data\">\n\t\t\t\t\t \t\t\t\t'.$event_dt_out[1].', '.$event_dt_out[0]\n .'</span> \n\t\t\t\t\t\t\t\t\t</div>\n \t<div class=\"to-event-url\">\n \t<div>\n\t\t\t\t\t\t\t\t<a href=\"'.$custom_event_url.'\" class=\"btn btn-default btn-sm\">'.__('Details','framework').'</a></div>\n </div>\n </li>';\n\t\tif($count++>=$number)\n\t\t{\n\t\t\tbreak;\n\t\t}\n\t}\n\t}\n\t$output .= '</ul>\n\t\t\t\t</section></div>';\n}\nelse\n{\n\t$output .= '<header class=\"listing-header\">\n \t<div class=\"row\">\n \t<div class=\"col-md-12 col-sm-12\">\n \t\t\t\t<h3>'.esc_attr($title).'</h3>\n </div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</header>';\n\t$output .= '<div class=\"container\"><div class=\"row\">';\n\t$output .= '<ul class=\"grid-holder col-3 events-grid\">';\n\t\t\n\t$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;\n\t$count = 1;\n\t$grid_item = 1;\n\t$perPage = get_option('posts_per_page');\n\t$paginate = 1;\n\tif($paged>1) \n\t{\n\t\t$paginate = ($paged-1)*$perPage; $paginate = $paginate+1; \n\t}\n\t$TotalEvents = count($events);\n\tif($TotalEvents%$perPage==0) \n\t{\n\t\t$TotalPages = $TotalEvents/$perPage;\n\t}\n\telse \n\t{\n\t\t$TotalPages = $TotalEvents/$perPage;\n\t\t$TotalPages = $TotalPages+1;\n\t}\n\tforeach($events as $key=>$value)\n\t{\n\t\tif(preg_match('/^[0-9]+$/',$value))\n\t\t{\n\t\t\t$google_flag =1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$google_flag =2;\n\t\t}\n\t\tif($google_flag==1)\n\t\t{\n\t\t\tsetup_postdata(get_post($value));\n\t\t\t$eventStartTime = strtotime(get_post_meta($value, 'imic_event_start_tm', true));\n\t\t\t$eventStartDate = strtotime(get_post_meta($value, 'imic_event_start_dt', true));\n\t\t\t$eventEndTime = strtotime(get_post_meta($value, 'imic_event_end_tm', true));\n\t\t\t$eventEndDate = strtotime(get_post_meta($value, 'imic_event_end_dt', true));\n\t\t\t$event_dt_out = imic_get_event_timeformate($eventStartTime.'|'.$eventEndTime,$eventStartDate.'|'.$eventEndDate,$value,$key);\n\t\t\t$event_dt_out = explode('BR',$event_dt_out);\n\t\t\t$registration_status = get_post_meta($value,'imic_event_registration_status',true);\n\t\t\t/** Event Details Manage **/\n\t\t\tif($registration_status==1&&(function_exists('imic_get_currency_symbol'))) \n\t\t\t{\n\t\t\t\t$eventDetailIcons = array('fa-calendar','fa-clock-o', 'fa-map-marker','fa-money');\t\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$eventDetailIcons = array('fa-calendar','fa-clock-o', 'fa-map-marker'); \n\t\t\t}\n\t\t\t$stime = \"\"; $etime = \"\";\n\t\t\tif($eventStartTime!='') \n\t\t\t{ \n\t\t\t\t$stime = ' | ' .date_i18n(get_option('time_format'), $eventStartTime) ; \n\t\t\t}\n\t\t\tif($eventEndTime!='') \n\t\t\t{ \n\t\t\t\t$etime = ' - '. date_i18n(get_option('time_format'),$eventEndTime); \n\t\t\t}\n\t\tif($registration_status==1&&(function_exists('imic_get_currency_symbol'))) \n\t\t{\n\t\t\t$event_registration_fee = get_post_meta($value,'imic_event_registration_fee',true);\n\t\t\t$registration_charge = ($event_registration_fee=='')?'Free':imic_get_currency_symbol(get_option('paypal_currency_options')).get_post_meta($value,'imic_event_registration_fee',true);\n\t\t\t$eventDetailsData = array($event_dt_out[1],$event_dt_out[0], get_post_meta($value,'imic_event_address',true),$registration_charge);\t\n\t\t\t/*\n\t\t\t$eventDetailsData = array(date_i18n('j M, ',$key).date_i18n('l',$key). $stime . $etime, get_post_meta($value,'imic_event_address',true),$registration_charge);\n\t\t\t*/\n\t\t}\n\t\telse \n\t\t{\n\t\t\t/*$eventDetailsData = array(date_i18n('j M, ',$key).date_i18n('l',$key). $stime . $etime, get_post_meta($value,'imic_event_address',true));*/\n\t\t\t$eventDetailsData = array($event_dt_out[1],$event_dt_out[0], get_post_meta($value,'imic_event_address',true));\n\t\t}\n\t\t$eventValues = array_filter($eventDetailsData, 'strlen');\n\t}\n\tif($count==$paginate&&$grid_item<=$perPage) \n\t{ \n\t\t$paginate++; $grid_item++;\n\t\tif($google_flag==1)\n\t\t{\n\t\t\t$frequency = get_post_meta($value,'imic_event_frequency',true); \n\t\t}\n\t\t//if ('' != get_the_post_thumbnail($value)) {\n\t\t$output .= '<li class=\"grid-item format-standard\">';\n\t\tif($google_flag==1)\n\t\t{\n\t\t\t$date_converted=date('Y-m-d',$key );\n\t\t\t$custom_event_url =imic_query_arg($date_converted,$value); \n\t\t}\n\t\tif($google_flag==2)\n\t\t{\n \t$google_data =(explode('!',$value)); \n \t$event_title=$google_data[0];\n \t$custom_event_url=$google_data[1];\n \t$stime = \"\"; $etime = \"\";\n \t\t$etime=$google_data[2];\n \tif($key!='') \n\t\t\t{ \n\t\t\t\t$stime = ' | ' .date_i18n(get_option('time_format'), $key) ; \n\t\t\t}\n\t\t\tif($etime!='') \n\t\t\t{ \n\t\t\t\t$etime = ' - '. date_i18n(get_option('time_format'),strtotime($etime)); \n\t\t\t}\n $eventAddress=$google_data[3];\n \t/* $eventDetailsData = array(date_i18n('j M, ',$key).date_i18n('l',$key). $stime . $etime,$eventAddress);*/ \n\t \t$event_dt_out = imic_get_event_timeformate($key.'|'.$google_data[2],$key.'|'.$key,$value,$key);\n $event_dt_out = explode('BR',$event_dt_out);\n\t\t\t$eventDetailsData = array($event_dt_out[1],$event_dt_out[0],$eventAddress);\n\t\t\t$eventValues = array_filter($eventDetailsData, 'strlen');\n\t\t\t$eventDetailIcons = array('fa-calendar','fa-clock-o', 'fa-map-marker'); \n\t\t}\n\t$output .= '<div class=\"grid-item-inner\">';\n\tif($google_flag==1)\n\t{\n\t\t$output .= '<a href=\"'.$custom_event_url.'\" class=\"media-box\">';\n\t\t$output .= get_the_post_thumbnail($value, 'full');\n\t\t$output .= '</a>';\n\t\t$event_title=get_the_title($value);\n\t}\n\t$output .= '<div class=\"grid-content\">';\n\t$output .= '<h3><a href=\"' . $custom_event_url. '\">'.$event_title.'</a>'.imicRecurrenceIcon($value).'</h3>';\n\tif($google_flag==1)\n\t{\n\t\t$output .= '<div class=\"page-content\">';\n\t\t$output .= imic_excerpt(25);\n\t\t$output .= '</div>';\n\t}\n\t$output .= '</div>';\n\tif(!empty($eventValues))\n\t{ \n\t\t$output .= '<ul class=\"info-table\">';\n\t\t$flag = 0;\n\t\tforeach($eventDetailsData as $edata)\n\t\t{\n\t\t\tif(!empty($edata))\n\t\t\t{\n\t\t\t\t$output .= '<li><i class=\"fa '.$eventDetailIcons[$flag].'\"></i> '.$edata.' </li>';\n\t\t\t}\t\t\t\t\n\t\t\t$flag++;\t\n\t\t}\n\t\t$output .= '</ul>';\n\t\t//}\n\t\t$output .= '</div>\n\t\t</li>';\n \t}\n} $count++;\n\t}\n\t$output .= '</ul></div></div>';\n}\n return $output;\n}",
"function register_eventItems($buttons) {\n array_push($buttons, \"eventItems\"); \n return $buttons; \n}",
"function mes_register_event_moment() {\n\n\t$labels = array(\n\t\t'name' => _x( 'Event Moments', 'Post Type General Name', 'max-event' ),\n\t\t'singular_name' => _x( 'Event Moment', 'Post Type Singular Name', 'max-event' ),\n\t\t'menu_name' => __( 'Event Moments', 'max-event' ),\n\t\t'name_admin_bar' => __( 'Event Moment', 'max-event' ),\n\t\t'archives' => __( 'Event Moment Archives', 'max-event' ),\n\t\t'attributes' => __( 'Event Moment Attributes', 'max-event' ),\n\t\t'parent_item_colon' => __( 'Parent Event Moment:', 'max-event' ),\n\t\t'all_items' => __( 'All Event Moments', 'max-event' ),\n\t\t'add_new_item' => __( 'Add New Event Moment', 'max-event' ),\n\t\t'add_new' => __( 'Add New', 'max-event' ),\n\t\t'new_item' => __( 'New Event Moment', 'max-event' ),\n\t\t'edit_item' => __( 'Edit Event Moment', 'max-event' ),\n\t\t'update_item' => __( 'Update Event Moment', 'max-event' ),\n\t\t'view_item' => __( 'View Event Moment', 'max-event' ),\n\t\t'view_items' => __( 'View Event Moments', 'max-event' ),\n\t\t'search_items' => __( 'Search Event Moment', 'max-event' ),\n\t\t'not_found' => __( 'Not found', 'max-event' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'max-event' ),\n\t\t'featured_image' => __( 'Featured Image', 'max-event' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'max-event' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'max-event' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'max-event' ),\n\t\t'insert_into_item' => __( 'Insert into Event Moment', 'max-event' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this Event Moment', 'max-event' ),\n\t\t'items_list' => __( 'Event Moments list', 'max-event' ),\n\t\t'items_list_navigation' => __( 'Event Moments list navigation', 'max-event' ),\n\t\t'filter_items_list' => __( 'Filter Event Moments list', 'max-event' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'Event Moment', 'max-event' ),\n\t\t'description' => __( 'Post Type Description', 'max-event' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'editor', 'thumbnail' ),\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' => IMAGES . 'event.svg',\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' => 'post',\n\t);\n\tregister_post_type( 'event_moment', $args );\n\n}",
"function MyEvents($args=array())\n {\n $this->Hash2Object($args);\n $this->AlwaysReadData=array(\"Unit\",\"Name\",\"Status\",\"StartDate\",\"EndDate\");\n $this->Sort=array(\"Name\");\n $this->IDGETVar=\"Event\";\n $this->NonGetVars=array(\"Event\",\"CreateTable\");\n \n $this->MyEvents_CellMethods_Init();\n }",
"public static function adminEventHandlerEventsListHeaders($args,$ismini=false) {\n\t\t\t$columns=&$args['columns'];\n\t\t\t$num = 3; //Insert a new column header @3rd position.\n\t\t\tif ($ismini)\n\t\t\t\t$num++;#Minilist adds a 'period' column so we increase $num\n\t\t\t$columns = array_merge(array_slice($columns, 0, $num), array('<th>' . __('Dummy') . '</th>'), array_slice($columns, $num));\n\t\t}",
"public function __construct()\n\t{\n\t\tadd_shortcode('ecs-list-events', array($this, 'ecs_fetch_events') ); // link new function to shortcode name\n\t}",
"public function pageChanged($sender,$param)\n {\nPrado::trace('PAGER '.$param->NewPageIndex.' '. get_class($param),'Json');\n // if ($this->Page->IsCallback && !($param instanceof TCallbackEventParameter))\n // {\n // return;\n //}\n\n\n\t\t//$this->populateData($param->NewPageIndex);\n $this->Repeater->DataSource = $this->getProducts(true);\n $this->Repeater->CurrentPageIndex=$param->NewPageIndex;\n \t $this->Repeater->dataBind();\n\n //$this->Pager->render($param->getNewWriter());\n // $this->broadcastEvent('OnOrderChanged', $this, $param);\n\n }",
"public function setWidgetParams(array $params)\n {\n parent::setWidgetParams($params);\n\n $this->widgetParams[self::PARAM_DISPLAY_MODE]->setValue($this->getDisplayMode());\n\n $this->widgetParams[\\XLite\\View\\Pager\\APager::PARAM_SHOW_ITEMS_PER_PAGE_SELECTOR]->setValue(false);\n $this->widgetParams[\\XLite\\View\\Pager\\APager::PARAM_ITEMS_COUNT]->setValue(5);\n }",
"function getEventTitles(&$params)\n {\n jimport('joomla.application.module.helper');\n\n \n\t\t// let's use the JDatabaseQuery class for assembly\n\t\t// see more here:\n\t\t// http://www.theartofjoomla.com/9-developer/135-database-upgrades-in-joomla-16.html\n\t\t// and\n\t\t// http://docs.joomla.org/API16:JDatabaseQuery/select\n jimport( 'joomla.database.databasequery' );\n\n $db = JFactory::getDbo();\n $query = $db->getQuery(true);\n $query->select(\"e.title, e.id AS eventID, e.start_date, e.end_date, \".\n \t\t\"e.event_type_id, e.summary, e.is_active, \".\n \t\t\"e.is_public, e.is_online_registration\");\n $query->from('civicrm_event e') ;\n $query->where('e.is_active = 1 AND e.is_template != 1');\n $query->order('e.start_date ASC');\n\n //disable past events setting\n $showpastevents = trim($params->get('showpastevents'));\n $currentdate = date(\"Y-m-d\");\n if (! $showpastevents){\n \t// OK, so hide past events, or events that are not in the future ....\n \t//only view events that end on or after current date, or where no end_date is defined\n \t$query->where(\"( e.end_date >= '\" . $currentdate . \"' OR e.end_date IS NULL OR e.end_date = '') \");\n \t// OR e.end_date = \\'\\'\");\n \t//only view events that start on or after current date\n \t$query->where(\"e.start_date >= '\" . $currentdate .\"'\");\n }\n\n \n \n \n //determine privacy setting\n $privacy = trim($params->get('privacy'));\n switch ($privacy) {\n \tcase(0):\n \t\t{\n \t\t\t// both public or private\n \t\t\tbreak;\n \t\t}\n \tcase(1):\n \t\t{\n \t\t\t// public only\n \t\t\t$query->where(\"e.is_public = 1 \");\n \t\t\tbreak;\n \t\t}\n \tcase(2):\n \t\t{\n \t\t\t// private only\n \t\t\t$query->where(\"e.is_public = 0 \");\n \t\t\tbreak;\n \t\t}\n }\n \n \n //determine display mode\n $mode = trim($params->get('mode'));\n switch ($mode) {\n \tcase(0): //default mode\n \t\t{\n \t\t\tbreak;\n \t\t}\n\n \tcase(1): //date range mode\n \t\t{\n \t\t\t$startdate = trim($params->get('startdate'));\n \t\t \t$enddate = trim($params->get('enddate'));\n\n\n \t\t \t//Rewrite date format\n \t\t\tif ($startdate) {\n \t\t\t\t$startdate_formatted = date('Y-m-d', strtotime($startdate));\n \t\t\t}\n \t\t \tif ($enddate) {\n \t\t\t\t$enddate_formatted = date('Y-m-d', strtotime($enddate));\n \t\t \t}\n\n \t\t \t/*\n \t\t \techo \"\\$startdate: \".$startdate.\"<BR />\" ; // debug\n \t\t \techo \"\\$enddate: \".$enddate.\"<BR />\" ; // debug\n \t\t \techo \"\\$startdate_formatted: \".$startdate_formatted.\"<BR />\" ; // debug\n \t\t\techo \"\\$enddate_formattted: \".$enddate_formatted.\"<BR />\" ; // debug\n\t\t\t\t\t*/\n \t\t \t\n \t\t\tif ($startdate == \"\" OR $startdate == \"Select\") //no start date selected, throw error\n \t\t\t{\n \t\t\t\tJError::raiseWarning(500, \"No start date selected for mod_civicrmfullcalendar module.\");\n \t\t\t} elseif ($enddate == \"\" OR $enddate == \"Select\") //Open end date parameter\n \t\t\t{\n \t\t\t\t$query->where(\"e.start_date >= '\" . $startdate_formatted . \"'\");\n\n \t\t\t} else //both start and end date parameter, replace default end date range\n \t\t\t{\n \t\t\t\t$query->where(\"e.start_date >= '\" . $startdate_formatted . \"' AND \" .\n \t\t\t\t\t\t\"e.end_date <= '\" . $enddate_formatted . \"'\");\n \t\t\t}\n \t\t\tbreak;\n \t\t}\n\n \tcase(2): //event type mode\n \t\t{\n \t\t\t$tid = trim($params->get('tid'));\n \t\t\t$query->where(\"e.event_type_id =\".$tid);\n \t\t\tbreak;\n \t\t}\n } //close mode switch\n\n \n \n // do we even need the location? ... don't forget, some events MIGHT NOT HAVE A LOCATION!\n if (\n \t\t(stristr(trim($params->get('fieldtemplate')), \"{event_street_address}\") != FALSE) ||\n \t\t(stristr(trim($params->get('fieldtemplate')), \"{event_supplemental_address_1}\") != FALSE) ||\n \t\t(stristr(trim($params->get('fieldtemplate')), \"{event_supplemental_address_2}\") != FALSE) ||\n \t\t$params->get('filterOnLocation') === \"1\"\n ) {\n \t// get the event location data\n \t$query->select( \"a.street_address, a.supplemental_address_1, a.supplemental_address_2 \");\n\t\t$query->leftJoin('civicrm_loc_block lb ON e.loc_block_id = lb.id')->leftJoin('civicrm_address a ON a.id = lb.address_id'); \n }\n\n // DEBUG echo $query ; // DEBUG\n \n //run $query;\n $db->setQuery($query);\n $result = $db->loadObjectList();\n \n if ($db->getErrorNum()) {\n JError::raiseWarning(500, \"No events meet the selected criteria.\");\n }\n\n\n return $result;\n\n }",
"function upcoming_reminders_options_callback() {\n\techo '<p>Adjust behaviour of the upcoming event reminders email process.</p>';\n}",
"public function hookOnecateproductslider($params)\r\n\t{ \r\n\t\t\t\t$this->_prepHook($params);\r\n $oneCate_Products=$this->getProducts();\r\n $this->smarty->assign(\r\n array(\r\n 'products' => $oneCate_Products,\r\n 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY')\r\n )\r\n );\r\n if(Configuration::get('FIELD_ONECATEPSL_VERTICAL'))\r\n return $this->display(__FILE__, 'fieldonecateproductslider_vertical.tpl');\r\n else\r\n return $this->display(__FILE__, 'fieldonecateproductslider.tpl');\r\n\t}",
"public function attach_events()\r\n\t{\r\n\t\tadd_action('bb_admin_menu_generator', array(&$this, 'event_bb_admin_menu_generator') );\r\n\t\tadd_action('bb_got_roles', array(&$this, 'event_bb_got_roles'), 5);\r\n\t\tadd_action('bb_new_post', array(&$this, 'event_bb_new_post'));\r\n\t\tadd_action('bb_new_topic', array(&$this, 'event_bb_new_topic'), 99, 3);\r\n\t\tadd_action('get_post_author', array(&$this, 'event_get_post_author'), 99, 2);\t\r\n\t\tadd_action('pre_post_form', array(&$this, 'event_pre_post_form'));\r\n\t\tadd_action('post_post_form', array(&$this, 'event_post_post_form'));\r\n\t\t\r\n\t\tadd_filter('bb_current_user_can', array(&$this, 'bb_current_user_can_callback'), 99, 3);\r\n\t\tadd_filter('bb_get_user_email', array(&$this, 'filter_bb_get_user_email'), 99);\r\n\t\tadd_filter('bb_get_user_link', array(&$this, 'filter_bb_get_user_link'), 99);\r\n\t\tadd_filter('get_topic_author', array(&$this, 'filter_get_topic_author'), 99, 2);\r\n\t\tadd_filter('get_topic_last_poster', array(&$this, 'filter_get_topic_last_poster'), 99, 2);\r\n\r\n\t\tbb_register_plugin_activation_hook(__FILE__, array(&$this, 'event_plugin_activation')); \r\n\t}",
"public function event_list($params) {\n\t\tif ($this->version == 1) {\n\t\t\t// not supported currently.\n\t\t\t//$request_url = \"{$this->url}&api_action=contact_delete_list&api_output={$this->output}&{$params}\";\n\t\t} elseif ($this->version == 2) {\n\t\t\t$request_url = \"{$this->url_base}/track/event\";\n\t\t}\n\t\t$response = parent::curl($request_url, array(), \"GET\", \"tracking_event_list\");\n\t\treturn $response;\n\t}",
"function __construct()\n\t{\n\n\t\t$this->events[\"ProcessValuesAdd\"]=true;\n\n\n\t\t$this->events[\"ProcessValuesEdit\"]=true;\n\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\n\t\t$this->events[\"BeforeQueryPrint\"]=true;\n\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\n\t}"
] | [
"0.57080054",
"0.5535826",
"0.5446374",
"0.5428995",
"0.528196",
"0.5246108",
"0.52412087",
"0.522159",
"0.52024627",
"0.5199527",
"0.5198559",
"0.5194394",
"0.513032",
"0.50966376",
"0.5075585",
"0.50643575",
"0.50330114",
"0.50230026",
"0.49927726",
"0.4974484",
"0.4963767",
"0.494054",
"0.49346498",
"0.4934509",
"0.49279132",
"0.4924438",
"0.4919171",
"0.49140942",
"0.49100322",
"0.49079803"
] | 0.6619435 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.