query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
/ this function is set to clean and save a text
function Rec($text) { $text = htmlspecialchars(trim($text), ENT_QUOTES); if (1 === get_magic_quotes_gpc()) { $text = stripslashes($text); } $text = nl2br($text); return $text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clean_text($text) {\n\treturn $text;\n}", "private function cleanText($text) {\n return $text;\n }", "function text($text) {\n\t\t// Removing html tags\n\t\t$text = strip_tags($text);\n\t\t// Removing line breaks and tabs\n\t\t$text = preg_replace('/[\\n\\r\\t]+/',' ',$text);\n\t\t// Removing extra spaces\n\t\t$text = preg_replace('/ {2,}/',' ',$text);\n\t\treturn $text;\n\t}", "function clean_text($string){\n // les donnees entre par l'etudiant ne contienne pas de caracteres special\n $string = trim($string);\n $string = stripslashes($string);\n //les caracteres special hml\n $string = htmlspecialchars($string); \n return $string;\n }", "public function sanitizeFreeText()\n {\n if ($this->locations) {\n foreach ($this->locations as $id => $loc) {\n $loc->sanitizeFreeText();\n }\n }\n if ($this->virtualLocations) {\n foreach ($this->virtualLocations as $id => $loc) {\n $loc->sanitizeFreeText();\n }\n }\n if ($this->links) {\n foreach ($this->links as $id => $lin) {\n $lin->sanitizeFreeText();\n }\n }\n if ($this->recurrenceOverrides) {\n foreach ($this->recurrenceOverrides as $id => $rec) {\n $rec->sanitizeFreeText();\n }\n }\n\n $this->title = AdapterUtil::reencode($this->title);\n $this->description = AdapterUtil::reencode($this->description);\n $this->keywords = AdapterUtil::reencode($this->keywords);\n }", "public function _CleanText($text) {\n\t\t$white_rx = \"/<\\s*/\";\n\t\t$tag_rx = \"/<[^>]*>/\";\n\t\t\n\t\t$safelist = Array(\n\t\t\t'/<p>|<\\/p>/i',\n\t\t\t'/<h[0-9]>[^<]*<\\/h[0-9]>/i',\n\t\t\t'/<a\\shref=.[\\/h#][^>]*>|<\\/a>/i',\n\t\t\t'/<b>|<\\/b>/i',\n\t\t\t'/<strong>|<\\/strong>/i',\n\t\t\t'/<i>|<\\/i>/i',\n\t\t\t'/<em>|<\\/em>/i',\n\t\t\t'/<br[^>]*>/i',\n\t\t\t'/<img\\ssrc=.[\\/h][^>]*\\/>|<img\\ssrc=\"[\\/h][^>]*>[^<]*<\\/img>/i',\n\t\t\t'/<hr[^>]*>/',\n\t\t\t'/<ol[^>]*>|<\\/ol[^>]*>/i',\n\t\t\t'/<ul[^>]*>|<\\/ul[^>]*>/i',\n\t\t\t'/<li[^>]*>|<\\/li[^>]*>/i',\n\t\t\t'/<code[^>]*>|<\\/code[^>]*>/i',\n\t\t\t'/<pre[^>]*>|<\\/pre[^>]*>/i'\n\t\t);\n\t\t\n\t\t$unsafe_words = Array(\n\t\t\t\"/javascript/e\",\n\t\t\t\"/script/e\",\n\t\t\t\"/onclick/e\",\n\t\t\t\"/onm\\w{1,}=/e\",\n\t\t\t\"/JAVASCRIPT/e\",\n\t\t\t\"/SCRIPT/e\",\n\t\t\t\"/ONCLICK/e\",\n\t\t\t\"/ONM\\w{1,}=/e\"\n\t\t);\n\t\t\n\t\t$dirty_words = Array(\n\t\t\t\"/fuck/e\",\n\t\t\t\"/bitch/e\",\n\t\t\t\"/asshole/e\",\n\t\t\t\"/damn/e\",\n\t\t\t\"/whore/e\",\n\t\t\t\"/babi/e\",\n\t\t\t\"/buto/e\",\n\t\t\t\"/sundal/e\",\n\t\t\t\"/sial/e\",\n\t\t\t\"/pepek/e\",\n\t\t\t\"/pantat/e\",\n\t\t\t\"/puki/e\",\n\t\t\t\"/pukimak/e\",\n\t\t\t\"/tetek/e\",\n\t\t\t\"/kelentit/e\",\n\t\t\t\"/konek/e\",\n\t\t\t\"/kontol/e\",\n\t\t\t\"/motherfucker/e\",\n\t\t\t\"/boobies/e\",\n\t\t\t\"/FUCK/e\",\n\t\t\t\"/BITCH/e\",\n\t\t\t\"/ASSHOLE/e\",\n\t\t\t\"/DAMN/e\",\n\t\t\t\"/WHORE/e\",\n\t\t\t\"/BABI/e\",\n\t\t\t\"/BUTO/e\",\n\t\t\t\"/SUNDAL/e\",\n\t\t\t\"/SIAL/e\",\n\t\t\t\"/PEPEK/e\",\n\t\t\t\"/PANTAT/e\",\n\t\t\t\"/PUKI/e\",\n\t\t\t\"/PUKIMAK/e\",\n\t\t\t\"/TETEK/e\",\n\t\t\t\"/KELENTIT/e\",\n\t\t\t\"/KONEK/e\",\n\t\t\t\"/KONTOL/e\",\n\t\t\t\"/MOTHERFUCKER/e\",\n\t\t\t\"/BOOBIES/e\",\n\t\t);\n\t\t\n\t\t$text = addcslashes($text,\"\\x00\\'\\x1a\\x3c\\x3e\\x25\");\n\t\t$text = preg_replace($white_rx, \"<\", $text);\n\t\t\n\t\tpreg_match_all($tag_rx, $text, $matches);\n\t\t$finds = $matches[0];\n\t\tforeach($finds as $find) {\n\t\t\t$clean = true;\n\t\t\tforeach($safelist as $safetag) {\n\t\t\t\tif(preg_match($safetag, $find) > 0) {\n\t\t\t\t\t$clean = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($clean === true) {\n\t\t\t\t$text = str_ireplace($find, htmlentities($find), $text);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$text = preg_replace($unsafe_words, \"zaseuuoqHSJAEWAdgsrppoVNAS\", $text);\n\t\t$text = preg_replace($dirty_words, \"zaseuuoqHSJAEWAdgsrppoVNAS\", $text);\n\t\t$text = str_replace(\"zaseuuoqHSJAEWAdgsrppoVNAS\",\"<i>BEEP</i>\",$text);\n\t\tif(function_exists(\"mysql_real_escape_string\")) {\n\t\t\t$text = mysql_real_escape_string($text);\n\t\t} elseif(function_exists(\"mysqli_real_escape_string\")) {\n\t\t\t$text = mysqli_real_escape_string($text);\n\t\t}\n\t\treturn $text;\n\t}", "public function _CleanText($text) {\n\t\t$white_rx = \"/<\\s*/\";\n\t\t$tag_rx = \"/<[^>]*>/\";\n\t\t\n\t\t$safelist = Array(\n\t\t\t'/<p>|<\\/p>/i',\n\t\t\t'/<h[0-9]>[^<]*<\\/h[0-9]>/i',\n\t\t\t'/<a\\shref=.[\\/h#][^>]*>|<\\/a>/i',\n\t\t\t'/<b>|<\\/b>/i',\n\t\t\t'/<strong>|<\\/strong>/i',\n\t\t\t'/<i>|<\\/i>/i',\n\t\t\t'/<em>|<\\/em>/i',\n\t\t\t'/<br[^>]*>/i',\n\t\t\t'/<img\\ssrc=.[\\/h][^>]*\\/>|<img\\ssrc=\"[\\/h][^>]*>[^<]*<\\/img>/i',\n\t\t\t'/<hr[^>]*>/',\n\t\t\t'/<ol[^>]*>|<\\/ol[^>]*>/i',\n\t\t\t'/<ul[^>]*>|<\\/ul[^>]*>/i',\n\t\t\t'/<li[^>]*>|<\\/li[^>]*>/i',\n\t\t\t'/<code[^>]*>|<\\/code[^>]*>/i',\n\t\t\t'/<pre[^>]*>|<\\/pre[^>]*>/i'\n\t\t);\n\t\t\n\t\t$unsafe_words = Array(\n\t\t\t\"/javascript/e\",\n\t\t\t\"/script/e\",\n\t\t\t\"/onclick/e\",\n\t\t\t\"/onm\\w{1,}=/e\",\n\t\t\t\"/JAVASCRIPT/e\",\n\t\t\t\"/SCRIPT/e\",\n\t\t\t\"/ONCLICK/e\",\n\t\t\t\"/ONM\\w{1,}=/e\"\n\t\t);\n\t\t\n\t\t$dirty_words = Array(\n\t\t\t\"/fuck/e\",\n\t\t\t\"/bitch/e\",\n\t\t\t\"/asshole/e\",\n\t\t\t\"/damn/e\",\n\t\t\t\"/whore/e\",\n\t\t\t\"/babi/e\",\n\t\t\t\"/buto/e\",\n\t\t\t\"/sundal/e\",\n\t\t\t\"/sial/e\",\n\t\t\t\"/pepek/e\",\n\t\t\t\"/pantat/e\",\n\t\t\t\"/puki/e\",\n\t\t\t\"/pukimak/e\",\n\t\t\t\"/tetek/e\",\n\t\t\t\"/kelentit/e\",\n\t\t\t\"/konek/e\",\n\t\t\t\"/kontol/e\",\n\t\t\t\"/motherfucker/e\",\n\t\t\t\"/boobies/e\",\n\t\t\t\"/FUCK/e\",\n\t\t\t\"/BITCH/e\",\n\t\t\t\"/ASSHOLE/e\",\n\t\t\t\"/DAMN/e\",\n\t\t\t\"/WHORE/e\",\n\t\t\t\"/BABI/e\",\n\t\t\t\"/BUTO/e\",\n\t\t\t\"/SUNDAL/e\",\n\t\t\t\"/SIAL/e\",\n\t\t\t\"/PEPEK/e\",\n\t\t\t\"/PANTAT/e\",\n\t\t\t\"/PUKI/e\",\n\t\t\t\"/PUKIMAK/e\",\n\t\t\t\"/TETEK/e\",\n\t\t\t\"/KELENTIT/e\",\n\t\t\t\"/KONEK/e\",\n\t\t\t\"/KONTOL/e\",\n\t\t\t\"/MOTHERFUCKER/e\",\n\t\t\t\"/BOOBIES/e\",\n\t\t);\n\t\t\n\t\t$text = addcslashes($text,\"\\x00\\'\\x1a\\x3c\\x3e\\x25\");\n\t\t$text = preg_replace($white_rx, \"<\", $text);\n\t\t\n\t\tpreg_match_all($tag_rx, $text, $matches);\n\t\t$finds = $matches[0];\n\t\tforeach($finds as $find) {\n\t\t\t$clean = true;\n\t\t\tforeach($safelist as $safetag) {\n\t\t\t\tif(preg_match($safetag, $find) > 0) {\n\t\t\t\t\t$clean = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($clean === true) {\n\t\t\t\t$text = str_ireplace($find, htmlentities($find), $text);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$text = preg_replace($unsafe_words, \"zaseuuoqHSJAEWAdgsrppoVNAS\", $text);\n\t\t$text = preg_replace($dirty_words, \"zaseuuoqHSJAEWAdgsrppoVNAS\", $text);\n\t\t$text = str_replace(\"zaseuuoqHSJAEWAdgsrppoVNAS\",\"<i>BEEP</i>\",$text);\n\t\tif(function_exists(\"mysql_real_escape_string\")) {\n\t\t\t$text = mysql_real_escape_string($text);\n\t\t} elseif(function_exists(\"mysqli_real_escape_string\")) {\n\t\t\t$text = mysqli_real_escape_string($text);\n\t\t}\n\t\treturn $text;\n\t}", "function treat($text) {\n\t$s1 = str_replace(\"\\n\\r\", \"\\n\", $text);\n\treturn str_replace(\"\\r\", \"\", $s1);\n}", "public function sanitizeFreeText()\n {\n $this->label = AdapterUtil::reencode($this->label);\n $this->street = AdapterUtil::reencode($this->street);\n $this->locality = AdapterUtil::reencode($this->locality);\n $this->region = AdapterUtil::reencode($this->region);\n $this->country = AdapterUtil::reencode($this->country);\n }", "function secu_txt($text) {\n return htmlentities(strip_tags($text), ENT_QUOTES, 'UTF-8');\n}", "function clean_text($string)\n{\n $string = trim($string);\n $string = stripslashes($string);\n $string = htmlspecialchars($string);\n return $string;\n}", "function clean_word() {\r\n\t\tpreg_match_all('/<img[^<>]*? alt=\"Text Box:\\s*([^\"]*?)\"[^<>]*?>/is', $this->code, $text_box_matches, PREG_OFFSET_CAPTURE);\r\n\t\t$counter = sizeof($text_box_matches[0]) - 1;\r\n\t\twhile($counter > -1) {\r\n\t\t\t$offset = $text_box_matches[0][$counter][1];\r\n\t\t\t$text = $text_box_matches[1][$counter][0];\r\n\t\t\t$text = '<p>' . str_replace('&#13;&#10;', '</p>\r\n<p>', $text) . '</p>';\r\n\t\t\t$this->code = substr($this->code, 0, $offset) . $text . substr($this->code, $offset + strlen($text_box_matches[0][$counter][0]));\r\n\t\t\t$counter--;\r\n\t\t}\r\n\t\t\r\n\t\t// although at least firefox seems smart enough to not display them, \r\n\t\t// some versions of word may use soft hyphens for print layout or some such nonsense\r\n\t\t// is this a candidate for general (basic) usage?\r\n\t\t$this->code = str_replace('&shy;', '', $this->code);\r\n\t\t// this needs revision for array(\"­\", \"&#173;\", \"&#xad;\", \"&shy;\"); and the fact that soft hyphens are misused by document authors (specific case: they show in RTF files but not in firefox)\r\n\t\t\r\n\t\tReTidy::decode_for_DOM_all_character_entities(); // since much of the clean_word work is removing styles\r\n\t\t\r\n\t\t// should we simply eliminate all names and ids (since the structure function will generate those which are needed)?\r\n\t\t// seems we should except for footnotes: _ftnref _ftn _ednref _edn\r\n\t\t$this->code = preg_replace('/ id=\"([^_][^\"]*?|_[^fe][^\"]*?|_f[^t][^\"]*?|_e[^d][^\"]*?|_ft[^n][^\"]*?|_ed[^n][^\"]*?)\"/is', '', $this->code);\r\n\t\t$this->code = preg_replace('/(<a[^<>]*?) name=\"([^_][^\"]*?|_[^fe][^\"]*?|_f[^t][^\"]*?|_e[^d][^\"]*?|_ft[^n][^\"]*?|_ed[^n][^\"]*?)\"([^<>]*?>)/is', '$1$3', $this->code);\r\n\t\t\r\n\t\t\r\n\t\t// often in word documents the lang attributes are wrong... so:\r\n\t\t$this->code = preg_replace('/ lang=\"EN[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ xml:lang=\"EN[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ lang=\"FR[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ xml:lang=\"FR[^\"]*\"/', '', $this->code);\r\n\t\t\r\n\t\t// white background\r\n\t\t$this->code = preg_replace('/ class=\"([^\"]*)whiteBG([^\"]*)\"/is', ' class=\"$1$2\"', $this->code);\r\n\t\t// parks canada specific:\r\n\t\t$this->code = preg_replace('/ class=\"([^\"]*)backTop([^\"]*)\"/is', ' class=\"$1alignRight$2\"', $this->code);\t\t\r\n\t\t\r\n\t\t// topPage; these should not exist (since documents in their original format shall not have links to the top)\r\n\t\t// but they sometimes come from styles to classes. On tags other than spans they style the alignment.\r\n\t\t$this->code = preg_replace('/<span([^>]*)class=\"([^\"]*)topPage([^\"]*)\"/is', '<span$1class=\"$2$3\"', $this->code);\r\n\t\t\r\n\t\t// word document section <div>s\r\n\t\t//$this->code = preg_replace('/<div style=\"page\\s*:\\s*[^;]+;\">/is', '<div stripme=\"y\">', $this->code);\r\n\t\tReTidy::non_DOM_stripme('<div style=\"page\\s*:\\s*[^;]+;\">');\r\n\t\t\r\n\t\t// remove style information declarations(?) or qualifications(?) like !msnorm and !important? \r\n\t\t// Nah, there is no need until word is seen to use !important (it could also be in government stylesheets so there is the remote chance that we\r\n\t\t// would like to keep it). Definately get rid of !msnorm though.\r\n\t\t$arrayStyleInformationPiecesToDelete = array(\r\n\t\t'!msorm',\r\n\t\t);\r\n\t\tforeach($arrayStyleInformationPiecesToDelete as $styleInformationPieceToDelete) {\r\n\t\t\t$styleInformationPieceToDeleteCount = -1;\r\n\t\t\twhile($styleInformationPieceToDeleteCount != 0) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*?)' . $styleInformationPieceToDelete . '([^\"]*?)\"/is', 'style=\"$1$2\"', $this->code, -1, $styleInformationPieceToDeleteCount);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// blockquote\r\n\t\tpreg_match_all('/<p[^<>]*style=[^<>]*(margin-right\\s*:\\s*([^;\\'\"]*)[;\\'\"])[^<>]*(margin-left\\s*:\\s*([^;\\'\"]*)[;\\'\"])[^<>]*>(.*?)<\\/p>/is', $this->code, $p_matches2);\r\n\t\tforeach($p_matches2[0] as $index => $value) {\r\n\t\t\tpreg_match('/([0-9\\.]*)in/', $p_matches2[2][$index], $margin_right_matches);\r\n\t\t\tpreg_match('/([0-9\\.]*)in/', $p_matches2[4][$index], $margin_left_matches);\r\n\t\t\tif($margin_right_matches[1] > 0.4 && $margin_left_matches[1] > 0.4) {\r\n\t\t\t\t$original = $new = $p_matches2[0][$index];\r\n\t\t\t\t$new = str_replace($p_matches2[1][$index], '', $new);\r\n\t\t\t\t$new = str_replace($p_matches2[3][$index], '', $new);\r\n\t\t\t\t$new = str_replace('<p', '<div', $new);\r\n\t\t\t\t$new = str_replace('</p>', '</div>', $new);\r\n\t\t\t\t$new = \"<blockquote>\" . $new . \"</blockquote>\";\r\n\t\t\t\t$this->code = str_replace($original, $new, $this->code);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// onmouseover, onmouseout; attributes to delete\r\n\t\t$arrayAttributesToDelete = array(\r\n\t\t'onmouseover',\r\n\t\t'onmouseout',\r\n\t\t);\r\n\t\tforeach($arrayAttributesToDelete as $attributeToDelete) {\r\n\t\t\t$this->code = preg_replace('/' . $attributeToDelete . '=\"([^\"]*)\"/is', '', $this->code);\r\n\t\t}\r\n\t\t\r\n\t\t// microsoft styles to delete\r\n\t\t$arrayMicrosoftStylesToDelete = array(\r\n\t\t'page-break-before',\r\n\t\t'page-break-after',\r\n\t\t'page-break-inside',\r\n\t\t'text-autospace',\r\n\t\t'text-transform',\t\t\r\n\t\t//'border',\r\n\t\t'border-left', // (2011-11-07)\r\n\t\t'border-right', // (2011-11-07)\r\n\t\t'border-bottom', // (2011-11-07)\r\n\t\t'border-top', // (2011-11-07)\r\n\t\t'border-collapse',\r\n\t\t'margin', //// notice that we may in some cases want to keep margins (as an indication of indentation)\r\n\t\t'margin-left', ////\r\n\t\t'margin-right', ////\r\n\t\t'margin-top', ////\r\n\t\t'margin-bottom', ////\t\t\t\t\t\t\t\r\n\t\t'padding',\r\n\t\t'padding-left',\r\n\t\t'padding-right',\r\n\t\t'padding-top',\r\n\t\t'padding-bottom',\r\n\t\t'font',\r\n\t\t'font-size', //// notice that we may in some cases want to keep font-size\r\n\t\t'font-family',\r\n\t\t//'font-style', // font-style: italic;\r\n\t\t//'text-decoration', // text-decoration: underline;\r\n\t\t'line-height',\r\n\t\t'layout-grid-mode',\r\n\t\t'page',\r\n\t\t'text-indent', //// notice that we may in some cases want to keep text-indent\r\n\t\t'font-variant', //// this may have to be amended in the future (if some document uses small caps without capitalizing those first letters that need to be capitalized)\r\n\t\t'mso-style-name',\r\n\t\t'mso-style-link',\r\n\t\t'z-index',\r\n\t\t'position',\r\n\t\t// we cannot enable the following and keep other style information that these are substrings of\r\n\t\t'top',\r\n\t\t'right',\r\n\t\t'bottom',\r\n\t\t'left',\r\n\t\t'letter-spacing',\r\n\t\t);\r\n\t\t// for this we assume that there are no embedded stylesheets\r\n\t\tforeach($arrayMicrosoftStylesToDelete as $microsoftStyle) {\r\n\t\t\twhile(true) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($microsoftStyle) . '\\s*:\\s*[^;\"]*;\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countA);\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($microsoftStyle) . '\\s*:\\s*[^;\"]*\"/is', 'style=\"$1\"', $this->code, -1, $countB);\r\n\t\t\t\tif($countA === 0 && $countB === 0) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif($this->config['strict_accessibility_level'] > 0) { // then just make it grey\r\n\t\t\twhile(true) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape('color') . '\\s*:\\s*[^;\"]*;\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countA);\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape('color') . '\\s*:\\s*[^;\"]*\"/is', 'style=\"$1\"', $this->code, -1, $countB);\r\n\t\t\t\tif($countA === 0 && $countB === 0) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$arrayMicrosoftStylesWithValuesToDelete = array(\r\n\t\t//'color' => array('black', 'windowtext'), // these can sometimes override other colours that we keep so ideally we would like to keep these in but style attributes for colour...\r\n\t\t'text-align' => array('justify'),\r\n\t\t'font-weight' => array('normal', 'normal !msorm', 'normal !msnorm'), \r\n\t\t// we take this out although it can usefully cascade other styles\r\n\t\t// which brings up the point that these all probably can... ;(\r\n\t\t//'font-variant' => array('normal', 'normal!important', 'normal !important', 'small-caps'),\r\n\t\t'background' => array('white', '#FFFFFF'),\r\n\t\t'background-color' => array('white', '#FFFFFF'),\r\n\t\t);\r\n\t\tforeach($arrayMicrosoftStylesWithValuesToDelete as $style => $value) {\r\n\t\t\tforeach($value as $information) {\r\n\t\t\t\twhile(true) {\r\n\t\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($style) . '\\s*:\\s*' . ReTidy::preg_escape($information) . ';\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countC);\r\n\t\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($style) . '\\s*:\\s*' . ReTidy::preg_escape($information) . '\"/is', 'style=\"$1\"', $this->code, -1, $countD);\r\n\t\t\t\t\tif($countC === 0 && $countD === 0) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$arrayMicrosoftStylesWithValuesOnTagsToDelete = array(\r\n\t\t'text-align' => array('left' => array('p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'),),\r\n\t\t'font-weight' => array('bold' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'),),\r\n\t\t'vertical-align' => array( \r\n\t\t// we should be careful here not to remove any styles that might be used to identify footnotes; although\r\n\t\t// I do not know of any that are currently (2011-11-28) used\r\n\t\t'baseline' => array('span'),\r\n\t\t'sub' => array('span'),\r\n\t\t'super' => array('span'),\r\n\t\t'top' => array('span'),\r\n\t\t'text-top' => array('span'),\r\n\t\t'middle' => array('span'),\r\n\t\t'bottom' => array('span'),\r\n\t\t'text-bottom' => array('span'),\r\n\t\t'inherit' => array('span'),\r\n\t\t),\r\n\r\n\t\t);\r\n\t\tforeach($arrayMicrosoftStylesWithValuesOnTagsToDelete as $property => $stylings) {\r\n\t\t\tforeach($stylings as $styling => $tags) {\r\n\t\t\t\t$tagsString = implode(\"|\", $tags);\r\n\t\t\t\twhile(true) {\r\n\t\t\t\t\t$this->code = preg_replace('/<(' . $tagsString . ')([^<>]*) style=\"([^\"]*)' . ReTidy::preg_escape($property) . '\\s*:\\s*' . ReTidy::preg_escape($styling) . ';\\s*([^\"]*)\"/is', '<$1$2 style=\"$3$4\"', $this->code, -1, $countE);\r\n\t\t\t\t\t$this->code = preg_replace('/<(' . $tagsString . ')([^<>]*) style=\"([^\"]*)' . ReTidy::preg_escape($property) . '\\s*:\\s*' . ReTidy::preg_escape($styling) . '\"/is', '<$1$2 style=\"$3\"', $this->code, -1, $countF);\r\n\t\t\t\t\tif($countE === 0 && $countF === 0) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// pseudo-elements\r\n\t\t// <a style=\":visited { color: purple; }\">\r\n\t\t$countE = -1;\r\n\t\twhile($countE !== 0) {\r\n\t\t\t//print(\"doing pseudo-elements<br>\\r\\n\");\r\n\t\t\t$this->code = preg_replace('/style=\"([^\"]{0,}):\\w+\\s*\\{[^\\{\\}]{0,}\\}([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countE);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// <hr> with width\r\n\t\t$this->code = preg_replace('/<hr([^<>]*) width=\"[^\"]*\"([^<>]*)\\/>/is', '<hr$1$2/>', $this->code);\r\n\t\t\r\n\t\t// microsoft using operating system independant CSS...\r\n\t\t// I guess for this we assume that we are using windows.\r\n\t\t$this->code = preg_replace('/style=\"([^\"]*)border\\s*:\\s*solid\\s+windowtext\\s+1.0pt\\s*(;?)([^\"]*)\"/is', 'style=\"$1border: 1px solid black$2$3\"', $this->code);\r\n\t\t\r\n\t\t// superscript using CSS\r\n\t\t//$this->code = preg_replace('/(<(\\w*)[^<>]* style=\"[^\"]*)vertical-align: super\\s*(;?)([^\"]*\"[^<>]*>.*?<\\/\\2>)/is', '<sup>$1$4</sup>', $this->code, -1, $countC);\r\n\t\t$this->code = preg_replace('/<(\\w+[^<>]* style=\"[^\"]*)vertical-align: super\\s*(;?[^\"]*\"[^<>]*)>/is', '<$1$2 newtag=\"sup\">', $this->code);\r\n\t\t\r\n\t\t// clean up stupidity generated by tidy\r\n\t\t$this->code = preg_replace('/<div([^<>]*?) start=\"[^\"]*?\"([^<>]*?)>/is', '<div$1$2>', $this->code);\r\n\t\t$this->code = preg_replace('/<div([^<>]*?) type=\"[^\"]*?\"([^<>]*?)>/is', '<div$1$2>', $this->code);\r\n\t\t\r\n\t\tReTidy::post_dom();\r\n\t\t// remove empty <a> tags; aside from general cleanup, to avoid the regular expression recursion limit of 100 (for the ridiculous\r\n\t\t// case of something like that many anchors at the same spot...\r\n\t\t//$this->code = str_replace('<a></a>', '', $this->code);\r\n\t\t$this->code = preg_replace('/<a>([^<>]*?)<\\/a>/is', '$1', $this->code);\r\n\t//\tReTidy::extra_space();\r\n\t\t\r\n\t\t// lists where each list element has a <ul>\r\n\t\tif(ReTidy::is_XHTML()) {\r\n\t\t\t$this->code = preg_replace('/<\\/li>\\s*<\\/ul>\\s*<ul( [^<>]*)?>/is', '<br /><br /></li>', $this->code);\r\n\t\t} else {\r\n\t\t\t$this->code = preg_replace('/<\\/li>\\s*<\\/ul>\\s*<ul( [^<>]*)?>/is', '<br><br></li>', $this->code);\r\n\t\t}\r\n\t\t\r\n\t\t// empty text blocks; notice that we would not want to do this generally\r\n\t\t$this->code = preg_replace('/<(p|h1|h2|h3|h4|h5|h6|li)( [^<>]*){0,1}>&nbsp;<\\/\\1>/is', '', $this->code);\r\n\t\t// some sort of full-width break from word that we do not want\r\n\t\t$this->code = preg_replace('/<br [^<>]*clear\\s*=\\s*[\"\\']*all[\"\\']*[^<>]*\\/>/is', '', $this->code);\r\n\t\t// force a border onto tables because word html uses border on cells rather than on the table\r\n\t\t$this->code = preg_replace('/<table([^<>]*) border=\"0\"/is', '<table$1 border=\"1\"', $this->code);\r\n\t\t// despan anchors\r\n\t\tpreg_match_all('/(<a ([^<>]*)[^\\/<>]>)(.*?)(<\\/a>)/is', $this->code, $anchor_matches);\r\n\t\tforeach($anchor_matches[0] as $index => $value) {\r\n\t\t\tif(strpos($anchor_matches[2][$index], \"href=\") === false) {\r\n\t\t\t\tif(strpos($anchor_matches[2][$index], \"name=\") !== false || strpos($anchor_matches[2][$index], \"id=\") !== false) {\r\n\t\t\t\t\t$this->code = str_replace($anchor_matches[1][$index] . $anchor_matches[3][$index] . $anchor_matches[4][$index], $anchor_matches[1][$index] . $anchor_matches[4][$index] . $anchor_matches[3][$index], $this->code);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// simplify lists that unnecessarily have a list for each list item\r\n\t\tpreg_match_all('/<ol([^<>]*?)>(.*?)<\\/ol>/is', $this->code, $ol_matches, PREG_OFFSET_CAPTURE);\r\n\t\t$size = sizeof($ol_matches[0]) - 1;\r\n\t\twhile($size > -1) {\r\n\t\t\tpreg_match('/ start=\"([^\"]*?)\"/is', $ol_matches[0][$size][0], $start_matches);\r\n\t\t\tpreg_match('/ type=\"([^\"]*?)\"/is', $ol_matches[0][$size][0], $type_matches);\r\n\t\t\t$start = $start_matches[1];\r\n\t\t\t$type = $type_matches[1];\r\n\t\t\t$combine_string = \"\";\r\n\t\t\twhile(true) {\r\n\t\t\t\t$end_of_previous_offset = $ol_matches[0][$size - 1][1] + strlen($ol_matches[0][$size - 1][0]);\r\n\t\t\t\t$end_of_current_offset = $ol_matches[0][$size][1] + strlen($ol_matches[0][$size][0]);\r\n\t\t\t\t$combine_string = substr($this->code, $end_of_previous_offset, $end_of_current_offset - $end_of_previous_offset) . $combine_string;\r\n\t\t\t\tpreg_match('/ type=\"([^\"]*?)\"/is', $ol_matches[0][$size - 1][0], $type_matches2);\r\n\t\t\t\t$type2 = $type_matches2[1];\r\n\t\t\t\tif($type !== $type2) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tpreg_match('/ start=\"([^\"]*?)\"/is', $ol_matches[0][$size - 1][0], $start_matches2);\r\n\t\t\t\t$start2 = $start_matches2[1];\r\n\t\t\t\tif(!is_numeric($start2) || $start2 >= $start) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tReTidy::preg_match_last('/<[^<>]+>/is', substr($this->code, 0, $ol_matches[0][$size][1]), $last_tag_piece_matches);\r\n\t\t\t\tif($last_tag_piece_matches[0] !== \"</ol>\") {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t$start = $start2;\r\n\t\t\t\t$size--;\r\n\t\t\t}\r\n\t\t\t$cleaned_combine_string = $combine_string;\r\n\t\t\t$cleaned_combine_string = preg_replace('/<\\/ol>\\s*<ol[^<>]*?>/is', '', $cleaned_combine_string);\r\n\t\t\t$this->code = str_replace($combine_string, $cleaned_combine_string, $this->code);\r\n\t\t\t$size--;\r\n\t\t}\r\n\t\t\r\n\t\tReTidy::clean_redundant_sufficient_inline();\r\n\t\tReTidy::double_breaks_to_paragraphs();\r\n\t\tReTidy::encode_for_DOM_all_character_entities(); // re-encode character entities that were decoded at the start of this function\r\n\t\t//$this->code = preg_replace('/(&nbsp;|&#160;|&#xA0;){3,}/is', '&nbsp;&nbsp;', $this->code); // added 2015-06-04\r\n\t\tReTidy::mitigate_consecutive_non_breaking_spaces(); // plz\r\n\t}", "function cleanString($text) {\r\n\t\t\t// 1) convert á ô => a o\r\n\t\t\t$text = preg_replace(\"/[áàâãªä]/u\",\"a\",$text);\r\n\t\t\t$text = preg_replace(\"/[ÁÀÂÃÄ]/u\",\"A\",$text);\r\n\t\t\t$text = preg_replace(\"/[ÍÌÎÏ]/u\",\"I\",$text);\r\n\t\t\t$text = preg_replace(\"/[íìîï]/u\",\"i\",$text);\r\n\t\t\t$text = preg_replace(\"/[éèêë]/u\",\"e\",$text);\r\n\t\t\t$text = preg_replace(\"/[ÉÈÊË]/u\",\"E\",$text);\r\n\t\t\t$text = preg_replace(\"/[óòôõºö]/u\",\"o\",$text);\r\n\t\t\t$text = preg_replace(\"/[ÓÒÔÕÖ]/u\",\"O\",$text);\r\n\t\t\t$text = preg_replace(\"/[úùûü]/u\",\"u\",$text);\r\n\t\t\t$text = preg_replace(\"/[ÚÙÛÜ]/u\",\"U\",$text);\r\n\t\t\t$text = preg_replace(\"/[’‘‹›‚]/u\",\"'\",$text);\r\n\t\t\t$text = preg_replace(\"/[“”«»„]/u\",'\"',$text);\r\n\t\t\t$text = str_replace(\"–\",\"-\",$text);\r\n\t\t\t$text = str_replace(\" \",\" \",$text);\r\n\t\t\t$text = str_replace(\"ç\",\"c\",$text);\r\n\t\t\t$text = str_replace(\"Ç\",\"C\",$text);\r\n\t\t\t$text = str_replace(\"ñ\",\"n\",$text);\r\n\t\t\t$text = str_replace(\"Ñ\",\"N\",$text);\r\n\t \r\n\t\t\t//2) Translation CP1252. &ndash; => -\r\n\t\t\t$trans = get_html_translation_table(HTML_ENTITIES); \r\n\t\t\t$trans[chr(130)] = '&sbquo;'; // Single Low-9 Quotation Mark \r\n\t\t\t$trans[chr(131)] = '&fnof;'; // Latin Small Letter F With Hook \r\n\t\t\t$trans[chr(132)] = '&bdquo;'; // Double Low-9 Quotation Mark \r\n\t\t\t$trans[chr(133)] = '&hellip;'; // Horizontal Ellipsis \r\n\t\t\t$trans[chr(134)] = '&dagger;'; // Dagger \r\n\t\t\t$trans[chr(135)] = '&Dagger;'; // Double Dagger \r\n\t\t\t$trans[chr(136)] = '&circ;'; // Modifier Letter Circumflex Accent \r\n\t\t\t$trans[chr(137)] = '&permil;'; // Per Mille Sign \r\n\t\t\t$trans[chr(138)] = '&Scaron;'; // Latin Capital Letter S With Caron \r\n\t\t\t$trans[chr(139)] = '&lsaquo;'; // Single Left-Pointing Angle Quotation Mark \r\n\t\t\t$trans[chr(140)] = '&OElig;'; // Latin Capital Ligature OE \r\n\t\t\t$trans[chr(145)] = '&lsquo;'; // Left Single Quotation Mark \r\n\t\t\t$trans[chr(146)] = '&rsquo;'; // Right Single Quotation Mark \r\n\t\t\t$trans[chr(147)] = '&ldquo;'; // Left Double Quotation Mark \r\n\t\t\t$trans[chr(148)] = '&rdquo;'; // Right Double Quotation Mark \r\n\t\t\t$trans[chr(149)] = '&bull;'; // Bullet \r\n\t\t\t$trans[chr(150)] = '&ndash;'; // En Dash \r\n\t\t\t$trans[chr(151)] = '&mdash;'; // Em Dash \r\n\t\t\t$trans[chr(152)] = '&tilde;'; // Small Tilde \r\n\t\t\t$trans[chr(153)] = '&trade;'; // Trade Mark Sign \r\n\t\t\t$trans[chr(154)] = '&scaron;'; // Latin Small Letter S With Caron \r\n\t\t\t$trans[chr(155)] = '&rsaquo;'; // Single Right-Pointing Angle Quotation Mark \r\n\t\t\t$trans[chr(156)] = '&oelig;'; // Latin Small Ligature OE \r\n\t\t\t$trans[chr(159)] = '&Yuml;'; // Latin Capital Letter Y With Diaeresis \r\n\t\t\t$trans['euro'] = '&euro;'; // euro currency symbol \r\n\t\t\tksort($trans); \r\n\t\t\t \r\n\t\t\tforeach ($trans as $k => $v) {\r\n\t\t\t\t\t$text = str_replace($v, $k, $text);\r\n\t\t\t}\r\n\t \r\n\t\t\t// 3) remove <p>, <br/> ...\r\n\t\t\t//$text = strip_tags($text); \r\n\t\t\t \r\n\t\t\t// 4) &amp; => & &quot; => '\r\n\t\t\t//$text = html_entity_decode($text);\r\n\t\t\t \r\n\t\t\t// 5) remove Windows-1252 symbols like \"TradeMark\", \"Euro\"...\r\n\t\t\t$text = preg_replace('/[^(\\x20-\\x7F)]*/','', $text); \r\n\t\t\t \r\n\t\t\t$targets=array('\\r\\n','\\n','\\r','\\t');\r\n\t\t\t$results=array(\" \",\" \",\" \",\"\");\r\n\t\t\t$text = str_replace($targets,$results,$text);\r\n\t \r\n\t\t\t//XML compatible\r\n\t\t\t/*\r\n\t\t\t$text = str_replace(\"&\", \"and\", $text);\r\n\t\t\t$text = str_replace(\"<\", \".\", $text);\r\n\t\t\t$text = str_replace(\">\", \".\", $text);\r\n\t\t\t$text = str_replace(\"\\\\\", \"-\", $text);\r\n\t\t\t$text = str_replace(\"/\", \"-\", $text);\r\n\t\t\t*/\r\n\t\t\t \r\n\t\t\treturn ($text);\r\n\t\t}", "function cleanText($text)\n{\n\t$text = strtolower($text);\n\t//$text = iconv('utf-8', 'ascii//TRANSLIT', $text);\n\t$text = preg_replace(\"/&([a-z])[a-z]+;/i\", \"$1\", htmlentities($text));\n\t$text = preg_replace(\"#[[:punct:]]#\", \"\", $text);\n\treturn ($text);\n}", "public function reparse()\n\t{\n\t\t$for_edit = $this->generate_text_for_edit();\n\t\t$this->post_text = $for_edit['text'];\n\n\t\t// Emulate what happens when sent from the user\n\t\t$this->post_text = html_entity_decode($this->post_text);\n\t\tset_var($this->post_text, $this->post_text, 'string', true);\n\n\t\t$this->generate_text_for_storage($for_edit['allow_bbcode'], $for_edit['allow_urls'], $for_edit['allow_smilies']);\n\t}", "function _sanitize_text_fields($str, $keep_newlines = \\false)\n {\n }", "function Rec($text)\r\n {\r\n \t$text = htmlspecialchars(trim($text), ENT_QUOTES);\r\n \tif (1 === get_magic_quotes_gpc())\r\n \t{\r\n \t\t$text = stripslashes($text);\r\n \t}\r\n \r\n \t$text = nl2br($text);\r\n \treturn $text;\r\n }", "function phpTrafficA_cleanTextBasic($text) {\n$text = str_replace(\"\\'\", \"&#39;\", $text);\n$text = str_replace(\"'\", \"&#39;\", $text);\n$text = str_replace(\"\\\"\", \"&#34;\", $text);\n$text = str_replace(\"\\\\\\\"\", \"&#34;\", $text);\n$text = str_replace(\"\\\\\", \"&#92;\", $text);\n$text = str_replace(\"\\\\\\\\\", \"&#92;\", $text);\n$text = str_replace(\"\\n\", \"\", $text);\n$text = str_replace(\"\\r\", \"\", $text);\n$text = str_replace(\"<\", \"&#060;\", $text);\n$text = str_replace(\">\", \"&#062;\", $text);\nreturn $text;\n}", "function treat($text) {\n $s1 = str_replace(\"\\n\\r\", \"\\n\", $text);\n return str_replace(\"\\r\", \"\", $s1);\n}", "function parseText($text) {\r\n\t\r\n\t\r\n\t\t$parsed_text = $this->urlsTolinks($text);\r\n\t\t\r\n\t\t//if no paragraph or break tags replace \\n with <br />\r\n\t\t\r\n\t\tif (!eregi('(<p|<br)', $parsed_text)) {\r\n\t\t\t\r\n\t\t\t$parsed_text = nl2br($parsed_text);\r\n\t\t\r\n \t\t} \r\n\t\t\r\n\t\t$parsed_text = $this->replaceMediaPlaceholders($parsed_text);\r\n\t\t$parsed_text = $this->replaceUserVariables($parsed_text);\r\n\t\t$parsed_text = $this->textoGif($parsed_text);\r\n\t\t//$parsed_text = $this->popuplinks($parsed_text);\r\n\t\t \t\t\r\n\t\treturn $parsed_text;\r\n\t\r\n\t}", "function cleanseTheData($data) \n\t\t{\n \t\t\t$data = trim($data);\n\t\t\t$data = stripslashes($data);\n\t\t\t$data = htmlspecialchars($data);\n\t\t\treturn $data;\n\t\t}", "public function markClean();", "private function writeTextToFile() {\n\t\t$text = $this -> pm -> getText($this -> padid);\n\t\t$path = sprintf('%s/%s.tex', $this -> directory, $this -> name);\n\t\tfile_put_contents($path, $text);\n\t}", "function safety($text){\r\n $text = strip_tags($text); //Remove html tags\r\n $text = $this->ixd->real_escape_string($text); // Make safe for Database.\r\n return $text;\r\n }", "function phpTrafficA_cleanText($text) {\n$text = str_replace(\"&\", \"&amp;\", $text);\n$text = str_replace(\"\\'\", \"&#39;\", $text);\n$text = str_replace(\"'\", \"&#39;\", $text);\n$text = str_replace(\"\\\"\", \"&#34;\", $text);\n$text = str_replace(\"\\\\\\\"\", \"&#34;\", $text);\n$text = str_replace(\"\\\\\", \"&#92;\", $text);\n$text = str_replace(\"\\\\\\\\\", \"&#92;\", $text);\n$text = str_replace(\"\\n\", \"\", $text);\n$text = str_replace(\"\\r\", \"\", $text);\n$text = str_replace(\"<\", \"&#060;\", $text);\n$text = str_replace(\">\", \"&#062;\", $text);\nreturn $text;\n}", "function filter_user_text($str) {\r\n\tif (!$str) return '';\r\n\r\n\t$str = preg_replace('/(\\r?\\n)+/', ' ', $str);\r\n\t$str = preg_replace('/\\s+/', ' ', $str);\r\n\t$str = str_replace('\"', '\\\"', $str);\r\n//\t$str = str_replace(\"'\", \"\\'\", $str);\r\n\t\r\n\treturn $str;\r\n}", "private function _clean($data){\n $data = preg_replace(\"/\\r|\\n/\",\"\",$data);\n $data = preg_replace(\"/\\s+/\",\" \",$data);\n return $data;\n }", "function text_filter($text)\r\n\t{\r\n\t\t$text = htmlspecialchars($text);\r\n\t\t$text = nl2br($text);\r\n\t\treturn $text;\r\n\t}", "function validateText($text)\n {\n return addslashes(htmlentities(strip_tags($text))); \n }", "private function prepareData(){\n\t\t\t$this->text = trim($this->text);\n\t\t\t$this->user_id = intval($this->user_id);\n\t\t\t$this->parent_id = intval($this->parent_id);\n\t\t}", "public static function clean ($text) {\n\t\t$to_return = strtolower($text);\n\t\t$to_return = preg_replace(\"/(?![.=$'€%-])\\p{P}/u\", \"\", $to_return);\n\t\t$to_return = trim($to_return);\n\t\t// remove double spacing\n\t\twhile (strpos($to_return, ' ')) {\n\t\t\t$to_return = str_replace(' ', ' ', $to_return);\n\t\t}\n\t\treturn $to_return;\n\t}", "function clean($data){\n\t\t$this->data = $data;\n\t\t$data = trim($data);\n\t\t$data = stripcslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "function specialchars($text){\n\t\t$newtext = trim($text);\n\t\t$newtext = strip_tags($newtext);\n\t\t$newtext=htmlspecialchars(str_replace('\\\\', '', $newtext),ENT_QUOTES);\n\t\t$newtext=eregi_replace('&amp;','&',$newtext);\n\t\t//$newtext=nl2br($newtext);\n\t\treturn $newtext;\n\t}", "public static function texturize($text) {\n\t\t$next = true;\n\t\t$output = '';\n\t\t$curl = '';\n\t\t$textarr = preg_split('/(<.*>)/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE);\n\t\t$stop = count($textarr);\n\t\n\t\t$static_characters = array_merge(array('---', ' -- ', '--', 'xn&#8211;', '...', '``', '\\'s', '\\'\\'', ' (tm)'), $cockney); \n\t\t$static_replacements = array_merge(array('&#8212;', ' &#8212; ', '&#8211;', 'xn--', '&#8230;', '&#8220;', '&#8217;s', '&#8221;', ' &#8482;'), $cockneyreplace);\n\t\n\t\t$dynamic_characters = array('/\\'(\\d\\d(?:&#8217;|\\')?s)/', '/(\\s|\\A|\")\\'/', '/(\\d+)\"/', '/(\\d+)\\'/', '/(\\S)\\'([^\\'\\s])/', '/(\\s|\\A)\"(?!\\s)/', '/\"(\\s|\\S|\\Z)/', '/\\'([\\s.]|\\Z)/', '/(\\d+)x(\\d+)/');\n\t\t$dynamic_replacements = array('&#8217;$1','$1&#8216;', '$1&#8243;', '$1&#8242;', '$1&#8217;$2', '$1&#8220;$2', '&#8221;$1', '&#8217;$1', '$1&#215;$2');\n\t\n\t\tfor ( $i = 0; $i < $stop; $i++ ) {\n\t\t\t$curl = $textarr[$i];\n\t\n\t\t\tif (isset($curl{0}) && '<' != $curl{0} && $next) { // If it's not a tag\n\t\t\t\t// static strings\n\t\t\t\t$curl = str_replace($static_characters, $static_replacements, $curl);\n\t\t\t\t// regular expressions\n\t\t\t\t$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);\n\t\t\t} elseif (strpos($curl, '<code') !== false || strpos($curl, '<pre') !== false || strpos($curl, '<kbd') !== false || strpos($curl, '<style') !== false || strpos($curl, '<script') !== false) {\n\t\t\t\t$next = false;\n\t\t\t} else {\n\t\t\t\t$next = true;\n\t\t\t}\n\t\n\t\t\t$curl = preg_replace('/&([^#])(?![a-zA-Z1-4]{1,8};)/', '&#038;$1', $curl);\n\t\t\t$output .= $curl;\n\t\t}\n\t\n\t\treturn $output;\n\t}", "function text_tidy($txt = \"\") {\n \n \t$trans = get_html_translation_table(HTML_ENTITIES);\n \t$trans = array_flip($trans);\n \t\n \t$txt = strtr( $txt, $trans );\n \t\n \t$txt = preg_replace( \"/\\s{2}/\" , \"&nbsp; \" , $txt );\n \t$txt = preg_replace( \"/\\r/\" , \"\\n\" , $txt );\n \t$txt = preg_replace( \"/\\t/\" , \"&nbsp;&nbsp;\" , $txt );\n \t//$txt = preg_replace( \"/\\\\n/\" , \"&#92;n\" , $txt );\n \t\n \treturn $txt;\n }", "private function validatetext($text){\n return $text;\n }", "function cleanData($data){\n\t\t$data = trim($data);\n\t\t$data = stripslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "public function sOptimizeText($text)\n {\n $text = html_entity_decode($text, ENT_NOQUOTES, 'UTF-8');\n $text = preg_replace('@<(script|style)[^>]*?>.*?</\\\\1>@si', '', $text);\n $text = preg_replace('!<[^>]*?>!u', ' ', $text);\n $text = preg_replace('/\\s\\s+/u', ' ', $text);\n $text = trim($text);\n\n return $text;\n }", "function format_text($text, $convert_to_html = true)\r\n{\r\n\tGLOBAL $TRENNZEICHEN;\r\n \tif ($convert_to_html) $text = htmlentities($text);\r\n\t$text = nl2br($text);\r\n\t$text = str_replace(\"\\n\",\"\",$text);\r\n\t$text = str_replace(chr(13),\"\",$text);\r\n\t$text = str_replace($TRENNZEICHEN,\"\",$text);\r\n\t$text = do_ubb($text);\r\n\t$text = trim($text);\r\n\treturn($text);\r\n}", "function delete_format($text, $etiquetas_permitidas = NULL)\n{\n return strip_tags($text, $etiquetas_permitidas);\n}", "function clean_for_aiml_match($text)\n{\n\t$otext = $text;\n\t$text= remove_allpuncutation($text); //was not all before\n\t$text= whitespace_clean($text);\n\t$text= captialise($text);\n\t\n\trunDebug( __FILE__, __FUNCTION__, __LINE__, \"In: $otext Out:$text\",3);\n\t\t\n\treturn $text;\n}", "function clean_str( $text )\n\t{ // tomreyn says: I'm afraid this function is more likely to cause to trouble than to fix stuff (you have mysql escaping and html escaping elsewhere where it makes more sense, but strip off < and > here already, but then you don't filter non-visible bytes here)\n\t\t//$text=strtolower($text);\n\t\t//$code_entities_match = array('!','@','#','$','%','^','&','*','(',')','_','+','{','}','|','\"','<','>','?','[',']','\\\\',';',\"'\",',','/','*','+','~','`','=');\n\t\t//$code_entities_replace = array('','','','','','','','','','','','','','','','','','','','','');\n\t\t$code_entities_match = array('$','%','^','&','_','+','{','}','|','\"','<','>','?','[',']','\\\\',';',\"'\",'/','+','~','`','=');\n\t\t$code_entities_replace = array('','','','','','','','','','','','','');\n \n\t\t$text = str_replace( $code_entities_match, $code_entities_replace, $text );\n\t\treturn $text;\n\t}", "function getTextInside(){\n\t $myfile = fopen($this->pathFile, \"r\") or die(\"Unable to open file!\");\t\t//membuka file\n\t $this->textInside = fread($myfile, filesize($this->pathFile));\t\t\t\t//menyimpan text yang ada dalam file ke textInside\n\t fclose($myfile);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//menutup file\n\t}", "function cleanText($str) {\r\n $str = @trim($str);\r\n if (get_magic_quotes_gpc()) {\r\n $str = stripslashes($str);\r\n }\r\n return $str;\r\n}", "function santitise_input($data) {\n $data = trim($data);\n //Removing backslashes.\n $data = stripslashes($data);\n //Removing HTML special/control characters.\n $data = htmlspecialchars($data);\n return $data; \n }", "function escreverTexto($sText) {\n\n /**\n * Aplicando negrito\n */\n $sText = str_replace(\"<b>\", chr(27) . chr(69), $sText);\n $sText = str_replace(\"</b>\", chr(27) . chr(70), $sText);\n /**\n * Aplicando italico\n */\n $sText = str_replace(\"<i>\", chr(27) . chr(52), $sText);\n $sText = str_replace(\"</i>\", chr(27) . chr(53), $sText);\n /**\n * Aplicando sublinhado\n */\n $sText = str_replace(\"<s>\", chr(27) . chr(45) . \"1\", $sText);\n $sText = str_replace(\"</s>\", chr(27) . chr(45) . \"0\", $sText);\n \n // $sText = $this->truncarLinhas($sText,48);\n $sText = $this->strToAsc($sText);\n \n $sComando = chr(27) . str_replace(\"\\n\", chr(10), $sText);\n parent::addComando($sComando);\n \n }", "function parseText($txt,$wrap){\n\t\t\t$txt = $this->TS_links_rte($txt, $wrap);\n\t\t\t//prepend relative paths with url\n\t\t\t$txt = $this->makeAbsolutePaths($txt);\n\t\t\t$txt = $this->cleanHTML($txt);\n\t\t\treturn $txt;\n\t\t\n\t}", "private static function _cleanName($text) \r\n {\r\n return $text;\r\n }", "public function createUsableText(string $text)\r\n {\r\n $text = preg_replace('/ /', ' ', $text);\r\n\r\n foreach ($this->textConversions as $textConversion) {\r\n\r\n switch ($textConversion) {\r\n case 'new-line-after-time':\r\n $text = preg_replace('/(?<=' . $this->timeRegex . ')/', PHP_EOL, $text);\r\n break;\r\n case 'event-on-time-line':\r\n $text = preg_replace('/(?<=[0-9]{2}\\.[0-9]{2})\\s+(?=Event)/', PHP_EOL, $text);\r\n break;\r\n case 'same-line-record':\r\n $text = preg_replace('/(?<=[A-Z]{2})\\t(?=[0-9][\\s[A-z]])/', '\\n', $text);\r\n break;\r\n }\r\n }\r\n return $text;\r\n }", "function filtrar($texto){\n\t\t$texto = htmlentities(strip_tags(trim($texto)));\n\t\t$texto = strtolower($texto);\n\t\treturn $texto;\n\t}", "public function cleanText($text, $fileMeta)\n {\n $callback = new cleanLink($this->flatten, $fileMeta);\n $callbackFix = new pandocFix();\n\n // decode inline html\n $text = html_entity_decode($text);\n\n if (mb_strpos($text, \"#\") === 0) {\n $ext=\".md\";\n $target=\"\";\n if (mb_stripos($text, \"#REDIRECT\") === 0) {\n $target = mb_substr($text, mb_strlen(\"#REDIRECT\"));\n } else if (mb_strpos($text, \"#重定向\") === 0) {\n $target = mb_substr($text, mb_strlen(\"#重定向\"));\n }\n\n $fileName = $fileMeta['filename'] . $ext;\n if (mb_strlen($target) > 4) {\n if ($fileMeta['type']<200) {\n $source = $fileMeta['directory'] . $fileName;\n unlink($source);\n file_put_contents(\n $this->output . \"Redirect/\" . $this->dataVersion . \".tsv\",\n $source . \"\\t\" . $target . \"\\n\",\n FILE_APPEND);\n return null;\n }\n $matches = [];\n preg_match('/\\[\\[(.*)\\]\\]/', $target, $matches, PREG_OFFSET_CAPTURE);\n if (count($matches)>1) {\n $dir=\"Page\";\n $mobj=$matches[1];\n if ($this->format === \"mediawiki\") {\n $dir = mb_substr($mobj[0],0,1);\n $ext = \".wikitext\";\n }\n $targetName = str_replace(' ', '_', $mobj[0]);\n $targetFile = $dir . \"/\" . $targetName . $ext;\n if ($fileMeta['type']>=200 && file_exists($this->output . $targetFile)) {\n $this->message(\"Redirect: \" . $fileMeta['filename'] . \" -> \" . $targetFile);\n if (array_key_exists($fileName, $this->outputTree['Redirect'])) {\n unlink($this->output . \"Redirect/\" . $fileName);\n }\n if (getenv(\"WIKILANG\") == \"en\") {\n $this->mapping(\n $this->output . \"Redirect/\" . mb_substr($fileName, 0, 1) . \".json\",\n $fileMeta['filename'],\n $targetName \n );\n } else {\n symlink(\"../\" . $targetFile, $this->output . \"Redirect/\" . $fileName);\n }\n } else {\n $this->message(\"Redirect target not exists: \" . $text . $targetFile);\n }\n\n $lagacyFile = $this->output . $dir . $fileName;\n if ($this->outputTree[$dir] && array_key_exists($fileName, $this->outputTree[$dir]) && filesize($lagacyFile) < 2048) {\n @unlink($lagacyFile);\n $this->message(\"Delete lagacy page: \" . $lagacyFile);\n } else {\n $this->message(\"Skip lagacy page: \", $lagacyFile);\n }\n return null;\n }\n }\n $this->message(\"Ignroe redirect: \" . $text);\n return null;\n }\n \n $pageMinSize=1024;\n if (getenv(\"WIKILANG\") == \"en\") {\n $pageMinSize*=16;\n }\n if (mb_strlen($text) < $pageMinSize) {\n $lagacyFile = $this->output . $fileMeta['directory'] . $fileMeta['filename'] . \".md\";\n if (@filesize($lagacyFile) < 2048) {\n @unlink($lagacyFile);\n }\n $this->message(\"Delete short page: \", $lagacyFile);\n return null;\n }\n \n // Hack to fix URLs for older version of pandoc\n if ($this->pandocBroken) {\n $text = preg_replace_callback('/\\[(http.+?)\\]/', [$callbackFix, 'urlFix'], $text);\n }\n\n // clean up links\n $text = preg_replace_callback('/\\[\\[(.+?)\\]\\]/', [$callback, \"cleanLink\"], $text);\n // remove comments\n return preg_replace('/<!--(.|\\s)*?-->/', '', $text);\n }", "function clearText(String $text) { \n $comAcentos = array('à', 'á', 'â', 'ã', 'ä', 'å', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', 'ù', 'ü', 'ú', 'ÿ', 'À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', 'O', 'Ù', 'Ü', 'Ú');\n $semAcentos = array('a', 'a', 'a', 'a', 'a', 'a', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i', 'n', 'o', 'o', 'o', 'o', 'o', 'u', 'u', 'u', 'y', 'A', 'A', 'A', 'A', 'A', 'A', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I', 'N', 'O', 'O', 'O', 'O', 'O', '0', 'U', 'U', 'U');\n return str_replace($comAcentos, $semAcentos, $text);\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 Cleartext($_text,$lang=1){\n\t\n\t$invalidchars = array(\"%\",\"__\",\"،\",\".\",\"--\");\n\t$_text=str_replace($invalidchars,\"\",$_text);\n\t$findchars=array(\"ة\",\"ي\",\"أ\",\"إ\",\"آ\",\"ئ\",\"ظ\",\"ق\",\"خ\",\"ج\");\n $replacechars = array(\"ه\",\"ى\",\"ا\",\"ا\",\"ا\",\"ى\",\"ض\",\"غ\",\"ح\",\"ح\");\n\t\n\treturn str_replace($findchars,$replacechars,$_text);\n\t\n\t\n\t}", "function wysiwygFilter($text) {\n\n\t\t// Clean up -----------------------------------------------------------\n\t\t$patterns = array(\n\t\t\t\t\t\t'/\\s\\s+/', // whitespace\n\t\t\t\t\t\t'/\\sstyle=\".*?\"/', // Strip all styles\n\t\t\t\t\t\t\"#(<span.*?>|</span>)#i\", // strip all spans\n\t\t\t\t\t\t'{<div[^>]*><br[^>]*>(.*?)</div>}', // empty div br\n\t\t\t\t\t\t'{<div[^>]*>(.*?)<br[^>]*></div>}', // empty div br\n\t\t\t\t\t\t'/<div>(.+?)<\\/div>/', // div content\n\t\t\t\t\t\t'/<p>(.+?)<\\/p>/', // p content\n\t\t\t\t\t\t'/<\\s?[bB]\\s?>/', // strong open\n\t\t\t\t\t\t'/<\\s?\\/\\s?[bB]\\s?>/', // strong close\n\t\t\t\t\t\t'/<\\s?[iI]\\s?>/', // emphasis open\n\t\t\t\t\t\t'/<\\s?\\/\\s?[iI]\\s?>/' // emphasis close\n\t\t\t\t\t\t );\n\t\t$replacements = array(\n\t\t\t\t\t\t'', // whitespace\n\t\t\t\t\t\t'', // strip all styles\n\t\t\t\t\t\t'', // strip all spans\n\t\t\t\t\t\t'$1', // empty div br\n\t\t\t\t\t\t'$1', // empty div br\n\t\t\t\t\t\t'<p>$1</p>'.\"\\n\\n\", // div content\n\t\t\t\t\t\t'<p>$1</p>'.\"\\n\\n\", // p content\n\t\t\t\t\t\t'<strong>', // strong open\n\t\t\t\t\t\t'</strong>', // strong close\n\t\t\t\t\t\t'<em>', // emphasis open\n\t\t\t\t\t\t'</em>' // emphasis close\n\t\t);\t\t\n\t\t$text = preg_replace($patterns, $replacements, $text);\n\n\t\t// TODO: add these to above preg_replace\n\t\t$text = str_replace(\n\t\t\tarray('<br></div>','<div></div>'),\n\t\t\tarray('</div>',''),\n\t\t\t$text\n\t\t);\n\t\t// Add new lines ------------------------------------------------------\n\n\t\t$text = str_replace(\n\t\t\tarray('<br>','</p>','</h1>','</h2>','</h3>','</h4>','</h5>','</h6>'),\n\t\t\tarray(\"\\n\",'</p>'.\"\\n\\n\",'</h1>'.\"\\n\\n\",'</h2>'.\"\\n\\n\",'</h3>'.\"\\n\\n\",'</h4>'.\"\\n\\n\",'</h5>'.\"\\n\\n\",'</h6>'.\"\\n\\n\"),\n\t\t\t$text\n\t\t);\n\n\t\t// Textile parser -----------------------------------------------------\n\t\t$textile = new Textile();\n\t\t$text = trim($text);\n\t\t$text = $textile->textileThis($text);\n\t\t// Empty <p> and Stuff ------------------------------------------------\n\t\t$text = preg_replace('/<p[^>]*>(?:\\s+|(?:&nbsp;)+|(?:<br\\s*\\/?>)+)*<\\/p>/', '', $text);\n\n\t\t$text = str_replace(\n\t\t\tarray('<p><span></span></p>','<p><span><strong></strong></span></p>','.&nbsp; ','&nbsp;</p>'),\n\t\t\tarray('','','. ','</p>'),\n\t\t\t$text\n\t\t);\n\t\t// Remove remaining empty tags and another go at the freakin <p> ------\n\t\t$text = preg_replace(\n\t\t\tarray(\"/<[^\\/>]*>([\\s]?)*<\\/[^>]*>/\", \"/<p[^>]*><\\\\/p[^>]*>/\"),\n\t\t\t'',\n\t\t\t$text\n\t\t);\n\t\t\n\t\t// Smart Quotes and the such ------------------------------------------\n\t\t// Utf\n\t\t$text = str_replace(\n\t\t\tarray(\"\\xe2\\x80\\x98\", \"\\xe2\\x80\\x99\", \"\\xe2\\x80\\x9c\", \"\\xe2\\x80\\x9d\", \"\\xe2\\x80\\x93\", \"\\xe2\\x80\\x94\", \"\\xe2\\x80\\xa6\"),\n\t\t\tarray(\"'\", \"'\", '\"', '\"', '-', '--', '...'),\n\t\t\t$text\n\t\t);\n\t\t// Windows\n\t\t$text = str_replace(\n\t\t\tarray(chr(145), chr(146), chr(147), chr(148), chr(150), chr(151), chr(133)),\n\t\t\tarray(\"'\", \"'\", '\"', '\"', '-', '--', '...'),\n\t\t\t$text\n\t\t);\n\n\t\t// Incidentals --------------------------------------------------------\n/*\n\n ADD NEW FILTERS HERE\n CONSOLIDATE ON NEW VERSION OF LIBRARY\n\n*/\n\t\t$text = str_replace(\n\t\t\tarray(' class=\"Content\"', ' class=\"content\"',' class=\"Apple-style-span\"'),\n\t\t\t'',\n\t\t\t$text\n\t\t);\n\n\t\treturn $text;\n\t}", "function estandariza_info($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function clean_input($data){\r\n\t\t\t\t\t$data = trim($data);\r\n\t\t\t\t\t$data = stripslashes($data);\r\n\t\t\t\t\t$data = htmlspecialchars($data);\r\n\t\t\t\t\treturn $data;\r\n\t\t\t\t}", "function cleanData(&$str)\n {\n // handling karakter tab\n $str = preg_replace(\"/\\t/\", \"\\\\t\", $str);\n\n // handling karakter enter\n $str = preg_replace(\"/\\r?\\n/\", \"\\\\n\", $str);\n\n // convert 't' and 'f' menjadi nilai boolean\n if($str == 't') $str = 'TRUE';\n if($str == 'f') $str = 'FALSE';\n\n // handle karakter doubel quotes\n if(strstr($str, '\"')) $str = '\"' . str_replace('\"', '\"\"', $str) . '\"';\n }", "private function processContent(){\n\t\t$this->textEnd = strpos($this->raw,\"</{$this->tag}\");\n\t\t$this->text = trim(substr($this->raw, $this->textStart, $this->textEnd - $this->textStart));\n\t}", "function pdfTextChars($string) {\n \n\t$string = trim($string);\n\t$string = stripslashes($string);\n\t$string = convertToHtml($string);\n\t\n\t// Eliminare i commenti HTML\n\t$string = preg_replace(\"#(\\n*)#\", \"\", $string);\n\t$string = preg_replace(\"#<!--(.*)-->#\", \"\", $string);\n\t\n\t//$string = preg_replace(\"#<br />#\", \"\\n\", $string);\n\n\t$string = str_replace ('&euro;', '€', $string);\n\t$string = str_replace ('&bull;', '•', $string);\n\t//$string = str_replace ('&', '&amp;', $string);\n\t//$string = str_replace ('\\'', '&#039;', $string);\n\t//$string = preg_replace(\"/:/\", \"&#58;\", $string);\n\t//$string = str_replace(':', \"&#58;\", $string);\n\t\n\t// conversione in entities\n\t$string = htmlentities($string, ENT_QUOTES, 'UTF-8');\n\t// riconversione di alcune entities\n\t$string = preg_replace('#&lt;([a-zA-Z]+)&gt;#', \"<$1>\", $string);\t// <p>\n\t$string = preg_replace('#&lt;/([a-zA-Z]+)&gt;#', \"</$1>\", $string);\t// </p>\n\t//$string = preg_replace('#/&gt;#', '/>', $string);\t\t\t\t\t// />\n\t$string = preg_replace(\"#&lt;([a-zA-Z]+)[\\s]+[\\w]*/&gt;#\", \"<$1 />\", $string);\t// <br />\n\t$string = preg_replace(\"#&lt;([a-zA-Z]+)[\\s]+(id|class|lang)=&quot;[\\w\\.\\-]*&quot;[\\s]*&gt;#\", \"<$1>\", $string);\t// <span id=\"...\">\n\t\n\t// per risolvere i problemi nel riconoscere la fine del tag 'b' quando è in prossimità di un 'br'\n\t$string = preg_replace(\"#><br />#\", \">\\n<br />\", $string);\n\t$string = preg_replace(\"#<br />\\n(<[a-zA-Z]+>)#\", \"$1\\n<br />\", $string);\n\t\n\t// problema quando non sono tag:\n\t//$string = str_replace('&lt;', \"<\", $string);\n\t//$string = str_replace('&gt;', \">\", $string);\n\t\n\t//$string = preg_replace(\"#><br />#\", \"> <br />\", $string);\n\t//$string = preg_replace(\"#<ul>#\", \"<ul style=\\\"margin:-20px;padding:0;\\\">\", $string);\n\t\n\treturn $string;\n}", "function whitespace_clean($text)\n{\n\t$otext = $text;\n\t$text = preg_replace('/\\s\\s+/', ' ', $text);\n\t\n\trunDebug( __FILE__, __FUNCTION__, __LINE__, \"In: $otext Out:$text\",3);\n\t\n\treturn trim($text);\t\n}", "function sanitize_text_field($str)\n {\n }", "function clean($data) {\n\t$data = trim($data);\n\t$data = stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\n}", "function clean($string){\n\t\t$string = trim($string); //remove white-spacing\n\t\t$string = htmlentities($string); //change to html\n\t\t$string = strip_tags($string); //delete html tags\n\t\treturn $string;\n\t}", "function textFormating($text)\n {\n $text = str_replace(\" \", \" &nbsp;\", htmlspecialchars($text));\n return $text;\n }", "function normalizeText( $text, $isMetaData = false )\n {\n //include_once( 'lib/ezi18n/classes/ezchartransform.php' );\n $trans = eZCharTransform::instance();\n $text = $trans->transformByGroup( $text, 'search' );\n\n // Remove quotes and asterix when not handling search text by end-user\n if ( $isMetaData )\n {\n $text = str_replace( array( \"\\\"\", \"*\" ), array( \" \", \" \" ), $text );\n }\n\n return $text;\n }", "function cleanInput($data) {\r\n\t\t\t$data = trim($data);\r\n\t\t\t$data = stripslashes($data);\r\n\t\t\t$data = htmlspecialchars($data);\r\n\t\t\treturn $data;\r\n\t\t}", "function strclean($txt){\n\t$txt=preg_replace('/&nbsp;?/i',' ',$txt);\n\t$array=array(\n\t\t'\\\\\\\\'=>'\\\\',\n\t\t'\\\\\\''=>'\\'',\n\t\t'\\\\\"'=>'\"',\n\t\t'&amp;'=>'&'\n\t);\n\treturn str_replace(array_keys($array),array_values($array),$txt);\n}", "function strclean($txt){\n\t$txt=preg_replace('/&nbsp;?/i',' ',$txt);\n\t$array=array(\n\t\t'\\\\\\\\'=>'\\\\',\n\t\t'\\\\\\''=>'\\'',\n\t\t'\\\\\"'=>'\"',\n\t\t'&amp;'=>'&'\n\t);\n\treturn str_replace(array_keys($array),array_values($array),$txt);\n}", "private function toText($text) {\r\n\t\t$search = array(\"&amp;#039;\", \"&amp;#036;\", \"&#039;\", \"&#036;\", \"&#092;\", \"&amp;#092;\", \"&quot;\", \"&amp;\");\r\n\t\t$replace = array(\"'\", '$', \"'\", '$', \"\\\\\", \"\\\\\", \"\\\"\", \"&\");\r\n\t\tif (!is_array($text)) {\r\n\t\t\t$text = stripslashes(str_replace($search, $replace, $text));\r\n\t\t} else {\r\n\t\t\tforeach ($text as $key => $val) {\r\n\t\t\t\t$text[$key] = $this->toText($val);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $text;\r\n\t}", "abstract public function sanitize();", "function testTextbasedSaving() {\n\t\t$existingEntry = $this->objFromFixture('TagFieldTest_BlogEntry', 'blogentry1');\n\t\t$field = new TagField('TextbasedTags', null, null, 'TagFieldTest_BlogEntry');\n\t\t$field->setValue('tag1 tag3 '); // test separator handling as well\n\t\t$field->saveInto($existingEntry);\n\t\t$existingEntry->write();\n\t\t$this->assertEquals(\n\t\t\t$existingEntry->TextbasedTags,\n\t\t\t'tag1 tag3'\n\t\t);\n\t}", "public static function txt2html($txt) {\n\n\t//Kills double spaces and spaces inside tags.\n\t// while( !( strpos($txt,' ') === FALSE ) ) $txt = str_replace(' ',' ',$txt);\n if( !( strpos($txt,' ') === FALSE ) ) $txt = str_replace(' ',' ',$txt);\n\n\t$txt = str_replace(' >','>',$txt);\n\t$txt = str_replace('< ','<',$txt);\n\n\t//Transforms accents in html entities.\n\t$txt = utf8_decode($txt);\n\t$txt = htmlentities($txt);\n\n\t//We need some HTML entities back!\n\t$txt = str_replace('&quot;','\"',$txt);\n\t$txt = str_replace('&lt;','<',$txt);\n\t$txt = str_replace('&gt;','>',$txt);\n\t$txt = str_replace('&amp;','&',$txt);\n\t\n\t//Ajdusts links - anything starting with HTTP opens in a new window\n\t$txt = WA_String::stri_replace(\"<a href=\\\"http://\",\"<a target=\\\"_blank\\\" href=\\\"http://\",$txt);\n\t$txt = WA_String::stri_replace(\"<a href=http://\",\"<a target=\\\"_blank\\\" href=http://\",$txt);\n\n\t//Basic formatting\n\t$eol = ( strpos($txt,\"\\r\") === FALSE ) ? \"\\n\" : \"\\r\\n\";\n\t$html = '<p>'.str_replace(\"$eol$eol\",\"</p><p>\",$txt).'</p>';\n $html = str_replace(\"$eol\",\"<br />\\n\",$html);\n\t$html = str_replace(\"</p>\",\"</p>\\n\\n\",$html);\n\t$html = str_replace(\"<p></p>\",\"<p>&nbsp;</p>\",$html);\n\n\t//Wipes <br> after block tags (for when the user includes some html in the text).\n\t$wipebr = Array(\"table\",\"tr\",\"td\",\"blockquote\",\"ul\",\"ol\",\"li\");\n\n\tfor($x = 0; $x < count($wipebr); $x++) {\n \t $tag = $wipebr[$x];\n \t $html = WA_String::stri_replace(\"<$tag><br />\",\"<$tag>\",$html);\n \t $html = WA_String::stri_replace(\"</$tag><br />\",\"</$tag>\",$html);\n\t}\n\n\treturn $html;\n }", "public static function convert_text_field() {\n\n\t\t// Create a new Text field.\n\t\tself::$field = new GF_Field_Text();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t}", "public static function text_change_check()\n {\n }", "public function saveNewTxtFile()\r\n {\r\n\r\n $fileName = date(\"Y-m-d\") . '-' . rand(0, 512) . \"Question\";\r\n\r\n $file = new StorageFileSaver($fileName);\r\n\r\n foreach ($this->fileContent as $content) {\r\n $file->write($content);\r\n }\r\n\r\n $file->saveAndCloseFile();\r\n }", "public function out($text = '');", "function convertText($b){\r\n\t\t$b = htmlspecialchars($b);\r\n\t\t$b = str_replace(\"\\011\", ' &nbsp;&nbsp;&nbsp;', str_replace(' ', ' &nbsp;', $b));\r\n\t\t$b = ereg_replace(\"((\\015\\012)|(\\015)|(\\012))\", '<br />', $b);\r\n\t\treturn $b;\r\n\t}", "function saveToTxt(){\n\t\t$text=file_get_contents(DIR.$this->filename);\n\t\t$filename=$this->filename+\".xml\";\n\t\theader(\"Content-type: application/text\");\n\t\theader(\"Content-Disposition: attachment; filename=\\\"$filename\\\"\");\n\t\tdie($text);\n\t\theader(\"location:index.php\");\n\t}", "public function process_text($text)\n {\n $new_text = $text;\n\n // Clean for the Lex Parser\n $new_text = $this->clean_text($new_text);\n // Parse\n $new_text = $this->parse_text($new_text);\n\n return $new_text;\n }", "function SaveItems() \n {\n global $Core;\n \n $name = $Core->GetVar($_POST, 'name', NULL);\n if (isset($_POST['content']) && !empty($_POST['content']))\n {\n $text = $_POST['content'];\n }\n \n $text = stripslashes($text);\n \n if (!empty($name) && !empty($text))\n {\n $name = $this->AddFileExtension($name, 'txt');\n $file = SB_SITE_DATA_DIR . \"ads/\" . $name;\n $Core->ExitEvent($Core->WriteFile($file, $text, 1), $this->redirect);\n }\n else\n {\n $Core->ExitEvent(0, $this->redirect);\n }\n }", "function template_text_format($text)\n {\n // Remove Escape Character Slashes\n $text = trim(stripslashes($text));\n // Get rid of carriage returns\n $text = str_replace(\"\\r\",\"\",$text);\n // Strip out all html except simple text formatting\n $text = htmlentities($text);\n // Convert urls to hyperlinks\n $text = eregi_replace(\"((http://)|(https://).[^\\s]+)\\ \",\"<a href=\\\"\\\\0\\\">\\\\0</a>\",$text); \n\n if ($_SESSION['prefs']['disable_wrap'] != \"t\") {\n $lines = explode(\"\\n\",$text);\n $text = \"\";\n\n $wrap = preg_match(\"/[0-9]+/\",$_SESSION['prefs']['word_wrap']) ? $_SESSION['prefs']['word_wrap'] : 80;\n foreach ($lines as $key => $val) {\n if (empty($val)) {\n $text .= \"\\n\";\n } else {\n if (strlen($val) > $wrap) {\n $val = wordwrap($val,$wrap,\"\\n\",TRUE);\n }\n\n $text .= stripslashes($val).\"\\n\";\n }\n }\n \n $text = \"<pre>$text</pre>\";\n } else {\n // Replace newlines with <br />'s\n $text = str_replace(\"\\n\",\"<br />\",$text);\n }\n return $text;\n }", "public function FormattedText($text) {\n\t\t$text = Convert::raw2xml($text);\n\t\tif ($this->Guestbook()->EnableEmoticons) {\n\t\t\t$text = $this->ReplaceSmileys($text);\n\t\t}\n\t\t$text = nl2br($text);\n\t\treturn $text;\n\t}", "public static function generateTxt(){\n $archivo = fopen('documents/proveedores.txt','a');\n //------- Creamos el Encabepado --------\n fputs($archivo,\"codigo_del_proveedor\");\n fputs($archivo,\" ; \");\n fputs($archivo,\"descripcion_del_proveedor\");\n fputs($archivo,\" ; \");\n fputs($archivo,\"tipo_de_proveedor\");\n fputs($archivo,\" ; \");\n fputs($archivo,\"rif\");\n fputs($archivo,\" ; \");\n fputs($archivo,\"otra_descripcion\");\n fputs($archivo,\" ; \");\n fputs($archivo,\"direccion\");\n fputs($archivo,\" ; \");\n fputs($archivo,\"telefono\");\n\n fputs($archivo,\"\\n\");\n\n //--------------------------------\n\n //----------- --------------------------\n $rows=Proveedores::find()->all();\n foreach($rows as $row)\n {\n fputs($archivo,$row->codigo);\n fputs($archivo,\";\");\n fputs($archivo,Proveedores::getSubString($row->razon,100));\n fputs($archivo,\";\");\n fputs($archivo,$row->tipo);\n fputs($archivo,\";\");\n fputs($archivo,$row->cedrif);\n fputs($archivo,\";\");\n fputs($archivo,'XXX');\n fputs($archivo,\";\");\n if (is_null($row->direccion)) fputs($archivo,'XXX'); else fputs($archivo,$row->direccion);\n fputs($archivo,\";\");\n if (($row->telefono==\"\")) fputs($archivo,'XXX'); else fputs($archivo,$row->telefono);\n fputs($archivo,\"\\n\");\n\n\n\n }\n fclose($archivo);\n\n\n }", "public function text() {}", "public function text() {}", "public function text() {}", "function tidy_repair_string($data, $config = null, $encoding = null) {}", "public function savetxtAction()\n {\n set_time_limit (10000);\n if (isset($_FILES['fileinputname']['name']) && $_FILES['fileinputname']['name'] != '') {\n try {\n $uploader = new Varien_File_Uploader('fileinputname');\n $uploader->setAllowedExtensions(array('txt'));\n $uploader->setAllowRenameFiles(true);\n $uploader->setFilesDispersion(false);\n $path = Mage::getBaseDir('media') . DS . 'txt' . DS;\n\n if (!is_dir($path)) {\n mkdir($path, 0777, true);\n }\n\n $files = glob($path . '*');\n foreach ($files as $file) {\n if (is_file($file)) {\n unlink($file);\n }\n }\n $saveResult = $uploader->save($path, $_FILES['fileinputname']['name']);\n $path = $saveResult['path'] . $saveResult['name'];\n $fileContents = file_get_contents($path);\n $rows = explode(\"\\n\", $fileContents);\n $model = Mage::getModel('googlemerchants/googlecategory');\n //$model->truncateCategoriesTable();\n $model->insertRoot('');\n foreach ($rows as $row => $data) {\n if ($row == 0) {\n continue;\n }\n $cols = explode('>', $data);\n foreach ($cols as $index => $col) {\n if (!empty($col)) {\n if ($index > 0) {\n $model->insertItem($col, $cols[$index - 1]);\n } else {\n $model->insertItem($col, NULL);\n }\n }\n }\n }\n $this->_redirect('adminhtml/googlemerchants/index');\n\n } catch (Exception $e) {\n Mage::getSingleton('core/session')->addError($e->getMessage());\n $this->_redirect('adminhtml/googlemerchants/downloadtxt');\n $error = true;\n }\n } else {\n Mage::getSingleton('core/session')->addError('Please select file with google categories.');\n $this->_redirect('adminhtml/googlemerchants/downloadtxt');\n }\n }", "function myParse($text) {\n\t$results = array();\n\t$rc = 0;\n\n\tfor($i=0; $i<strlen($text); $i++) {\n\t\t$c = substr($text, $i, 1);\n\n\t\tif ($c=='<') {\n\t\t\t// Starting tag\n\t\t\t$tagC = '';\n\t\t\t$tag = true;\n\t\t}\n\n\t\tif ($tag) {\n\t\t\t$tagC .= $c;\n\t\t} else {\n\t\t\tif ($c==\"\\n\") {\n\t\t\t\t// Advance the counter so each line is stored separately \n\t\t\t\tif (empty($_SESSION['para'])) { \n\t\t\t\t\t$rc++;\n\t\t\t\t} else {\t\t\t\t\t\n\t\t\t\t\tif (!isset($results[$rc])) {\n\t\t\t\t\t\t// Get position of New editable text\n\t\t\t\t\t\t$results[$rc] = array('index'=>$i, 'text'=>'');\n\t\t\t\t\t}\n\t\t\t\t\t$results[$rc]['text'] .= $c;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!isset($results[$rc])) {\n\t\t\t\t\t// Get position of New editable text\n\t\t\t\t\t$results[$rc] = array('index'=>$i, 'text'=>'');\n\t\t\t\t}\n\t\t\t\t$results[$rc]['text'] .= $c;\n\t\t\t}\n\t\t}\n\t\tif ($c=='>') {\n\t\t\t// Tag ending\n\t\t\t$tagC .= $c;\n\t\t\t$tag = false;\n\t\t\t$rc++;\n\t\t}\n\t}\n\n\t// Filter editable text\n\t$resultsx = array();\n\tforeach($results as $resline) {\t\t\n\t\t$res = trim($resline['text']);\n\n\t\t// Skip empty, &xx; and literals \n\t\tif (!$res || ($res[0]=='&' && substr($res,-1)==';') || isLiteral($res) ) continue;\n\t\t\n\t\tif (!empty($_SESSION['para'])) {\n\t\t\t// trim \\n and adjust position\n\t\t\twhile(substr($resline['text'], 0, 1)==\"\\n\" || substr($resline['text'], 0, 1)==\"\\r\") {\n\t\t\t\t$resline['index']++;\n\t\t\t\t$resline['text'] = substr($resline['text'], 1);\n\t\t\t}\n\t\t\t// recheck \\n \n\t\t\tif (!strstr($resline['text'], \"\\n\")) {\n\t\t\t\t// treat as one line (trim and adjust)\n\t\t\t\twhile(substr($resline['text'], 0, 1)==' ') {\n\t\t\t\t\t$resline['index']++;\n\t\t\t\t\t$resline['text'] = substr($resline['text'], 1);\n\t\t\t\t}\n\t\t\t\t$resline['text'] = trim($resline['text']);\n\t\t\t}\n\t\t\t$res = $resline['text'];\n\t\t} else {\n\t\t\t// trim and adjust position\n\t\t\twhile(substr($resline['text'], 0, 1)==' ') {\n\t\t\t\t$resline['index']++;\n\t\t\t\t$resline['text'] = substr($resline['text'], 1);\n\t\t\t}\n\t\t\t$res = trim($resline['text']);\n\t\t}\n\t\t$resultsx[$resline['index']] = $res;\n\t}\n\n\t// Return an array contains all editable texts and their positions in file contents\n\treturn $resultsx;\n}", "private static function clean_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function _dotgo_filter_process($text) {\n $filtered = _filter_autop($text);\n\n $filtered = preg_replace(\"/<p[^>]*?>/\", \"\", $filtered);\n $filtered = str_replace(\"</p>\", \"<br />\", $filtered);\n $filtered = preg_replace('/<br\\s*?\\/?>\\s*$/', '', $filtered);\n $filtered = preg_replace('/&nbsp;/', ' ', $filtered);\n $filtered = preg_replace('/&nbsp;/', ' ', $filtered);\n $filtered = preg_replace('/\\s+/', ' ', $filtered);\n\n $filter = new stdClass();\n $filter->settings['allowed_html'] = '<a> <br /> <url> <block> <query> <follow>';\n $filter->settings['filter_html_nofollow'] = 0;\n $filtered = _filter_html($filtered, $filter);\n\n return $filtered;\n}", "public static function text() {}", "function text($text) {\n\t\treturn nl2br($text);\n\t}", "function clean_PDF() {\r\n\t\t$this->code = str_replace('font-style: normal;', '', $this->code);\r\n\t\t$this->code = str_replace('text-decoration: none;', '', $this->code);\r\n\t\t$this->code = str_replace('overflow: visible;', '', $this->code);\r\n\t\t$this->code = preg_replace('/border-\\w+-[^\\:]+:[^;]+;/is', '', $this->code);\r\n\t\t$this->code = preg_replace('/padding-[^\\:]+:[^;]+;/is', '', $this->code);\r\n\t\t$this->code = preg_replace('/text-indent:[^;]+;/is', '', $this->code);\r\n\t\t$this->code = preg_replace('/line-height:[^;]+;/is', '', $this->code);\r\n\t\t$this->code = preg_replace('/display:[^;]+;/is', '', $this->code);\r\n\t\t//$this->code = str_replace('text-align: left;', '', $this->code);\r\n\t\t// hyphenated words...\r\n\t\t$this->code = preg_replace('/(\\w)- (\\w)/is', '$1$2', $this->code);\r\n\t\t// footnotes\r\n\t\t$footnotes_code = '<hr>\r\n';\r\n\t\tpreg_match_all('/(<p[^<>]{0,}>.{0,100}?<img[^<>]+height=\"1\".*?<\\/p>)\\s{0,}(<p[^<>]{0,}>.*?<\\/p>)/is', $this->code, $footnote_matches);\r\n\t\t//print('$footnote_matches: ');var_dump($footnote_matches);\r\n\t\t// <p class=Default><a href=\"#_ftnref1\" name=\"_ftn1\" title=\"\">[1]</a>  <i>R. v. Bentley</i>, 2017 ONCA 982</p>\r\n\t\tforeach($footnote_matches[0] as $footnote_index => $footnote_match) {\r\n\t\t\t$footnote_code = $footnote_matches[2][$footnote_index];\r\n\t\t\t$footnote_code = ReTidy::preg_replace_first('/<a name=\"bookmark[0-9]+\">\\s{0,}([0-9]+)\\s{0,}<\\/a>/is', '<a href=\"#_ftnref$1\" name=\"_ftn$1\" title=\"\">[$1]</a>', $footnote_code); // so that clean_word recognizes it\r\n\t\t\t$footnotes_code .= $footnote_code . '\r\n';\r\n\t\t\t$this->code = str_replace($footnote_matches[0][$footnote_index], '', $this->code);\r\n\t\t}\r\n\t\t$this->code = str_replace('</body>', $footnotes_code . '</body>', $this->code);\r\n\t\t// <a href=\"#bookmark0\" class=\"s6\">1</a>\r\n\t\t// <a href=\"#_ftn1\" name=\"_ftnref1\" title=\"\"><span class=MsoFootnoteReference><span class=MsoFootnoteReference><span lang=EN-GB style='font-size:12.0pt;line-height:115%;font-family:\"Times New Roman\",serif'>[1]</span></span></span></a>\r\n\t\t$this->code = preg_replace('/<a href=\"#bookmark[0-9]+\"[^<>]{0,}>([0-9]+)<\\/a>/is', '<a href=\"#_ftn$1\" name=\"_ftnref$1\" title=\"\">[$1]</a>', $this->code);\r\n\t\t// strip <p>s in <li>s; loop this since lists can be nested\r\n\t\t$closing_p_count = -1;\r\n\t\twhile($closing_p_count != 0) {\r\n\t\t\t$this->code = preg_replace('/(<li[^<>]{0,}>.*?)<\\/p>([^<>]*?<\\/li>)/is', '$1$2', $this->code, -1, $closing_p_count);\r\n\t\t}\r\n\t\t$opening_p_count = -1;\r\n\t\twhile($opening_p_count != 0) {\r\n\t\t\t$this->code = preg_replace('/(<li[^<>]{0,}>[^<>]*?)<p[^<>]{0,}>(.*?<\\/li>)/is', '$1$2', $this->code, -1, $opening_p_count);\r\n\t\t}\r\n\t\t// would be simple if this code was ready\r\n\t\t/*\r\n\t\tif(!include_once('..' . DS . 'LOM' . DS . 'O.php')) {\r\n\t\t\tprint('<a href=\"https://www.phpclasses.org/package/10594-PHP-Extract-information-from-XML-documents.html\">LOM</a> is required');exit(0);\r\n\t\t}\r\n\t\t$O = new O($this->code);\r\n\t\t$lis = $O->_('li');\r\n\t\tprint('$lis: ');var_dump($lis);*/\r\n\t\t\r\n\t\tReTidy::style_cdata();\r\n\t\r\n\t\tReTidy::dom_init();\r\n\t\tReTidy::DOM_stylesheets_to_styles();\r\n\t\tReTidy::dom_save();\r\n\r\n\t//\tReTidy::post_dom();\r\n\t\t\r\n\t}", "public function formatAsUrl() {\r\n $url_save_chars = array_merge(range('a','z'),range(0,9),['_','-']);\r\n \r\n $specials = array('ä','ü','ö','ß',' ','ç','é','â','ê','î','ô','û','à','è','ì','ò','ù','ë','ï','ü','&');\r\n $specials_replacements = array('ae','ue','oe','ss','_','c','e','a','e','i','o','u','a','e','i','o','u','e','i','u','');\r\n // make everything lowercase and replace umlaute and spaces\r\n $url_save_text = trim(str_replace($specials, $specials_replacements, mb_strtolower($this->text,'UTF-8')));\r\n // remove every invalid character thats left from text (replace with \"-\") \r\n for($i = 0; $i < strlen($url_save_text); $i++){\r\n if(!in_array($url_save_text[$i], $url_save_chars)){\r\n $url_save_text[$i] = \"-\";\r\n }\r\n } \r\n return $url_save_text;\r\n }", "function textfilter_specialchars($text){\n\t$text = strip_tags(trim($text));\n\t$text = mb_convert_case($text, MB_CASE_LOWER, \"UTF-8\");\n\treturn $text;\n\t}", "public function clean()\n {\n $this->file = '';\n $this->vars = array();\n $this->headers = array();\n $this->metas = array();\n $this->jses = array();\n $this->javascript = array();\n $this->attachments = array();\n $this->csses = array();\n }", "private function cleanUp() : void\n {\n\n // For every line.\n foreach ($this->contents as $lineId => $line) {\n\n // Test.\n preg_match('/( +)(\\*)( )(.+)/', $line, $output);\n\n // First option - this is proper comment line.\n // Second option - sth is wrong - ignore this line.\n if (isset($output[4]) === true && empty($output[4]) === false) {\n $this->contents[$lineId] = $output[4];\n } else {\n unset($this->contents[$lineId]);\n }\n }\n }", "public function prepare($text) {\r\n\t \treturn str_replace(array(\"\\r\",\"\\n\"), \"\", str_replace(array('\\'', '\"'), \"\\\\'\", $text));\r\n\t }" ]
[ "0.67417693", "0.67115337", "0.6656856", "0.6464599", "0.64059114", "0.63104284", "0.63104284", "0.6211645", "0.61807656", "0.61723155", "0.61462873", "0.61040765", "0.6097638", "0.60629535", "0.60620683", "0.6022567", "0.60168725", "0.6014722", "0.59958756", "0.5976179", "0.5963459", "0.59566474", "0.5943611", "0.5936824", "0.5907636", "0.5907519", "0.58975255", "0.58924055", "0.5881761", "0.5846792", "0.5830955", "0.5816017", "0.5781227", "0.5775609", "0.5767249", "0.5757854", "0.57537514", "0.571745", "0.5714494", "0.57110274", "0.56946784", "0.5676531", "0.5669424", "0.56668603", "0.5666646", "0.56643283", "0.56643087", "0.5628909", "0.56279904", "0.5623549", "0.56209093", "0.56159526", "0.5613412", "0.5576287", "0.5574726", "0.5574591", "0.5566514", "0.5563497", "0.55600244", "0.5559596", "0.5551447", "0.5536796", "0.5535676", "0.5519244", "0.5518203", "0.5516956", "0.55169225", "0.55071646", "0.55071646", "0.5501427", "0.5501195", "0.5488015", "0.5485827", "0.5484893", "0.54798454", "0.54781544", "0.54780066", "0.54765683", "0.54749155", "0.54680806", "0.5465275", "0.54650646", "0.54616606", "0.54595", "0.5455447", "0.5455447", "0.5455447", "0.54545057", "0.545162", "0.5450763", "0.5449634", "0.5447681", "0.5434152", "0.54338795", "0.5424343", "0.54240125", "0.54237527", "0.5422937", "0.5421471", "0.5419376" ]
0.5771874
34
/ This function check the synthax of an email
function IsEmail($email) { $value = preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_-]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $email); return (($value === 0) || ($value === false)) ? false : true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emailOk ($email) {\r\n return filter_var($email, FILTER_VALIDATE_EMAIL);\r\n }", "public function isEmail();", "function validateEmail($TO,$SUBJECT,$BODY,$headers){\r\n\r\n if(!$this->getAccessLevel() > 0) {echo 'false'; return false;}\r\n\r\n //$server = \"http://localhost/dev/pansophy\"; // dev server\r\n $server = \"http://pansophy.wooster.edu\";\r\n $referer = $_SERVER['HTTP_REFERER'];\r\n\t\t\r\n // check if server string is a substring of the referer string\r\n $pos = strpos($referer,$server);\r\n\r\n if($pos === false)\r\n return false;\r\n else if($pos == 0)\r\n return true;\r\n else \r\n return false;\r\n\t}", "function verifica_email ($email)\r\n{\r\n\t$retorno = true;\r\n\r\n\t/* Aqui estaria el codigo para verificar \r\n\tla direccion de correo */\r\n\r\n\treturn $retorno;\r\n}", "function is_email($emailadres)\r\n{\r\n // Eerst een snelle controle uitvoeren: \r\n // een e-mailadres moet uit minimaal 7 tekens bestaan:\r\n if (strlen($emailadres) < 7) \r\n {\r\n return false;\r\n }\r\n // Daarna een controle met een reguliere expressie uitvoeren:\r\n if( ! ereg(\"^[_a-zA-Z0-9-]+(\\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\\.)+([a-zA-Z]{2,4})$\", $emailadres) ) \r\n {\r\n return false;\r\n } \r\n\r\n return true; \r\n}", "public function check_email() {\n\n\t\t$email = Input::post('email');\n \n\t\tif(is_string($email)) {\n\t\t\t\n\t\t\t$this->_password_reset->_unlocked_me($email);\n\t\t\t$row = $this->_password_reset->_validate_email($email);\n\t\t\t$res = $this->_password_reset->getData($email);\n\t\t\t$_res = $this->_password_reset->_check_if_reg($email);\n\t\t\t$ques = $this->_question->getquestion($res['question_id']);\n\n\t\t\tif($row > 0) {\n\t\t\t\tif($_res > 0) {\n\t\t\t\t\tif($res['status'] != 0) {\n\t\t\t\t\t\t$_arr = array('msg' =>Constant::EMAIL_CONFIRM, 'question' => $ques['security_question']);\n\t\t\t\t\t\techo json_encode($_arr);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$_arr = array('msg' =>Constant::LOCKED);\n\t\t\t\t\t\techo json_encode($_arr);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_arr = array('msg' =>Constant::NOT_REGISTERED);\n\t\t\t\t\techo json_encode($_arr);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\t\t\texit;\n\t\t\t}\n\n\t\t} else {\n\t\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\t\texit;\n\t\t}\n\t}", "function email_ok($email,$new=FALSE){\n if(empty($email)) return FALSE;\n if(!preg_match($this->pat_email,$email)) return FALSE;\n if(!$new) return TRUE;\n foreach($this->domains as $umd)\n if($umd->newemail_ok($email)>0) return FALSE;\n return TRUE;\n }", "function comprobar_email($email){\n\t\tif(preg_match('/^[A-Za-z0-9-_.+%]+@[A-Za-z0-9-.]+\\.[A-Za-z]{2,4}$/', $email)){ \n\t\t\treturn 0; \n\t\t}else\n\t\t\treturn 1;\n\t}", "function isEmail($email) {\nreturn(preg_match(\"/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i\",$email));\n}", "public function email_check($str) {\n //if(!empty($str) && $this->get_by(\"email\", $str))\n // return FALSE;\n return TRUE;\n }", "private function check_email_syntax($email) {\n\t\tif (preg_match('/(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)/', $email) || !preg_match('/^\\S+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$/', $email)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function s2_is_valid_email($email)\n{\n $return = ($hook = s2_hook('fn_is_valid_email_start')) ? eval($hook) : null;\n if ($return != null)\n return $return;\n\n if (strlen($email) > 80)\n return false;\n\n return preg_match('/^(([^<>()[\\]\\\\.,;:\\s@\"\\']+(\\.[^<>()[\\]\\\\.,;:\\s@\"\\']+)*)|(\"[^\"\\']+\"))@((\\[\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\])|(([a-zA-Z\\d\\-]+\\.)+[a-zA-Z]{2,}))$/', $email);\n}", "protected function validateEmail($args) {\n\n if ($args['ent_email'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $vmail = new verifyEmail();\n\n if ($vmail->check($args['ent_email'])) {\n return $this->_getStatusMessage(34, $args['ent_email']);\n } else if ($vmail->isValid($args['ent_email'])) {\n return $this->_getStatusMessage(24, $args['ent_email']); //_getStatusMessage($errNo, $test_num);\n//echo 'email valid, but not exist!';\n } else {\n return $this->_getStatusMessage(25, $args['ent_email']); //_getStatusMessage($errNo, $test_num);\n//echo 'email not valid and not exist!';\n }\n }", "public function isMail()\n {\n }", "function checkEmail($email){\n\t\t\t\t$email=trim(strip_tags($email));\n\t\t\t\tif(get_magic_quotes_gpc()==false)\n\t\t\t\t{\n\t\t\t\t\t$email=mysql_real_escape_string($email);\t\n\t\t\t\t}\n\t\t\t\t$sql=\"SELECT * FROM emailmarketing WHERE Email='$email'\";\n\t\t\t\t$kq=mysql_query($sql) or die(mysql_error());\n\t\t\t\tif(mysql_fetch_row($kq)>=1)\n\t\t\t\t\treturn 0;\n\t\t\t\telse return 1;\n\t\t\t}", "function checkmail($youremail)\n{\n if (ereg('^[-!#$%&\\'*+\\\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&\\'*+\\\\/0-9=?A-Z^_`a-z{|}~]+\\.'.\n '[-!#$%&\\'*+\\\\./0-9=?A-Z^_`a-z{|}~]+$', $youremail))\n {\n\t return true;\n }\n else\n {\n\t return false;\n }\n}", "function is_email($value)\r\n{\r\n\treturn preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i', $value);\r\n}", "function is_email($addr)\n{\n $addr = strtolower(trim($addr));\n $addr = str_replace(\"&#064;\",\"@\",$addr);\n if ( (strstr($addr, \"..\")) || (strstr($addr, \".@\")) || (strstr($addr, \"@.\")) || (!preg_match(\"/^[[:alnum:]][a-z0-9_.-]*@[a-z0-9][a-z0-9.-]{0,61}[a-z0-9]\\.[a-z]{2,6}\\$/\", stripslashes(trim($addr)))) ) {\n $emailvalidity = 0;\n } else {\n $emailvalidity = 1;\n }\n return $emailvalidity;\n}", "private function emailValidation($field) {\t\r\n\t \t\t$sent = $this->getSentData($field);\r\n\t \t\t\r\n\t \t\t$email_pattern = '/^[^@\\s<&>]+@([-a-z0-9]+\\.)+[a-z]{2,}$/i';\r\n\t\t\tif (preg_match($email_pattern, $sent)) \r\n \t\t\treturn true;\r\n\t\t\telse\r\n\t\t\t\treturn false;\r\n\t \t}", "function is_valid_email($mail) {\r\t// simple: \t\"/^[-_a-z0-9]+(\\.[-_a-z0-9]+)*@[-a-z0-9]+(\\.[-a-z0-9]+)*\\.[a-z]{2,6}$/i\"\r\t$r = 0;\r\tif($mail) {\r\t\t$p =\t\"/^[-_a-z0-9]+(\\.[-_a-z0-9]+)*@[-a-z0-9]+(\\.[-a-z0-9]+)*\\.(\";\r\t\t// TLD (01-30-2004)\r\t\t$p .=\t\"com|edu|gov|int|mil|net|org|aero|biz|coop|info|museum|name|pro|arpa\";\r\t\t// ccTLD (01-30-2004)\r\t\t$p .=\t\"ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|az|ba|bb|bd|\";\r\t\t$p .=\t\"be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|\";\r\t\t$p .=\t\"cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|\";\r\t\t$p .=\t\"ec|ee|eg|eh|er|es|et|fi|fj|fk|fm|fo|fr|ga|gd|ge|gf|gg|gh|gi|\";\r\t\t$p .=\t\"gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|\";\r\t\t$p .=\t\"im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|\";\r\t\t$p .=\t\"ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mk|ml|\";\r\t\t$p .=\t\"mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|\";\r\t\t$p .=\t\"nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|\";\r\t\t$p .=\t\"py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|\";\r\t\t$p .=\t\"sr|st|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|\";\r\t\t$p .=\t\"tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|\";\r\t\t$p .=\t\"za|zm|zw\";\r\t\t$p .=\t\")$/i\";\r\r\t\t$r = preg_match($p, $mail) ? 1 : 0;\r\t}\r\treturn $r;\r}", "function is_email($email)\n {\n return util::isEmail($email);\n }", "function checkmail($youremail)\n{\n if (ereg('^[-!#$%&\\'*+\\\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&\\'*+\\\\/0-9=?A-Z^_`a-z{|}~]+\\.'.\n '[-!#$%&\\'*+\\\\./0-9=?A-Z^_`a-z{|}~]+$', $youremail)) \n {\n\t return true;\n } \n else \n {\n\t return false;\n }\n}", "function emailIsValid($email,&$reason) {\r\n $isValid= true;\r\n $reasons= array();\r\n $atIndex= strrpos($email, \"@\");\r\n if (is_bool($atIndex) && !$atIndex) {\r\n $isValid= false;\r\n $reasons[]= \"chybí @\";\r\n }\r\n else {\r\n $domain= substr($email, $atIndex+1);\r\n $local= substr($email, 0, $atIndex);\r\n $localLen= strlen($local);\r\n $domainLen= strlen($domain);\r\n if ($localLen < 1 || $localLen > 64) {\r\n $isValid= false;\r\n $reasons[]= \"dlouhé jméno\";\r\n }\r\n else if ($domainLen < 1 || $domainLen > 255) {\r\n $isValid= false;\r\n $reasons[]= \"dlouhá doména\";\r\n }\r\n else if ($local[0] == '.' || $local[$localLen-1] == '.') {\r\n $reasons[]= \"tečka na kraji\";\r\n $isValid= false;\r\n }\r\n else if (preg_match('/\\\\.\\\\./', $local)) {\r\n $reasons[]= \"dvě tečky ve jménu\";\r\n $isValid= false;\r\n }\r\n else if (!preg_match('/^[A-Za-z0-9\\\\-\\\\.]+$/', $domain)) {\r\n $reasons[]= \"chybný znak v doméně\";\r\n $isValid= false;\r\n }\r\n else if (preg_match('/\\\\.\\\\./', $domain)) {\r\n $reasons[]= \"dvě tečky v doméně\";\r\n $isValid= false;\r\n }\r\n else if (!preg_match('/^(\\\\\\\\.|[A-Za-z0-9!#%&`_=\\\\/$\\'*+?^{}|~.-])+$/', str_replace(\"\\\\\\\\\",\"\",$local))) {\r\n $reasons[]= \"chybný znak ve jménu\";\r\n if (!preg_match('/^\"(\\\\\\\\\"|[^\"])+\"$/',\r\n str_replace(\"\\\\\\\\\",\"\",$local))) {\r\n $isValid= false;\r\n }\r\n }\r\n if ( $domain!='proglas.cz' && $domain!='setkani.org' ) {\r\n if ($isValid && !(checkdnsrr($domain,\"MX\") || checkdnsrr($domain,\"A\"))) {\r\n $reasons[]= \"$domain je neznámá doména\";\r\n $isValid= false;\r\n }\r\n }\r\n }\r\n $reason= count($reasons) ? implode(', ',$reasons) : '';\r\n return $isValid;\r\n}", "function checkNUVEmail($email) {\n\t\t$regEX = \"/([a-zA-Z0-9_]+)([\\.{1}_])?([a-zA-Z0-9_]+)\\@nuv([\\.])ac([\\.])in/\";\n\t\tif (preg_match($regEX, $email)) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t\texit();\t\n\t\t}\n\t}", "public function isQmail()\n {\n }", "function isEmail($email_quote ) {\n\treturn(preg_match(\"/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i\",$email_quote ));\n}", "function kiemtra_email($email)\n {\n if($this->default_model->getInfoID($this->_table,array(\"Email\" => $email))!=TRUE){ // ko ton tai $email\n return TRUE;\n }\n else{\n $this->form_validation->set_message(\"kiemtra_email\",sprintf($this->lang->line('error_kiemtra_email'),$email));\n return FALSE;\n }\n }", "public function usermail() {\n\n $mail = $_POST['mail'];\n\n $dmn = substr($mail, strpos($mail, '@') + 1);\n\n $fmt = filter_var($mail, FILTER_VALIDATE_EMAIL);\n\n return checkdnsrr($dmn) && $fmt;\n\n }", "function verify_email($email) // Colorize: green\n { // Colorize: green\n return isset($email) // Colorize: green\n && // Colorize: green\n is_string($email) // Colorize: green\n && // Colorize: green\n filter_var($email, FILTER_VALIDATE_EMAIL); // Colorize: green\n }", "function check_email ($email) {\n\t\n if (preg_match ('/^[-!#$%&\\'*+\\\\.\\/0-9=?A-Z^_{|}~]+' . '@' . '([-0-9A-Z]+\\.)+' . '([0-9A-Z]){2,4}$/i', trim ($email))) {\n \n return true;\n \n } else {\n \n return false;\n \n }\n}", "function checkemail() {\n\t\tConfigure::write('debug', 0);\n\t\t$this->autoRender = false;\n\t\t$this->layout = \"\";\n\t\t\n\t\t$email = $_REQUEST['data']['Member']['email'];\n\t\t\n\t\t$count = $this->Member->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'email' => $email\n\t\t\t)\n\t\t));\n\t\t\n\t\t\n\t\tif ($count > 0) {\n\t\t\techo \"false\";\n\t\t} else {\n\t\t\techo \"true\";\n\t\t}\n\t}", "function is_email($email, $deprecated = \\false)\n {\n }", "function isemail($email) {\r\n return preg_match('|^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]{2,})+$|i', $email);\r\n\r\n // /* Define the test for a valid email address */ \r\n // $email_test = \"/ \r\n // ^([a-zA-Z0-9_\\.\\-\\+]) \r\n // + \r\n // \\@ \r\n // (([a-zA-Z0-9\\-])+\\.) \r\n // + \r\n // ([a-zA-Z0-9]{2,4})+$ \r\n // /x\"; \r\n}", "function valid_email($name){\r\n if(strpos($name, '@') !== false)\r\n return true;\r\n else\r\n return false;\r\n }", "function checkEmail($email) {\n\t\tif(strpos($email, '@') && strpos($email, '.')) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function verifyContainsEmail(): bool\n {\n $words = explode(' ', $this->input);\n foreach ($words as $word) {\n if (static::isValidEmail($word)) {\n return true;\n }\n }\n \n return false;\n }", "function email_validation($toemail) \n\t{ \n\t\t$param_array = func_get_args();\n\t\t\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD email::email_validation() - PARAMETER LIST : ', $param_array);\n\t\t\t\n\t\tif($_SERVER['REMOTE_ADDR'] != \"127.0.0.1\")\n\t\t{\n\t\t\n\t\tglobal $HTTP_HOST; \n\t\t\n\t\t$result = array(); \n\t\t\n\t\t$result[0]=true; \n\t\t\n\t\t$result[1]=\"$toemail appears to be valid.\"; \n\t\t/* this regular expression is not allowing some of the domain names like .name etc., so we check for one @ symbol and \n\t\tatleast 1 \".\" symbol in email id.\n\t\tif (!eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$\", $toemail)) \n\t\t{ \t\t\n\t\t\t$result[0]=false; \n\t\t\t\n\t\t\t$result[1]=\"$toemail is not properly formatted\"; \n\t\t\t\n\t\t}\n\t\t*/\n\t\t\n\t\t//remove the name from the email\n\t\t\n\t\t$earr = explode(\"<\", $toemail);\n\t\t\n\t\tif(count($earr) == 2 && strlen(trim($earr[1])) > 0)\n\t\t\t$email = substr(trim($earr[1]),0,-1);\n\t\telse\n\t\t\t$email = trim($earr[0]);\n\t\t\n\t\t$eml_arr = explode(\"@\",$email);\n\t\t$result[0]=false; \n\t\t\n\t\t$result[1]=\"$toemail is not properly formatted\"; \n\t\tif(count($eml_arr) == 2 && strlen(trim($eml_arr[0])) > 0 && strlen(trim($eml_arr[1])) > 0)\n\t\t{\n\t\t\t$domain_arr = explode(\".\",$eml_arr[1]);\n\t\t\tif(count($domain_arr) > 1 && strlen(trim($domain_arr[0])) > 0 && strlen(trim($domain_arr[1])) > 0)\n\t\t\t{\n\t\t\t\t$result[0]=true; \n\t\t\t\t$result[1]=\"$toemail appears to be valid.\"; \n\t\t\t}\n\t\t}\n\t\t\n\t\tif(1==2)\n\t\t{//need not check by communicating to email server...\n\t\t\n\t\tlist ( $username, $domain ) = split (\"@\",$toemail); \n\t\t\n\t\tif (getmxrr($domain, $MXHost)) \n\t\t{\t\t\n\t\t\t$connectaddress = $MXHost[0];\n\t\t}\n\t\telse \n\t\t{\t\t\n\t\t\t$connectaddress = $domain;\n\t\t} \n\t\t//echo \"Connect address : \" . $connectaddress . \"<br>\";\n\t\t//echo \"Domain Name : \" . $domain . \"<br>\";\n\t\t$connect = fsockopen ( $connectaddress, 25 ); \n\t\t\n\t\tif ($connect) \n\t\t{\t\t\n\t\t\tif (ereg(\"^220\", $Out = fgets($connect, 1024))) \n\t\t\t{ \n\t\t\t\n\t\t\t fputs ($connect, \"HELO $HTTP_HOST\\r\\n\"); \n\t\t\t \n\t\t\t $out = fgets ( $connect, 1024 ); \n\t\t\t \n\t\t\t $this->from_email = $GLOBALS['site_config']['admin_email'];\n\t\t\t \n\t\t\t $from = $this->from_email;\n\t\t\t \n\t\t\t fputs ($connect, \"MAIL FROM: <{$from}>\\r\\n\"); \n\t\t\t \n\t\t\t $from = fgets ( $connect, 1024 ); \n\t\t\t \n\t\t\t fputs ($connect, \"RCPT TO: <{$toemail}>\\r\\n\"); \n\t\t\t \n\t\t\t $to = fgets ($connect, 1024); \n\t\t\t \n\t\t\t fputs ($connect, \"QUIT\\r\\n\"); \n\t\t\t \n\t\t\t fclose($connect); \n\t\t\t \n\t\t\t if (!ereg (\"^250\", $from) || !ereg ( \"^250\", $to )) \n\t\t\t { \n\t\t\t \n\t\t\t\t $result[0]=false; \n\t\t\t\t \n\t\t\t\t $result[1]=\"Server rejected address\"; \n\t\t\t\t \n\t\t\t\t} \n\t\t\t} \n\t\t\t\n\t\t\telse\n\t\t\t{\t\t\t\t\n\t\t\t\t$result[0] = false; \n\t\t\t\t\n\t\t\t\t$result[1] = \"No response from server\"; \n\t\t\t\t\n\t\t\t } \n\t\t\t \n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$result[0]=false; \n\t\t\t\n\t\t\t$result[1]=\"Can not connect E-Mail server.\"; \n\t\t\t\n\t\t\t//return $result; \n\t\t} \n\t\t\n\t\t}\n\t\t\n\t\tif(!$result[0])\n\t\t{\n\n\t\t\t$ttext = \"\";\n\t\t\t$ttext .= \"<table border=0 cellpadding=3 cellspacing=1 align=center width=90%>\";\n\t\t\t$ttext .= \"<tr align=left><td><strong>Error Message</strong></td><td>\" . $result[1] . \" (\" . $toemail . \")\" . \"</td></tr>\";\n\t\t\t$ttext .= \"</table>\";\n\n\t\t\t$GLOBALS['logger_obj']->error('<br>METHOD email::email_validation() - Return Value : ', $ttext,'email');\n\n\t\t}\n\t}\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD email::email_validation() - Return Value : ', $result);\n\t\treturn $result; \n\t\t\n\t}", "function mme_checkemail( $email ) {\n\t$match = preg_match( '/^[A-z0-9_\\-.]+[@][A-z0-9_\\-]+([.][A-z0-9_\\-]+)+[A-z.]{2,4}$/', $email );\n\tif(!$match){\n\t\t$error_msg = 'Invalid E-mail address';\n\t\tmme_error_notice( $error_msg );\n\t\treturn false;\n\t\t}\n\treturn true;\n}", "function isEmail($verify_email) {\n\t\n\t\treturn(preg_match(\"/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i\",$verify_email));\n\t\n\t}", "function isEmail($field_data) \n{ \n\t$fields_ok=preg_match(\"/^([a-zA-Z0-9])+([a-zA-Z0-9\\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\\._-]+)+$/\" , $field_data); \n\treturn $fields_ok; \n}", "function check_email($str){\n\t\t$this->db->where('user_email',$str);\n\t\t$rs\t=\t$this->db->get('reseller_store');\t\n\t\t$is_email_exits\t=\t$rs->num_rows();\n\t\tif($is_email_exits>0){\n\t\t\t$user_email_exits_msg\t=\tRegisterMessages(1);\n\t\t\t$this->form_validation->set_message('check_email', $user_email_exits_msg);\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t\treturn true;\n\t}", "public function checkEmail() {\n $result = $this->model->checkEmail($_POST);\n if($result) {\n echo \"true\"; \n } else {\n echo \"false\";\n }\n }", "function checkSupEmail($supervisorEmail,$message){\r\n\t\tif ($supervisorEmail != NULL){\r\n\t\t\tif(strlen($supervisorEmail)<=25 && filter_var($supervisorEmail, FILTER_VALIDATE_EMAIL)){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function ValidEmail( $address, $leMail )\r\n\t\t{\r\n\t\tif( ereg( \".*<(.+)>\", $address, $regs ) )\r\n\t\t\t$address = $regs[1];\r\n\r\n\t\tif( !ereg( \"^[^@ ]+@([a-zA-Z0-9\\-]+\\.)+([a-zA-Z0-9\\-]{2}|net|com|gov|mil|org|edu|int)\\$\",$address) )\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t\t}", "private function process_email($value)\n {\n return (bool) filter_var($value, FILTER_VALIDATE_EMAIL);\n }", "private function checkEmail($email)\n {\n $pattern = '/\\b[\\w.-]+@[\\w.-]+\\.[A-Za-z]{2,6}\\b/';\n if(!preg_match($pattern, $email) ){\n echo \"ERROR nell' email : \".$email;\n throw new InvalidArgumentException();\n }\n else return true;\n }", "function email_is_valid($email) {\r\n return preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i',$email);\r\n }", "public function _check_email_exists($email = ''){\n\t\t\n\t}", "function check_email($emaildddress)\n{\n\t$goodchars = '^[A-Za-z0-9\\._-]+@([A-Za-z][A-Za-z0-9-]{1,62})(\\.[A-Za-z][A-Za-z0-9-]{1,62})+$';\n\n\t$isvalid = true;\n\tif(!ereg($goodchars,$emaildddress))\n\t{\n\t\t$isvalid = false;\n\t}\n\treturn $isvalid;\n}", "public function check_email() {\n\t\t$email = urldecode($_GET['email']);\n\n\t\t$result = $this->Member_Model->check_email_if_exists($email);\n\n\t\tif ($result > 0) {\n\t\t\techo json_encode(false);\n\t\t} else {\n\t\t\techo json_encode(true);\n\t\t}\n\t}", "function valid_mail($str) {\n\t\treturn (!preg_match(\"/^([a-z0-9\\+_\\-]+)(\\.[a-z0-9\\+_\\-]+)*@([a-z0-9\\-]+\\.)+[a-z]{2,6}$/ix\", $str)) ? FALSE : TRUE;\n\t}", "function isEmail($input){\n return preg_match('/[a-z0-9]@[a-z]{3,}\\.[a-z]{3}$/',$input);\n }", "function checkemail() {\n\t\tConfigure::write('debug', 0);\n\t\t$this->autoRender = false;\n\t\t\n\t\t$email = $_REQUEST['data']['Member']['email'];\n\t\t\n\t\t$count = $this->Member->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'email' => $email\n\t\t\t)\n\t\t));\n\t\t\n\t\t/*echo $count;\n\t\tdie;*/\n\t\tif ($count > 0) {\n\t\t\techo \"false\";\n\t\t} else {\n\t\t\techo \"true\";\n\t\t}\n\t}", "static public function checkEmail($email){\n\t\treturn !t3lib_div::validEmail($email);\n\t}", "function validate_email($email){\n\t\n\tif(empty($email)){\n\t\t\n\t\treturn false;\n\t\t\n\t}\n\tif(count(explode('@',$email)) != 2){\n\t\t\n\t\treturn false;\n\t\t\n\t}\n\telse {\n\t\t\n\t\t$words = explode('@',$email);\n\t\t\t$second = $words[1];\n\t\t\tif(count(explode('.',$email)) != 2){\n\t\t\t\n\t\t\treturn false;\n\t\t\n\t\t}\n\t\t\n\t}\n\t\treturn true;\n\t\n\t\n}", "function check_email ($email)\n{\n return (preg_match ('/^[-!#$%&\\'*+\\\\.\\/0-9=?A-Z^_{|}~]+' . '@' . '([-0-9A-Z]+\\.)+' . '([0-9A-Z]){2,4}$/i', trim($email)));\n}", "function comprobar_email($email) {\n return (filter_var($email, FILTER_VALIDATE_EMAIL)) ? 1 : 0;\n}", "function check($email)\n\t{\n\t if (preg_match(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$\", $email, $matches))\n\t { \n\t //if (checkdate($matches[2], $matches[3], $matches[1]))\n\t //{ \n\t return true; \n\t //} \n\t } \n\t return false;\n\t}", "public function emailEntryIsValid() {\r\n \r\n $email = $this->getEmail();\r\n \r\n if ( empty($email) ) {\r\n $this->errors[\"email\"] = \"Email is missing.\";\r\n } else if ( !Validator::emailIsValid($this->getEmail()) ) {\r\n $this->errors[\"email\"] = \"Email is not valid.\"; \r\n }\r\n \r\n return ( empty($this->errors[\"email\"]) ? true : false ) ;\r\n }", "public function is_dispo_email($email)\n\t{\n\t\t$sql=\"SELECT ut_id FROM utilisateur WHERE ut_mail=?\";\n\t\t$tuple = $this->executerRequete($sql,array($email));\n\t\t$numRows = $tuple->rowCount();\n\t\tif($numRows>0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function check_email($email){\n $query = $this->db->select('01_email')\n ->where('01_email', $email)\n ->get('register_01');\n if($query->num_rows()>0){\n return 0;\n }else{\n $query = $this->db->where('is_sms', 1)\n ->where('number', $email)\n ->get('verify_otp_12');\n if($query->num_rows()>0){\n return 'sent';\n }else{\n $query = $this->db->where('number', $email)\n ->delete('verify_otp_12');\n $otp = rand(10000, 1000000);\n $data = array(\n 'number' => $email,\n 'otp' => $otp,\n );\n $query = $this->db->insert('verify_otp_12', $data);\n return true;\n }\n }\n }", "public function email($input){\n if(preg_match('/^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/', $input) == true){\n return true;\n\t}else{\n return false;\n }\n }", "public function isSendmail()\n {\n }", "function validaremail($email){ \n if (!ereg(\"^([a-zA-Z0-9._]+)@([a-zA-Z0-9.-]+).([a-zA-Z]{2,4})$\",$email)){ \n return FALSE; \n } else { \n return TRUE; \n } \n}", "function my_email_check_function($id, $email)\n{\n # ...do some meaningful check here...\n return true;\n}", "function check_email($email) \r\n{ \r\n\t$emailArray = preg_split('//', $email); \r\n $atSign = false; \r\n $dotSign = false; \r\n $badCharacter = false; \r\n $validEmail = true; \r\n\tif (in_array (\"@\", $emailArray)) \r\n\t{ \r\n \t$atSign = true; \r\n } \r\n if (in_array (\".\", $emailArray)) \r\n\t{ \r\n \t$dotSign = true; \r\n } \r\n\t$badCharactersArray = array('#', '$', '%', '(', ')', '&', '!'); // Add your own bad \r\n\tfor ($i = 0; $i < sizeof($badCharactersArray); $i++) \r\n\t{ \r\n\t\tif (in_array ($badCharactersArray[$i], $emailArray)) \r\n \t{ \r\n \t\t$badCharacter = true; \r\n \t} \r\n\t} \r\n\tif ((!$atSign) or (!$dotSign) or ($badCharacter)) \r\n \t$validEmail = false; \r\n}", "function checkEmail($checkemail) {\r\n if(preg_match(\"/^([a-zA-Z0-9])+([a-zA-Z0-9\\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\\._-]+)+$/\" , $checkemail))\r\n {\r\n list($username,$domain)=split('@',$checkemail);\r\n \r\n if(!getmxrr ($domain,$mxhosts)) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n return false;\r\n}", "public function checkMail()\n {\n $mail = htmlspecialchars($_POST['email']);\n $mail2 = htmlspecialchars($_POST['confirmation_mail']);\n if (!empty($_POST['email']) &&\n !empty($_POST['confirmation_mail'])) {\n if ($mail == $mail2) {\n if (filter_var($mail, FILTER_VALIDATE_EMAIL)) {\n $isMail = $this->isMail($mail);\n if ($isMail == 0) {\n return true;\n } else {\n return $message = 'Votre email n\\'est pas valide!';\n }\n } else {\n return $message = 'Votre adresse mail n\\'est pas valide';\n }\n } else {\n return $message = 'Vos adresses mails ne correspondent pas';\n }\n } else {\n return $message = 'Tous les champs ne sont pas complétés';\n }\n }", "function cjpopups_is_email_valid($email){\n\treturn preg_match(\"/^[_a-z0-9-]+(\\.[_a-z0-9+-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,})$/i\", $email);\n}", "function virustotalscan_valid_email($email) \r\n{\r\n\tif (function_exists(\"filter_var\") && !filter_var($email, FILTER_VALIDATE_EMAIL)) {\r\n return false;\r\n }\r\n else {\r\n // daca functia exista atunci se returneaza true\r\n if (function_exists(\"filter_var\")) return true;\r\n else {\r\n // altfel inseamna ca functia nu exista si trebuie sa utilizam o alta metoda\r\n return eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$\", $email);\r\n }\r\n }\r\n}", "function isEmailCorrect($email){\r\n\tif (filter_var($email, FILTER_VALIDATE_EMAIL) && strlen($email)<=255) {\r\n\t\t//check if it's only string\r\n\t\tif (htmlentities($email)==$email) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t}\r\n\r\n\treturn 0;\r\n}", "function validaemail($emailForm){\n if (!ereg('^([a-zA-Z0-9.-])*([@])([a-z0-9]).([a-z]{2,3})',$emailForm)){\n $mensagem='E-mail Inv&aacute;lido!';\n return $mensagem;\n }\n else{\n //Valida o dominio\n $dominio=explode('@',$emailForm);\n if(!checkdnsrr($dominio[1],'A')){\n $mensagem='E-mail Inv&aacute;lido!';\n return $mensagem;\n }\n else{return true;} // Retorno true para indicar que o e-mail é valido\n }\n }", "public function hasEmail() {\n return $this->_has(4);\n }", "public function hasEmail(): bool;", "function checkEmail()\n {\n\t\t\t$email = $_POST['email'];\n\n\t\t\t// Check its existence (for example, execute a query from the database) ...\n\t\t\t$email_cek = $this->account_model->Check_TblUsers('email',$email);\n\t\t\t\n\t\t\tif($email_cek == 0)\n\t\t\t{\n\t\t\t\t$isAvailable = true;\n\t\t\t}else{\n\t\t\t\t$isAvailable = False;\n\t\t\t} \n\n\t\t\t// Finally, return a JSON\n\t\t\techo json_encode(array(\n\t\t\t\t'valid' => $isAvailable,\n\t\t\t));\n\t\t}", "public function isCheckEmail()\n {\n if( (!$this -> zgloszePozniej) && ($this -> emailAtt2User == '') ) :\n return false;\n endif;\n return true;\n }", "function validateMail() : bool\n {\n if($this->Mail && filter_var($this->Mail, FILTER_VALIDATE_EMAIL) && strlen($this->Mail)<=40)\n {\n return true;\n }\n else\n return false;\n }", "function is_valid_email ($mail)\n{\n return filter_var($mail, FILTER_VALIDATE_EMAIL) && (! preg_match('/@\\[[^\\]]++\\]\\z/', $mail));\n}", "function checkEmail(){\n\t\t$json\t= ceHelper::checkEmail(JRequest::getVar('email'));\n\t\t$this->jsonReturn($json);\n\t}", "function validate_email() {\n # Check Value is an Email Address\n if ($this->check_email_address($this->cur_val)) {\n # Remove any existing error message\n $this->error_message = \"\";\n\n # Return Email\n return $this->cur_val;\n }\n else {\n # Set Error Message\n $this->set_error(\"Validation for email address ({$this->cur_val}) failed. This is type \" . gettype($this->cur_val));\n\n # Return Blank String\n return \"\";\n }\n }", "function KTEmail($email){\n\t\t\t\t$sql=\"SELECT * FROM user WHERE Email='$email'\";\n\t\t\t\t$re=mysql_query($sql) or die(mysql_error());\n\t\t\t\t$n=mysql_num_rows($re);\n\t\t\t\tif($n>=1)\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t}", "function isValidEmail($email) {\n return strpos($email, \"@\") !== false;\n }", "public function check_email($f3)\r\n {\r\n // query params should be\r\n // 'email'\r\n\r\n $this->uri = $this->endpoint . \"/email/check\";\r\n $this->uri .= \"?\" . $f3->get('QUERY') . \"&package_id=\" . $f3->get(\"SESSION.{$this->session_ident}.package_id\");\r\n\r\n $this->request();\r\n $this->process();\r\n }", "function is_ok_smtp ($cmd = \"\"){\n\t\tif(empty($cmd))\t\t\t\t{ return false; }\n\t\tif (ereg (\"^220\", $cmd))\t{ return true; }\n\t\tif (ereg (\"^250\", $cmd))\t{ return true; }\n\t\treturn false;\n\t}", "function checkEmail($errorString) {\n if(strlen($_POST[\"email\"]) > 64) { // (1)\n return $errorString.\"Email může být dlouhý maximálně <b>64</b> znaků.<br>\";\n }\n return $errorString;\n}", "public static function is_email($value) {\r\n\t\t$parts = explode('@', $value, 2);\r\n\t\t$local_part = array_shift($parts);\r\n\t\t$domain = array_shift($parts);\r\n\t\t\r\n\t\t$ret = self::is_domain($domain);\r\n\t\t// local part may be up to 64 characters \r\n\t\t$ret = $ret && (strlen($local_part) <= 64);\r\n\t\t// dot is not allowed at the end or beginning\r\n\t\t// There is also a rule that 2 or more dots are illegal like in '[email protected]'\r\n\t\t// Unfortunately: my neighbor's address IS [email protected]! And I can't lock my neighbor \r\n\t\t// out of the services I program, can I? \r\n\t\t$ret = $ret && (substr($local_part, 0, 1) !== '.');\r\n\t\t$ret = $ret && (substr($local_part, -1) !== '.');\r\n\t\t// Only a-z, A-Z, 0-9 and !#$%&'*+-/=?^_`{|}~ and . are allowed\r\n\t\t// (There is quoting and escaping, but we do not hear, we do not hear, we do not hear...)\r\n\t\t$pattern = \"@^[a-zA-Z0-9!#$%&'*+\\-/=?^_`{|}~.]+$@s\";\r\n\t\t$ret = $ret && preg_match($pattern, strtr($local_part, \"\\r\\n\", ' '));\r\n\t\t\r\n\t\treturn $ret;\r\n\t}", "function checkMAIL($account, $email)\n {\n while ($users = $account->fetch()) {\n if ($users['email'] == $email) {\n return true;\n }\n }\n return false;\n }", "function is_check_email($str){\n\t\t$this->db->where('user_email',$str);\n\t\t$rs\t=\t$this->db->get('reseller_store');\t\n\t\t$is_email_exits\t=\t$rs->num_rows();\n\t\tif($is_email_exits>0){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\t$user_email_exits_msg\t=\tLoginMessages(7);\n\t\t\t$this->form_validation->set_message('is_check_email', $user_email_exits_msg);\n\t\t\treturn false;\t\t\n\t\t}\n\t}", "public function email_check($str){\n\t\tif($this->user_model->exist_row_check('email', $str) > 0){\n $this->form_validation->set_error_delimiters('', '');\n\t\t\t$this->form_validation->set_message('email_check', 'Email telah digunakan');\n\t\t\treturn FALSE;\n\t\t}\n\t\telse{\n\t\t\treturn TRUE;\n\t\t}\n\t}", "function isEmail($email) {\r\n\r\n\treturn preg_match(\"/^(((([^]<>()[\\.,;:@\\\" ]|(\\\\\\[\\\\x00-\\\\x7F]))\\\\.?)+)|(\\\"((\\\\\\[\\\\x00-\\\\x7F])|[^\\\\x0D\\\\x0A\\\"\\\\\\])+\\\"))@((([[:alnum:]]([[:alnum:]]|-)*[[:alnum:]]))(\\\\.([[:alnum:]]([[:alnum:]]|-)*[[:alnum:]]))*|(#[[:digit:]]+)|(\\\\[([[:digit:]]{1,3}(\\\\.[[:digit:]]{1,3}){3})]))$/\", $email);\r\n\r\n}", "private function checkEmail($data) {\n\t\tif(filter_var($data, FILTER_VALIDATE_EMAIL)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "static function isEmail($string)\n\t{\n\t if (!preg_match(\"#^([a-z0-9._-]+)@([a-z0-9.-]{2,}([.][a-z]{2,})*[.][a-z]{2,3})$#\", $string))\n\t {\n\t return false;\n\t }\n\t else\n\t {\n\t return true;\n\t }\n\t}", "private function clean_poea_email($email) {\n\n \t$emails = array();\n\n \t$email = str_replace('@y.c', \"@yahoo.com\", $email);\n\n\t\t$slash_email = explode(\"/\", $email);\n\t\t$or_email = explode(\" or \", $email);\n\t\t$and_email = explode(\"&\", $email);\n\n\t\tif(count($slash_email) > 1) {\n\t\t\t\n\t\t\tforeach ($slash_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t\t\t$emails[] = $v;\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(count($and_email) > 1) {\n\n\t\t\tforeach ($and_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t\t\t$emails[] = $v;\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(count($or_email) > 1) {\n\n\t\t\tforeach ($or_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\t\n\t\t\t\t\t$emails[] = $v;\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t$emails[] = $email;\t\n\n\t\t}\n\n\t\tif(empty($emails)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn json_encode($emails);\n }", "function chk_email($email)\n\t{\n\t\t$str = \"Select u_email from tbl_user where u_email = ?\";\n\t\t\n\t\t//Executes the query\n\t\t$res = $this -> db -> query($str, $email);\n\t\t\n\t\t//Checks whether the result is available in the table\n\t\tif($res -> num_rows() > 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function email_check($str){\n\t\tif ($this->user_model->count(array('email' => $str)) > 0){\n $this->form_validation->set_message('email_check', 'Email sudah digunakan, mohon ganti dengan yang lain');\n return FALSE;\n }\n else{\n return TRUE;\n }\n\t}", "function email_check($email) {\n\tif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\t\treturn false; \n\t}\n\t$domain = explode(\"@\",$email);\n\tif (!checkdnsrr($domain[1], 'MX')) {\n\t\treturn false; \n\t}\n\treturn true;\n}", "public function email_check($str){\n $con['returnType'] = 'count';\n $con['conditions'] = array('email'=>$str);\n $checkEmail = $this->user->getRows($con);\n if($checkEmail > 0){\n $this->form_validation->set_message('email_check', 'The given email already exists.');\n return FALSE;\n } else {\n return TRUE;\n }\n }", "function isEmail($email)\n{\n if(preg_match(\"~([a-zA-Z0-9!#$%&'*+-/=?^_`{|}~])@([a-zA-Z0-9-]).([a-zA-Z0-9]{2,4})~\",$email)) \n {\n return true;\n }else{\n return false;\n } \n}", "function useremail_check($str) {\r\n $res = $this->auth_model->is_email_exists($str);\r\n if ($res <= 0) {\r\n $this->form_validation->set_message('useremail_check', lang_key('email_not_matched'));\r\n return FALSE;\r\n } else {\r\n return TRUE;\r\n }\r\n }", "function mail_un_routine($conn, $email, $un){\n check_email(\"students\",$conn, $email);\n check_email(\"teachers\", $conn, $email);\n check_username(\"students\", $conn, $un);\n check_username(\"teachers\", $conn, $un);\n }", "function checkEmail($email) {\n\t\t\tif(!eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$\", $email)) {return false;}\n\t\t\treturn true;\n\t\t}" ]
[ "0.71680707", "0.7099788", "0.7025897", "0.69389284", "0.693363", "0.69320184", "0.68899703", "0.6888583", "0.686845", "0.68427116", "0.68057686", "0.68032044", "0.67794305", "0.6775179", "0.67427766", "0.6727921", "0.67278355", "0.672636", "0.6725586", "0.67196435", "0.67173976", "0.6703426", "0.66874045", "0.6677065", "0.66740906", "0.666227", "0.6636196", "0.6619787", "0.66188884", "0.65895486", "0.6588926", "0.6578155", "0.6563235", "0.6544486", "0.6526098", "0.652028", "0.6511282", "0.651055", "0.65088385", "0.64979297", "0.6487202", "0.64845926", "0.64845216", "0.6482775", "0.6469793", "0.6458697", "0.64584637", "0.6454417", "0.64397085", "0.64381593", "0.64349395", "0.6434835", "0.64278", "0.64236236", "0.6419208", "0.64149773", "0.641487", "0.6414217", "0.64133346", "0.6403395", "0.6401999", "0.6401663", "0.63986903", "0.6397675", "0.6393759", "0.6393019", "0.6392345", "0.63855565", "0.63850605", "0.6384764", "0.6382455", "0.6381459", "0.63786745", "0.63778234", "0.6375286", "0.6373701", "0.63642675", "0.63451356", "0.63447946", "0.6343174", "0.63431674", "0.633972", "0.633854", "0.6330279", "0.63296604", "0.6329145", "0.63275707", "0.6326386", "0.6320464", "0.6317435", "0.6314038", "0.6312174", "0.63113225", "0.63064", "0.6302933", "0.62905145", "0.62849337", "0.6284379", "0.6280922", "0.6279081", "0.62789893" ]
0.0
-1
Display a listing of the resource.
public function index(Request $request) { $estado = $request->get('estado'); $nombre = $request->get('nombre'); $pagina = ($request->get('page')!=null)?$request->get('page'):1; $pagina--; $pagina *= 10; $tacs = Tac::buscar($nombre,$estado); $activos = Tac::where('estado',true)->count(); $inactivos = Tac::where('estado',false)->count(); return view('Tac.index',compact( 'tacs', 'estado', 'nombre', 'activos', 'inactivos', 'pagina' )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { return view('Tac.create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { DB::beginTransaction(); try{ $tacNuevo = new Tac; $tacNuevo->nombre=$request->nombre; $tacNuevo->save(); //Crear una categoria de servicio asociada a los examen $categoria_existe = CategoriaServicio::where('nombre','TAC')->first(); if($categoria_existe==null){ $categoria_existe = new CategoriaServicio; $categoria_existe->nombre = "TAC"; $categoria_existe->save(); } $servicio = new Servicio; $servicio->nombre = $request->nombre; $servicio->f_categoria = $categoria_existe->id; $servicio->precio = $request->precio; $servicio->f_tac = $tacNuevo->id; $servicio->save(); }catch(\Exception $e){ DB::rollback(); return $e; return redirect('/tacs')->with('mensaje', $e); } DB::commit(); Bitacora::bitacora('store','tacs','tacs',$tacNuevo->id); return redirect('/tacs')->with('mensaje', '¡Guardado!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72875285", "0.71454394", "0.71323526", "0.6639812", "0.6620611", "0.6568348", "0.6526527", "0.6509403", "0.64499927", "0.6375791", "0.63739914", "0.6365971", "0.6365971", "0.6365971", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667" ]
0.0
-1
Display the specified resource.
public function show($id) { $tac = Tac::find($id); $servicio = Servicio::where('f_tac',$id)->first(); return view('Tac.show',compact('tac','servicio')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $servicio =Servicio::where('f_tac',$id)->first(); $precio=$servicio->precio; $tac = Tac::find($id); return view('Tac.edit',compact('tac','precio')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $servicio =Servicio::where('f_tac',$id)->first(); $servicio->precio=$request->precio; $servicio->save(); $tac = Tac::find($id); $tac->fill($request->all()); $tac->save(); Bitacora::bitacora('update','tacs','tacs',$id); if($tac->estado) { return redirect('/tacs')->with('mensaje', '¡Editado!'); } else{ return redirect('/tacs?estado=0')->with('mensaje', '¡Editado!'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { DB::beginTransaction(); try{ $servicio =Servicio::where('f_tac',$id)->first(); $servicio->delete(); $tac = Tac::findOrFail($id); $tac->delete(); }catch(\Exception $e){ DB::rollback(); return redirect('/tacs?estado=0')->with('error', " "); } Bitacora::bitacora('destroy','tacs','tacs',$id); DB::commit(); return redirect('/tacs?estado=0')->with('mensaje',' '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
CREATE TABLE tb_table_pk ( table_name varchar(20) not null, pk_value varchar(20), PRIMARY KEY (table_name) );
public function get_pk_value($table_name) { $sql = " SELECT pk_value FROM tb_table_pk "; $sql .= " WHERE table_name = '".$table_name."'"; Log::debug($sql); $this->open_connect(); $this->db->query("LOCK TABLES tb_table_pk"); $result = $this->db->query($sql); $rows = $this->db->num_rows($result); $value = 0; if($rows == 0) { $sql = " INSERT INTO "; $sql .= " tb_table_pk (table_name, pk_value) "; $sql .= " VALUES("; $sql .= " '".$table_name."', '0'"; $sql .= " )"; Log::debug($sql); $this->db->query($sql); } else { $value = $this->db->result($result); } $this->db->free_result($result); $value = (intval($value, 10)+1); //Log::out_print($value); $sql = " UPDATE "; $sql .= " tb_table_pk "; $sql .= " SET "; $sql .= " pk_value='".$value."'"; $sql .= " WHERE "; $sql .= " table_name='".$table_name."'"; Log::debug($sql); $this->db->query($sql); $this->db->query("UNLOCK TABLES"); $this->close_connect(); return sprintf("%012d",$value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function create_table($table_name, $fields, $primary_key = TRUE);", "public function createTable( $table ) {\n\t\t$idfield = $this->getIDfield($table, true);\n\t\t$table = $this->safeTable($table);\n\t\t$sql = \"\n CREATE TABLE $table ( $idfield INTEGER PRIMARY KEY AUTOINCREMENT )\n\t\t\t\t \";\n\t\t$this->adapter->exec( $sql );\n\t}", "function getPKName($table)\n{\n $field_list = getTableFields($table);\n foreach($field_list as $f) {\n if ($f['Key' == 'PRI']) {\n return $f['Field'];\n }\n }\n return \"\";\n}", "public function createTable( $table ) {\n\t\t$rawTable = $this->safeTable($table,true);\n\t\t$table = $this->safeTable($table);\n\n\t\t$sql = ' CREATE TABLE '.$table.' (\n \"id\" integer AUTO_INCREMENT,\n\t\t\t\t\t CONSTRAINT \"pk_'.$rawTable.'_id\" PRIMARY KEY(\"id\")\n\t\t )';\n\t\t$this->adapter->exec( $sql );\n\t}", "function modifyPrimaryKey($sTablename, $aColumns)\n{\n Yii::app()->db->createCommand(\"ALTER TABLE {{\".$sTablename.\"}} DROP PRIMARY KEY, ADD PRIMARY KEY (\".implode(',',$aColumns).\")\")->execute();\n}", "protected function _createTableSql()\n\t{\n\t\treturn 'CREATE TABLE ' . $this->getTable() . ' (pgt_iou VARCHAR(255) NOT NULL PRIMARY KEY, pgt VARCHAR(255) NOT NULL)';\n\t}", "function db_add_primary_key(&$ret, $table, $fields) {\n $ret[] = update_sql('ALTER TABLE {'. $table .'} ADD PRIMARY KEY ('.\n _db_create_key_sql($fields) .')');\n}", "public function getTablePrimaryKey()\n {\n return 'p.id';\n }", "public function getPrimaryKeyDDL(Table $table);", "public function PK($table_name){\n $PK = DB::select('SELECT FNC_GETPK(\"'.$table_name.'\");');\n foreach ($PK as $value) {\n $result = $value;\n }\n foreach ($result as $id) {\n $result = $id; // primary key\n }\n\n return $id;\n }", "public function create()\n {\n $db = XenForo_Application::get('db');\n $db->query('CREATE TABLE `' . self::DB_TABLE . '`\n (`threema_id` CHAR(8) NOT NULL PRIMARY KEY,\n `public_key` CHAR(64) NOT NULL)\n ');\n }", "protected function primaryKeyName($table) {\n $table = $this->connection->prefixTables('{' . $table . '}');\n return $this->connection->query('SELECT name FROM sys.key_constraints WHERE parent_object_id = OBJECT_ID(:table) AND type = :type', [\n ':table' => $table,\n ':type' => 'PK',\n ])->fetchField();\n }", "function createTable($conn, $table)\n { \n /*$sqlStr = \"CREATE TABLE $table(name VARCHAR(150), vendor VARCHAR(150), manufacturer VARCHAR(150), rating DECIMAL(4, 2), quantity INT, PRIMARY KEY(name, vendor))\";*/\n $sqlStr = \"CREATE TABLE $table(name VARCHAR(150) NOT NULL, vendor VARCHAR(150) NOT NULL, manufacturer VARCHAR(150) NOT NULL, rating DECIMAL(4, 2), quantity INT, productID INT primary key AUTO_INCREMENT)\";\n $result = $conn->query($sqlStr);\n if(!result) die($conn->error);\n else\n echo \"Created the $table table.<br />\";\n if(strcmp(\"NEWEGG\", strtoupper($table)) == 0)\n echo \"<br />\";\n }", "function primary_key()\r\n\t{\r\n\t\treturn 'key';\r\n\t}", "function kval_sqlite_create(\\PDO $pdo)\n{\n $pdo->exec('CREATE TABLE kv (\n id INTEGER PRIMARY KEY, \n kv_key TEXT,\n kv_ts INTEGER DEFAULT 0,\n kv_value BLOB\n )');\n $pdo->exec('CREATE UNIQUE INDEX kv_key_idx ON kv (kv_key)');\n}", "protected function setUpPrimaryKey()\n {\n $this->getOldTable()->createColumn('foo', Type::STRING, array('length' => 50));\n $this->getOldTable()->createColumn('bar', Type::STRING, array('length' => 50));\n\n $this->getOldTable()->createPrimaryKey(array('foo'), 'pk');\n\n $this->createOldTable();\n }", "public function getTableKeyName()\n\t{\n\t\treturn \"id\".$this->getTableName();\n\t}", "abstract public function createTable();", "function Dataface_ConfigTool_createConfigTable(){\n\t$self =& Dataface_ConfigTool::getInstance();\n\tif ( !Dataface_Table::tableExists($self->configTableName, false) ){\n\t\t$sql = \"CREATE TABLE `\".$self->configTableName.\"` (\n\t\t\t\t\tconfig_id int(11) NOT NULL auto_increment primary key,\n\t\t\t\t\t`file` varchar(255) NOT NULL,\n\t\t\t\t\t`section` varchar(128),\n\t\t\t\t\t`key` varchar(128) NOT NULL,\n\t\t\t\t\t`value` text NOT NULL,\n\t\t\t\t\t`lang` varchar(2),\n\t\t\t\t\t`username` varchar(32),\n\t\t\t\t\t`priority` int(5) default 5\n\t\t\t\t\t)\";\n\t\t$res = mysql_query($sql, df_db());\n\t\tif ( !$res ){\n\t\t\ttrigger_error(mysql_error(df_db()), E_USER_ERROR);\n\t\t\texit;\n\t\t}\n\t}\n\n}", "public function json_primary_key($table_name){\n\t\tif( in_array( $table_name, array_keys(Model_Kiwi::$kiwi_pk_hash))){\n\t\t\treturn Model_Kiwi::$kiwi_pk_hash[ $table_name ];\n\t\t}\n\t\treturn Model_Kiwi::singularize($table_name) . '_id';\n\t}", "public function addPrimaryKey($tableName, $schemaName, $index){ }", "public function getTableKeyName()\r\n\t{\r\n\t\treturn \"id\".$this->getTableName();\r\n\t}", "function createTable(){\n \n $conn = $this->connect();\n \n $sql = 'CREATE TABLE IF NOT EXISTS ' . $this->dbtable . \n\t\t\t\t\t'( codigo INTEGER NOT NULL AUTO_INCREMENT, email VARCHAR(100), CONSTRAINT pk_' . $this->dbtable . \n\t\t\t\t\t' PRIMARY KEY (codigo)) ENGINE=INNODB CHARSET=utf8';\n $ret = mysql_query( $sql, $conn);\n mysql_close( $conn );\n\t\t\treturn $ret;\n }", "function create_table($table_name, $field_name, $field_type, $field_length){\n // $sql_chk = db::query(\"SELECT COUNT(*) AS TOTAL FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_CATALOG='\".strtoupper(db::$_dbName).\"' AND TABLE_NAME = '\".$table_name.\"'\");\n // $rec_chk = db::fetch_array($sql_chk);\n // if($rec_chk['TOTAL'] > 0)\n // {\n // echo \"<script>alert('ตาราง \".$table_name.\" ถูกใช้งานแล้ว กรุณาตรวจสอบ'); window.location.href='\".$_SERVER['HTTP_REFERER'].\"';</script>\";\n // db::db_close();\n // exit;\n // }\n\n $field_length = $field_length == \"\" ? \"\" : \"(\".$field_length.\")\";\n\n $sql_create = \" CREATE TABLE [dbo].[\".$table_name.\"]([\".$field_name.\"] \".$field_type.\" \".$field_length.\" NOT NULL, PRIMARY KEY ([\".$field_name.\"]))\";\n\n }", "public function createSchemaTable();", "function createTable($table_name, $columns_array)\n{\n // $table_name = 'zoho_contact_information_v1';\n $drop_table = \"DROP TABLE IF EXISTS $table_name\";\n execute_sql($drop_table);\n $table = \"CREATE TABLE `$table_name` (\";\n $table .= 'id int NOT NULL PRIMARY KEY AUTO_INCREMENT,';\n\n foreach ($columns_array as $column) {\n $column = str_replace(' ', '__', $column);\n $table .= $column . ' varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,';\n }\n\n $table = trim($table, ',');\n $table .= ') ENGINE=InnoDB DEFAULT CHARSET=utf8;';\n\n execute_sql($table);\n}", "function pk_key() {\r\n\t\t$c = 0;\r\n\t\tfor($i = 0; $i < count ( $this->fields ); $i ++) {\r\n\t\t\tif ($this->fields [$i] ['PK'] == 'yes') {\r\n\t\t\t\t$pk_key [$c] = $this->fields [$i] ['VAR'];\r\n\t\t\t\t$c ++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $pk_key;\r\n\t}", "function getPKType($table)\n{\n $field_list = getTableFields($table);\n foreach($field_list as $f) {\n if ($f['Key' == 'PRI']) {\n return $f['Type'];\n }\n }\n return \"\";\n}", "protected function createTechnicalPrimaryColumn($table) {\n if (!$this->fieldExists($table, $this->TECHNICAL_PK_COLUMN_NAME)) {\n $this->connection->query(\"ALTER TABLE {{$table}} ADD {$this->TECHNICAL_PK_COLUMN_NAME} UNIQUEIDENTIFIER DEFAULT NEWID() NOT NULL\");\n }\n }", "function mscaffolding_create_table($name, $data)\n\t{\n\t\t$query_string = \"CREATE TABLE `\" . lconf_get(\"db_name\") . \"`.`\" . $name . \"` (`id` INT NOT NULL AUTO_INCREMENT,\";\n\n\t\tfor ($i = 0; $i < count($data) / 2; $i++)\n\t\t{\n\t\t\t$query_string .= \"`\" . $data[\"name\" . $i] . \"`\" . mscaffolding_get_type($data[\"type\" . $i]);\n\t\t}\n\n\t\t$query_string .= \" PRIMARY KEY ( `id` )) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_slovenian_ci\";\n\n\t\treturn ldb_query($query_string);\n\t}", "function createTable($objSchema);", "public function create_table() {\n\n\t\tglobal $wpdb;\n\n\t\t$table_name \t = $this->table_name;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\n\t\t$query = \"CREATE TABLE {$table_name} (\n\t\t\tid bigint(10) NOT NULL AUTO_INCREMENT,\n\t\t\tname text NOT NULL,\n\t\t\tdate_created datetime NOT NULL,\n\t\t\tdate_modified datetime NOT NULL,\n\t\t\tstatus text NOT NULL,\n\t\t\tical_hash text NOT NULL,\n\t\t\tPRIMARY KEY id (id)\n\t\t) {$charset_collate};\";\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\tdbDelta( $query );\n\n\t}", "private function _fetch_table_primary_key()\n {\n if ($this->primary_key == null) {\n $this->primary_key = preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this))) . '_id';\n }\n }", "private function _fetch_table_primary_key()\n {\n if ($this->primary_key == null) {\n $this->primary_key = preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this))) . '_id';\n }\n }", "function get_pk($args)\n {\n return $this->_pk[$args['table']];\n }", "private function createTechnicalPrimaryKeyIndexSql($table) {\n $result = [];\n $result[] = \"{$this->TECHNICAL_PK_COLUMN_NAME} UNIQUEIDENTIFIER DEFAULT NEWID() NOT NULL\";\n $result[] = \"CONSTRAINT {{$table}}_pkey_technical PRIMARY KEY CLUSTERED ({$this->TECHNICAL_PK_COLUMN_NAME})\";\n return implode(' ', $result);\n }", "protected function findPrimaryKeys($table)\n\t{\n\t\t$pks=$this->getDbConnection()->getPdoInstance()->cubrid_schema(PDO::CUBRID_SCH_PRIMARY_KEY,$table->name);\n\n\t\tforeach($pks as $pk)\n\t\t{\n\t\t\t$c = $table->columns[$pk['ATTR_NAME']];\n\t\t\t$c->isPrimaryKey = true;\n\n\t\t\tif($table->primaryKey===null)\n\t\t\t\t$table->primaryKey=$c->name;\n\t\t\telseif(is_string($table->primaryKey))\n\t\t\t\t$table->primaryKey=array($table->primaryKey,$c->name);\n\t\t\telse\n\t\t\t\t$table->primaryKey[]=$c->name;\n\t\t\tif($c->autoIncrement)\n\t\t\t\t$table->sequenceName='';\n\t\t}\n\t}", "public function addPrimaryKeyColumns( $value){\n return $this->_add(4, $value);\n }", "function maybe_create_table($table_name, $create_ddl)\n {\n }", "function GetPK($table) {\n $this->query = \"SELECT PK FROM metatabla WHERE lower(Nombre)='\".strtolower($table).\"'\";\n\n $this->consulta($this->query);\n if ($this->num_rows() > 0) { \n $this->rs01 = $this->fetch_row();\n $pk = $this->rs01[0];\n $this->cerrarConsulta();\n return $pk;\n }else{\n return false;\n }\t\n\t}", "private function pk_column(){\n\t\tif( in_array(static::$table_name, Model_Kiwi::$composite_key_tables) ){\n\t\t\treturn \"composite_key\";\n\t\t}\n\t\t//if the primary key of the table has been defined in config - return that else use convention\n\t\tif( in_array( static::$table_name, array_keys(Model_Kiwi::$kiwi_pk_hash))){\n\t\t\treturn Model_Kiwi::$kiwi_pk_hash[ static::$table_name ];\n\t\t}\n\t\treturn Model_Kiwi::singularize(static::$table_name) . '_id';\n\t}", "function db_drop_primary_key(&$ret, $table) {\n $ret[] = update_sql('ALTER TABLE {'. $table .'} DROP PRIMARY KEY');\n}", "public function create($table_name, $table_field_name_with_value) {\n $result = $this->db->insert($table_name, $table_field_name_with_value);\n if (!$result) {\n return 0;\n } else {\n return $this->db->insert_id();\n }\n }", "private function createNewTable() {\n //generate the create table statement\n $sql = \"create table $this->tableName(\";\n $comma = \"\";\n $keyNameList = [];\n foreach ($this->columns as $column /* @var $column DbColumn */) {\n $sql .= \" $comma $column->columnName $column->dataType $column->extraStuff\";\n $comma = \",\";\n if ($column->primaryKey === true) {\n $keyNameList[] = $column->columnName;\n }\n }\n //generate the primary key list, if any are present\n $primaryKeySql = \"\";\n if (count($keyNameList) > 0) {\n $primaryKeySql = \"primary key(\";\n $comma = \"\";\n foreach ($keyNameList as $keyName) {\n $primaryKeySql = \"$primaryKeySql $comma $keyName\";\n $comma = \",\";\n }\n $primaryKeySql = \",$primaryKeySql)\";\n }\n\n //constraints\n $cSql = \"\";\n //we are assuming that there is at least one table. otherwise, the query would fail anyway.\n $comma = \",\";\n foreach ($this->constraints as $c) {\n $cSql .= \" $comma\";\n switch ($c->constraintType) {\n case \"foreign key\":\n $cSql .= \" FOREIGN KEY($c->columnName) REFERENCES $c->referencesTableName($c->referencesColumnName)\";\n break;\n }\n }\n $sql = \"$sql $primaryKeySql $cSql)\";\n return DbManager::nonQuery($sql);\n }", "public function getPrimaryKey($value = FALSE) {\n\t\t$pK = self::$primaryKey[$this->table];\n\t\tif ($value)\t\n\t\t\treturn $this->$pK;\n\t\treturn $pK;\n\t}", "public function pkName()\r\n {\r\n $schema = $this->schema();\r\n foreach($schema as $col){\r\n if( $col['PRIMARY'] === true )\r\n return $col['FIELD'];\r\n }\r\n throw new \\Exception( __CLASS__ .\" Error: could not find Primary Key for table: \" . $this->table->name() ); \r\n }", "function get_table_def($db, $table, $crlf) {\n global $drop, $RAD_dbi;\n\n $schema_create = \"\";\n if(!empty($drop))\n $schema_create .= \"DROP TABLE IF EXISTS $table;$crlf\";\n $schema_create .= \"CREATE TABLE $table ($crlf\";\n if (strtolower(_DEF_dbtype)==\"oracle\") $res=sql_query(\"select COLUMN_NAME,DATA_TYPE,DATA_LENGTH,DATA_DEFAULT from all_tab_columns where table_name='\".$table.\"' order by column_id\", $RAD_dbi);\n else $res=sql_query(\"SHOW FIELDS FROM \".$table, $RAD_dbi);\n $num_fields=0;\n while($row = sql_fetch_array($res, $RAD_dbi)) {\n\tif ($row[\"COLUMN_NAME\"]==$A_fields[($num_fields-1)]) continue;\n\tif ($row[\"COLUMN_NAME\"]!=\"\") $row[\"Field\"]=$row[\"COLUMN_NAME\"];\n\tif ($row[\"DATA_TYPE\"]!=\"\") $row[\"Type\"]=$row[\"DATA_TYPE\"];\n\tif ($row[\"DATA_LENGTH\"]!=\"\") $row[\"Length\"]=$row[\"DATA_LENGTH\"];\n\tif ($row[\"DATA_DEFAULT\"]!=\"\") $row[\"Default\"]=$row[\"DATA_DEFAULT\"];\n\t$A_fields[$num_fields]=$row[\"Field\"];\n\t$num_fields++;\n $schema_create .= \" $row[Field] $row[Type]\";\n if(isset($row[\"Default\"]) && (!empty($row[\"Default\"]) || $row[\"Default\"] == \"0\"))\n $schema_create .= \" DEFAULT '$row[Default]'\";\n if($row[\"Null\"] != \"YES\")\n $schema_create .= \" NOT NULL\";\n if($row[\"Extra\"] != \"\")\n $schema_create .= \" $row[Extra]\";\n $schema_create .= \",$crlf\";\n }\n $schema_create = ereg_replace(\",\".$crlf.\"$\", \"\", $schema_create);\n $result = sql_query(\"SHOW KEYS FROM $table\", $RAD_dbi);\n while($row = sql_fetch_array($result, $RAD_dbi))\n {\n $kname=$row['Key_name'];\n if(($kname != \"PRIMARY\") && ($row['Non_unique'] == 0))\n $kname=\"UNIQUE|$kname\";\n if(!isset($index[$kname]))\n $index[$kname] = array();\n $index[$kname][] = $row['Column_name'];\n }\n\n while(list($x, $columns) = @each($index))\n {\n $schema_create .= \",$crlf\";\n if($x == \"PRIMARY\")\n $schema_create .= \" PRIMARY KEY (\" . implode($columns, \", \") . \")\";\n elseif (substr($x,0,6) == \"UNIQUE\")\n $schema_create .= \" UNIQUE \".substr($x,7).\" (\" . implode($columns, \", \") . \")\";\n else\n $schema_create .= \" KEY $x (\" . implode($columns, \", \") . \")\";\n }\n\n $schema_create .= \"$crlf)\";\n return (stripslashes($schema_create));\n}", "public function create_table($tablename, $vararray) {\n try {\n $str = \"SET AUTOCOMMIT = 0;\\n\";\n $str .= \"START TRANSACTION;\\n\";\n $str .= \"CREATE TABLE `\".$tablename.\"` (\\n\" ;\n $str .= \"\t`id` int(11) NOT NULL,\\n\";\n foreach($vararray as $row) {\n if ($row['name'] == \"id\" || $row['name'] == \"status\") {\n $row['name'] = $tablename.\"_\".$row['name']; // change name\n }\n $str .= \"\t`\".$row['name'].\"` \".$row['type'];\n if ($row['notnull']) $str .= \" NOT NULL\";\n if ($row['default']) $str .= \" DEFAULT '\".$row['default'].\"'\";\n $str .= \",\\n\";\n }\n $str .= \"\t`status` enum('INACTIVE','LOCKED','ACTIVE') NOT NULL DEFAULT 'INACTIVE'\\n\";\n $str .= \") ENGINE=INNODB;\\n\";\n $str .= \"ALTER TABLE `\".$tablename.\"`\\n\";\n $str .= \"\tADD PRIMARY KEY (`id`);\\n\";\n $str .= \"ALTER TABLE `\".$tablename.\"`\\n\";\n $str .= \"\tMODIFY `id` int(11) NOT NULL AUTO_INCREMENT;\\n\";\n $str .= \"COMMIT;\\n\";\n //echo $str.\"<br>\";\n $result = $this->conn->query($str);\n } catch (PDOException $e) {\n die(\"DB ERROR: \".$e->getMessage());\n }\n }", "protected function findPrimaryKey($table)\n {\n $kcu = 'INFORMATION_SCHEMA.KEY_COLUMN_USAGE';\n $tc = 'INFORMATION_SCHEMA.TABLE_CONSTRAINTS';\n if (isset($table->catalogName)) {\n $kcu = $table->catalogName . '.' . $kcu;\n $tc = $table->catalogName . '.' . $tc;\n }\n\n $sql = <<<EOD\n\t\tSELECT k.column_name field_name\n\t\t\tFROM {$this->quoteTableName($kcu)} k\n\t\t LEFT JOIN {$this->quoteTableName($tc)} c\n\t\t ON k.table_name = c.table_name\n\t\t AND k.constraint_name = c.constraint_name\n\t\t WHERE c.constraint_type ='PRIMARY KEY'\n\t\t \t AND k.table_name = :table\n\t\t\t\tAND k.table_schema = :schema\nEOD;\n $primary =\n $this->selectColumn($sql, [':table' => $table->tableName, ':schema' => $table->schemaName]);\n switch (count($primary)) {\n case 0: // No primary key on table\n $primary = null;\n break;\n case 1: // Only 1 primary key\n $primary = $primary[0];\n $cnk = strtolower($primary);\n if (isset($table->columns[$cnk])) {\n $table->columns[$cnk]->isPrimaryKey = true;\n if ((ColumnSchema::TYPE_INTEGER === $table->columns[$cnk]->type) &&\n $table->columns[$cnk]->autoIncrement\n ) {\n $table->columns[$cnk]->type = ColumnSchema::TYPE_ID;\n }\n }\n break;\n default:\n if (is_array($primary)) {\n foreach ($primary as $key) {\n $cnk = strtolower($key);\n if (isset($table->columns[$cnk])) {\n $table->columns[$cnk]->isPrimaryKey = true;\n }\n }\n }\n break;\n }\n $table->primaryKey = $primary;\n }", "public static function create_table($name = NULL)\n\t{\n\t\treturn new Database_SQLite_DDL_Create_Table($name);\n\t}", "function setObjectTablePK($a_column_name)\n\t{\n\t\tif (!isset($a_column_name))\n\t\t{\n\t\t\t$this->ilErr->raiseError(get_class($this).\"::setObjectTablePK(): No column name given!\",$this->ilErr->WARNING);\n\t\t}\n\n\t\t$this->obj_pk = $a_column_name;\n\t\treturn true;\n\t}", "private function createDummyTable() {}", "protected function createTable() {\n\t\t$query = \"\n\t\tCREATE TABLE `items` (\n\t\t\t`id`\tINTEGER,\n\t\t\t`firstName`\tTEXT,\n\t\t\t`lastName`\tTEXT,\n\t\t\t`address`\tTEXT,\n\t\t\t'occupation' TEXT,\n\t\t\tPRIMARY KEY(`id`)\n\t\t);\n\t\t\";\n\t\t$this->PDO->query($query);\n\t}", "function db_createAuthTable()\n{\n db_run(\"DROP TABLE IF EXISTS \" . TBL_AUTH);\n\n db_run(\"CREATE TABLE \" . TBL_AUTH .\n \"(auth_id varchar(128) primary key,\n userid int,\n index userid_index (userid))\");\n}", "protected function addPrimaryKey(Table $table)\n {\n $stmt = $this->dbh->query(\"SHOW KEYS FROM `\" . $table->getName() . \"`\");\n\n // Loop through the returned results, grouping the same key_name together\n // adding each column for that key.\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n // Skip any non-primary keys.\n if ($row['Key_name'] !== 'PRIMARY') {\n continue;\n }\n $name = $row[\"Column_name\"];\n $table->getColumn($name)->setPrimaryKey(true);\n }\n }", "function createTable($ctx){\r\n\t\t$create =\r\n 'CREATE TABLE IF NOT EXISTS `'.$ctx.'` ('.\r\n '`key` VARCHAR( 60 ) NOT NULL ,'.\r\n '`willExpireAt` int NOT NULL DEFAULT 0 ,'.\r\n\t\t'`lastModified` int NOT NULL DEFAULT 0, '.\r\n '`content` TEXT NULL ,PRIMARY KEY ( `key` ));';\r\n\r\n\t\tif(strlen($this->stm['before_create']) > 0 ){\r\n\t\t\t$this->db->Execute($this->stm['before_create'], array()) or die();\r\n\t\t}\r\n\t\t$dict = NewDataDictionary($this->db);\r\n\t\t$x = $dict->ExecuteSQLArray(array($create)) or die();\r\n\t\treturn $x;\r\n\t}", "function setup_table($app,$table,$colum_prefix='')\n\t{\n\t\t$this->table_name = $table;\n\t\t$this->table_def = $this->db->get_table_definitions($app,$table);\n\t\tif (!$this->table_def || !is_array($this->table_def['fd']))\n\t\t{\n\t\t\tthrow new egw_exception_wrong_parameter(__METHOD__.\"('$app','$table'): No table definition for '$table' found !!!\");\n\t\t}\n\t\t$this->db_key_cols = $this->db_data_cols = $this->db_cols = array();\n\t\t$this->autoinc_id = '';\n\t\t$len_prefix = strlen($colum_prefix);\n\t\tforeach($this->table_def['fd'] as $col => $def)\n\t\t{\n\t\t\t$name = $col;\n\t\t\tif ($len_prefix && substr($name,0,$len_prefix) == $colum_prefix)\n\t\t\t{\n\t\t\t\t$name = substr($col,$len_prefix);\n\t\t\t}\n\t\t\tif (in_array($col,$this->table_def['pk']))\n\t\t\t{\n\t\t\t\t$this->db_key_cols[$col] = $name;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db_data_cols[$col] = $name;\n\t\t\t}\n\t\t\t$this->db_cols[$col] = $name;\n\n\t\t\tif ($def['type'] == 'auto')\n\t\t\t{\n\t\t\t\t$this->autoinc_id = $col;\n\t\t\t}\n\t\t\tif ($def['type'] == 'bool') $this->has_bools = true;\n\n\t\t\tforeach($this->table_def['uc'] as $k => $uni_index)\n\t\t\t{\n\t\t\t\tif (is_array($uni_index) && in_array($name,$uni_index))\n\t\t\t\t{\n\t\t\t\t\t$this->db_uni_cols[$k][$col] = $name;\n\t\t\t\t}\n\t\t\t\telseif($name === $uni_index)\n\t\t\t\t{\n\t\t\t\t\t$this->db_uni_cols[$col] = $name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "abstract protected function loadTablePrimaryKey(string $tableName): ?Constraint;", "public function createTable()\n\t{\n\t\tphpCAS::traceBegin();\n\n\t\t// initialize the PDO object for this method\n\t\t$pdo = $this->getPdo();\n\t\t$this->setErrorMode();\n\n\t\ttry {\n\t\t\t$pdo->beginTransaction();\n\n\t\t\t$query = $pdo->query($this->_createTableSQL());\n\t\t\t$query->closeCursor();\n\n\t\t\t$pdo->commit();\n\t\t}\n\t\tcatch(PDOException $e) {\n\t\t\t// attempt rolling back the transaction before throwing a phpCAS error\n\t\t\ttry {\n\t\t\t\t$pdo->rollBack();\n\t\t\t}\n\t\t\tcatch(PDOException $e) {}\n\t\t\tphpCAS::error('error creating PGT storage table: ' . $e->getMessage());\n\t\t}\n\n\t\t// reset the PDO object\n\t\t$this->resetErrorMode();\n\n\t\tphpCAS::traceEnd();\n\t}", "protected function createTable() {\n $this->db->initializeQuery();\n $query = \"\nCREATE TABLE `items` (\n`id`INTEGER,\n`name`TEXT,\n`price`REAL,\nPRIMARY KEY(`id`)\n);\n\";\n\n $r = $this->db->q->Expr($query)->execute($this->db->c);\n \n }", "private function createPrimaryKey($table, $fields, $limit = 900) {\n // To be on the safe side, on the most restrictive use case the limit\n // for a primary key clustered index is of 128 bytes (usually 900).\n // @see http://blogs.msdn.com/b/jgalla/archive/2005/08/18/453189.aspx\n // If that is going to be exceeded, use a computed column.\n $csv_fields = $this->createKeySql($fields);\n $size = $this->calculateClusteredIndexRowSizeBytes($table, $this->createKeySql($fields, TRUE));\n $result = [];\n $index = FALSE;\n // Add support for nullable columns in a primary key.\n $nullable = FALSE;\n $field_specs = $this->loadFieldsSpec($fields, $table);\n foreach ($field_specs as $field) {\n if ($field['is_nullable'] == TRUE) {\n $nullable = TRUE;\n break;\n }\n }\n\n if ($nullable || $size >= $limit) {\n // Use a computed column instead, and create a custom index.\n $result[] = \"{$this->COMPUTED_PK_COLUMN_NAME} AS (CONVERT(VARCHAR(32), HASHBYTES('MD5', CONCAT('',{$csv_fields})), 2)) PERSISTED NOT NULL\";\n $result[] = \"CONSTRAINT {{$table}}_pkey PRIMARY KEY CLUSTERED ({$this->COMPUTED_PK_COLUMN_NAME})\";\n $index = TRUE;\n }\n else {\n $result[] = \"CONSTRAINT {{$table}}_pkey PRIMARY KEY CLUSTERED ({$csv_fields})\";\n }\n\n $this->connection->query_direct('ALTER TABLE [{' . $table . '}] ADD ' . implode(' ', $result));\n\n // If we relied on a computed column for the Primary Key,\n // at least index the fields with a regular index.\n if ($index) {\n $this->addIndex($table, $this->COMPUTED_PK_COLUMN_INDEX, $fields);\n }\n\n // Invalidate current introspection.\n $this->queryColumnInformationInvalidate($table);\n }", "public function testPrimaryKeyConstraints()\n {\n $xml = '<table name=\"test\"><constraints>\n <primary-key name=\"asset_type_pk\">\n <column>type_code</column>\n </primary-key>\n </constraints></table>';\n\n $queryXml = new DOMDocument();\n $queryXml->loadXML($xml);\n $table = $queryXml->getElementsByTagName('table')->item(0);\n $expected = array(\n 'PRIMARY-KEYS' => array(\n 0 => array(\n 'name' => 'asset_type_pk',\n 'COLUMNS' => array(\n 0 => 'type_code',\n ),\n ),\n ),\n );\n\n $retVal = DALSchemaParser::getTableConstraints($table);\n\n PHPUnit_Framework_Assert::assertEquals($expected, $retVal);\n\n }", "function getPrimary(string $table);", "public function create_table()\n {\n $sql = \"CREATE TABLE IF NOT EXISTS `whollycoders`.`table_contacts_171005_1207` (\n `contact_ID` INT NOT NULL AUTO_INCREMENT , \n `contact_firstname` VARCHAR(50) NOT NULL , \n `contact_lastname` VARCHAR(50) NOT NULL , \n `contact_phone` VARCHAR(20) NOT NULL , \n `contact_email` VARCHAR(100) NOT NULL , \n `contact_date_added` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP , \n PRIMARY KEY (`contact_ID`)\n ) ENGINE = InnoDB;\";\n $result = $this->process_query($sql);\n }", "public static function create_table( $table_name ) {\n\t\tglobal $wpdb;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\n\t\t/* Create the database table */\n\t\t$sql = \"CREATE TABLE $table_name (\n\t\t\t\tid BIGINT(20) NOT NULL AUTO_INCREMENT,\n\t\t\t\tname TINYTEXT NOT NULL DEFAULT '',\n\t\t\t\tdescription TEXT NOT NULL DEFAULT '',\n\t\t\t\tcode LONGTEXT NOT NULL DEFAULT '',\n\t\t\t\ttags LONGTEXT NOT NULL DEFAULT '',\n\t\t\t\tscope VARCHAR(15) NOT NULL DEFAULT 'global',\n\t\t\t\tpriority SMALLINT NOT NULL DEFAULT 10,\n\t\t\t\tactive TINYINT(1) NOT NULL DEFAULT 0,\n\t\t\t\tmodified DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\tPRIMARY KEY (id),\n\t\t\t\tKEY scope (scope),\n\t\t\t\tKEY active (active)\n\t\t\t) $charset_collate;\";\n\n\t\trequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\t\tdbDelta( $sql );\n\n\t\t$success = empty( $wpdb->last_error );\n\n\t\tif ( $success ) {\n\t\t\tdo_action( 'code_snippets/create_table', $table_name );\n\t\t}\n\n\t\treturn $success;\n\t}", "private function _createTable() {\n $query = \"\n CREATE TABLE `seo_metadata` (\n `metadata_id` int(11) NOT NULL auto_increment,\n `seo_id` char(60) NOT NULL,\n `seo_title` varchar(255) NOT NULL,\n `seo_description` varchar(255) NOT NULL,\n `seo_keyword` varchar(255) NOT NULL,\n PRIMARY KEY (`metadata_id`),\n KEY `id_idx` (`id`)\n )\";\n $this->getAdapter()->query( $query );\n }", "function getPrimary($table);", "public function createTable(){\n\t\t\t\n\t\t$sql = \"CREATE TABLE IF NOT EXISTS `biblio_entries_inbook` (\n\t\t`id_publi` int(11) NOT NULL AUTO_INCREMENT,\t\n\t\t`chapter` varchar(150) NOT NULL,\n\t\t`pages` varchar(15) NOT NULL,\t\t\t\t\n\t\t`publisher` int(11) NOT NULL,\n\t\t`volume` int(11) NOT NULL,\t\t\n\t\t`series` varchar(20) NOT NULL,\n\t\t`address` varchar(50) NOT NULL,\n\t\t`edition` varchar(50) NOT NULL,\t\t\t\t\t\t\n\t\tPRIMARY KEY (`id_publi`)\n\t\t);\";\n\t\t$pdo = $this->runRequest($sql);\n\t\treturn $pdo;\n\t}", "public function createTable(){\nreturn $this->pdo->exec(\n\"CREATE TABLE `sottocategoria` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `codice_categoria` varchar(3) NOT NULL,\n `codice` varchar(3) NOT NULL,\n `descrizione` varchar(80) DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `index_codice_cat` (`codice_categoria`),\n KEY `index_codice` (`codice`),\n CONSTRAINT `fk_categoriasottocategoria_1` FOREIGN KEY (`codice_categoria`) REFERENCES `categoria` (`codice`) ON DELETE NO ACTION ON UPDATE NO ACTION\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\"\n);\n}", "function extractPrimaryKey($_sTable) {\n $_sTable = trim($_sTable);\n if(strpos($_sTable, '_') === FALSE) {\n return 'n'.ucfirst(substr($_sTable, 0, 3)).'Id';\n } else {\n return 'n'.ucfirst(substr($_sTable, 0, 2)).strtoupper($_sTable{strpos($_sTable, '_') + 1}).'Id';\n }\n}", "function wb_create_users_table($con)\n{\n\t$query = 'CREATE TABLE IF NOT EXISTS users\n\t(\n\t\tuser_id SERIAL,\n\t\tPRIMARY KEY(user_id),\n\t\tUvaNetID VARCHAR(50) NOT NULL UNIQUE,\n\t\tname VARCHAR(50)\n\t) ENGINE=InnoDB';\n\t\n\twb_query($query, $con);\n}", "public function create_table() {\n\n\t\tglobal $wpdb;\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\n\t\tif ( $wpdb->get_var( \"SHOW TABLES LIKE '$this->table_name'\" ) == $this->table_name ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$sql = \"CREATE TABLE \" . $this->table_name . \" (\n\t\tid bigint(20) NOT NULL AUTO_INCREMENT,\n\t\tuser_id bigint(20) NOT NULL,\n\t\tusername varchar(50) NOT NULL,\n\t\temail varchar(50) NOT NULL,\n\t\tname mediumtext NOT NULL,\n\t\tproduct_count bigint(20) NOT NULL,\n\t\tsales_value mediumtext NOT NULL,\n\t\tsales_count bigint(20) NOT NULL,\n\t\tstatus mediumtext NOT NULL,\n\t\tnotes longtext NOT NULL,\n\t\tdate_created datetime NOT NULL,\n\t\tPRIMARY KEY (id),\n\t\tUNIQUE KEY email (email),\n\t\tKEY user (user_id)\n\t\t) CHARACTER SET utf8 COLLATE utf8_general_ci;\";\n\n\t\tdbDelta( $sql );\n\n\t\tupdate_option( $this->table_name . '_db_version', $this->version );\n\t}", "public function createTable($table, array $fields = array(), $pkFields = array(), $fkFields = array(), $execute = true) {\r\n\t\tif (is_string($pkFields) && !empty($pkFields)) {\r\n\t\t\t$pkFields = array($pkFields);\r\n\t\t}\r\n\r\n\t\t$dbtype = $this->getDbtype();\r\n\r\n\t\t$fields = $this->guessTypes($fields, $pkFields);\r\n\r\n\t\tif ($dbtype != 'sqlite' && empty($pkFields) && isset($fields['id'])) {\r\n\t\t\t$pkFields[] = 'id';\r\n\t\t}\r\n\r\n\t\tif (self::isReservedName($table)) {\r\n\t\t\tthrow new Exception($table . ' is a reserved name');\r\n\t\t}\r\n\t\tforeach ($fields as $field => $value) {\r\n\t\t\tif (self::isReservedName($field)) {\r\n\t\t\t\tthrow new Exception($field . ' is a reserved name in table ' . $table);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$sql = 'CREATE TABLE IF NOT EXISTS ' . $table . \"(\\n\";\r\n\t\tforeach ($fields as $field => $type) {\r\n\t\t\t$sql .= \"\\t\" . $field . ' ' . $type . \",\\n\";\r\n\t\t}\r\n\r\n\t\t//primary key\r\n\t\tif (!($dbtype == 'sqlite' && strpos($sql, 'PRIMARY KEY') !== false)) {\r\n\t\t\tif (!empty($pkFields)) {\r\n\t\t\t\t$sql .= \"\\t\" . 'PRIMARY KEY (' . implode(',', $pkFields) . ')' . \",\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//foreign keys\r\n\t\tif (!empty($fkFields)) {\r\n\t\t\t$constraints = $this->createConstraint($table, $fkFields);\r\n\t\t\t$sql .= implode(\",\\n\", $constraints);\r\n\t\t}\r\n\r\n\t\t$sql = rtrim($sql, \",\\n\");\r\n\r\n\t\t$sql .= \"\\n);\";\r\n\r\n\t\tif ($execute) {\r\n\t\t\t$this->exec($sql);\r\n\t\t}\r\n\r\n\t\treturn $sql;\r\n\t}", "public function create_table($name, $data) {\n\t\t$this->execute($this->engine->create_table_sql($name, $data));\n\t}", "public function addPrimaryKey($name,$table,$columns)\n\t{\n\t\treturn $this->setText($this->getConnection()->getSchema()->addPrimaryKey($name,$table,$columns))->execute();\n\t}", "public function create_table($table, $definition, $index=array()){\n\t\t$create_sql = \"CREATE TABLE $table (\";\n\t\tif(!is_array($definition)){\n\t\t\tnew DbException(\"Definici&oacute;n invalida para crear la tabla '$table'\");\n\t\t\treturn false;\n\t\t}\n\t\t$create_lines = array();\n\t\t$index = array();\n\t\t$unique_index = array();\n\t\t$primary = array();\n\t\t$not_null = \"\";\n\t\t$size = \"\";\n\t\tforeach($definition as $field => $field_def){\n\t\t\tif(isset($field_def['not_null'])){\n\t\t\t\t$not_null = $field_def['not_null'] ? 'NOT NULL' : '';\n\t\t\t} else {\n\t\t\t\t$not_null = \"\";\n\t\t\t}\n\t\t\tif(isset($field_def['size'])){\n\t\t\t\t$size = $field_def['size'] ? '('.$field_def['size'].')' : '';\n\t\t\t} else {\n\t\t\t\t$size = \"\";\n\t\t\t}\n\t\t\tif(isset($field_def['index'])){\n\t\t\t\tif($field_def['index']){\n\t\t\t\t\t$index[] = \"INDEX($field)\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($field_def['unique_index'])){\n\t\t\t\tif($field_def['unique_index']){\n\t\t\t\t\t$index[] = \"UNIQUE($field)\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($field_def['primary'])){\n\t\t\t\tif($field_def['primary']){\n\t\t\t\t\t$primary[] = \"$field\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($field_def['auto'])){\n\t\t\t\tif($field_def['auto']){\n\t\t\t\t\t$field_def['type'] = \"SERIAL\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($field_def['extra'])){\n\t\t\t\t$extra = $field_def['extra'];\n\t\t\t} else {\n\t\t\t\t$extra = \"\";\n\t\t\t}\n\t\t\t$create_lines[] = \"$field \".$field_def['type'].$size.' '.$not_null.' '.$extra;\n\t\t}\n\t\t$create_sql.= join(',', $create_lines);\n\t\t$last_lines = array();\n\t\tif(count($primary)){\n\t\t\t$last_lines[] = 'PRIMARY KEY('.join(\",\", $primary).')';\n\t\t}\n\t\tif(count($index)){\n\t\t\t$last_lines[] = join(',', $index);\n\t\t}\n\t\tif(count($unique_index)){\n\t\t\t$last_lines[] = join(',', $unique_index);\n\t\t}\n\t\tif(count($last_lines)){\n\t\t\t$create_sql.= ','.join(',', $last_lines).')';\n\t\t}\n\t\treturn $this->query($create_sql);\n\n\t}", "private function checkOrCreateTable(){\n $this->pdo->query(\"CREATE TABLE IF NOT EXISTS k_UserDean(wp_id BIGINT UNSIGNED PRIMARY KEY, dean_id BIGINT UNSIGNED);\");\n }", "public function create_table($table, $definition, $index=array()){\n\t\t$create_sql = \"CREATE TABLE $table (\";\n\t\tif(!is_array($definition)){\n\t\t\tnew DbException(\"Definici&oacute;n invalida para crear la tabla '$table'\");\n\t\t\treturn false;\n\t\t}\n\t\t$create_lines = array();\n\t\t$index = array();\n\t\t$unique_index = array();\n\t\t$primary = array();\n\t\t$not_null = \"\";\n\t\t$size = \"\";\n\t\tforeach($definition as $field => $field_def){\n\t\t\tif(isset($field_def['not_null'])){\n\t\t\t\t$not_null = $field_def['not_null'] ? 'NOT NULL' : '';\n\t\t\t} else {\n\t\t\t\t$not_null = \"\";\n\t\t\t}\n\t\t\tif(isset($field_def['size'])){\n\t\t\t\t$size = $field_def['size'] ? '('.$field_def['size'].')' : '';\n\t\t\t} else {\n\t\t\t\t$size = \"\";\n\t\t\t}\n\t\t\tif(isset($field_def['index'])){\n\t\t\t\tif($field_def['index']){\n\t\t\t\t\t$index[] = \"INDEX($field)\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($field_def['unique_index'])){\n\t\t\t\tif($field_def['unique_index']){\n\t\t\t\t\t$index[] = \"UNIQUE($field)\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($field_def['primary'])){\n\t\t\t\tif($field_def['primary']){\n\t\t\t\t\t$primary[] = \"$field\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($field_def['auto'])){\n\t\t\t\tif($field_def['auto']){\n\t\t\t\t\t$gen = $this->fetch_one(\"SELECT COUNT(*) FROM RDB\\$GENERATORS WHERE RDB\\$GENERATOR_NAME = UPPER('{$table}_{$field}_seq')\");\n\t\t\t\t\tif(!$gen[0]){\n\t\t\t\t\t\t$this->query(\"INSERT INTO RDB\\$GENERATORS (RDB\\$GENERATOR_NAME) VALUES (UPPER('{$table}_{$field}_seq'))\");\n\t\t\t\t\t}\n\t\t\t\t\t$this->query(\"SET GENERATOR {$table}_{$field}_seq TO 1;\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($field_def['extra'])){\n\t\t\t\t$extra = $field_def['extra'];\n\t\t\t} else {\n\t\t\t\t$extra = \"\";\n\t\t\t}\n\t\t\t$create_lines[] = \"$field \".$field_def['type'].$size.' '.$not_null.' '.$extra;\n\t\t}\n\t\t$create_sql.= join(',', $create_lines);\n\t\t$last_lines = array();\n\t\tif(count($primary)){\n\t\t\t$last_lines[] = 'PRIMARY KEY('.join(\",\", $primary).')';\n\t\t}\n\t\tif(count($index)){\n\t\t\t$last_lines[] = join(',', $index);\n\t\t}\n\t\tif(count($unique_index)){\n\t\t\t$last_lines[] = join(',', $unique_index);\n\t\t}\n\t\tif(count($last_lines)){\n\t\t\t$create_sql.= ','.join(',', $last_lines).')';\n\t\t}\n\t\treturn $this->query($create_sql);\n\n\t}", "public static function getTableName()\n\t{\n\t\treturn 'b_documentgenerator_template_provider';\n\t}", "function CreateTable($tableName, $tableDefinition)\n{\n $stmt = SQL_CREATE_TABLE . \" IF NOT EXISTS $tableName ($tableDefinition);\";\n return mysql_query($stmt);\n}", "public function primaryKeyForTable(Table $table)\n {\n // Execute the query directly\n $result = $this->client->query(\"SHOW KEYS FROM $table->name WHERE Key_name = 'PRIMARY'\");\n\n // If no results are returned, return null\n if ($result === false) {\n return;\n }\n\n // Fetch the query results\n $data = $result->fetch_assoc();\n\n // Return the field name\n return $data['Column_name'];\n }", "function getPrimKey($fk1, $fk2, $pkCol, $fk1Col, $fk2Col, $table)\n\t{\n\t\t//intialize variable\n\t\t$pkId\t= 0;\n\t\t\n\t\t//statement\n\t\t$sql\t= \"SELECT \".$pkCol.\" FROM \".$table. \n\t\t\t\t \" WHERE \".$fk1Col.\"='\".$fk1.\"' \n\t\t\t\t AND \".$fk2Col.\"='\".$fk2.\"'\";\n\t\t\n\t\t$query\t= mysql_query($sql);\n\t\t\n\t\t\n\t\tif(mysql_num_rows($query) > 0)\n\t\t{\t\n\t\t\twhile($result = mysql_fetch_object($query))\n\t\t\t{\n\t\t\t\t$pkId\t= $result->$pkCol;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//return\n\t\treturn $pkId;\n\t\t\n\t}", "protected function getCreateTableSQL($tablename) {\n\t\t$SQL='';\n\t\tforeach ($this->fieldNames as $fieldName) {\n\t\t\tif ($SQL!='') $SQL.=','.\"<br>\";\t\t\t\n\t\t\t$SQL.=$fieldName.' varchar(20)';\n\t\t}\n\t\t$SQL.=')';\n\t\t$SQL='create table '.$tablename.' ('.$SQL;\n\t\treturn $SQL;\n\n\t}", "protected function _applyKeySchema( $strTable, $strSqlVal )\n {\n }", "public static function getTableName()\n\t{\n\t\treturn 'vbch_bonus_card';\n\t}", "function createTable($name, $rows);", "public function createTable()\n\t{\n\t\t$app = Factory::getApplication();\n\n\t\tif ($app->isSite())\n\t\t{\n\t\t\techo 'Error creating DB table - Need to run this in admin area';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$user = Factory::getUser();\n\n\t\tif (!$user->authorise('core.admin'))\n\t\t{\n\t\t\techo 'Error creating DB table - You need to be superadmin user to exeacute this task';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$jinput = $app->input;\n\t\t$context = $jinput->get->get('context', '', 'cmd');\n\n\t\tif (empty($context))\n\t\t{\n\t\t\techo 'Error creating DB table - No context is passed';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$model = $this->getModel('indexer');\n\t\t$model->createTable($context);\n\t}", "public static function getTableName()\n {\n return 'pk_market_basket';\n }", "function create_ROMP_settings_Db_table(){\n\t\tob_start();\n\t\t$table_name = $this->wpdb->prefix . 'romp_settings';\n \t$charset_collate = $this->wpdb->get_charset_collate();\n\n\t\t$sql = \"CREATE TABLE $table_name (\n\t\t\t\t`romp_crm_id` TEXT NOT NULL ,\n\t\t\t\t`romp_cf_link` TEXT NOT NULL\n\t\t\t) $charset_collate;\";\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\tdbDelta( $sql );\n\t}", "public static function create($table_name, $column_data)\n {\n $query = 'CREATE TABLE IF NOT EXISTS ' .$table_name.' (';\n foreach ($column_data as $column => $type) {\n $query .= $column.' '.implode(' ', $type).', ';\n }\n $query = rtrim($query, ', ');\n $query .= ') ENGINE = INNODB;';\n Connection::getInstance()->query($query);\n }", "public function newPrimaryKey($name)\n\t{\n\t\t// TODO: More options directly in this method\n\t\t\n\t\t$pk = new Db_Descriptor_PrimaryKey();\n\t\t$pk->setColumn($name);\n\t\t\n\t\treturn $pk;\n\t}", "function setPrimaryKey($pkey_name){\n\n\t\t$this->pkey = $pkey_name;\n\n\t}", "public function createTable($tableName)\n {\n $query=\"CREATE TABLE \".$tableName.\" ( `productID` INT NOT NULL AUTO_INCREMENT , `product_name` VARCHAR(255) NOT NULL , `product_description` TEXT NOT NULL , `product_quantity` INT NOT NULL , `product_price` INT NOT NULL , `product_color` VARCHAR(255) NOT NULL , `product_status` INT NOT NULL , `product_picture` TEXT NOT NULL , `post_status` INT NOT NULL , `categoryID` INT NOT NULL , `subCategoryID` INT NOT NULL , `ownerID` INT NOT NULL , `owner_type` INT NOT NULL , `itID` INT NOT NULL , `c_date` DATETIME NOT NULL , PRIMARY KEY (`productID`)) ENGINE = InnoDB;\";\n $validate=$this->db->query($query);\n return $validate?true:false;\n }", "public function enablePrimaryKeys($tableName): void\n {\n return;\n }", "public static function getTableName()\n {\n return 'catalog_generator';\n }", "function generateKeyPrimary($table){\n /*\n key : code-tanggal-hurufAcak-jam\n\n logikanya\n 1 cek create untuk tabel yang mana\n 2 jika pengguna codenya PGN\n 3 jika sawah codoenya SWH\n 4 nanti key akan jadi code-tanggal-hurufAcak-jam\n\n */\n // konfigurasi\n // hurufnya apaan\n $str = \"1234567890abcdefghijklmnopqrstuvwxyz\";\n //batas maksimal huruf randonmnya\n $keyLenght = 6;\n\n //Tentukan code\n if ($table == \"pengguna\") {\n $code = \"PGN\";\n } elseif ($table == \"sawah\") {\n $code = \"SWH\";\n }\n\n $date = date('ymd');\n $randStr = substr(str_shuffle($str), 0, $keyLenght);\n $hours = date('his');\n\n $key = $code . \"-\" . $date . \"-\" . $randStr . \"-\" . $hours;\n\n return $key;\n}", "public static function getTableName()\n\t{\n\t\treturn 'b_catalog_contractor';\n\t}", "public function createTable($table) {\n global $wpdb;\n\n $table = $wpdb->prefix . $table;\n\n $sql = \"CREATE TABLE $table (\n post_id mediumint(9) NOT NULL,\n PRIMARY KEY (post_id),\n UNIQUE (post_id)\n ) {$this->charsetCollate};\";\n\n require_once ABSPATH . 'wp-admin/includes/upgrade.php';\n dbDelta($sql);\n }", "protected function generateTable(){\n\t\t$columns = $this->getConfig()->getColumns();\n\t\t$columns['magento_entity_id'] = array('type' => 'int');\n\n\t\t$sql = 'CREATE TABLE ' . $this->_table . '(';\n\n\t\tforeach ($columns as $name => $params) {\n\t\t\t$type = $this->getConfig()->getTypeForDatabase($params['type'], $name);\n\t\t\t$value = isset($params['default']) ? $params['default'] : 'NULL';\n\t\t\tif ($value != 'NULL') {\n\t\t\t\t$value = 'DEFAULT ' . $value;\n\t\t\t}\n\t\t\t$primary = isset($params['primary']) && $params['primary'] ? ' PRIMARY KEY' : '';\n\n\t\t\t$sql .= \"\\n\" . $name . \" \" . $type . \" \" . $value . $primary . \",\";\n\t\t}\n\t\t$sql = substr($sql, 0, -1) . ') ENGINE=InnoDB DEFAULT CHARSET=utf8;' . \"\\n\";\n\n\t\treturn $sql;\n\t}", "public static function get_table_name()\n {\n return self::TABLE_NAME;\n }" ]
[ "0.703775", "0.65729445", "0.6402711", "0.6353708", "0.6323042", "0.6176299", "0.6168588", "0.60971045", "0.6075723", "0.607519", "0.6074395", "0.6063244", "0.60473573", "0.6045216", "0.6007314", "0.5996009", "0.5992343", "0.59665954", "0.5958267", "0.59581256", "0.59344035", "0.59332234", "0.59231883", "0.5896308", "0.5892418", "0.588251", "0.58648926", "0.58471835", "0.5833689", "0.5798788", "0.57865554", "0.5779574", "0.5778614", "0.5778614", "0.57709706", "0.5760797", "0.57507306", "0.5741321", "0.5724556", "0.5721096", "0.5716246", "0.5697614", "0.5688028", "0.5682628", "0.5677599", "0.566516", "0.5664222", "0.5663602", "0.5656557", "0.5652037", "0.5646838", "0.56431985", "0.56410456", "0.5638818", "0.5632692", "0.5622956", "0.5613061", "0.5604259", "0.5588655", "0.55885434", "0.558727", "0.55793476", "0.5578656", "0.55722964", "0.55670846", "0.55601895", "0.55528116", "0.5540417", "0.5538284", "0.55289847", "0.55283767", "0.5502289", "0.54961395", "0.548842", "0.54872197", "0.5481787", "0.5472135", "0.54673225", "0.54597723", "0.5456921", "0.5452739", "0.5446704", "0.54443896", "0.5443733", "0.54387367", "0.5436493", "0.5430943", "0.54284924", "0.54245687", "0.5420108", "0.5411648", "0.54013777", "0.5386598", "0.5374226", "0.5373867", "0.5360523", "0.5359811", "0.5358031", "0.53565097", "0.53462887" ]
0.58527946
27
TODO:: make sure this is a AJAX Request
public function checkUserExistsAjaxAction() { if(isset($_POST['Username']) && !empty($_POST['Username'])) { header('Content-type: text/plain'); if(UserModel::userExists($this->filterString($_POST['Username'])) !== false) { echo 1; } else { echo 2; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handleAjaxRequest();", "public function ajax_response()\n {\n }", "protected function processGetRequest()\n {\n $this->ajaxDie(json_encode([\n 'success' => true,\n 'operation' => 'get'\n ]));\n }", "public function ajax_function()\n\t{\n\t}", "protected function _request() {}", "function ajaxList() {\r\n $this->rdAuth->noStudentsAllowed();\r\n // Set up the list\r\n $this->setUpAjaxList();\r\n // Process the request for data\r\n $this->AjaxList->asyncGet();\r\n }", "function ajax_query()\n {\n }", "abstract public function LowAjax();", "abstract public function HighAjax();", "public function loadAjax() {\n\t \n\t\t$this->classificationFacade->loadAjax($_GET);\n\t\t\n\t}", "public function gr_webforms_ajax_request()\n\t{\n\t\t$forms = $this->grApiInstance->getWebforms(array('sort' => array('name' => 'asc')));\n\t\t$response = json_encode(array('success' => $forms));\n\t\theader(\"Content-Type: application/json\");\n\t\techo $response;\n\t\texit;\n\t}", "protected function ajax() {\n\t\t// Ignore invalid AJAX requests, AJAX requests should always contain a vote\n\t\tif ( ! $this->is_ajax or empty( $this->new_vote ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Load results and vote feedback\n\t\t$this->load_results();\n\t\t$this->load_vote();\n\n\t\t// Send the item back in JSON format\n\t\techo json_encode( $this->item );\n\t}", "public function getAjaxID() {}", "public function ajaxmethod()\n {\n $result = [\n \"csrfTokenName\" => $this->security->get_csrf_token_name(),\n \"csrfHash\" => $this->security->get_csrf_hash(),\n ];\n $this->output->set_content_type('application/json')->set_output(json_encode($result));\n }", "public function ajaxSendRequest()\n\t{\n\t\t$request = FriendshipRequest::saveRequest(Input::get('id'));\n\t\t\n\t\tif ($request)\n\t\t{\n\t\t\treturn array('error' => 0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array('error' => 1);\n\t\t}\n\t}", "public function adminAjax()\r\n\t{\r\n\t\treturn;\r\n\t}", "public function ajax() {\n \n // Get action's get input\n $action = $this->CI->input->get('action');\n\n if ( !$action ) {\n $action = $this->CI->input->post('action');\n }\n \n try {\n\n // Call method if exists\n (new MidrubBaseAdminCollectionFrontendControllers\\Ajax)->$action();\n\n } catch (Exception $ex) {\n\n $data = array(\n 'success' => FALSE,\n 'message' => $ex->getMessage()\n );\n\n echo json_encode($data);\n\n }\n \n }", "public function showRequestPost();", "public function requestAction()\n {\n return $this->returnAjaxResponse(self::REQUEST);\n }", "private function ajaxController()\n {\n\n switch ($this->request['action']) {\n case 'add_task':\n $result = $this->addTask($this->request);\n break;\n case 'task_edit_popup':\n $result = $this->getEditTaskPopupData($this->request['task_id']);\n break;\n case 'edit_task':\n $result = $this->editTask($this->request);\n break;\n default:\n return false;\n }\n\n echo json_encode($result);\n exit();\n }", "public function ajax_backend_call()\n {\n\n // Security check\n check_ajax_referer('referer_id', 'nonce');\n\n $response = 'OK';\n // Send response in JSON format\n // wp_send_json( $response );\n // wp_send_json_error();\n wp_send_json_success($response);\n\n die();\n }", "public function ajaxpingAction()\r\n\t{\r\n\t\t$sid = $this->request->getParam(\"session\");\r\n\t\t$arr['live'] = $this->engine->ping($sid);\r\n $this->request->setParam(\"format\", \"json\");\r\n $this->request->setParam(\"render\", \"false\");\r\n $response = $this->getResponse(); \r\n $response->setContent(json_encode($arr)); \r\n // returned to View\\Listener\r\n return $response;\r\n\t}", "public function ajax_load() {\n\t\t$wrapper = new netxRestWrapper();\n\t\t$netx = $wrapper->getNetx();\n\t\t$cats = $netx->getCategoryTree();\n\t\t$options = get_option('netx_options');\n\t\t?>\n\t\t<form id=\"netx-form\" class=\"media-upload-form validate\" action=\"<?php echo get_bloginfo(\"url\"); ?>/wp-admin/media-upload.php?post_id=<?php echo $postID; ?>&tab=netx\" method=\"post\" enctype=\"multipart/form-data\">\n\t\t\t<div id=\"category-tree\">\n\t\t\t\t<ul>\n\t\t\t\t\t<?php $this->tree_node_view($this->getRootCategoryFromTree($cats['1']['children'], $options['netx_base_category_id']), $options['netx_base_category_id']); ?>\n\t\t\t\t</ul>\n\t\t\t</div>\n\n\t\t\t<div id=\"media-items\">\n\t\t\t\t<div class=\"netx-upload-loading-area\">\n\t\t\t\t\t<div class=\"netx-spinner\">\n\t\t\t\t\t\t<div class=\"netx-dot1\"></div>\n\t\t\t\t\t\t<div class=\"netx-dot2\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class=\"clear-fix\"></div>\n\t\t</form>\n\t\t<?php\n\t\twp_die();\n\t}", "abstract public function ajaxAction(): string;", "protected function _response() {}", "public function ajax_content()\n\t{\n\t\t$return_struct = array(\n\t\t\t'status' => 0,\n\t\t\t'code'\t => 501,\n\t\t\t'msg'\t => 'Not Implemented'\n\t\t);\n\t\tif(request::is_ajax())\n\t\t{\n\t\t\t$id = intval($this->input->get('id')); \n $value = $this->single($id);\n \n\t\t\t$return_template = $this->template = new View('template_blank');\n\t\t\t$this->template->content = $value;\n\t\t\t$return_str = $return_template->render();\n\t\t\t$return_struct['status'] = 1;\n\t\t\t$return_struct['code'] = 200;\n\t\t\t$return_struct['msg'] = 'Success';\n\t\t\t$return_struct['content'] = $return_str;\n\t\t\texit(json_encode($return_struct));\n\t\t}\n\t}", "function handleRequest() ;", "protected function getAjaxUri() {}", "protected function getAjaxUri() {}", "public function getAjaxStatus() {}", "public function ajax_frontend_call()\n {\n\n // Security check\n check_ajax_referer('referer_id', 'nonce');\n\n $response = 'OK';\n // Send response in JSON format\n // wp_send_json( $response );\n // wp_send_json_error();\n wp_send_json_success($response);\n\n die();\n }", "public function isAjax();", "private function processRequest()\n\t{\n\t\t\n\t\t$request = NEnvironment::getService('httpRequest');\n\t\t\n\t\tif ($request->isPost() && $request->isAjax() && $request->getHeader('x-callback-client')) { \n\t\t\t\n\t\t\t$data = json_decode(file_get_contents('php://input'), TRUE);\n\t\t\tif (count($data) > 0) {\n\t\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t\tif (isset($this->items[$key]) && isset($this->items[$key]['callback']) && $value === TRUE) {\n\t\t\t\t\t\t$this->items[$key]['callback']->invokeArgs($this->items[$key]['args']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tdie(json_encode(array('status' => \"OK\")));\n\t\t}\n\t\t\n\t}", "function request()\n {\n }", "public function request();", "public function getSettingsAjax()\n {\n $formId = absint($_REQUEST['form_id']);\n wp_send_json_success(array(\n 'custom_css' => $this->getData($formId, '_custom_form_css'),\n 'custom_js' => $this->getData($formId, '_custom_form_js'),\n ), 200);\n }", "protected function getRequest() {}", "abstract public function request();", "public function maybe_run_ajax_cache()\n {\n }", "function handleRequest(){\n\n check_ajax_referer( 'mvc-ajax' );\n \n $class = apply_filters( 'mvc_theme_ajax_handle_class', $this->getControllerObject( $_POST['controller'] ), $_POST );\n\n if( !$this->no_priv ){\n if( !isset( $class->ajax_allow ) || !in_array( $_POST['method'], $class->ajax_allow ) ){\n echo 'This method has not been added to the ajax_allow allowed list';\n exit();\n } \n }\n\n $data = $class->{$_POST['method']}($_POST['args']);\n \n if( !is_string( $data ) ){\n echo json_encode( $data );\n } else {\n echo $data;\n }\n exit(); \n }", "public function echoAjaxContent() {\n\t\t\n\t\t$sSection = trim( $_GET[ 'section' ] );\n\t\t$sMethod = '';\n\t\t\n\t\tif ( $sSection ) {\n\t\t\t$sMethod = sprintf( 'get%sAjax', Geko_Inflector::camelize( $sSection ) );\n\t\t\tif ( !method_exists( $this, $sMethod ) ) $sMethod = '';\n\t\t}\n\t\t\n\t\tif ( $sMethod ) {\n\t\t\t$aAjaxResponse = $this->$sMethod();\n\t\t\techo Zend_Json::encode( $aAjaxResponse );\n\t\t}\n\t}", "public function get_ajax_request() {\n\t\t$result = new stdClass;\n\n\t\tif ($this->type === 'list') {\n\t\t\t$result->categories = $this->get_addon_categories($this->addons);\n\t\t}\n\n\t\t$result->type = $this->type;\n\t\t$result->rowIndex \t\t= $this->row_index;\n\t\t$result->columnIndex \t= $this->column_index;\n\t\t$result->addonIndex \t= $this->addon_index;\n\t\t$result->addonName \t\t= $this->addon_name;\n\t\t$result->data \t \t\t\t= $this->get_settings_result();\n\t\t$result->status = true;\n\n\t\treturn json_encode($result);\n\t}", "public function ajaxAcceptRequest()\n\t{\n\t\t$request = FriendshipRequest::acceptRequest(Input::get('id'));\n\t\t\n\t\tif ($request)\n\t\t{\n\t\t\treturn array('error' => 0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array('error' => 1);\n\t\t}\n\t}", "public function ajax(){\n\t\t//$where = \"author_id = 1 AND status = 'active'\";\n\t\t//$str = $this->db->update_string('table_name', $data, $where);\n\t\t//$this->db->get_where()\n\t\t//$this->db->get_where('mytable', array('id' => $id));\n\t\t//$this->db->get_where(\"clinc_meta\", \"meta_name\", \"1\")\n\t\t//count of record $this->db->count_all('clinc_meta')\n\t\t\n\t\techo json_encode(array (\n\t\t\t\"msg\" => \"ahmed\"\n\t\t\n\t\t));\n\t}", "public function ajaxCall() {\n return json_encode('asdf');\n }", "function ajaxQueryServiceStatusDetails()\n {\n $serviceId = $_POST[\"serviceStatusId\"];\n\n if (!empty($serviceId)) {\n if (!is_numeric($serviceId)) {\n echo \"{}\";\n return;\n }\n\n $no = $this->NetworkOutage_model->getNetworkOutageById($serviceId);\n //header('Content-Type: text/javascript');\n $expNO = $this->exportNetworkOutageDetail($no->next());\n\n $exptNOResp = json_encode($expNO);\n if (is_null($_GET['callback'])) {\n echo $exptNOResp;\n } else {\n echo $_GET['callback']. '('. $exptNOResp .');';\n }\n } else {\n // return empty object\n echo \"{}\";\n }\n }", "function wp_doing_ajax()\n {\n }", "public function xhrGetListings()\n {\n $result = $this->db->select(\"SELECT * FROM data\");\n echo json_encode($result);\n }", "public function index_ajax()\n {\n $this->department->getDepartmentAjax();\n }", "public function _ajax()\n\t{\n\t\tswitch($this->action)\n\t\t{\t\t\t\t\n\t\t\tcase 'category':\t\t\t\t\n\t\t\t\tif(empty($_GET['sort']))\n\t\t\t\t\treturn $this->posts_wrapper();\n\t\t\t\treturn $this->get_posts_list();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'view':\n\t\t\t\tif(empty($_GET['sort']))\n\t\t\t\t\treturn $this->comments_wrapper();\n\t\t\t\treturn $this->get_comments_list($this->filter);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'submit':\n\t\t\t\treturn $this->add_post();\n\t\t\t\tbreak;\n\n\t\t\tcase 'vote':\n\t\t\t\treturn $this->vote();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'edit':\n\t\t\t\treturn $this->edit();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'my':\n\t\t\t\t# no sorter default to posts.\n\t\t\t\tif(empty($_GET['sort']))\n\t\t\t\t\treturn $this->my($this->filter);\n\t\t\t\t\n\t\t\t\t# has sorter, so we fetch raw content lists\n\t\t\t\tif('posts' == $this->filter)\n\t\t\t\t\treturn $this->my_posts_list();\n\t\t\t\tif('comments' == $this->filter)\n\t\t\t\t\treturn $this->my_comments_list();\n\t\t\t\tif('starred' == $this->filter)\n\t\t\t\t\treturn $this->my_starred_list();\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn 'invalid url parameters';\n\t}", "private function ajaxResponse()\n {\n echo json_encode($this->response);\n die(1);\n }", "function wp_ajax_fetch_list()\n {\n }", "function fatherly_fcr_handle_ajax()\n{\n include_once(__DIR__ . '/inc/classes/ContentRecirculation.php');\n $FCRInstance = FCR\\ContentRecirculation::init();\n switch ($_REQUEST['operation']) {\n case 'add':\n $results = $FCRInstance->addNewPostToRecirculation($_REQUEST['post_id']);\n break;\n case 'delete':\n $results = $FCRInstance->deletePostFromRecirculation($_REQUEST['post_id']);\n break;\n case 'reset':\n $results = $FCRInstance->resetPostProcessedStatus($_REQUEST['post_id']);\n break;\n }\n echo wp_json_encode($results);\n wp_die();\n}", "public function ajaxCall() {\n return json_encode('asdf');\n }", "public function ajaxCall() {\n return json_encode('asdf');\n }", "function dumpForAjax()\r\n {\r\n $this->updateControl();\r\n $this->commonScript();\r\n }", "public function ajaxGetAction()\n {\n $this->view->disable();\n $response = new \\Phalcon\\Http\\Response();\n if (!$this->request->isAjax()) {\n echo \"is not Ajax ! \";\n }\n if (!$this->request->isPost()) {\n echo \"is not Post ! \";\n }\n $tokuisaki_bunrui4 = TokuisakiBunrui4Kbns::find(array(\n 'order' => 'cd',\n 'conditions' => ' cd LIKE ?1 ',\n 'bind' => array(1 => $this->request->getPost('cd').'%')\n ));\n $res_flds = [\"id\",\"cd\",\"name\",];\n $resData = array();\n foreach ($tokuisaki_bunrui4 as $bunrui4) {\n $resAdata = array();\n foreach ($res_flds as $res_fld) {\n $resAdata[$res_fld] = $bunrui4->$res_fld;\n }\n $resData[] = $resAdata;\n }\n $response->setContent(json_encode($resData));\n return $response;\n }", "private function send_ajax_request_info($result)\n {\n // Check if action was fired via Ajax call. If yes, JS code will be triggered, else the user is redirected to the user page\n if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {\n $result = json_encode($result);\n echo $result;\n } else {\n header(\"Location: \".$_SERVER[\"HTTP_REFERER\"]);\n }\n\n // don't forget to end your scripts with a die() function - very important\n die();\n }", "public function initAjax()\n {\n }", "public function mp_hook_smsabo_ajax(){\n\t\treturn $this->mp_hook_payment_ajax('smsabo');\n\t\t}", "public static function handle_ajax() {\n\t\tHelpers::ajax_wrapper( array( self::class, 'ajax_handler_body' ) );\n\t}", "public function gr_forms_ajax_request()\n\t{\n\t\t$forms = $this->grApiInstance->getForms(array('sort' => array('name' => 'asc')));\n\t\t$response = json_encode(array('success' => $forms));\n\t\theader(\"Content-Type: application/json\");\n\t\techo $response;\n\t\texit;\n\t}", "public function ajax()\n {\n $ajax_data = array();\n $user_id = $this->user_session->getUserId();\n $post = $this->request->request->all();\n\n if ($user_id) {\n $user = $this->user_logic->getUserById($user_id);\n if ($user !== false) {\n if (! empty($user) AND is_array($user)) {\n\n $user = array_pop($user);\n\n $ajax_data['code'] = 0;\n $ajax_data['data']['user'] = $user;\n $ajax_data['message'] = 'User Data Found;';\n\n switch($post['action']) {\n\n case 'update' : $result = $this->user_logic->ajaxUpdate($user,$post['unit_id'],$post['fields'],$post['values']);\n $ajax_data['message'] = $result;\n break;\n\n default : $ajax_data['message'] .= ' Processing unit_id: '. $post['unit_id'] . ';';\n $ajax_data['message'] .= ' Action: '. $post['action'] . ';';\n\n }\n\n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'User does not exist'; \n } \n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'Failed to get user info'; \n } \n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'Invalid user id';\n }\n \n $this->ajax_respond($ajax_data);\n }", "public function processRequest();", "public function ajax_details()\n\t{\n\t\t$member_id = $this->input->post(\"id\");\n\t\t\n\t\t$returnAJAX = $this->members_model->read_form($member_id);\n\n\t\techo json_encode($returnAJAX);\n\t}", "public function ajax(): bool\n {\n return $this->isXmlHttpRequest();\n }", "function populate_from_request();", "public function ajaxGuion() {\n\t\t\tif($this->peticion->ajax() == true):\n\t\t\t\t$this->existenciaDatos();\n\t\t\telse:\n\t\t\t\texit('Guión no fue creado por Error en petición Ajax');\n\t\t\tendif;\n\t\t}", "public function callAjaxUpdate () {\n return $this->callAjaxInit();\n }", "public function ajax_response()\n {\n $this->ajax_data_return['data'] = (object) $this->ajax_data_return['data'];\n echo json_encode($this->ajax_data_return);\n }", "public function ajaxVisuaDocente(){\n $item =\"id\";\n $valor = $this->idDocente;\n $respuesta = ControladorDocentes::ctrMostrarDocentes($item,$valor);\n echo json_encode($respuesta);\n\n}", "final public function wp_ajax()\n {\n remove_filter(current_filter(), __METHOD__);\n do_action( 'tify_form_loaded' );\n \n $data = array( 'html' => $this->form()->display() );\n \n if( $this->form()->handle()->hasError() ) :\n wp_send_json_error( $data );\n else :\n wp_send_json_success( $data );\n endif;\n \n }", "function ajax_add()\n {\n\t\n }", "public function ajaxProcessSearchProduct()\n {\n }", "public function ajaxAction(){\n $request = $this->getRequest();\n $cat = $request->request->get('cat');\n $pg = $request->request->get('pg');\n $q = $request->request->get('q');\n $sort = $request->request->get('sort');\n if(!$request->isXmlHttpRequest() || !$pg || !$cat){\n throw new AccessDeniedHttpException('Você não tem permissão para acessar esta página.');\n }\n $ret['search'] = (empty ($q)) ? null : $q;\n $ret['cat'] = ($cat == 'all') ? null : $cat;\n if($pg != 1){\n list($field, $pg) = explode('_', $pg);\n }\n $ret['pg'] = $pg;\n $ret['sort'] = $sort;\n return $ret;\n }", "public function ajaxGetStats()\n {\n $amount_of_employees = $this->model->getAmountOfEmployees();\n\n // simply echo out something. A supersimple API would be possible by echoing JSON here\n echo $amount_of_employees;\n }", "public function ajax()\n {\n $this->app->get_table_data('discountlevels');\n }", "function acf_send_ajax_results($response)\n{\n}", "private function loadAjax(): void {\n // ID på tabellen skal være sat enten i $_GET eller $_POST\n if (isset($_POST['RCMSTable']) || isset($_GET['RCMSTable'])) {\n $id = $_POST['RCMSTable'] ?? $_GET['RCMSTable'];\n } else {\n return;\n }\n\n if (!isset($this->table[$id])) {\n return;\n }\n\n ob_get_clean();\n ob_start();\n header(\"Content-Type: application/json\");\n\n $table = $this->table[$id];\n $columns = $this->columns[$id];\n $where = $this->where[$id];\n $order = $this->order[$id];\n $settings = $this->settings[$id];\n\n if (isset($_POST['pageNum'])) {\n $settings['pageNum'] = $_POST['pageNum'];\n }\n\n if (isset($_POST['searchTxt'])) {\n $settings['searchTxt'] = $_POST['searchTxt'];\n }\n\n if (isset($_POST['sortKey'])) {\n $settings['sortKey'] = $_POST['sortKey'];\n }\n\n if (isset($_POST['sortDir'])) {\n $settings['sortDir'] = $_POST['sortDir'];\n }\n\n $this->settings[$id] = $settings;\n\n $rows = $this->retrieveData($table, $columns, $where, $order, $settings);\n\n $this->buildRows($id, $rows);\n\n exit;\n }", "function cinerama_edge_hook_twitter_request_ajax() {\n\t\tCineramaTwitterApi::getInstance()->obtainRequestToken();\n\t}", "public function ajax()\n {\n /*if($name!=\"\"){\n switch($name){\n case 'change_active':\n $post['active'] = $status;\n $this->User_model->update($post, $id); \n break;\n } \n exit;\n }*/\n \n $this->app->get_table_data('users'); \n }", "public function get_data_berita_on_slider_page(){\r\r\n\t\tif( $this->input->is_ajax_request() ){\r\r\n\t\t\t$this->get_data_ajax_berita_on_slider_page();\r\r\n\t\t}else{\r\r\n\t\t\tredirect(base_url());\r\r\n\t\t}\r\r\n\t}", "public function mp_hook_abo_ajax(){\n\t\treturn $this->mp_hook_payment_ajax('abo');\n\t\t}", "protected function processDeleteRequest()\n {\n $this->ajaxDie(json_encode([\n 'success' => true,\n 'operation' => 'delete'\n ]));\n }", "function getRequest();", "public function displayAjax()\n {\n http_response_code(400);\n $this->ajaxRenderJson(['error' => 'Invalid endpoint']);\n }", "public function ajaxAction(Request $request)\n {\n if($request->isXMLHttpRequest()){\n $db = $this->get('database_connection');\n $query = \"select * from post\";\n $rows = $db->fetchAll($query);\n return new JsonResponse(array('data' => json_encode($rows)));\n }\n return new Response(\"Ajax request error\", 400);\n }", "public function ajax_load_available_items()\n {\n }", "public function actionAjaxLoad()\r\n {\r\n \treturn $this->render('ajax-load');\r\n }", "private function isAjax()\n\t{\n\t\treturn $this->getRequest()->isXmlHttpRequest();\n\t}", "protected function processPutRequest()\n {\n $this->ajaxDie(json_encode([\n 'success' => true,\n 'operation' => 'put'\n ]));\n }", "public static function wp_ajax_tb_rank_math_content_ajax() {\n\t\tThemify_Builder_Component_Base::retrieve_template('builder-output.php', array('builder_output' => $_POST['data'], 'builder_id' => $_POST['id']), '', '', true);\n\t\twp_die();\n\t}", "function is_ajax() {\n return true;\n}", "public function ajaxProcessSearchCustomers()\n {\n }", "public function isAjax(): bool {}", "public function actionAjax()\n {\n $url = $_POST['url'];\n $video_id = VideoLibrary::get_video_id($url);\n //check if link was parsed succesfully\n if ( $video_id ) \n {\n $json_output = VideoLibrary::get_json_output($video_id);\n $title = VideoLibrary::get_info($json_output,'title');\n $description = VideoLibrary::get_info($json_output,'description');\n $image = VideoLibrary::get_info($json_output,'thumbnails')->high->url;\n $video_url = \"http://www.youtube.com/embed/\" . $video_id;\n $json_array = [\"title\"=>$title, \"description\"=>$description, \"image\"=>$image, \"video_url\"=> $video_url ];\n echo json_encode($json_array);\n\n }\n }", "public function getInitialData() \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n { $this->autorender = false;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n \t\t$this->layout = null;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n \t $this->render('ajax');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n $params = json_decode(file_get_contents('php://input'),true); //\n// $fileURL=$params['fileURL'];\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t//\n Controller::loadModel('Bugs');\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n $bugData=$this->Bugs->find('all', array('conditions' => array('status' => '0', 'parentid' => '0'))); //\n echo(json_encode($bugData)); //\n }", "final public function wp_ajax()\n\t{\n\t\t$this->display( $_POST['date'] );\n\t\texit;\n\t}", "function verify_ajax()\n {\n }", "function ajaxRequest($url, $post=null)\n{\n $d = httpRequest($url, $post);\n return json_decode($d['data'], false); // return Object\n}", "function ajaxGetEmployeeStatusHistory() {\n $empId = $_GET['empId'];\n\n $employeeHistory = getEmployeeStatusHistory($empId);\n\n echo json_encode($employeeHistory);\n }" ]
[ "0.71470916", "0.6824907", "0.66170937", "0.6443197", "0.63690317", "0.6348328", "0.62474847", "0.62352216", "0.617868", "0.6102074", "0.60912126", "0.608441", "0.6081433", "0.60764885", "0.6071746", "0.60660714", "0.60460734", "0.60431075", "0.60210663", "0.6013252", "0.59757525", "0.5946961", "0.5942796", "0.59417915", "0.59258807", "0.5920325", "0.5904455", "0.5875625", "0.5875625", "0.5872411", "0.586967", "0.5860707", "0.5851738", "0.5847744", "0.58432764", "0.58409965", "0.58342475", "0.58218175", "0.5821542", "0.5819574", "0.58130944", "0.5812871", "0.58063585", "0.57986414", "0.5793469", "0.5792359", "0.5775303", "0.5773246", "0.57667536", "0.5759109", "0.5754684", "0.57393694", "0.5737788", "0.573681", "0.573681", "0.57344854", "0.5734158", "0.5723537", "0.5713694", "0.5713607", "0.5712725", "0.5710087", "0.569826", "0.568569", "0.568204", "0.56779385", "0.5675929", "0.5671832", "0.5662262", "0.5646255", "0.5630812", "0.56275594", "0.5621856", "0.56209165", "0.5616373", "0.5610049", "0.5589923", "0.5587059", "0.5582282", "0.558194", "0.55766195", "0.5570711", "0.5570644", "0.55687094", "0.5564882", "0.5564681", "0.5564536", "0.5558518", "0.55546474", "0.5546515", "0.55430245", "0.5538627", "0.553718", "0.5534473", "0.55193245", "0.5516909", "0.55096674", "0.55052465", "0.5500145", "0.54973793", "0.54922605" ]
0.0
-1
TODO:: make sure this is a AJAX Request
public function checkEmailExistsAjaxAction() { if(isset($_POST['Email']) && !empty($_POST['Email'])) { header('Content-type: text/plain'); if(UserModel::emailExists($this->filterString($_POST['Email'])) !== false) { echo 1; } else { echo 2; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handleAjaxRequest();", "public function ajax_response()\n {\n }", "protected function processGetRequest()\n {\n $this->ajaxDie(json_encode([\n 'success' => true,\n 'operation' => 'get'\n ]));\n }", "public function ajax_function()\n\t{\n\t}", "protected function _request() {}", "function ajaxList() {\r\n $this->rdAuth->noStudentsAllowed();\r\n // Set up the list\r\n $this->setUpAjaxList();\r\n // Process the request for data\r\n $this->AjaxList->asyncGet();\r\n }", "function ajax_query()\n {\n }", "abstract public function LowAjax();", "abstract public function HighAjax();", "public function loadAjax() {\n\t \n\t\t$this->classificationFacade->loadAjax($_GET);\n\t\t\n\t}", "public function gr_webforms_ajax_request()\n\t{\n\t\t$forms = $this->grApiInstance->getWebforms(array('sort' => array('name' => 'asc')));\n\t\t$response = json_encode(array('success' => $forms));\n\t\theader(\"Content-Type: application/json\");\n\t\techo $response;\n\t\texit;\n\t}", "protected function ajax() {\n\t\t// Ignore invalid AJAX requests, AJAX requests should always contain a vote\n\t\tif ( ! $this->is_ajax or empty( $this->new_vote ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Load results and vote feedback\n\t\t$this->load_results();\n\t\t$this->load_vote();\n\n\t\t// Send the item back in JSON format\n\t\techo json_encode( $this->item );\n\t}", "public function getAjaxID() {}", "public function ajaxmethod()\n {\n $result = [\n \"csrfTokenName\" => $this->security->get_csrf_token_name(),\n \"csrfHash\" => $this->security->get_csrf_hash(),\n ];\n $this->output->set_content_type('application/json')->set_output(json_encode($result));\n }", "public function ajaxSendRequest()\n\t{\n\t\t$request = FriendshipRequest::saveRequest(Input::get('id'));\n\t\t\n\t\tif ($request)\n\t\t{\n\t\t\treturn array('error' => 0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array('error' => 1);\n\t\t}\n\t}", "public function adminAjax()\r\n\t{\r\n\t\treturn;\r\n\t}", "public function ajax() {\n \n // Get action's get input\n $action = $this->CI->input->get('action');\n\n if ( !$action ) {\n $action = $this->CI->input->post('action');\n }\n \n try {\n\n // Call method if exists\n (new MidrubBaseAdminCollectionFrontendControllers\\Ajax)->$action();\n\n } catch (Exception $ex) {\n\n $data = array(\n 'success' => FALSE,\n 'message' => $ex->getMessage()\n );\n\n echo json_encode($data);\n\n }\n \n }", "public function showRequestPost();", "public function requestAction()\n {\n return $this->returnAjaxResponse(self::REQUEST);\n }", "private function ajaxController()\n {\n\n switch ($this->request['action']) {\n case 'add_task':\n $result = $this->addTask($this->request);\n break;\n case 'task_edit_popup':\n $result = $this->getEditTaskPopupData($this->request['task_id']);\n break;\n case 'edit_task':\n $result = $this->editTask($this->request);\n break;\n default:\n return false;\n }\n\n echo json_encode($result);\n exit();\n }", "public function ajax_backend_call()\n {\n\n // Security check\n check_ajax_referer('referer_id', 'nonce');\n\n $response = 'OK';\n // Send response in JSON format\n // wp_send_json( $response );\n // wp_send_json_error();\n wp_send_json_success($response);\n\n die();\n }", "public function ajaxpingAction()\r\n\t{\r\n\t\t$sid = $this->request->getParam(\"session\");\r\n\t\t$arr['live'] = $this->engine->ping($sid);\r\n $this->request->setParam(\"format\", \"json\");\r\n $this->request->setParam(\"render\", \"false\");\r\n $response = $this->getResponse(); \r\n $response->setContent(json_encode($arr)); \r\n // returned to View\\Listener\r\n return $response;\r\n\t}", "public function ajax_load() {\n\t\t$wrapper = new netxRestWrapper();\n\t\t$netx = $wrapper->getNetx();\n\t\t$cats = $netx->getCategoryTree();\n\t\t$options = get_option('netx_options');\n\t\t?>\n\t\t<form id=\"netx-form\" class=\"media-upload-form validate\" action=\"<?php echo get_bloginfo(\"url\"); ?>/wp-admin/media-upload.php?post_id=<?php echo $postID; ?>&tab=netx\" method=\"post\" enctype=\"multipart/form-data\">\n\t\t\t<div id=\"category-tree\">\n\t\t\t\t<ul>\n\t\t\t\t\t<?php $this->tree_node_view($this->getRootCategoryFromTree($cats['1']['children'], $options['netx_base_category_id']), $options['netx_base_category_id']); ?>\n\t\t\t\t</ul>\n\t\t\t</div>\n\n\t\t\t<div id=\"media-items\">\n\t\t\t\t<div class=\"netx-upload-loading-area\">\n\t\t\t\t\t<div class=\"netx-spinner\">\n\t\t\t\t\t\t<div class=\"netx-dot1\"></div>\n\t\t\t\t\t\t<div class=\"netx-dot2\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class=\"clear-fix\"></div>\n\t\t</form>\n\t\t<?php\n\t\twp_die();\n\t}", "abstract public function ajaxAction(): string;", "protected function _response() {}", "public function ajax_content()\n\t{\n\t\t$return_struct = array(\n\t\t\t'status' => 0,\n\t\t\t'code'\t => 501,\n\t\t\t'msg'\t => 'Not Implemented'\n\t\t);\n\t\tif(request::is_ajax())\n\t\t{\n\t\t\t$id = intval($this->input->get('id')); \n $value = $this->single($id);\n \n\t\t\t$return_template = $this->template = new View('template_blank');\n\t\t\t$this->template->content = $value;\n\t\t\t$return_str = $return_template->render();\n\t\t\t$return_struct['status'] = 1;\n\t\t\t$return_struct['code'] = 200;\n\t\t\t$return_struct['msg'] = 'Success';\n\t\t\t$return_struct['content'] = $return_str;\n\t\t\texit(json_encode($return_struct));\n\t\t}\n\t}", "function handleRequest() ;", "protected function getAjaxUri() {}", "protected function getAjaxUri() {}", "public function getAjaxStatus() {}", "public function ajax_frontend_call()\n {\n\n // Security check\n check_ajax_referer('referer_id', 'nonce');\n\n $response = 'OK';\n // Send response in JSON format\n // wp_send_json( $response );\n // wp_send_json_error();\n wp_send_json_success($response);\n\n die();\n }", "public function isAjax();", "private function processRequest()\n\t{\n\t\t\n\t\t$request = NEnvironment::getService('httpRequest');\n\t\t\n\t\tif ($request->isPost() && $request->isAjax() && $request->getHeader('x-callback-client')) { \n\t\t\t\n\t\t\t$data = json_decode(file_get_contents('php://input'), TRUE);\n\t\t\tif (count($data) > 0) {\n\t\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t\tif (isset($this->items[$key]) && isset($this->items[$key]['callback']) && $value === TRUE) {\n\t\t\t\t\t\t$this->items[$key]['callback']->invokeArgs($this->items[$key]['args']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tdie(json_encode(array('status' => \"OK\")));\n\t\t}\n\t\t\n\t}", "function request()\n {\n }", "public function request();", "public function getSettingsAjax()\n {\n $formId = absint($_REQUEST['form_id']);\n wp_send_json_success(array(\n 'custom_css' => $this->getData($formId, '_custom_form_css'),\n 'custom_js' => $this->getData($formId, '_custom_form_js'),\n ), 200);\n }", "protected function getRequest() {}", "abstract public function request();", "public function maybe_run_ajax_cache()\n {\n }", "function handleRequest(){\n\n check_ajax_referer( 'mvc-ajax' );\n \n $class = apply_filters( 'mvc_theme_ajax_handle_class', $this->getControllerObject( $_POST['controller'] ), $_POST );\n\n if( !$this->no_priv ){\n if( !isset( $class->ajax_allow ) || !in_array( $_POST['method'], $class->ajax_allow ) ){\n echo 'This method has not been added to the ajax_allow allowed list';\n exit();\n } \n }\n\n $data = $class->{$_POST['method']}($_POST['args']);\n \n if( !is_string( $data ) ){\n echo json_encode( $data );\n } else {\n echo $data;\n }\n exit(); \n }", "public function echoAjaxContent() {\n\t\t\n\t\t$sSection = trim( $_GET[ 'section' ] );\n\t\t$sMethod = '';\n\t\t\n\t\tif ( $sSection ) {\n\t\t\t$sMethod = sprintf( 'get%sAjax', Geko_Inflector::camelize( $sSection ) );\n\t\t\tif ( !method_exists( $this, $sMethod ) ) $sMethod = '';\n\t\t}\n\t\t\n\t\tif ( $sMethod ) {\n\t\t\t$aAjaxResponse = $this->$sMethod();\n\t\t\techo Zend_Json::encode( $aAjaxResponse );\n\t\t}\n\t}", "public function get_ajax_request() {\n\t\t$result = new stdClass;\n\n\t\tif ($this->type === 'list') {\n\t\t\t$result->categories = $this->get_addon_categories($this->addons);\n\t\t}\n\n\t\t$result->type = $this->type;\n\t\t$result->rowIndex \t\t= $this->row_index;\n\t\t$result->columnIndex \t= $this->column_index;\n\t\t$result->addonIndex \t= $this->addon_index;\n\t\t$result->addonName \t\t= $this->addon_name;\n\t\t$result->data \t \t\t\t= $this->get_settings_result();\n\t\t$result->status = true;\n\n\t\treturn json_encode($result);\n\t}", "public function ajaxAcceptRequest()\n\t{\n\t\t$request = FriendshipRequest::acceptRequest(Input::get('id'));\n\t\t\n\t\tif ($request)\n\t\t{\n\t\t\treturn array('error' => 0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array('error' => 1);\n\t\t}\n\t}", "public function ajax(){\n\t\t//$where = \"author_id = 1 AND status = 'active'\";\n\t\t//$str = $this->db->update_string('table_name', $data, $where);\n\t\t//$this->db->get_where()\n\t\t//$this->db->get_where('mytable', array('id' => $id));\n\t\t//$this->db->get_where(\"clinc_meta\", \"meta_name\", \"1\")\n\t\t//count of record $this->db->count_all('clinc_meta')\n\t\t\n\t\techo json_encode(array (\n\t\t\t\"msg\" => \"ahmed\"\n\t\t\n\t\t));\n\t}", "public function ajaxCall() {\n return json_encode('asdf');\n }", "function ajaxQueryServiceStatusDetails()\n {\n $serviceId = $_POST[\"serviceStatusId\"];\n\n if (!empty($serviceId)) {\n if (!is_numeric($serviceId)) {\n echo \"{}\";\n return;\n }\n\n $no = $this->NetworkOutage_model->getNetworkOutageById($serviceId);\n //header('Content-Type: text/javascript');\n $expNO = $this->exportNetworkOutageDetail($no->next());\n\n $exptNOResp = json_encode($expNO);\n if (is_null($_GET['callback'])) {\n echo $exptNOResp;\n } else {\n echo $_GET['callback']. '('. $exptNOResp .');';\n }\n } else {\n // return empty object\n echo \"{}\";\n }\n }", "function wp_doing_ajax()\n {\n }", "public function xhrGetListings()\n {\n $result = $this->db->select(\"SELECT * FROM data\");\n echo json_encode($result);\n }", "public function index_ajax()\n {\n $this->department->getDepartmentAjax();\n }", "public function _ajax()\n\t{\n\t\tswitch($this->action)\n\t\t{\t\t\t\t\n\t\t\tcase 'category':\t\t\t\t\n\t\t\t\tif(empty($_GET['sort']))\n\t\t\t\t\treturn $this->posts_wrapper();\n\t\t\t\treturn $this->get_posts_list();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'view':\n\t\t\t\tif(empty($_GET['sort']))\n\t\t\t\t\treturn $this->comments_wrapper();\n\t\t\t\treturn $this->get_comments_list($this->filter);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'submit':\n\t\t\t\treturn $this->add_post();\n\t\t\t\tbreak;\n\n\t\t\tcase 'vote':\n\t\t\t\treturn $this->vote();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'edit':\n\t\t\t\treturn $this->edit();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'my':\n\t\t\t\t# no sorter default to posts.\n\t\t\t\tif(empty($_GET['sort']))\n\t\t\t\t\treturn $this->my($this->filter);\n\t\t\t\t\n\t\t\t\t# has sorter, so we fetch raw content lists\n\t\t\t\tif('posts' == $this->filter)\n\t\t\t\t\treturn $this->my_posts_list();\n\t\t\t\tif('comments' == $this->filter)\n\t\t\t\t\treturn $this->my_comments_list();\n\t\t\t\tif('starred' == $this->filter)\n\t\t\t\t\treturn $this->my_starred_list();\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn 'invalid url parameters';\n\t}", "private function ajaxResponse()\n {\n echo json_encode($this->response);\n die(1);\n }", "function wp_ajax_fetch_list()\n {\n }", "function fatherly_fcr_handle_ajax()\n{\n include_once(__DIR__ . '/inc/classes/ContentRecirculation.php');\n $FCRInstance = FCR\\ContentRecirculation::init();\n switch ($_REQUEST['operation']) {\n case 'add':\n $results = $FCRInstance->addNewPostToRecirculation($_REQUEST['post_id']);\n break;\n case 'delete':\n $results = $FCRInstance->deletePostFromRecirculation($_REQUEST['post_id']);\n break;\n case 'reset':\n $results = $FCRInstance->resetPostProcessedStatus($_REQUEST['post_id']);\n break;\n }\n echo wp_json_encode($results);\n wp_die();\n}", "public function ajaxCall() {\n return json_encode('asdf');\n }", "public function ajaxCall() {\n return json_encode('asdf');\n }", "function dumpForAjax()\r\n {\r\n $this->updateControl();\r\n $this->commonScript();\r\n }", "public function ajaxGetAction()\n {\n $this->view->disable();\n $response = new \\Phalcon\\Http\\Response();\n if (!$this->request->isAjax()) {\n echo \"is not Ajax ! \";\n }\n if (!$this->request->isPost()) {\n echo \"is not Post ! \";\n }\n $tokuisaki_bunrui4 = TokuisakiBunrui4Kbns::find(array(\n 'order' => 'cd',\n 'conditions' => ' cd LIKE ?1 ',\n 'bind' => array(1 => $this->request->getPost('cd').'%')\n ));\n $res_flds = [\"id\",\"cd\",\"name\",];\n $resData = array();\n foreach ($tokuisaki_bunrui4 as $bunrui4) {\n $resAdata = array();\n foreach ($res_flds as $res_fld) {\n $resAdata[$res_fld] = $bunrui4->$res_fld;\n }\n $resData[] = $resAdata;\n }\n $response->setContent(json_encode($resData));\n return $response;\n }", "private function send_ajax_request_info($result)\n {\n // Check if action was fired via Ajax call. If yes, JS code will be triggered, else the user is redirected to the user page\n if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {\n $result = json_encode($result);\n echo $result;\n } else {\n header(\"Location: \".$_SERVER[\"HTTP_REFERER\"]);\n }\n\n // don't forget to end your scripts with a die() function - very important\n die();\n }", "public function initAjax()\n {\n }", "public function mp_hook_smsabo_ajax(){\n\t\treturn $this->mp_hook_payment_ajax('smsabo');\n\t\t}", "public static function handle_ajax() {\n\t\tHelpers::ajax_wrapper( array( self::class, 'ajax_handler_body' ) );\n\t}", "public function gr_forms_ajax_request()\n\t{\n\t\t$forms = $this->grApiInstance->getForms(array('sort' => array('name' => 'asc')));\n\t\t$response = json_encode(array('success' => $forms));\n\t\theader(\"Content-Type: application/json\");\n\t\techo $response;\n\t\texit;\n\t}", "public function ajax()\n {\n $ajax_data = array();\n $user_id = $this->user_session->getUserId();\n $post = $this->request->request->all();\n\n if ($user_id) {\n $user = $this->user_logic->getUserById($user_id);\n if ($user !== false) {\n if (! empty($user) AND is_array($user)) {\n\n $user = array_pop($user);\n\n $ajax_data['code'] = 0;\n $ajax_data['data']['user'] = $user;\n $ajax_data['message'] = 'User Data Found;';\n\n switch($post['action']) {\n\n case 'update' : $result = $this->user_logic->ajaxUpdate($user,$post['unit_id'],$post['fields'],$post['values']);\n $ajax_data['message'] = $result;\n break;\n\n default : $ajax_data['message'] .= ' Processing unit_id: '. $post['unit_id'] . ';';\n $ajax_data['message'] .= ' Action: '. $post['action'] . ';';\n\n }\n\n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'User does not exist'; \n } \n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'Failed to get user info'; \n } \n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'Invalid user id';\n }\n \n $this->ajax_respond($ajax_data);\n }", "public function processRequest();", "public function ajax_details()\n\t{\n\t\t$member_id = $this->input->post(\"id\");\n\t\t\n\t\t$returnAJAX = $this->members_model->read_form($member_id);\n\n\t\techo json_encode($returnAJAX);\n\t}", "public function ajax(): bool\n {\n return $this->isXmlHttpRequest();\n }", "function populate_from_request();", "public function ajaxGuion() {\n\t\t\tif($this->peticion->ajax() == true):\n\t\t\t\t$this->existenciaDatos();\n\t\t\telse:\n\t\t\t\texit('Guión no fue creado por Error en petición Ajax');\n\t\t\tendif;\n\t\t}", "public function callAjaxUpdate () {\n return $this->callAjaxInit();\n }", "public function ajax_response()\n {\n $this->ajax_data_return['data'] = (object) $this->ajax_data_return['data'];\n echo json_encode($this->ajax_data_return);\n }", "public function ajaxVisuaDocente(){\n $item =\"id\";\n $valor = $this->idDocente;\n $respuesta = ControladorDocentes::ctrMostrarDocentes($item,$valor);\n echo json_encode($respuesta);\n\n}", "final public function wp_ajax()\n {\n remove_filter(current_filter(), __METHOD__);\n do_action( 'tify_form_loaded' );\n \n $data = array( 'html' => $this->form()->display() );\n \n if( $this->form()->handle()->hasError() ) :\n wp_send_json_error( $data );\n else :\n wp_send_json_success( $data );\n endif;\n \n }", "function ajax_add()\n {\n\t\n }", "public function ajaxProcessSearchProduct()\n {\n }", "public function ajaxAction(){\n $request = $this->getRequest();\n $cat = $request->request->get('cat');\n $pg = $request->request->get('pg');\n $q = $request->request->get('q');\n $sort = $request->request->get('sort');\n if(!$request->isXmlHttpRequest() || !$pg || !$cat){\n throw new AccessDeniedHttpException('Você não tem permissão para acessar esta página.');\n }\n $ret['search'] = (empty ($q)) ? null : $q;\n $ret['cat'] = ($cat == 'all') ? null : $cat;\n if($pg != 1){\n list($field, $pg) = explode('_', $pg);\n }\n $ret['pg'] = $pg;\n $ret['sort'] = $sort;\n return $ret;\n }", "public function ajaxGetStats()\n {\n $amount_of_employees = $this->model->getAmountOfEmployees();\n\n // simply echo out something. A supersimple API would be possible by echoing JSON here\n echo $amount_of_employees;\n }", "public function ajax()\n {\n $this->app->get_table_data('discountlevels');\n }", "function acf_send_ajax_results($response)\n{\n}", "private function loadAjax(): void {\n // ID på tabellen skal være sat enten i $_GET eller $_POST\n if (isset($_POST['RCMSTable']) || isset($_GET['RCMSTable'])) {\n $id = $_POST['RCMSTable'] ?? $_GET['RCMSTable'];\n } else {\n return;\n }\n\n if (!isset($this->table[$id])) {\n return;\n }\n\n ob_get_clean();\n ob_start();\n header(\"Content-Type: application/json\");\n\n $table = $this->table[$id];\n $columns = $this->columns[$id];\n $where = $this->where[$id];\n $order = $this->order[$id];\n $settings = $this->settings[$id];\n\n if (isset($_POST['pageNum'])) {\n $settings['pageNum'] = $_POST['pageNum'];\n }\n\n if (isset($_POST['searchTxt'])) {\n $settings['searchTxt'] = $_POST['searchTxt'];\n }\n\n if (isset($_POST['sortKey'])) {\n $settings['sortKey'] = $_POST['sortKey'];\n }\n\n if (isset($_POST['sortDir'])) {\n $settings['sortDir'] = $_POST['sortDir'];\n }\n\n $this->settings[$id] = $settings;\n\n $rows = $this->retrieveData($table, $columns, $where, $order, $settings);\n\n $this->buildRows($id, $rows);\n\n exit;\n }", "function cinerama_edge_hook_twitter_request_ajax() {\n\t\tCineramaTwitterApi::getInstance()->obtainRequestToken();\n\t}", "public function ajax()\n {\n /*if($name!=\"\"){\n switch($name){\n case 'change_active':\n $post['active'] = $status;\n $this->User_model->update($post, $id); \n break;\n } \n exit;\n }*/\n \n $this->app->get_table_data('users'); \n }", "public function get_data_berita_on_slider_page(){\r\r\n\t\tif( $this->input->is_ajax_request() ){\r\r\n\t\t\t$this->get_data_ajax_berita_on_slider_page();\r\r\n\t\t}else{\r\r\n\t\t\tredirect(base_url());\r\r\n\t\t}\r\r\n\t}", "public function mp_hook_abo_ajax(){\n\t\treturn $this->mp_hook_payment_ajax('abo');\n\t\t}", "protected function processDeleteRequest()\n {\n $this->ajaxDie(json_encode([\n 'success' => true,\n 'operation' => 'delete'\n ]));\n }", "function getRequest();", "public function displayAjax()\n {\n http_response_code(400);\n $this->ajaxRenderJson(['error' => 'Invalid endpoint']);\n }", "public function ajaxAction(Request $request)\n {\n if($request->isXMLHttpRequest()){\n $db = $this->get('database_connection');\n $query = \"select * from post\";\n $rows = $db->fetchAll($query);\n return new JsonResponse(array('data' => json_encode($rows)));\n }\n return new Response(\"Ajax request error\", 400);\n }", "public function ajax_load_available_items()\n {\n }", "public function actionAjaxLoad()\r\n {\r\n \treturn $this->render('ajax-load');\r\n }", "private function isAjax()\n\t{\n\t\treturn $this->getRequest()->isXmlHttpRequest();\n\t}", "protected function processPutRequest()\n {\n $this->ajaxDie(json_encode([\n 'success' => true,\n 'operation' => 'put'\n ]));\n }", "public static function wp_ajax_tb_rank_math_content_ajax() {\n\t\tThemify_Builder_Component_Base::retrieve_template('builder-output.php', array('builder_output' => $_POST['data'], 'builder_id' => $_POST['id']), '', '', true);\n\t\twp_die();\n\t}", "function is_ajax() {\n return true;\n}", "public function ajaxProcessSearchCustomers()\n {\n }", "public function isAjax(): bool {}", "public function actionAjax()\n {\n $url = $_POST['url'];\n $video_id = VideoLibrary::get_video_id($url);\n //check if link was parsed succesfully\n if ( $video_id ) \n {\n $json_output = VideoLibrary::get_json_output($video_id);\n $title = VideoLibrary::get_info($json_output,'title');\n $description = VideoLibrary::get_info($json_output,'description');\n $image = VideoLibrary::get_info($json_output,'thumbnails')->high->url;\n $video_url = \"http://www.youtube.com/embed/\" . $video_id;\n $json_array = [\"title\"=>$title, \"description\"=>$description, \"image\"=>$image, \"video_url\"=> $video_url ];\n echo json_encode($json_array);\n\n }\n }", "public function getInitialData() \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n { $this->autorender = false;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n \t\t$this->layout = null;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n \t $this->render('ajax');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n $params = json_decode(file_get_contents('php://input'),true); //\n// $fileURL=$params['fileURL'];\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t//\n Controller::loadModel('Bugs');\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n $bugData=$this->Bugs->find('all', array('conditions' => array('status' => '0', 'parentid' => '0'))); //\n echo(json_encode($bugData)); //\n }", "final public function wp_ajax()\n\t{\n\t\t$this->display( $_POST['date'] );\n\t\texit;\n\t}", "function verify_ajax()\n {\n }", "function ajaxRequest($url, $post=null)\n{\n $d = httpRequest($url, $post);\n return json_decode($d['data'], false); // return Object\n}", "function ajaxGetEmployeeStatusHistory() {\n $empId = $_GET['empId'];\n\n $employeeHistory = getEmployeeStatusHistory($empId);\n\n echo json_encode($employeeHistory);\n }" ]
[ "0.71470916", "0.6824907", "0.66170937", "0.6443197", "0.63690317", "0.6348328", "0.62474847", "0.62352216", "0.617868", "0.6102074", "0.60912126", "0.608441", "0.6081433", "0.60764885", "0.6071746", "0.60660714", "0.60460734", "0.60431075", "0.60210663", "0.6013252", "0.59757525", "0.5946961", "0.5942796", "0.59417915", "0.59258807", "0.5920325", "0.5904455", "0.5875625", "0.5875625", "0.5872411", "0.586967", "0.5860707", "0.5851738", "0.5847744", "0.58432764", "0.58409965", "0.58342475", "0.58218175", "0.5821542", "0.5819574", "0.58130944", "0.5812871", "0.58063585", "0.57986414", "0.5793469", "0.5792359", "0.5775303", "0.5773246", "0.57667536", "0.5759109", "0.5754684", "0.57393694", "0.5737788", "0.573681", "0.573681", "0.57344854", "0.5734158", "0.5723537", "0.5713694", "0.5713607", "0.5712725", "0.5710087", "0.569826", "0.568569", "0.568204", "0.56779385", "0.5675929", "0.5671832", "0.5662262", "0.5646255", "0.5630812", "0.56275594", "0.5621856", "0.56209165", "0.5616373", "0.5610049", "0.5589923", "0.5587059", "0.5582282", "0.558194", "0.55766195", "0.5570711", "0.5570644", "0.55687094", "0.5564882", "0.5564681", "0.5564536", "0.5558518", "0.55546474", "0.5546515", "0.55430245", "0.5538627", "0.553718", "0.5534473", "0.55193245", "0.5516909", "0.55096674", "0.55052465", "0.5500145", "0.54973793", "0.54922605" ]
0.0
-1
///////////////////////////////////////////////////////////////////////// / Constructor / /////////////////////////////////////////////////////////////////////////
function __construct() { $this->user = new Profile(); $this->status = new Status(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function __construct()\t{}", "final private function __construct() {\n\t\t\t}", "private function __construct( )\n {\n\t}", "private function __construct() {\r\n\t\r\n\t}", "final private function __construct()\n\t{\n\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "public function __construct( )\r\n\t{\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "private function __construct()\n\t{\n\t\t\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "private function __construct()\r\n\t{\r\n\t}", "private function __construct() {\n\t\t}", "private function __construct() {\r\n\t\t\r\n\t}", "private function __construct () \n\t{\n\t}", "private function __construct()\r\r\n\t{\r\r\n\t}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct()\n\t{\n\n\t}", "final private function __construct(){\r\r\n\t}", "private function __construct() { \n\t\t\n\n\t}", "function _construct() {\n \t\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t// TODO Auto-generated constructor\n\t}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() {}", "final private function __construct() {}", "final private function __construct()\n {\n }", "private function __construct() {\r\n\t}", "private function __construct() {\r\n\t}", "private function __construct()\n\t{\n\t}", "private function __construct()\n\t{\n\t}", "private function __construct()\n\t{\n\t}", "private function __construct()\n\t{\n\t}", "private function __construct()\n\t{\n\t}", "private function __construct()\n\t{\n\t}", "private function __construct()\n\t{\n\t}", "private function __construct()\n\t{\n\t}", "private function __construct()\n\t{\n\t}", "function __construct()\r\n\t\t{\r\n\t\t\t\r\n\t\t}", "private function __construct () {}", "private function __construct()\r\n {}", "function __construct (){\n\t\t}", "function __construct() { }", "function __construct() { }", "function __construct() { }", "public function __construct()\n\t\t{\n\t\t\t//\n\t\t}", "private function __construct() {\n\t}", "private function __construct() {\n\t}", "private function __construct() {\n\t}", "private function __construct() {\n\t}", "private function __construct() {\n\t}", "private function __construct() {\n\t}", "private function __construct() {\n\t}", "private function __construct() {\n\t}", "private function __construct() {\n\t}", "private function __construct() {\n\t}", "private function __construct() {\n\t}", "private function __construct() {\n\t}", "private function __construct() {\n\t}", "private function __construct() {\n\t}", "private function __construct() {\n\t}", "private function __construct() {\n\t}", "private function __construct() {\n\t}", "private function __construct() {\n\t}", "private function __construct() {\n\t}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}" ]
[ "0.8757909", "0.85689086", "0.8497271", "0.8496717", "0.8492053", "0.84912395", "0.84625304", "0.8459791", "0.8459791", "0.8459791", "0.84510356", "0.84014404", "0.84014404", "0.84014404", "0.84014404", "0.84014404", "0.84014404", "0.84014404", "0.839564", "0.83825314", "0.8379307", "0.8377414", "0.8360704", "0.83571446", "0.83571446", "0.83571446", "0.83571446", "0.83571446", "0.83571446", "0.83571446", "0.83571446", "0.83571446", "0.83571446", "0.83571446", "0.83571446", "0.83571446", "0.83571446", "0.83571446", "0.83571446", "0.83571446", "0.835082", "0.8349272", "0.834823", "0.8343724", "0.83406603", "0.833987", "0.833987", "0.833987", "0.8335769", "0.8335769", "0.8318581", "0.8308653", "0.8308653", "0.82830924", "0.82830924", "0.82830924", "0.82830924", "0.82830924", "0.82830924", "0.82830924", "0.82830924", "0.82830924", "0.8278583", "0.8275439", "0.8273246", "0.8271987", "0.8251993", "0.8251993", "0.8251993", "0.8244623", "0.8240297", "0.8240297", "0.8240297", "0.8240297", "0.8240297", "0.8240297", "0.8240297", "0.8240297", "0.8240297", "0.8240297", "0.8240297", "0.8240297", "0.8240297", "0.8240297", "0.8240297", "0.8240297", "0.8240297", "0.8240297", "0.8240297", "0.8231552", "0.8231552", "0.8231552", "0.8231552", "0.8231552", "0.8231552", "0.8231552", "0.8231552", "0.8231552", "0.8231552", "0.8231552", "0.8231552" ]
0.0
-1
///////////////////////////////////////////////////////////////////////// / login() / / This method will attempt to login a user give a username and password. / If the login is successful it will load the user profile. Otherwise the / user profile will remain empty. /
public function login($username, $password) { if (strlen($username) > 0 && strlen($password) > 0) { // If values are supplied for both parameters then attempt to login. $this->user->loadProfile($username); $correctPassword = $this->user->getPassword(); if ($correctPassword == $password) { $this->user->loadFriends($username); return true; } else { unset($this->user); $this->user = new Profile(); return false; } } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function doLogin()\n {\n\n //check if all the fields were filled\n if (!Request::checkVars(Request::postData(), array('username', 'password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"Complete all the fields!\", \"type\" => \"error\")));\n exit;\n }\n\n //create the user entity with the spcific login data\n $userEntity = new User(array('username' => Request::post('username'), 'password' => Request::post('password'), 'email' => null, 'name' => null));\n\n //check if the user exists and get it as entity if exists\n if (!$userEntity = $this->repository->findUser($userEntity)) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The username does not exist!\", \"type\" => \"error\")));\n exit;\n }\n\n //get the user ID from database\n $userEntity->setAttr('access', $this->repository->getAccessByUsername(Request::post('username')));\n\n //check if the login credentials are correct for login\n if (!$this->repository->checkLogin($userEntity, Request::post('password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The user/email is incorrect!\", \"type\" => \"error\")));\n exit;\n }\n\n $userEntity->setAttr('access', $this->repository->getAccessByUsername(Request::post('username')));\n\n //set the session using the user data\n $this->session->setSession($userEntity);\n\n echo json_encode(\n array(\n \"swal\" => array(\"title\" => \"Success!\", \"text\" => \"You successfully logged in!\", \"type\" => \"success\", \"hideConfirmButton\" => true),\n \"redirect\" => array(\"url\" => BASE_URL . '/index.php?page=home', 'time' => 1)\n )\n );\n }", "public function do_login()\n {\n $this->userObject = new User();\n\n // grab the uID of the person signing in\n $uid = $this->userObject->checkUser($_POST['user_email'], $_POST['user_password']);\n\n // if the uID exists\n if ($uid) {\n\n $this->set('message', 'You logged in!');\n\n // grab the array of user-data from the database\n $user = $this->userObject->getUser($uid);\n\n // leave out the password\n unset($user['password']);\n unset($user[4]);\n\n // if (strlen($_SESSION['redirect']i) > 0) { // basically, if someone types in the url with the funciton after,\n // // supposed to redirect people to the pages they want.\n // $view = $_SESSION['redirect'];\n // unset($_SESSION['redirect']);\n // header('Location: ' . BASE_URL . $view);\n\n // make the SESSION key 'user' and set it equal to the aray of user-data\n $_SESSION['user'] = $user;\n\n header('Location: /index.php/');\n\n } else {\n\n $this->set('error', 'Sorry! Looks like something might be messed up with your Username or Password! :p');\n }\n }", "public function login(){\n require_once($_SERVER['DOCUMENT_ROOT'] . $_SERVER['CONTEXT_PREFIX'] . '/model/users.php');\n\n $username = $this->security->clean($this->data['username']);\n $password = $this->security->clean($this->data['password']);\n $password = $this->security->crypt($password);\n\n $user = new stdClass;\n\n $user->id = null;\n $user->username = $username;\n $user->password = $password;\n\n $users = new Users($user);\n\n $checkUsername = $users->checkUsername();\n if(gettype($checkUsername) == 'string'){\n return ['status' => false, 'data' => $checkUsername];\n }else{\n if($checkUsername){\n $checkPassword = $users->checkPassword();\n if(gettype($checkPassword) == 'string'){\n return ['status' => false, 'data' => $checkPassword];\n }else{\n if($checkPassword){\n $cookie = setcookie($this->security->crypt('user'), $this->security->crypt($users->getId()), time() + 60 * 60 * 24 * 30, '/', 'localhost', false, true);\n if($cookie){\n session_start();\n $_SESSION['user'] = $users->getId();\n session_write_close();\n \n return ['status' => true, 'data' => $checkPassword];\n }else{\n return ['status' => false, 'data' => 'Cookie failed'];\n }\n }else{\n return ['status' => true, 'data' => 'password'];\n }\n }\n }else{\n return ['status' => true, 'data' => 'username'];\n }\n }\n }", "public function login() {\r\n\t\t\r\n\t\t$back = $this->hybrid->get_back_url();\r\n\t\t$user_profile = $this->hybrid->auth();\r\n\t\t\r\n\t\t$email = $user_profile->emailVerified;\r\n\t\tif(!$email)\r\n\t\t\t$email = $user_profile->email;\r\n\t\t\r\n\t\tif(!$email)\r\n\t\t\t$this->hybrid->throw_error($this->ts(\"You don't have any email address associated with this account\"));\r\n\t\t\r\n\t\t/* check if user exists */\r\n\t\t$user = current($this->a_session->user->get(array(\"email\" => $email)));\r\n\t\tif(!$user) {\r\n\t\t\t/* create user */\r\n\t\t\t$uid = $this->hybrid->add_user($email, $user_profile);\r\n\t\t\t$user = current($this->a_session->user->get(array(\"id\" => $uid)));\r\n\t\t\t\r\n\t\t\tif(!$user)\r\n\t\t\t\t$this->wf->display_error(500, $this->ts(\"Error creating your account\"), true);\r\n\t\t}\r\n\t\t\r\n\t\t/* login user */\r\n\t\t$sessid = $this->hybrid->generate_session_id();\r\n\t\t$update = array(\r\n\t\t\t\"session_id\" => $sessid,\r\n\t\t\t\"session_time\" => time(),\r\n\t\t\t\"session_time_auth\" => time()\r\n\t\t);\r\n\t\t$this->a_session->user->modify($update, (int)$user[\"id\"]);\r\n\t\t$this->a_session->setcookie(\r\n\t\t\t$this->a_session->session_var,\r\n\t\t\t$sessid,\r\n\t\t\ttime() + $this->a_session->session_timeout\r\n\t\t);\r\n\t\t\r\n\t\t/* save hybridauth session */\r\n\t\t$this->a_session->check_session();\r\n\t\t$this->hybrid->save();\r\n\t\t\r\n\t\t/* redirect */\r\n\t\t$redirect_url = $this->wf->linker('/');\r\n\t\tif(isset($uid))\r\n\t\t\t$redirect_url = $this->wf->linker('/account/secure');\r\n\t\t$redirect_url = $back ? $back : $redirect_url;\r\n\t\t$this->wf->redirector($redirect_url);\r\n\t}", "public function login() {\n\t\tif(!empty(Session::get('http_response'))) {\n\t\t\thttp_response_code(Session::get('http_response'));\n\t\t\tSession::delete('http_response');\n\t\t}\n\t\tif($_POST && isset($_POST['login']) && isset($_POST['password'])) {\n\t\t\t$user = $this->_model->getLogin(strtolower($_POST['login']));\n\t\t\tif($user && $user->enabled) {\n\t\t\t\tif(hash_equals($user->password,crypt($_POST['password'],$user->password))) {\n\t\t\t\t\tif($user->blocked) {\n\t\t\t\t\t\thttp_response_code(403);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is blocked\"));\n\t\t\t\t\t} elseif($user->verified) {\n\t\t\t\t\t\tSession::set('user',$user);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'success','icon'=>'check','text'=>\"User has logged in successfully\"));\n\t\t\t\t\t\t$redirect = Session::get('login_redirect');\n\t\t\t\t\t\tRouter::redirect(Session::get('login_redirect'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is not yet confirmed\"));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thttp_response_code(401);\n\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t}\t\n\t\t}\n\t}", "private function login(){\n\t\tif (empty($_POST['username'])) {\n\t\t\t$this->errors[] = \"Username field was empty.\";\n } elseif (empty($_POST['password'])) {\n $this->errors[] = \"Password field was empty.\";\n } elseif (!empty($_POST['username']) && !empty($_POST['password'])) { \n\t\t\t$this->username = filter_var($_POST['username'], FILTER_SANITIZE_STRING);\t\t\t\n \t\n\t\t\t//prepared statement to login user\n\t\t\t$sel = \"SELECT * FROM users WHERE username = ? OR email = ? \";\n \tif($stmt = $this->connection->prepare($sel)){\n \t\t$stmt->bind_param(\"ss\", $this->username, $this->username);\n \t\t$stmt->execute();\n \t\t//$stmt->bind_result();\n \t\t$res = $stmt->get_result();\n \t\t$user_info = $res->fetch_object();\n \t}\n\t\t\t\t\t\t\t\t\t\n\t\t\tif (password_verify($_POST['password'], $user_info->password)) {\n\t\t\t\t$_SESSION['username'] = $user_info->username;\n\t\t\t\t$_SESSION['email'] = $user_info->email;\n\t\t\t\t$_SESSION['user_login_status'] = 1;\n\t\t\t} else if(empty($user_info)){\n\t\t\t\t$this->errors[] = \"Wrong User name. Please try again\";\n\t\t\t} else {\n\t\t\t\t$this->errors[] = \"Wrong password. Please try again\";\n\t\t\t}\n\t\t}\n\t}", "public function Login()\n\t{\n\t\t$this->user->email = $_POST['email'];\n\t\t$this->user->password = $_POST['password'];\n // Here we verify the nonce, so that only users can try to log in\n\t\t// to whom we've actually shown a login page. The first parameter\n\t\t// of Nonce::Verify needs to correspond to the parameter that we\n\t\t// used to create the nonce, but otherwise it can be anything\n\t\t// as long as they match.\n\t\tif (isset($_POST['nonce']) && ulNonce::Verify('login', $_POST['nonce'])){\n\t\t\t// We store it in the session if the user wants to be remembered. This is because\n\t\t\t// some auth backends redirect the user and we will need it after the user\n\t\t\t// arrives back.\n\t\t\t//echo \"login successful\";\n\t\t\t\n\t\t\t///echo $this->input->post('email');\n\n\t\t\tif (isset($_POST['autologin']))\n\t\t\t\t$_SESSION['appRememberMeRequested'] = true;\n\t\t\telse\n\t\t\t\tunset($_SESSION['appRememberMeRequested']);\n \n\t\t\t// This is the line where we actually try to authenticate against some kind\n\t\t\t// of user database. Note that depending on the auth backend, this function might\n\t\t\t// redirect the user to a different page, in which case it does not return.\n\t\t\t$this->ulogin->Authenticate($_POST['email'], $_POST['password']);\n\t\t\tif ($this->ulogin->IsAuthSuccess()){\n\t\t\t\t$_SESSION[\"loggedIn\"] = true;\n\t\t\t\techo \"success\";\n\t\t\t}else echo \"failed\";\n\t\t}else echo 'refresh';\n\t\t//$this->load->view('layout/home.php');\n\t}", "public function login($username, $password)\r\n\t{\r\n\t\t// Make sure we have something to work with\r\n\t\tif(!strlen($username) || !strlen($password)) return $this->user = false;\r\n\t\t\r\n\t\t// Check who the user is and if the password is right\r\n\t\t$username = mysql_real_escape_string($username);\r\n\t\t$password = hash(HASH_ALGO, $password . $username);\r\n\t\t$query = 'SELECT id,username,userlevel,email,realname,country,linkedin_id,linkedin_url FROM users WHERE username=\"' . $username\r\n\t\t\t\t\t. '\" AND password=\"' . $password . '\" LIMIT 1';\r\n\t\t$res = mysql_query($query) or die('Bad SQL Query on login attempt');\r\n\t\t$res = mysql_fetch_array($res);\r\n\t\tif($res === false) return $this->user = false;\r\n\r\n\t\t// Credentials OK. Approve the login.\r\n\t\t$this->user = new User();\r\n\t\t$this->user->id = $res['id'];\r\n\t\t$this->user->username = $res['username'];\r\n\t\t$this->user->email = $res['email'];\r\n\t\t$this->user->userlevel = $res['userlevel'];\r\n\t\t$this->user->realname = $res['realname'];\r\n\t\t$this->user->country = $res['country'];\r\n\t\t$this->user->linkedin_id = $res['linkedin_id'];\r\n\t\t$this->user->linkedin_url = $res['linkedin_url'];\r\n\t\t\r\n\t\t$query = 'UPDATE users SET fingerprint=\"' . genPrint() . '\" WHERE id=' . $this->user->id . ' LIMIT 1';\r\n\t\t$res = mysql_query($query) or die('Bad SQL Query on login approval');\r\n\t\tsetcookie('qw_login', $this->user->id, time()+60*60*24*365, '/');\r\n\t\treturn true;\r\n\t}", "public function login(){\n //we expect a form of ?controller=login&action=login to show the login page\n if($_SERVER['REQUEST_METHOD'] == 'GET') {\n require_once('views/login/login.php');\n } else {\n \n $login= Login::login($_POST['username'], $_POST['password'], $_POST['email']);\n \n if ($login){ \n Login::setSession($login);\n $user = Login::getUser($_POST['username']);\n require_once('views/login/userProfile.php');\n \n}\n }\n}", "private function login() {\n //Look for this username in the database\n $params = array($this->auth_username);\n $sql = \"SELECT id, password, salt \n FROM user \n WHERE username = ? \n AND deleted = 0\";\n //If there is a User with this name\n if ($row = $this->db->fetch_array($sql, $params)) {\n //And if password matches\n if (password_verify($this->auth_password.$row[0] ['salt'], $row[0] ['password'])) {\n $params = array(\n session_id(), //Session ID\n $row[0] ['id'], //User ID\n self::ISLOGGEDIN, //Login Status\n time() //Timestamp for last action\n );\n $sql = \"INSERT INTO user_session (session_id, user_id, logged_in, last_action) \n VALUES (?,?,?,?)\";\n $this->db->query($sql, $params);\n header('Location: ' . $_SERVER['HTTP_REFERER']);\n //User now officially logged in\n }\n //If password doesn't match\n else {\n //Send user back to login with error\n $this->login_form(self::ERR_NOUSERFOUND);\n }\n }\n //If there isn't a User with this name\n else {\n //Send user back to login with error\n $this->login_form(self::ERR_NOUSERFOUND);\n }\n }", "public function tryLogIn(){\n if(count(self::$loginErrors) === 0){\n $password = md5(self::$loginPassword);\n $query = self::$connection->db->prepare(\"SELECT * FROM users WHERE email = ? AND password = ?\");\n $query->bind_param(\"ss\", self::$loginEmail, $password);\n $query->execute();\n $user = mysqli_fetch_assoc( $query->get_result());\n //Send to Profile page if correct credentials; otherwise, stay on authentication page\n if($user){\n $this->prepareSession($user['name'], self::$loginEmail);\n $_POST = array();\n Auth::CreateView('Profile');\n }else{\n self::addError(\"login\", \"Incorrect credentials!\");\n Auth::CreateView('Auth');\n }\n }\n self::$connection->closeConnection();\n }", "public function login() {\n\t\t//see if the user exists in the config.\r\n\t\tif (empty ( $_SESSION['uid'] ) && !isset($_POST['user'])) {\n\t\t\techo '<reply action=\"login-error\"><message type=\"error\">Login required.</message></reply>';\n\t\t\tsession_destroy();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(isset($_POST['user'])){\n\t\t\t$xmlUser = $this->getUser ( $_POST ['user'] );\n\t\t}\n\t\t\n\t\t//Validate the user\n\t\tif ( isset ( $xmlUser ) && (empty($xmlUser ['password']) || (isset($_POST ['password']) && $xmlUser ['password'] == crypt($_POST ['password'],$xmlUser['password'])))) {\n\t\t\t//if a session exists, restrict login to only that user.\n\t\t\tif (! isset ( $this->session ) || ($this->session ['name'] == $xmlUser ['name'] && $this->session ['ip'] == $_SERVER ['REMOTE_ADDR'])) {\n\t\t\t\t//Login OK\r\n\t\t\t\t$this->isLoggedin = true;\n\t\t\t\t$this->name = $xmlUser ['name'];\n\t\t\t\t$this->group = $xmlUser ['group'];\n\t\t\t\t$this->session ['uid'] = session_id ();\n\t\t\t\t$this->session ['name'] = ( string ) $xmlUser ['name'];\n\t\t\t\t$this->session ['ip'] = $_SERVER ['REMOTE_ADDR'];\n\t\t\t\tsession_register('uid');\n\t\t\t\tsession_register('group');\n\t\t\t\t$_SESSION['uid'] = (string) $xmlUser['name'];\n\t\t\t\t$_SESSION['group'] = (string)$xmlUser['group'];\n\t\t\t\t$this->updateSession ();\n\t\t\t\t\n\t\t\t\tLogger::getRootLogger ()->info ( \"User {$xmlUser['name']} is logged in.\" );\n\t\t\t\techo '<reply action=\"login-ok\"><message>logged in.</message></reply>';\n\t\t\t} else {\n\t\t\t\t//Another user is logged in\r\n\t\t\t\tLogger::getRootLogger ()->info ( \"Could not login user {$_POST['user']}. Another user is already logged in.\" );\n\t\t\t\techo '<reply action=\"login-error\"><message type=\"error\">Error logging in. Another user is already logged in.</message></reply>';\n\t\t\t}\n\t\t} else {\n\t\t\tif(isset($_POST['password'])){\n\t\t\t\t//Wrong user and/or pass\n\t\t\t\tsession_destroy();\r\n\t\t\t\tLogger::getRootLogger ()->info ( \"Could not login user {$_POST['user']}. Wrong username and/or password.\" );\n\t\t\t\techo '<reply action=\"login-error\"><message type=\"error\">Error logging in. Username and or password is incorrect.</message></reply>';\n\t\t\t}\n\t\t\telse{\n\t\t\t\tsession_destroy();\n\t\t\t\techo '<reply action=\"login-error\"><message type=\"error\">Your session has expired</message></reply>';\n\t\t\t}\n\t\t}\n\t}", "public function login_user()\n\t{\n\t\t$form_filled = true;\n\n\t\t//a way to set default values\n\t\tif (isset($_POST['username']) && $_POST['username'] != \"\") \n\t\t{\n\t\t\t$username = $_POST[\"username\"];\n\t\t} else\n\t\t{\n\t\t\t$username = \"\";\n\t\t\t$form_filled = false;\n\t\t}\n\t\tif (isset($_POST['password']) && $_POST['password'] != \"\") \n\t\t{\n\t\t\t$password = $_POST[\"password\"];\n\t\t} else\n\t\t{\n\t\t\t$password = \"\";\n\t\t\t$form_filled = false;\n\t\t}\n\n\t\tif ($form_filled)\n\t\t{\n\t\t\t$table = $this->getTableFormat(\"users\");\n\t\t\t$results = DB::query(\"SELECT id, username, password FROM $table\");\n\t\t\tforeach ($results as $row) {\n\t\t\t\tif ($row['username'] == $username)\n\t\t\t\t{\n\t\t\t\t\tif (password_verify($password, $row['password']))\n\t\t\t\t\t{\n\t\t\t\t\t\t//echo \"Login Correct\";\n\t\t\t\t\t\t$logged_in = true;\n\t\t\t\t\t\t//$_SESSION['user'] = $row['id'];\n\n\t\t\t\t\t\t/*Add login to logins table*/\n\t\t\t\t\t\t$userid = $row['id'];\n\t\t\t\t\t\t$userip = $_SERVER['REMOTE_ADDR'];\n\t\t\t\t\t\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\t\t\t\t\t$userip2 = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$userip2 = $userip;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$current_time = time();\n\t\t\t\t\t\t$table = $this->getTableFormat(\"logins\");\n\t\t\t\t\t\tDB::insert($table, array(\n\t\t\t\t\t\t 'userid' => $userid,\n\t\t\t\t\t\t 'user_ip' => $userip,\n\t\t\t\t\t\t 'user_ip_2' => $userip2,\n\t\t\t\t\t\t 'last_action' => $current_time\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\t//now, lets get the id of the session, hash it, and save it in the session variable\n\t\t\t\t\t\t$login_results = DB::query(\"Select * FROM $table\");\n\t\t\t\t\t\tforeach ($login_results as $i)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($i['userid'] == $userid && $i['user_ip'] == $userip && $i['user_ip_2'] == $userip2 && $i['last_action'] == $current_time) {\n\t\t\t\t\t\t\t\t//echo \"found the record\";\n\t\t\t\t\t\t\t\t$_SESSION['user'] = hash('ripemd160', $i['id']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\n\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t//echo \"Username or Password not correct\";\n\t\t\t\t\t$logged_in = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function login() {\n $this->db->sql = 'SELECT * FROM '.$this->db->dbTbl['users'].' WHERE username = :username LIMIT 1';\n\n $user = $this->db->fetch(array(\n ':username' => $this->getData('un')\n ));\n\n if($user['hash'] === $this->hashPw($user['salt'], $this->getData('pw'))) {\n $this->sessionId = md5($user['id']);\n $_SESSION['user'] = $user['username'];\n $_SESSION['valid'] = true;\n $this->output = array(\n 'success' => true,\n 'sKey' => $this->sessionId\n );\n } else {\n $this->logout();\n $this->output = array(\n 'success' => false,\n 'key' => 'WfzBq'\n );\n }\n\n $this->renderOutput();\n }", "public function login()\n\t{\n\t\t$mtg_login_failed = I18n::__('mtg_login_failed');\n\t\tR::selectDatabase('oxid');\n\t\t$sql = 'SELECT oxid, oxfname, oxlname FROM oxuser WHERE oxusername = ? AND oxactive = 1 AND oxpassword = MD5(CONCAT(?, UNHEX(oxpasssalt)))';\n\t\t$users = R::getAll($sql, array(\n\t\t\tFlight::request()->data->uname,\n\t\t\tFlight::request()->data->pw\n\t\t));\n\t\tR::selectDatabase('default');//before doing session stuff we have to return to db\n\t\tif ( ! empty($users) && count($users) == 1) {\n\t\t\t$_SESSION['oxuser'] = array(\n\t\t\t\t'id' => $users[0]['oxid'],\n\t\t\t\t'name' => $users[0]['oxfname'].' '.$users[0]['oxlname']\n\t\t\t);\n\t\t} else {\n\t\t\t$_SESSION['msg'] = $mtg_login_failed;\n\t\t}\n\t\t$this->redirect(Flight::request()->data->goto, true);\n\t}", "function login() {\n\t\tif (isset($_REQUEST['username']) && !empty($_REQUEST['username'])) {\n\t\t\t$username = $_REQUEST['username'];\n\n\t\t\t$userDAO = implementationUserDAO_Dummy::getInstance();\n\t\t\t$users = $userDAO->getUsers();\n\n\t\t\tforeach ($users as $key => $user) {\n\t\t\t\tif ($user->getUsername() === $username) {\n\t\t\t\t\t$userFound = $user;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($userFound) && $userFound != null) {\n\n\t\t\t\tif (isset($_REQUEST['password']) && !empty($_REQUEST['password'])) {\n\t\t\t\t\t$password = $_REQUEST['password'];\n\n\t\t\t\t\tif ($userFound->getPassword() === $password) {\n\n\t\t\t\t\t\tsession_start();\n\t\t\t\t\t\t$_SESSION['USERNAME']= $username;\n\n\t\t\t\t\t\t$url = getPreviousUrl();\n\t\t\t\t\t\t$newUrl = substr($url, 0, strpos($url, \"?\"));\n\n\t\t\t\t\t\tredirectToUrl($newUrl);\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\t// redirecting to login with bad password alert\n\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\t// redirecting to login page with bad username alert\n\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t}\n\n\n\t}", "function user_login($username, $password)\n {\n\n $query = \"SELECT u.*\n \t\t FROM \" . $this->db_table_prefix . \"users u\n \t\t JOIN \" . $this->db_table_prefix . \"roles r ON u.role_id = r.id\n \t\t WHERE email='\" . $username . \"' AND password='\" . md5($password) . \"' \n AND u.status = '1' LIMIT 0,1\";\n \n $result = $this->commonDatabaseAction($query); \n $user_details = array(); \n $user_details = $this->sqlAssoc;\n \n// if (mysql_num_rows($result) > 0 && !empty($user_details))\n if ($this->rowCount > 0 && !empty($user_details))\n { \n $_SESSION ['user_id'] = $user_details[0]['id'];\n $_SESSION ['user_first_name'] = $user_details[0]['firstname'];\n\n if ($user_details[0]['lastname'] !== '')\n {\n $_SESSION ['user_last_name'] = $user_details[0]['lastname'];\n }\n else\n {\n $_SESSION ['user_last_name'] = '';\n }\n\n $_SESSION ['user_role'] = $user_details[0]['role_id'];\n }\n else\n {\n $_SESSION ['user_login_error'] = 1;\n }\n }", "function userLogin()\n\t{\n\t\t$userName = $_POST['userName'];\n\t\t$password = $_POST['userPassword'];\n\t\t$rememberData = $_POST['rememberData'];\n\n\t\t# Verify if the user currently exists in the Database\n\t\t$result = validateUserCredentials($userName);\n\n\t\tif ($result['status'] == 'COMPLETE')\n\t\t{\n\t\t\t$decryptedPassword = decryptPassword($result['password']);\n\n\t\t\t# Compare the decrypted password with the one provided by the user\n\t\t \tif ($decryptedPassword === $password)\n\t\t \t{\n\t\t \t$response = array(\"status\" => \"COMPLETE\");\n\n\t\t\t # Starting the sesion\n\t\t \tstartSession($result['fName'], $result['lName'], $userName);\n\n\t\t\t # Setting the cookies\n\t\t\t if ($rememberData)\n\t\t\t\t{\n\t\t\t\t\tsetcookie(\"cookieUserName\", $userName);\n\t\t\t \t}\n\t\t\t echo json_encode($response);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdie(json_encode(errors(306)));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdie(json_encode($result));\n\t\t}\n\t}", "public function checkLogin() {\r\n\t\t$post = $this -> sanitize();\r\n\t\textract($post);\r\n\t\t// Hash the password that was entered into the form (if it was correct, it will match the hashed password in the database)\r\n\t\t$password = sha1($password);\r\n\t\t// Query\r\n\t\t$query = \"SELECT username, userID, profilePic, access, email FROM users WHERE username='$username' AND password='$password'\";\r\n\t\t$data = $this -> singleSelectQuery($query);\r\n\t\tif($data){\r\n\t\t\t//set up the session\r\n\t\t\t$_SESSION['userID'] = $data['userID'];\r\n\t\t\t$_SESSION['username'] = $data['username'];\r\n\t\t\t$_SESSION['profilePic'] = $data['profilePic'];\r\n\t\t\t$_SESSION['userType'] = $data['userType'];\r\n\t\t\t$_SESSION['access'] = $data['access'];\r\n\t\t\t//redirects to their profile\r\n\t\t\theader('location: index.php?page=profile&userID='.$_SESSION['userID']);\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t}", "function login()\n\t{\n\t\tif(isset($this->cookie[$this->sets['cookie_prefix'] . 'user']) && isset($this->cookie[$this->sets['cookie_prefix'] . 'pass'])) {\n\t\t\t$cookie_user = intval($this->cookie[$this->sets['cookie_prefix'] . 'user']);\n\t\t\t$cookie_pass = $this->cookie[$this->sets['cookie_prefix'] . 'pass'];\n\t\t\t$user = $this->db->fetch(\"SELECT m.*, s.skin_dir, g.group_perms, g.group_file_perms, g.group_name, t.membertitle_icon\n\t\t\t\tFROM (%pskins s, %pgroups g, %pusers m)\n\t\t\t\tLEFT JOIN %pmembertitles t ON t.membertitle_id = m.user_level\n\t\t\t\tWHERE m.user_id=%d AND\n\t\t\t\t m.user_password='%s' AND\n\t\t\t\t s.skin_dir=m.user_skin AND\n\t\t\t\t g.group_id=m.user_group LIMIT 1\",\t$cookie_user, $cookie_pass);\n\t\t} else if(isset($_SESSION['user']) && isset($_SESSION['pass'])) {\n\t\t\t$session_user = intval($_SESSION['user']);\n\t\t\t$session_pass = $_SESSION['pass'];\n\t\t\t$user = $this->db->fetch(\"SELECT m.*, s.skin_dir, g.group_perms, g.group_file_perms, g.group_name, t.membertitle_icon\n\t\t\t\tFROM (%pskins s, %pgroups g, %pusers m)\n\t\t\t\tLEFT JOIN %pmembertitles t ON t.membertitle_id = m.user_level\n\t\t\t\tWHERE m.user_id=%d AND\n\t\t\t\t MD5(CONCAT(m.user_password,'%s'))='%s' AND\n\t\t\t\t s.skin_dir=m.user_skin AND\n\t\t\t\t g.group_id=m.user_group LIMIT 1\",\t$session_user, $this->ip, $session_pass);\n\t\t} else {\n\t\t\t$user = $this->db->fetch(\"SELECT m.*, s.skin_dir, g.group_perms, g.group_file_perms, g.group_name\n\t\t\t\tFROM (%pskins s, %pgroups g, %pusers m)\n\t\t\t\tWHERE m.user_id=%d AND\n\t\t\t\t s.skin_dir=m.user_skin AND\n\t\t\t\t g.group_id=m.user_group LIMIT 1\", USER_GUEST_UID);\n\t\t\t$user['user_language'] = $this->get_browser_lang($this->sets['default_lang']);\n\t\t}\n\n\t\tif (!isset($user['user_id'])) {\n\t\t\t$user = $this->db->fetch(\"SELECT m.*, s.skin_dir, g.group_perms, g.group_file_perms, g.group_name\n\t\t\t\tFROM (%pskins s, %pgroups g, %pusers m)\n\t\t\t\tWHERE m.user_id=%d AND\n\t\t\t\t s.skin_dir=m.user_skin AND\n\t\t\t\t g.group_id=m.user_group LIMIT 1\", USER_GUEST_UID);\n\n\t\t\tsetcookie($this->sets['cookie_prefix'] . 'user', '', $this->time - 9000, $this->sets['cookie_path'], $this->sets['cookie_domain'], $this->sets['cookie_secure'], true );\n\t\t\tsetcookie($this->sets['cookie_prefix'] . 'pass', '', $this->time - 9000, $this->sets['cookie_path'], $this->sets['cookie_domain'], $this->sets['cookie_secure'], true );\n\n\t\t\tunset($_SESSION['user']);\n\t\t\tunset($_SESSION['pass']);\n\t\t\t$user['user_language'] = $this->get_browser_lang($this->sets['default_lang']);\n\t\t}\n\t\treturn $user;\n\t}", "public function login()\n\t{\t\n\t\tif ($this->common->isLoggedIn()) {\n\t\t\t$this->url->redirect('dashboard');\n\t\t}\n\t\tif ($this->commons->validateToken($this->url->post('_token'))){\n\t\t\t$this->url->redirect('login');\n\t\t}\n\n\t\t$username = $this->url->post('username');\n\t\t$password = $this->url->post('password');\n\n\t\tif (!$this->validate($username, $password)) {\n\t\t\t$this->session->data['error'] = 'Warning: Please enter valid data in input box.';\n\t\t\t$this->url->redirect('login');\n\t\t}\n\n\t\tunset($this->session->data['user_id']);\n\t\tunset($this->session->data['login_token']);\n\t\tunset($this->session->data['role']);\n\n\t\t/*Intiate login Model*/\n\t\t$this->loginModel = new Login();\n\t\t/** \n\t\t* If the user exists\n\t\t* Check his account and login attempts\n\t\t* Get user data \n **/\n\t\tif ($user = $this->loginModel->checkUser($username)) {\n\t\t\t/** \n\t\t\t* User exists now We check if\n\t\t\t* The account is locked From too many login attempts \n **/\n\t\t\tif (!$this->checkLoginAttempts($user['email'])) {\n\t\t\t\t$this->session->data['error'] = 'Warning: Your account has exceeded allowed number of login attempts. Please try again in 1 hour.';\n\t\t\t\t\n\t\t\t\t$this->url->redirect('login');\n\t\t\t}\n\t\t\telse if ($user['status'] === 1) {\n\t /** \n\t * Check if the password in the database matches the password user submitted.\n\t * We are using the password_verify function to avoid timing attacks.\n\t **/\n\t if (password_verify( $password, $user['password'])) {\n\t \t$this->loginModel->deleteAttempt($user['email']);\n\t \t/** \n\t \t* Start session for user create session varible \n\t\t * Create session login string for authentication\n\t\t **/\n\t \t$this->session->data['user_id'] = preg_replace(\"/[^0-9]+/\", \"\", $user['user_id']); \n\t \t$this->session->data['role'] = preg_replace(\"/[^0-9]+/\", \"\", $user['user_role']);\n\t \t$this->session->data['login_token'] = hash('sha512', AUTH_KEY . LOGGED_IN_SALT);\n\t \t$this->url->Redirect('dashboard');\n\t } else {\n\t \t/** \n\t \t* Add login attemt to Db\n\t\t * Redirect back to login page and set error for user\n\t\t **/\n\t \t$this->loginModel->addAttempt($user['email']);\n\t \t$this->session->data['error'] = 'Warning: No match for Username and/or Password.';\n\t \t$this->url->Redirect('login');\n\t }\n\t }\n\t else {\n\t \t/** \n\t \t* If account is disabled by admin \n\t\t * Then Show error to user\n\t\t **/\n\t \t$this->session->data['error'] = 'Warning: Your account has disabled for more info contact us.';\n\t \t$this->url->redirect('login');\n\t }\n\t }\n\t else {\n\t \t/** \n\t * If email address not found in DB \n\t\t * Show error to user for creating account\n\t\t **/\n\t \t$this->session->data['error'] = 'Warning: No match for Username and/or Password.';\n\t \t$this->url->redirect('login');\n\t }\n\t}", "public function login()\n\t{\n\t\t//Compute the hash code of the password submited by user\n\t\t$user_password_hash = $this->passwordEncrypt($this->user_info['user_password']);\n\t\t\n\t\t//Do datebase query to get the hash code of the password\n\t\t$db = BFL_Database :: getInstance();\n\t\t$stmt = $db->factory('select `user_id`,`user_password` from '.DB_TABLE_USER.' WHERE `user_name` = :user_name');\n\t\t$stmt->bindParam(':user_name', $this->user_info['user_name']);\n\t\t$stmt->execute();\n\t\t$rs = $stmt->fetch();\n\t\tif (empty($rs))\n\t\t\tthrow new MDL_Exception_User_Passport('user_name');\n\t\t\n\t\tif ($rs['user_password'] != $user_password_hash)\n\t\t\tthrow new MDL_Exception_User_Passport('user_password');\n\n\t\t//Set user session\n\t\t$auth = BFL_ACL :: getInstance();\n\t\t$auth->setUserID($rs['user_id']);\n\t}", "private static function login() {\n if ( !self::validatePost() ) {\n return;\n }\n $_POST['email'] = strtolower($_POST['email']);\n \n $password = Helper::hash($_POST['password'].$_POST['email']);\n \n $result = Database::getUser($_POST['email'],$password);\n \n if ( $result === false || !is_array($result) ) {\n self::setError('Unbekannter Benutzername oder Passwort!<br>');\n return;\n }\n \n if ( count($result) != 1 ) {\n self::setError('Unbekannter Benutzername oder Passwort!<br>');\n return;\n }\n \n $_SESSION['user']['id'] = $result[0]['id'];\n $_SESSION['user']['email'] = $result[0]['email'];\n $_SESSION['user']['nickname'] = $result[0]['nickname'];\n $_SESSION['user']['verified'] = $result[0]['verified'];\n $_SESSION['user']['moderator'] = $result[0]['moderator'];\n $_SESSION['user']['supermoderator'] = $result[0]['supermoderator'];\n $_SESSION['loggedin'] = true;\n self::$loggedin = true;\n }", "function loginUser() {\n\tsession_start();\n\trequire_once(\"sql/dbQueries.php\");\n\n\t// Fetching user data from login data\n\t$userData = getUserFromLogin($_POST['vms_email'], $_POST['userPassword']);\n\n\tif($userData == False) {\n\t\tprintLoginPage(\"The login information supplied is not valid.\");\n\t\treturn;\n\t} else {\n\t\t// Saving the user's info in a session variable\n\t\t$_SESSION['auth'] = TRUE;\n\t\t$_SESSION['auth_info'] = $userData[0];\n\n\t\t// Fetching the DID for the user's default DID.\n\t\t$activeDID = getDIDFromID($userData[0]['didID_default']);\n\t\tif($activeDID != false) {\n\t\t\t$_SESSION['auth_info']['activeDID'] = $activeDID['did'];\n\t\t} else {\n\t\t\t$_SESSION['auth_info']['activeDID'] = null;\n\t\t}\n\t\t//print_r($_SESSION);\n\n\t\t// Head back home\n\t\theader(\"Location: index.php\");\n\t\treturn;\n\t}\n}", "function login()\n{\n\tglobal $conf, $json, $resout, $db;\n\n\t$username = cRequest::any('_user');\n\t$password = cRequest::any('_pass');\n\t$p = $password;\n\n\t//die(\"_user: $username | _pass: $password\");\n\t\n\tif ((!$password) || (!$username)) {\n\t\t# XXX: Error page\n\t\tdie(\"Username and Password Required\");\n\t}\n\n\t$dbh = $db->open($conf['db']['host'], $conf['db']['user'],\n\t\t\t $conf['db']['passwd'], $conf['db']['name']);\n\n\t$uname = $db->secure($username);\n\t$passwd = sha1($password);\n\n\t$sql = \"select * from {$conf['tbl']['usermap']}\n\t\twhere username='$uname';\";\n\t$ret = $db->query($sql);\n\tif ($ret) {\n\t\t$res = $db->asfetch($ret);\n\t\t$uid = $res['uid'];\n\t\t$actype = $res['actype'];\n\t\tswitch($actype) {\n\t\tcase 'sa':\n\t\t\t$sql = \"select * from {$conf['tbl']['login']}\n\t\t\t\twhere username='$uname'\";\n\t\t\t$ret = $db->query($sql);\n\t\t\t$res = $db->asfetch($ret);\n\t\t\tbreak;\n\t\tcase 'a':\n\t\t\t$sql = \"select * from {$conf['tbl']['shopinfo']}\n\t\t\t\tleft join {$conf['tbl']['login']} \n\t\t\t\ton({$conf['tbl']['shopinfo']}.sid = \n\t\t\t\t{$conf['tbl']['login']}.uid )\n\t\t\t\twhere username='$uname'\";\n\t\t\t$ret = $db->query($sql);\n\t\t\t$res = $db->asfetch($ret);\n\t\t\tbreak;\n\t\tcase 'u':\n\t\t\t$sql = \"select * from {$conf['tbl']['profile']}\n\t\t\t\tleft join {$conf['tbl']['login']} \n\t\t\t\ton({$conf['tbl']['profile']}.uid = \n\t\t\t\t{$conf['tbl']['login']}.uid )\n\t\t\t\twhere username='$uname'\";\n\t\t\t$ret = $db->query($sql);\n\t\t\t$res = $db->asfetch($ret);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t/* XXX: ERROR */\n\t\t\tdie(\"[!] Error: No account with Username $uname\");\n\t\t\t/* NOTREACHED */\n\t\t}\n\n\t\t# cmp passwd\n\t\tif ($passwd != $res['passwd']) {\n\t\t\tprint_r($res);\n\t\t\tprint \"Passwords don't match[$passwd | {$res['passwd']}]\";\n\t\t\texit();\n\t\t}\n\n\t\t# get last login\n\t\t$sqll = \"select * from loginhistory where uid='$uid'\";\n\t\t$retl = $db->query($sqll);\n\t\t$resl = $db->asfetch($retl);\n\n\t\t# set up session data\n\t\t$sess = new cSession;\n\t\t$datetime = date('Y/m/d H:i:s');\n\t\t$lastip = cIP::getusrip();\n\t\t$location = cIP::getusrcountry($lastip); # FIXME: need to add ip2ctry dir\n\t\tif (isset($location['country_name'])) {\n\t\t\t$location = $location['country_name'];\n\t\t} else {\n\t\t\t$location = \"Unknown\";\n\t\t}\n\n\t\tif (preg_match('/1996\\/09\\/26 16:00:00/', $resl['lastlogin'], $match)) {\n\t\t\t$ll = $datetime;\n\t\t} else {\n\t\t\t$ll = $resl['lastlogin'];\n\t\t}\n\n\t\tif (preg_match('/0\\.0\\.0\\.0/', $resl['lastip'], $match)) {\n\t\t\t$lip = $lastip;\n\t\t} else {\n\t\t\t$lip = $resl['lastip'];\n\t\t}\n\n\t\t$sess->set('uid', $res['uid']);\n\t\t$sess->set('uname', $username);\n\t\t$sess->set('actype', $actype);\n\t\tif ($actype == 'u') {\n\t\t\t$sess->set('fname', $res['fname']);\n\t\t\t$sess->set('email', $res['email']);\n\t\t}\n\t\tif ($actype == 'a') {\n\t\t\t$sess->set('sname', $res['sname']);\n\t\t\t$sess->set('email', $res['email']);\n\t\t}\n\n\t\t$sess->set('lastlogin', $ll);\n\t\t$sess->set('lastip', $lip);\n\n\t\t# XXX: update login history\n\t\t$sql = \"update {$conf['tbl']['loginhistory']} set lastlogin='$datetime',\n\t\t\tlastip='$lastip', lastlocation='$location'\n\t\t\twhere uid='$uid';\";\n\t\t$db->query($sql);\n\n\t\t$db->close($dbh);\n\t\tunset($db);\n\t\tunset($sess);\n\n\t\theader(\"Location: dashboard.php\");\n\t\texit();\n\t} else {\n\t\t# XXX: Error page\n\t\tdie(\"[!] Fatal Error: No account with Username '$uname'\");\n\t\t/* NOTREACHED */\n\t}\n}", "public function login()\n {\n //$this->username = $username; // we are gonnna use the above property: $username here\n //$this->password = $password;\n // we want to call authuser from within login so\n $this->auth_user(); // we don't need to pass any arguments here because we know the class properties above this line\n\n }", "function login()\n{\n// See if we have values already stored in the session\nif ($this->session->get('login_hash')) {\n$this->confirmAuth();\nreturn;\n}\n// If this is a fresh login, check $_POST variables\nif (!isset($_POST[USER_LOGIN_VAR]) ||\n!isset($_POST[USER_PASSW_VAR])) {\n$this->redirect();\n}\nif ($this->md5) {\n $password = md5($_POST[USER_PASSW_VAR]);\n} else {\n$password = $_POST[USER_PASSW_VAR];\n}\n// Escape the variables for the query\n$login = mysql_escape_string($_POST[USER_LOGIN_VAR]);\n$password = mysql_escape_string($password);\n// Query to count number of users with this combination\n$sql = \"SELECT COUNT(*) AS usuarios\nFROM \" . USER_TABLE . \"\nWHERE\n\" . USER_TABLE_LOGIN . \"='$login' AND\n\" . USER_TABLE_PASSW . \"='$password'\";\n$result = $this->db->query($sql);\n$row = $result->fetch();\n// If there isn't is exactly one entry, redirect\nif ($row['num_users'] != 1) {\n$this->redirect();\n// Else is a valid user; set the session variables\n} else {\n$this->storeAuth($login, $password);\n}\n\n}", "public function login()\n {\n $strUsername = !empty($_POST['username']) ? $_POST['username'] : null;\n $strPassword = !empty($_POST['password']) ? $_POST['password'] : null;\n if( is_null($strUsername) || is_null($strPassword) )\n {\n header('HTTP/1.1 422 Unprocessable Entity');\n return ['error' => \"Both a username and a password are required.\"];\n }\n $oRet = $this->oUserModel->checkLogin($strUsername, $strPassword);\n if( $oRet->HasFailure() )\n {\n header('HTTP/1.1 403 Forbidden');\n $aRet = ['error' => $oRet->GetError()];\n }\n else\n {\n $_SESSION['user_id'] = $oRet->Get();\n $oRet = $this->oUserModel\n ->getUser(['user_id' => $oRet->Get()]);\n if( $oRet->HasFailure() )\n {\n unset($_SESSION['user_id']);\n header('HTTP/1.1 500 Internal Server Error');\n $aRet = ['error' => $oRet->GetError()];\n }\n else\n {\n $aRet = ['success' => true, 'user' => $oRet->Get()[0]];\n }\n }\n return $aRet;\n }", "public function userLogin(){\n\t\t\tif (isset($_POST['user_name']) && isset($_POST['password'])){\n\t\t\t\t$response = $this->model->getUser(\"*\", \"user_name = \".\"'\".$_POST['user_name'].\"'\");\n\t\t\t\t$response = $response[0];\n\t\t\t\t$user_rol = null;\n\t\t\t\t//The user is valid\n\t\t\t\tif ($response['password']==$_POST['password']) {\n\t\t\t\t\t//Verify the roles\n\t\t\t\t\t$response_role = $this->model->getRoles(\"user_id = '\".$response['_id'].\"'\");\n\t\t\t\t\tif (count($response_role)>1) {\n\t\t\t\t\t\t//Multipage user\n\t\t\t\t\t\t$user_rol = array();\n\t\t\t\t\t\tforeach ($response_role as $value) {\n\t\t\t\t\t\t\tarray_push($user_rol, $value['role']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (in_array('ADMIN', $user_rol)) { \n\t\t\t\t\t\t\t$_SERVER['PHP_AUTH_USER'] = $_POST['user_name'];\n \t\t\t\t\t$_SERVER['PHP_AUTH_PW'] = $_POST['password'];\n \t\t\t\t\t$_SERVER['AUTH_TYPE'] = \"Basic Auth\"; \n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$user_rol = $response_role[0]['role'];\n\t\t\t\t\t\tif ($user_rol == 'ADMIN') {\n\t\t\t\t\t\t\t$_SERVER['PHP_AUTH_USER'] = $_POST['user_name'];\n \t\t\t\t\t$_SERVER['PHP_AUTH_PW'] = $_POST['password'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->createSession($response['user_name'], $user_rol);\n\t\t\t\t\techo 1;\n\t\t\t\t}\n\t\t\t \n\t\t\t}\n\t\t}", "function login(){\r\n\t\tif(!isset($_POST['username']) || !isset($_POST['password']) ){\r\n\t\t\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Invalid Request\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//sanitize \r\n\t\t$username = $_POST['username'];\r\n\t\t$password = $_POST['password'];\r\n\t\t\r\n\t\t//query database\r\n\t\t$user = Doo::db()->getOne('Users', array('where' => \"username =:username\", 'param' => array(':username' => $username)));\r\n\t\t//$user = Doo::db()->getOne('Users', array('where' => 'username = \\'' . $username . '\\' '));\r\n\t\t\r\n\t\t//check for result row\r\n\t\tif(empty($user)){\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Invalid username and/or password. Note: Both fields are case sensitive\";\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//see if user is blocked\r\n\t\tif(!$user->is_enabled) {\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"User is blocked. Contact your administrator\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//compare hash values\r\n\t\tif($user->password === md5($password)) {\r\n\t\t\r\n\t\t\tsession_start();\r\n\t\t\tsession_regenerate_id();\r\n\t\t\tunset($_SESSION['user']);\r\n\t\t\t\t\r\n\t\t\t//save user session vars\r\n\t\t\t$_SESSION['user'] = array(\r\n\t\t\t\t\t\t\t\t\t'id' \t\t\t=> $user->id, \r\n\t\t\t\t\t\t\t\t\t'username' \t\t=> $user->username, \t\r\n\t\t\t\t\t\t\t\t\t'email'\t\t\t=> $user->email,\r\n\t\t\t\t\t\t\t\t\t'cluster_zoom_level' => $user->cluster_zoom_level\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = true;\r\n\t\t\t$this->res->message = \"Login Successful.\";\r\n\t\t\t\r\n\r\n\t\t\t//update user\r\n\t\t\t$user->client_ip = $this->clientIP();\r\n\t\t\tdate_default_timezone_set('UTC');\r\n\t\t\t$user->last_login_utc = date( 'Y-m-d H:i:s', time());\t\r\n\t\t\t$user->update();\r\n\t\t\t\r\n\t\t\t//update log\r\n\t\t\t$log = new Log;\r\n\t\t\t$log->username = $user->username;\r\n\t\t\t$log->ip_address = $this->clientIP();\r\n\t\t\t$log->client_ip = $this->clientIP();\r\n\t\t\t$log->insert();\r\n\t\t\t\r\n\t\t\t//change password\r\n\t\t\tif($user->change_password_on_login == 1){\r\n\t\t\t\t//build response\r\n\t\t\t\t$this->res->success = true;\r\n\t\t\t\t$this->res->message = \"Change Password Requested\";\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else{\r\n\t\t\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Invalid username and/or password. Note: Both fields are case sensitive\";\t\r\n\t\t}\r\n\t\r\n\t}", "public function login()\n {\n if(isset($_SESSION['user']))\n Url::redirectTo('/profile/' . $_SESSION['user']);\n\n $data = array();\n if(isset($_SESSION['error']) && $_SESSION['error']['errored'])\n {\n $data['errored'] = $_SESSION['error']['errored'];\n $data['emessage'] = $_SESSION['emessage'];\n $_SESSION['error']['errored'] = false;\n }\n if(isset($_SESSION['message']))\n {\n $data['message'] = $_SESSION['message'];\n unset($_SESSION['message']);\n }\n View::render('profile/login', $data);\n }", "function login(){\n\t\t$this->init(new User());\n\n\t\tif(isset($_POST['login_user'])){\n\t\t\t$this->record = array();\n\n\t\t\t// $row = $this->model->get_by_property(array('username'=>$_POST['email']));\n\t\t\t$record = Model::get_sql_data(\"select u.*,df.value as date_format_primary,df2.value date_format_short,\n\t\t\t d.value as first_day_week,l.locale as 'locale', l.value as 'language' from `user` u \n\t\t\tinner join user_settings us on (us.user_id=u.id)\n\t\t\tinner join `date_format` df on (df.id=us.date_format_id)\n\t\t\tinner join `date_format` df2 on (df2.id=us.date_format_short_id)\n\t\t\tinner join `day` d on (us.first_day_week_id=d.id)\n\t\t\tinner join `language` l on (l.id=us.language_id)\n\t\t\twhere u.username=? or u.mail=?\", array('username'=>$_POST['email'],'mail'=>$_POST['email']) , false);\n\n\t\t\t$row = empty($record)? $this->model->get_by_property(array('username'=>$_POST['email'])):$record;\n\n\t\t\tif(!$row){\n\t\t\t\t$row = $this->model->get_by_property(array('mail'=>$_POST['email']));\n\t\t\t}\n\n\t\t\tif(isset($row) && isset($row['id'])){\n\t\t\t\tif($row['password'] == $_POST['password']){\n\t\t\t\t\tSession::set_user_session_data($row);\n\t\t\t\t\theader('location: '.CoreUtils::base_url().'index/index');\n\t\t\t\t}else{\n\t\t\t\t\t$this->record['error_message']='error_msg_password';\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->record['error_message']='error_msg_email';\n\t\t\t}\n\t\t}else{\n\t\t\tSession::unset_user_session_data();\n\t\t}\n\t\t$this->render(\"login\");\t\n\t}", "public function p_login() {\n\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\t\n\t# Search the db for this email and password\n\t# Retrieve the token if it's available\n\t$q = \"SELECT token \n\t\tFROM users \n\t\tWHERE email = '\".$_POST['email'].\"' \n\t\tAND password = '\".$_POST['password'].\"'\";\n\t\n\t$token = DB::instance(DB_NAME)->select_field($q);\t\n\t\t\t\t\n\t# If we didn't get a token back, login failed\n\tif(!$token) {\n\t\t\t\n\t\t# Send them back to the login page\n\n\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t\n\t# But if we did, login succeeded! \n\t} else {\n\t\t\t\n\t\t# Store this token in a cookie\n\t\t@setcookie(\"token\", $token, strtotime('+2 weeks'), '/');\n\t\t\n\t\tRouter::redirect(\"/users/profile\");\n\t\t\t\t\t\n\t}\n }", "public function login()\n {\n $username = $this->getAttribute('username');\n\n $this->_user = $this->db->select(Db::TABLE_USER, array(\n 'username' => $username,\n 'password' => UserAuth::hash(\n $this->getAttribute('password')\n ),\n ));\n\n if(!empty($this->_user)) {\n\n $identity = new UserAuth();\n $identity->login($username);\n\n return true;\n } else {\n $this->addError('password','Incorrect username or password');\n }\n\n return false;\n }", "public function login (){\n\t\t$user = $this->get_by(array(\n\t\t\t'email' => $this->input->post('email'),\n\t\t\t'password' => $this->hash($this->input->post('password')),\n\t\t\t), TRUE);\n\t\t\n\t\tif (count($user)) {\n\t\t\t// Log in user\n\t\t\t$data = array(\n\t\t\t\t'username' => $user->username,\n\t\t\t\t'email' => $user->email,\n\t\t\t\t'id' => $user->id,\n\t\t\t\t'loggedin' => TRUE,\n\t\t\t);\n\t\t\t$this->session->set_userdata($data);\n\t\t}\n\t\t}", "public function login();", "public function login();", "public function login() {\n\n $user = $this->get_by(array(\n 'username' => $this->input->post('username'),\n 'password' => $this->hash( $this->input->post('password') ),\n ), TRUE);\n\n if ( count( $user ) ) {\n // return 1 to indicate account is inactive\n if ( $user->active == 0 ) { \n return 1; \n } else {\n //log in user if active\n $data = array(\n 'name' => $user->surname . \", \" . $user->firstName,\n 'fullName' => $user->firstName . \" \" . $user->surname,\n 'userId' => $user->userId,\n 'accessLevel' => $user->accessLevel,\n 'loggedin' => TRUE,\n );\n // Will check remember me is checked and set a session to 30days\n if ( $this->input->post('rememberme') ) { \n $this->session->sess_expiration = 2592000; \n // if no remember me session will be for 2 hours\n } else { \n $this->session->sess_expiration = 7200; \n }\n\n $this->session->set_userdata( $data );\n\n return $data;\n }\n \n } else { \n // return empty for incorect username or password\n return $user;\n }\n }", "function login() {\n\t $login_parameters = array(\n\t\t \"user_auth\" => array(\n\t\t \"user_name\" => $this->username,\n\t\t \"password\" => $this->hash,\n\t\t \"version\" => \"1\"\n\t\t ),\n\t\t \"application_name\" => \"mCasePortal\",\n\t\t \"name_value_list\" => array(),\n\t );\n\n\t $login_result = $this->call(\"login\", $login_parameters);\n\t $this->session = $login_result->id;\n\t return $login_result->id;\n\t}", "public function login($login,$password) {\n\t\t$success = false;\n\t\t// Check the supplied email and password against database to see \n\t\t// if the user exists.\n\t\t$this->db->select('id, password, active');\n\t\t$this->db->where($this->uniqueField,$login);\n\t\t$rsLogin = $this->db->get($this->tblName);\n\t\tif ($rsLogin->num_rows() > 0) {\n\t\t\t$row = $rsLogin->row();\n\t\t\t$hashPass = $this->hashPassword($password);\n\t\t\t//echo($hashPass.\"<br />\");\n\t\t\t//echo($row->password.\"<br />\");\n\t\t\t//echo($row->password === $hashPass ? \"true\" : \"false\".\"<br />\");\n\t\t\tif ($row->password === $hashPass) {\n\t\t\t\t//echo(\"Password OK\".\"<br />\");\n\t\t\t\tif ($row->active == 1) {\n\t\t\t\t\t$success = $this->load($row->id);\n\t\t\t\t\tif (!$success) {\n\t\t\t\t\t\t$this->errorCode = 4;\n\t\t\t\t\t\t$err = \"Load of user infomation failed.\";\n\t\t\t\t\t\t$this->statusMess = $err.\" \".$this->statusMess;\n\t\t\t\t\t} else {\t\t\t\t\t\n\t\t\t\t\t\t$this->statusMess = \"Login Successful.\";\n\t\t\t\t\t\t$session = $this->config->item('session_auth');\n\t\t\t\t\t\t$this->session->set_userdata($session,$row->$session);\n\t\t\t\t\t\t$this->setLoginStatus(1);\n\t\t\t\t\t} // END if\n\t\t\t\t} else {\n\t\t\t\t\t$this->errorCode = 3;\n\t\t\t\t\t$this->statusMess = \"User account is not active.\";\n\t\t\t\t\t$this->logFailedAccess($login);\t\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//echo(\"Password failed\".\"<br />\");\n\t\t\t\t$this->errorCode = 2;\n\t\t\t\t$this->statusMess = \"Password incorrect.\";\n\t\t\t\t$this->logFailedAccess($login);\n\t\t\t} // END if\n\t\t} else {\n\t\t\t$this->errorCode = 1;\n\t\t\t$this->statusMess = \"Username not found.\";\n\t\t\t$this->logFailedAccess($login);\n\t\t} // END if\n\t\tif ($this->config->item('log_auth')) {\n\t\t\t$this->logAccess($login,$success);\n\t\t}\n\t\treturn $success;\n\t}", "public function login()\n {\n $formLoginEnabled = true;\n $this->set('formLoginEnabled', $formLoginEnabled);\n\n $this->request->allowMethod(['get', 'post']);\n $result = $this->Authentication->getResult();\n // regardless of POST or GET, redirect if user is logged in\n if ($result->isValid()) {\n // redirect to /users after login success\n // TODO: redirect to /users/profile after login success [cakephp 2.x -> 4.x migration]\n $redirect = $this->request->getQuery('redirect', [\n 'controller' => 'Admin',\n 'action' => 'users/index', \n ]);\n\n return $this->redirect($redirect);\n }\n // display error if user submitted and authentication failed\n if ($this->request->is('post') && !$result->isValid()) {\n $this->Flash->error(__('Invalid username or password'));\n }\n }", "public function authLogin() {\n\t\tif($this->input->post()) {\n\t\t\t$user = $this->input->post('username');\n\t\t\t$pass = $this->input->post('upassword');\n\t\t\t$login = $this->m_user->checkLogin($user, $pass);\n\t\t\tif($login) {\n\t\t\t\t$output = array('success' => true, 'login' => $login);\n\t\t\t\t$this->session->set_userdata('u_login', $login);\n\t\t\t\t$this->session->set_userdata('u_name', $login->username);\n\t\t\t\t$this->session->set_userdata('u_level', $login->level);\n\t\t\t\treturn $this->m_user->json($output);\n\t\t\t} else {\n\t\t\t\t$output = array('success' => false, 'login' => null);\n\t\t\t\treturn $this->m_user->json($output);\n\t\t\t}\n\t\t}\n\t}", "public function p_login() {\n\n\t\t# Sanitize the user entered data to prevent any funny-business (re: SQL Injection Attacks)\n\t\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n\t\t# Hash submitted password so we can compare it against one in the db\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t# Search the db for this email and password\n\t\t# Retrieve the token if it's available\n\t\t$q = \"SELECT token \n\t\t\tFROM users \n\t\t\tWHERE email = '\".$_POST['email'].\"' \n\t\t\tAND password = '\".$_POST['password'].\"'\";\n\n\t\t$token = DB::instance(DB_NAME)->select_field($q);\n\n\t\t# If we didn't find a matching token in the database, it means login failed\n\t\tif(!$token) {\n\n\t\t\t# Send them back to the login page\n\t\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t# But if we did, login succeeded! \n\t\t} else {\n\t\t\tsetcookie(\"token\", $token, strtotime('+1 year'), '/');\n\t\t\t# Send them to the main page - or whever you want them to go\n\t\t\tRouter::redirect(\"/\");\n\t\t}\n\t}", "public static function login($username,$password) { \n $db = Database::getDB();\n //query the users table for a row with a username AND password\n\t\t//the query will only return a row if a row exists with both the username and password\n\t\t$query = \"SELECT * FROM users\n WHERE username = '$username'\n\t\t\t\t AND password = '$password'\";\n //execute the query\n\t\t$result = $db->query($query);\n\t\t$row = $result->fetch();\n\t\t//if $row = true (meaning a row was found)\n\t\tif ($row){\t \n\t\t\t//create a new User object for the user\n\t\t\t$user = new User($row['userID'],\n\t\t\t\t\t\t\t $row['userName'],\n $row['password'],\n\t\t\t\t\t\t $row['firstName'],\n\t\t\t\t\t\t $row['lastName'],\n\t\t\t\t\t\t $row['email']);\t\n\t\t//create a session variable isLoggedIn and set it to 1\n\t\t$_SESSION['isLoggedIn'] = \"1\";\n\t\t//create a session variable userID and set it equal to the userID of the current user\n\t\t$_SESSION['userID'] = $row['userID'];\n\t\t//create a session variable username and set it equal to the username of the current user\n\t\t$_SESSION['username'] = $row['userName'];\n\t\t//create a session variable firstname and set it equal to the firstname of the current user\n\t\t$_SESSION['firstName'] = $row['firstName'];\n\t\t//return the new user object\n\t\treturn $user;\n }\n\t //if now row was found (meaning the users credentials were not matched in the database\n\t else{\n\t\t//throw an exception\n\t\tthrow new Exception(\"No user found.\");\n\t }\n\t}", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->username,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n $duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\n $lastLogin = date(\"Y-m-d H:i:s\");\n\n if(Yii::app()->user->tableName === 'tbl_user'){\n $sql = \"UPDATE tbl_user_dynamic SET ulast_login = :lastLogin WHERE user_id = :userid\";\n }\n if(Yii::app()->user->tableName === 'tbl_personnel'){\n $sql = \"UPDATE tbl_user_dynamic SET plast_login = :lastLogin WHERE user_id = :userid\";\n }\n if(Yii::app()->user->tableName === 'tbl_reader'){\n $sql = \"UPDATE tbl_user_dynamic SET rlast_login = :lastLogin WHERE user_id = :userid\";\n }\n $command = Yii::app()->db->createCommand($sql);\n $command->bindValue(\":userid\", $this->_identity->id, PDO::PARAM_STR);\n $command->bindValue(\":lastLogin\", $lastLogin, PDO::PARAM_STR);\n $command->execute();\n Tank::wipeStats();\n Yii::app()->user->setState('todayHasRecord',User::todayHasRecord());\n return true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function login($username, $password){\n\t\t\n\t\t$sql = \"\n\t\t\tSELECT \n\t\t\t\taccount.id as account_id,\t\t\t\t \n\t\t\t\taccount.password as password\n\t\t\tFROM account\t\t\t\n\t\t\tWHERE username = :username\n\t\t\";\n\t\t/*echo $sql;\n\t\t//prepare\n\t\t$stmt = $this->db->prepare($sql);\n\t\t//execute\n\t\t$stmt->execute(['username'=>$username]);\n\t\t//feth the executed code this should only return an associative array because we are using :FETCH_ASSOC.\n\t\t$result = $stmt->fetch(PDO::FETCH_ASSOC); */\n\n\t\t\t$result = $this->executeQuery('select', $sql, ['username'=>$username]);\n\t\t\tprint_r($result);\n\n\n\t\t//CHECK IF $result is an array\n\t\tif(is_array($result)){\n\t\t\t\n\t\t\tif(count($result) > 0){\n\t\t\t\t\n\t\t\t\t$hashed_password = $result['password'];\n\t\t\t\tvar_dump( password_verify($password, $hashed_password));\n\n\t\t\t\t// verify if user exists and that given password is the same as the hashed password.\n\t\t\t\tif($username && password_verify($password, $hashed_password)){\n\t\t\t\t\t\n\t\t\t\t\t//start the session\n\t\t\t\t\tsession_start();\n\n\t\t\t\t\t//store the userdata in session variable\n\t\t\t\t\t$_SESSION['account_id'] = $result['account_id'];\n\t\t\t\t\t$_SESSION['username'] = $username;\n\t\t\t\t\t$_SESSION['loggedin'] = true;\n\n\t\t\t\t\t//after the user will be logged in this page will show \n\t\t\t\t\theader(\"location: welcome.php\");\t\t\t\t\t\t\n\t\t\t\t\texit;\n\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\treturn \"Incorrect username and/or password. Please change your input and try again.\";\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t// no matching user found in db. Make sure not to tell the user directly.\n\t\t\treturn \"Failed to login. Please try again\";\n\t\t}\n\t}", "public function usersLogin() {\n // login uses its own handle\n $httpLogin = $this->_prepareLoginRequest();\n $url = $this->_appendApiKey($this->uriBase . '/users/login.json');\n $data = array('login' => $this->username, 'password' => $this->password);\n return $this->_processRequest($httpLogin, $url, 'post', $data);\n }", "public function login()\n {\n self::$facebook = new \\Facebook(array(\n 'appId' => $this->applicationData[0],\n 'secret' => $this->applicationData[1],\n ));\n\n $user = self::$facebook->getUser();\n if (empty($user) && empty($_GET[\"state\"])) {\n \\Cx\\Core\\Csrf\\Controller\\Csrf::header('Location: ' . self::$facebook->getLoginUrl(array('scope' => self::$permissions)));\n exit;\n }\n\n self::$userdata = $this->getUserData();\n $this->getContrexxUser($user);\n }", "private function user_login() {\n\t\t\t// Cross validation if the request method is POST else it will return \"Not Acceptable\" status\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\t\t\tif(!isset($_POST['password']) && !isset($_POST['email'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter email and password is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['email'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter email is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['password'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter password is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\t$email = $this->_request['email'];\n\t\t\t$password = $this->_request['password'];\n\t\t\t$hashed_password = sha1($password);\n\t\t\t\t\t\t\t\t\t\t// Input validations\n\t\t\tif(!empty($email) and !empty($password)) {\n\t\t\t\tif(filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\t\t\t\t\t$sql = \"SELECT user_name, user_email, user_phone_no, user_pic, user_address, remember_token\n\t\t\t\t\t\t\t\t\tFROM table_user\n\t\t\t\t\t\t\t\t\tWHERE user_email = '$email'\n\t\t\t\t\t\t\t\t\tAND user_password = '\".$hashed_password.\"'\n\t\t\t\t\t\t\t\t\tLIMIT 1\";\n\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t$stmt->execute();\n\t\t\t\t $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n if($stmt->rowCount()=='0') {\n $error = array('status' => \"Failed\", \"msg\" => \"Invalid Email address or Password\");\n $this->response($this->json($error), 200);\n }\n\t\t\t\t\t\t$error = array('status' => \"Success\", \"msg\" => \"Sucessfully Login!\", \"data\" => json_encode($results) );\n\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Fields are required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\t// If invalid inputs \"Bad Request\" status message and reason\n\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Invalid Email address or Password\");\n\t\t\t$this->response($this->json($error), 200);\n\t\t}", "public function login() {\r\n if (!empty($_POST)) {\r\n $username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING);\r\n $password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);\r\n\r\n $hash = hash('sha512', $password . Configuration::USER_SALT);\r\n unset($password);\r\n\r\n $user = UserModel::getByUsernameAndPasswordHash($username, $hash);\r\n unset($hash);\r\n\r\n if ($user) {\r\n Session::set('user_id', $user->user_id);\r\n Session::set('username', $username);\r\n Session::set('ip', filter_input(INPUT_SERVER, 'REMOTE_ADDR'));\r\n Session::set('ua', filter_input(INPUT_SERVER, 'HTTP_USER_AGENT', FILTER_SANITIZE_STRING));\r\n\r\n Misc::redirect('');\r\n } else {\r\n $this->set('message', 'Nisu dobri login parametri.');\r\n sleep(1);\r\n }\r\n }\r\n }", "function login() {\n\t\t//$salt = Configure::read('Security.salt');\n\t\t//echo md5('password'.$salt);\n\n\t\t// redirect user if already logged in\n\t\tif( $this->Session->check('User') ) {\n\t\t\t$this->redirect(array('controller'=>'dashboard','action'=>'index','admin'=>true));\n\t\t}\n\n\t\tif(!empty($this->data)) {\n\t\t\t// set the form data to enable validation\n\t\t\t$this->User->set( $this->data );\n\t\t\t// see if the data validates\n\t\t\tif($this->User->validates()) {\n\t\t\t\t// check user is valid\n\t\t\t\t$result = $this->User->check_user_data($this->data);\n\n\t\t\t\tif( $result !== FALSE ) {\n\t\t\t\t\t// update login time\n\t\t\t\t\t$this->User->id = $result['User']['id'];\n\t\t\t\t\t$this->User->saveField('last_login',date(\"Y-m-d H:i:s\"));\n\t\t\t\t\t// save to session\n\t\t\t\t\t$this->Session->write('User',$result);\n\t\t\t\t\t//$this->Session->setFlash('You have successfully logged in');\n\t\t\t\t\t$this->redirect(array('controller'=>'dashboard','action'=>'index','admin'=>true));\n\t\t\t\t} else {\n\t\t\t\t\t$this->Session->setFlash('Either your Username of Password is incorrect');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function login(){\n\t\tif(isset($_POST['login'])){//if login button pressed\n\t\t\t$userTable= new Table('users');//new table created\n\t\t\t$user= $userTable->findInDatabase('user_username', $_POST['username']);//querying users table\n\t\t\tif($user->rowCount()>0){//if data available\n\t\t\t\t$data=$user->fetch();//fetch data\n\t\t\t\tif (password_verify($_POST['password'], $data['user_password'])){//if password matches\n\t\t\t\t\t$_SESSION['session_id']=$data['user_id'];//session variable is set\n\t\t\t\t\t$_SESSION['type']=$data['user_type'];//session variable is set\n\t\t\t\t\t$_SESSION['fullname']=$data['user_firstname'].\" \".$data['user_lastname'];//session variable is set\n\t\t\t\t\theader(\"Location:index.php\");//redirect to another page\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\techo '<script> alert(\"Password is incorrect\"); </script>';//js alert is shown\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo '<script> alert(\"Username is incorrect\"); </script>';//js alert for username incorrect\n\t\t\t}\n\t\t}\n\t}", "public function login()\n {\n if(is_logged_in()) {\n redirect_to(url('thread/index'));\n }\n\n $user = new User;\n $page = Param::get('page_next', 'login');\n\n switch($page) {\n case 'login':\n break;\n\n case 'lobby':\n $user->username = Param::get('username');\n $user->password = Param::get('password');\n\n try {\n $user = $user->verify();\n $_SESSION['id'] = $user['id'];\n } catch (UserNotFoundException $e) {\n $page = 'login';\n }\n break;\n\n default:\n throw new UserNotFoundException(\"User not found\");\n }\n\n $this->set(get_defined_vars());\n $this->render($page);\n }", "public function login()\n\t{\t\n\n\t\t$this->db->select('id, username, password, access');\n\t\t$this->db->where('username', $this->input->post('username', true));\n\t\t$query = $this->db->get('all_users_info', 1);\n\t\tif ($result = $query->first_row()) {\n\t\t\t$pw_check = $this->password_check($this->input->post('password', true), $result->password);\n\t\t\tif ($pw_check) {\n\n\t\t\t\t// check to see if user suspended or not\n\t\t\t\t$result->suspended = $this->is_user_suspended($result->id);\n\t\t\t\tif (!$result->suspended) {\n\t\t\t\t\t$array = array(\n\t\t\t\t\t'set_id' => $result->id,\n\t\t\t\t\t'access_pass' => $result->access,\n\t\t\t\t);\n\t\t\t\t\t$this->session->set_userdata($array);\n\t\t\t\t}\n\t\t\t\treturn $result;\n\t\t\t} else {\n\t\t\t\t$this->session->set_flashdata('msg', 'Username or Password is incorrect');\n\t\t\t\treturn false;\n\t\t\t}\t\n\t\t} else {\n\t\t\t$this->session->set_flashdata('msg', 'Username or Password is incorrect');\n\t\t\treturn false;\n\t\t}\n\n\t}", "public function logIn() {\n try {\n /* Check if for the empty or null email and password parameters */\n if (isset($_POST[\"email\"]) && isset($_POST[\"password\"])) {\n // Get the email and password parameters from POST request\n $form_data = array(\n ':email' => $_POST[\"email\"],\n ':password' => $_POST[\"password\"]\n );\n // Create a SQL query to check if exist this user with email and password\n $query = \"\n select id, username, access \n from tb_user \n where email = :email and password = :password and state = 1\n \";\n // Create object to connect to MySQL using PDO\n $mysqlPDO = new MySQLPDO();\n // Prepare the query\n $statement = $mysqlPDO->getConnection()->prepare($query);\n // Execute the query with passed parameters username and password\n $statement->execute($form_data);\n // Get affect rows in associative array\n $row = $statement->fetch(PDO::FETCH_ASSOC);\n // Check if any affected row\n if ($row) {\n // Check if there's any open session\n if (isset($_SESSION['views'])) {\n // Increment the open session + 1\n $_SESSION['views']++;\n } else {\n // Open new session\n $_SESSION['views'] = 1;\n }\n // Set user info into php session\n $_SESSION[$_SESSION['views'].'id'] = $row['id'];\n $_SESSION[$_SESSION['views'].'email'] = $form_data[':email'];\n $_SESSION[$_SESSION['views'].'password'] = $form_data[':password'];\n $_SESSION[$_SESSION['views'].'username'] = $row['username'];\n $_SESSION[$_SESSION['views'].'access'] = $row['access'];\n // data[] is a associative array that return json\n $data[] = array('result' => '1');\n } else {\n $data[] = array('result' => 'Please check your username or password!');\n }\n } else {\n // Check for missing parameters in POST data\n if (!isset($_POST[\"email\"]) && !isset($_POST[\"password\"])) {\n $data[] = array('result' => 'All parameters are missing for user authentication!');\n } elseif (!isset($_POST[\"email\"])) {\n $data[] = array('result' => 'Missing email parameter!');\n } else {\n $data[] = array('result' => 'Missing password parameter!!');\n }\n }\n return $data;\n } catch (PDOException $e) {\n die(\"Error message: \" . $e->getMessage());\n }\n }", "function p_login() {\n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n # Hash submitted password so we can compare it against one in the db\n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n # Search the db for this email and password\n # Retrieve the token if it's available\n $q = \"SELECT token \n FROM users \n WHERE email = '\".$_POST['email'].\"' \n AND password = '\".$_POST['password'].\"'\";\n\n $token = DB::instance(DB_NAME)->select_field($q);\n\n # If we didn't find a matching token in the database, it means login failed\n if(!$token) {\n\n # Send them back to the login page\n Router::redirect(\"/users/login/error\");\n\n # But if we did, login succeeded! \n } else {\n /* \n Store this token in a cookie using setcookie()\n Important Note: *Nothing* else can echo to the page before setcookie is called\n Not even one single white space.\n param 1 = name of the cookie\n param 2 = the value of the cookie\n param 3 = when to expire\n param 4 = the path of the cookie (a single forward slash sets it for the entire domain)\n */\n setcookie(\"token\", $token, strtotime('+1 year'), '/');\n\n # update the last_login time for the user\n/* $_POST['last_login'] = Time::now();\n\n $user_id = DB::instance(DB_NAME)->update('users', $_POST); */\n\n # Send them to the main page - or whever you want them to go\n Router::redirect(\"/\");\n }\n }", "public function login(){\n \t\t//TODO redirect if user already logged in\n \t\t//TODO Seut up a form\n \t\t//TODO Try to log in\n \t\t//TODO Redirect\n \t\t//TODO Error message\n \t\t//TODO Set subview and load layout\n\n \t}", "public function login()\n {\n if ($this->UserManager_model->verifUser($_POST['user_id'], $_POST['user_password'])) {\n\n $arrUser = $this->UserManager_model->getUserByIdentifier($_POST['user_id']);\n $data = array();\n $objUser = new UserClass_model;\n $objUser->hydrate($arrUser);\n $data['objUser'] = $objUser;\n\n $user = array(\n 'user_id' => $objUser->getId(),\n 'user_pseudo' => $objUser->getPseudo(),\n 'user_img' => $objUser->getImg(),\n 'user_role' => $objUser->getRole(),\n );\n\n $this->session->set_userdata($user);\n redirect('/');\n } else {\n $this->signin(true);\n }\n }", "public function loginUser()\n {\n $request = new Request();\n\n $email = $request->input('email');\n $password = $request->input('password');\n\n // Check email\n if (!$email) {\n $this->showLoginForm(['Please enter email']);\n }\n // Check password\n if (!$password) {\n $this->showLoginForm(['Please enter password']);\n }\n\n // Check user exist and then password\n $user = $this->getUser($email);\n $password = md5($password);\n if (!$user || $password !== $user['password']) {\n $this->showLoginForm(['Error on login']);\n }\n\n // Save login details to cookies\n if (!defined('APP_USERS_COOKIES_EMAIL')\n || !defined('APP_USERS_COOKIES_PASSWORD')) {\n $this->showLoginForm(['Error on login']);\n }\n setcookie(APP_USERS_COOKIES_EMAIL, $email);\n setcookie(APP_USERS_COOKIES_PASSWORD, $password);\n\n // Redirect to endpoint\n header(\"Location: \" . self::ENDPOINTS['success_login']);\n }", "public function login() {\n $userName = Request::post('user_name');\n $userPassword = Request::post('user_password');\n if (isset($userName) && isset($userPassword)) {\n // perform the login method, put result (true or false) into $login_successful\n $login_successful = LoginModel::login($userName, $userPassword);\n\n // check login status: if true, then redirect user login/showProfile, if false, then to login form again\n if ($login_successful) {\n //if the user successfully logs in, reset the count\n $userID = Session::get('user_id');\n LoginModel::validLogin($userID);\n Redirect::to('login/loginHome');\n } else {\n Redirect::to('login/index');\n }\n }\n }", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->UserName,$this->passWd);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tuser()->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function login()\n {\n if (isset($_POST['signIn'])) {\n $userExist = $this->checkIfUserExist($_POST['login']);\n var_dump($userExist);\n \n if ($userExist === false) {\n header('Location: auth&alert=NotUser');\n exit();\n } else {\n $authUser = $this->usersManager->getAuthUser($_POST['login']);\n if (password_verify($_POST['password'], $authUser[0]->userPassword())) {\n $this->usersManager->setLastConnexionUser($authUser[0]->userId());\n $this->openSession($authUser[0]);\n } else {\n header('Location: auth&alert=Login');\n exit();\n }\n }\n } else {\n throw new Exception($this->datasError);\n }\n }", "public function login(){\n\t\t$this->user = $this->user->checkCredentials();\n\t\t$this->user = array_pop($this->user);\n\t\tif($this->user) {\n\t\t\t$_SESSION['id'] = $this->user['id'];\n\t\t\t$_SESSION['name'] = $this->user['name'];\n\t\t\t$_SESSION['admin'] = $this->user['admin'];\n\t\t\t$this->isAdmin();\n\t \t\theader('location: ../view/home.php');\n\t \t\texit;\n\t \t}\n\t\t$dados = array('msg' => 'Usuário ou senha incorreto!', 'type' => parent::$error);\n\t\t$_SESSION['data'] = $dados;\n\t\theader('location: ../view/login.php');\n \t\texit;\n\t}", "public function actionLogin() {\n $categories = array();\n $categories = Category::getCategoriesList();\n\n $email = '';\n $password = '';\n\n\n if (isset($_POST['submit'])) {\n $email = $_POST['email'];\n $password = $_POST['password'];\n\n $errors = false;\n\n if (!User::checkEmail($email)) {\n $errors[] = 'Invalid email.';\n }\n\n if (!User::checkPassword($password)) {\n $errors[] = 'Password should be at least 6 characters.';\n }\n\n $userId = User::checkUserData($email, $password);\n\n if ($userId == false) {\n $errors[] = 'User with such email and password does not exist. Please check your login details.';\n } else {\n User::auth($userId);\n\n header(\"Location: /profile/\");\n }\n }\n\n require_once (ROOT.'/views/user/login.php');\n\n return true;\n }", "function Login()\n{\n\tglobal $txt, $context;\n\n\t// You're not a guest, why are you here?\n\tif (we::$is_member)\n\t\tredirectexit();\n\n\t// We need to load the Login template/language file.\n\tloadLanguage('Login');\n\tloadTemplate('Login');\n\twetem::load('login');\n\n\t// Get the template ready.... not really much else to do.\n\t$context['page_title'] = $txt['login'];\n\t$context['default_username'] =& $_REQUEST['u'];\n\t$context['default_password'] = '';\n\t$context['never_expire'] = false;\n\t$context['robot_no_index'] = true;\n\n\t// Add the login chain to the link tree.\n\tadd_linktree($txt['login'], '<URL>?action=login');\n\n\t// Set the login URL - will be used when the login process is done (but careful not to send us to an attachment).\n\tif (isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'dlattach') === false && strhas($_SESSION['old_url'], array('board=', 'topic=', 'board,', 'topic,')))\n\t\t$_SESSION['login_url'] = $_SESSION['old_url'];\n\telse\n\t\tunset($_SESSION['login_url']);\n}", "function make_login() {\n \n $this -> load -> model(array('users_model'));\n\n $q = $this -> users_model -> get_user_login($this -> input -> post('login'));\n\n if($q->num_rows == 0){\n $this->data['msg'] = t('User does not exist.');\n $this->session->set_flashdata('msg', t('User does not exist.'));\n redirect('home#login_form');\n }else{\n\n $row = $q -> row_array();\n\n if ($this -> input -> post('password') != $row['user_password']) {\n $this->data['msg'] = t('Password error.');\n $this->session->set_flashdata('msg', t('Password error.'));\n redirect('home#login_form');\n }\n\n $this -> session -> set_userdata(array('user_logged_in' => true));\n $this -> session -> set_userdata(array('user_firstname' => $row['user_firstname']));\n $this -> session -> set_userdata(array('user_username' => $row['user_username']));\n $this -> session -> set_userdata(array('user_id' => $row['user_id']));\n $this -> session -> set_userdata(array('user_email' => $row['user_email']));\n redirect('courses');\n }\n }", "function login()\n{\n global $db;\n\n // Validate input\n $email = InputValidator::email($_POST['email']);\n $password = InputValidator::password($_POST['password']);\n\n if (is_null($email) || is_null($password)) {\n $_SESSION['errors']['login'] = 'Invalid email/password combination';\n return false;\n }\n // Get account/user with email specified by the user\n $user_sql = \"SELECT * FROM account JOIN user WHERE user.email = ? AND user.id = account.id\";\n $stmt = $db->prepare($user_sql);\n $exec = $stmt->execute([$email]);\n\n if (!$exec) return false;\n\n // Fetch the user and compare the stored hashed password with the one sent by the user\n $user = $stmt->fetch();\n $passwordhash = hash('sha256', $password);\n\n if ($user == null || $passwordhash != $user['passwordhash']) {\n $_SESSION['errors']['login'] = 'Invalid email/password combination';\n return false;\n }\n\n // set the session to the current user\n $_SESSION['user'] = fetchUser($user['id']);\n $_SESSION['errors'] = array(\"error\" => \"invalid date\");\n return true;\n}", "function login($username, $password = null)\n {\n $f3->get('user')->copyfrom('POST');\n k($f3);\n $user = self::load(\"name = $username\");\n k($user);\n }", "public function login()\n\t{\n\t\tif ($this->request->is('post')) {\n\t\t\tif ($this->User->find('count') <= 0) {\r\n\t\t\t\t$this->User->create();\r\n\t\t\t\t$data['User']['username'] = \"admin\";\r\n\t\t\t\t$data['User']['password'] = AuthComponent::password(\"admin\");\r\n\t\t\t\t$this->User->save($data);\r\n\t\t\t}\n\t\t\tif ($this->Auth->login()) {\n\t\t\t\t$this->Session->write('isLoggedIn', true);\n\t\t\t\t$this->Session->write('mc_rootpath', WWW_ROOT.\"/files/\");\n\t\t\t\t$this->Session->write('mc_path', WWW_ROOT.\"/files/\");\n\t\t\t\t$this->Session->write('imagemanager.preview.wwwroot', WWW_ROOT);\n\t\t\t\t$this->Session->write('imagemanager.preview.urlprefix', Router::url( \"/\", true ));\n\t\t\t\treturn $this->redirect($this->Auth->redirect());\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Username or password is incorrect'), 'default', array(), 'auth');\n\t\t\t}\n\t\t}\n\t}", "public function login($username, $password);", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->username,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "function login()\n{\n\t$username = $this->Session->read('user');\n\tif ($username){\n\t$this->redirect('/inhabitants/');}\n\t\n\t$this->pageTitle = 'Login';\n\t\n\t$this->set('error', false);\n\t// jika form yg disubmit tidak kosong\n\tif ($this->data)\n\t{\n\t// jika username dan password cocok\n\t$results = $this->User->findByUsername($this->data['User']['username']);\n\t\tif ($results && $results['User']['password'] ==\n\t\tmd5($this->data['User']['password']))\n\t\t{\n\t\t\t$this->Session->write('user', $this->data['User']['username']);\n\t\t\t$this->Session->write('last_login', $results['User']['last_login']);\n\t\t\t$results['User']['last_login'] = date(\"Y-m-d H:i:s\");\n\t\t\t$this->User->save($results);\n\t\t\t// redirect\n\t\t\t$this->redirect('/users/');\n\t\t} else {\n\t\t\t$this->set('error', true);\n\t\t}\n\t}\n}", "public function log_in() {\n\n // Check if the user exists on the database\n if (!$this->does_exist('username')) {\n return \"Username does not exist\";\n }\n\n $user = User::find($this->username, 'username');\n\n // If password matches\n if ($user->password !== $this->password) {\n return \"Sorry, password does not match\";\n }\n\n return true;\n }", "function signIn(){\n\t\t\tglobal $db;\n\t\t\tglobal $json;\n\n\t\t\tinclude_once(\"security.php\");\n\t\t\t\n\t\t\tif($this->username == \"\" || $this->password == null){\n\t\t\t\t$json->invalidRequest();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$userInfo = $db->prepare('SELECT * FROM user WHERE Username = :username');\n\t\t\t\t$userInfo->bindParam(':username', $this->username);\n\t\t\t\t$userInfo->execute();\n\t\t\t\t\n\t\t\t\t//Check if user exists\n\t\t\t\tif($userInfo->rowCount() == 0){\n\t\t\t\t\t$json->notFound(\"User\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t//If exists, pull Password hash and verify against inserted password\n\t\t\t\t\tforeach($userInfo as $row) {\n\t\t\t\t\t\tif($row['Password'] === crypt($this->password, $row['Password'])){\n\t\t\t\t\t\t\t//correct username & password combination\n\t\t\t\t\t\t\techo '{ \"User\" : { \"Id\" : '.$row['Id'].', \"Username\" : \"'.$row['Username'].'\", \"Subject\" : '.$row['Subject'].', \"Admin\" : '.$row['Admin'].', \"ApiKey\" : \"'.$row['ApiKey'].'\" } }';\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$json->unauthorizedInvalidPassword();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function login() {\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n // process form\n // sanitize POST_data\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n // input data\n $data = [\n 'email' => trim($_POST['email']),\n 'pass' => trim($_POST['pass']),\n // error variables\n 'email_err' => '',\n 'pass_err' => ''\n ];\n // logic for if fields are empty\n if (empty($data['email'])) {\n $data['email_err'] = \"Enter your account's corresponding email address\";\n }\n \n if (empty($data['pass'])) {\n $data['pass_err'] = \"Enter your password that you set the account up with\";\n }\n // check for user|email\n if ($this->userModel->findUserByEmail($data['email'])) {\n // user was found\n } else {\n $data['email_err'] = 'No user found';\n }\n // make sure no error vars are filled\n if (empty($data['email_err']) && empty($data['pass_err'])) {\n // validated\n // check and set logged in user\n $loggedInUser = $this->userModel->login($data['email'], $data['pass']);\n if ($loggedInUser) {\n // create session vars\n // create/start user session\n $this->createUserSession($loggedInUser);\n } else {\n // render with error\n $data['pass_err'] = 'Password is incorrect';\n // reload the view\n $this->view('users/login', $data);\n }\n } else {\n // load view with errors\n $this->view('users/login', $data);\n }\n \n } else {\n // load the form\n // init the data \n $data = [\n 'email' => '',\n 'pass' => '',\n // error variables\n 'email_err' => '',\n 'pass_err' => '',\n ];\n // load the view\n $this->view('users/login', $data);\n }\n }", "public static function login()\n {\n //when you add the method you need to look at my find one, you need to return the user object.\n //then you need to check the password and create the session if the password matches.\n //you might want to add something that handles if the password is invalid, you could add a page template and direct to that\n //after you login you can use the header function to forward the user to a page that displays their tasks.\n // $record = accounts::findUser($_POST['email']);\n $user = accounts::findUserbyEmail($_REQUEST['email']);\n print_r($user);\n //$tasks = accounts::findTasksbyID($_REQUEST['ownerid']);\n // print_r($tasks);\n if ($user == FALSE) {\n echo 'user not found';\n } else {\n\n if($user->checkPassword($_POST['password']) == TRUE) {\n session_start();\n $_SESSION[\"userID\"] = $user->id;\n header(\"Location: index.php?page=tasks&action=all\");\n } else {\n echo 'password does not match';\n }\n }\n }", "function login()\r\n {\r\n if ($this->data)\r\n {\r\n // Use the AuthComponent's login action\r\n if ($this->Auth->login($this->data))\r\n {\r\n // Retrieve user data\r\n $results = $this->User->find(array('User.username' => $this->data['User']['username']), array('User.active'), null, false);\r\n // Check to see if the User's account isn't active\r\n\r\n if ($results['User']['active'] == 0)\r\n {\r\n // account has not been activated\r\n $this->Auth->logout();\r\n $this->flashNotice('Hello ' . $this->Session->read('Auth.User.username') . '. Your account has not been activated yet! Please check your mail and activate your account.', 'login');\r\n }\r\n // user is active, redirect post login\r\n else\r\n {\r\n $this->User->id = $this->Auth->user('id');\r\n $this->flashSuccess('Hello ' . $this->Session->read('Auth.User.username') . '. You have successfully logged in. Please choose your destination on the left menu.');\r\n $this->User->saveField('last_login', date('Y-m-d H:i:s') );\r\n $this->redirect(array('controller' => 'users', 'action' => 'login'));\r\n }\r\n }\r\n $this->flashWarning('You could not be logged in. Maybe wrong username or password?');\r\n }\r\n }", "public function log_in()\n\t{\n\t\tif( isset( $_POST['user_login'] ) && wp_verify_nonce( $_POST['login_nonce'], 'login-nonce') ) \n\t\t{\n\t\t\t/** Error when no password enter */\n\t\t\tif( ! isset( $_POST['user_pass']) || $_POST['user_pass'] == '') {\n\t\t\t\t$this->system_message['error'][] = __('Please enter a password');\n\t\t\t\treturn false;\n\t\t\t}\n\t \t\t\n\t\t\t// this returns the user ID and other info from the user name\n\t\t\t$user = get_user_by('login', $_POST['user_login'] );\n \n\t\t\tif( ! $user ) \n\t\t\t{\t\t\t\t\n\t\t\t\t$this->system_message['error'][] = __('Invalid ID or password');\n\t\t\t\treturn false;\n\t\t\t}\n\t \n\t\t\t// check the user's login with their password\n\t\t\tif( ! wp_check_password( $_POST['user_pass'], $user->user_pass, $user->ID) ) {\n\t\t\t\t// if the password is incorrect for the specified user\n\t\t\t\t$this->system_message['error'][] = __('Invalid ID or password');\n\t\t\t}\n\t \n\t\t\t// only log the user in if there are no errors\n\t\t\tif( empty( $this->system_message['error'] )) \n\t\t\t{\n\t\t\t\twp_set_auth_cookie( $user->ID, false, true );\n\t\t\t\twp_set_current_user( $user->ID );\t\n\t\t\t\tdo_action('wp_login', $_POST['user_login']);\n\t \n\t\t\t\twp_redirect( home_url() ); exit;\n\t\t\t}\n\t\t}\n\t}", "function au_login() {\n\n\tglobal $aulis;\n\t\n\t// Error messages!\n\t$errormsg = array();\n\t\n\t// Are we currently attempting to login?\n\tif(isset($_POST['au_login'])) {\n\t\n\t\t// Did we provide our username?\n\t\tif(empty($_POST['au_username']))\n\t\t\t$errormsg[] = LOGIN_NO_USERNAME;\n\t\t\t\n\t\t// What about our password?\n\t\tif(empty($_POST['au_password']))\n\t\t\t$errormsg[] = LOGIN_NO_PASSWORD;\n\t\t\t\n\t\t// Create variables that are easier to type\n\t\t$login['username'] = $_POST['au_username'];\n\t\t$login['password'] = $_POST['au_password'];\n\t\t\t\n\t\t// Usernames don't contain HTML\n\t\tif($login['username'] != htmlspecialchars($login['username'], ENT_NOQUOTES, 'UTF-8', false))\n\t\t\t$errormsg[] = LOGIN_USERNAME_NO_HTML;\n\t\t\t\n\t\t// We don't want to mess up the database\n\t\t$login['username'] = mysqli_real_escape_string($aulis['connection'], $login['username']);\n\t\t\n\t\t// Hash the password\n\t\t$login['password'] = au_hash($login['password']);\n\t\t\n\t\t// Okay. Now check if the database has any record of the user\n\t\t$result = au_query(\"\n\t\t\tSELECT user_id, user_username, user_password\n\t\t\t\tFROM users\n\t\t\t\tWHERE user_username = '\" . $login['username'] . \"'\n\t\t\");\n\t\t\n\t\t\t// This is only run if the user exists\n\t\t\tforeach($result as $userlogin) {\n\t\t\t\n\t\t\t\t// Get the user id\n\t\t\t\t$userid = $userlogin['user_id'];\n\t\t\t\n\t\t\t\t// Does the password match?\n\t\t\t\tif($userlogin['user_password'] == $login['password'])\n\t\t\t\t\t$correctpass = true;\n\t\t\t\telse\n\t\t\t\t\t$errormsg[] = LOGIN_PASSWORD_FAIL;\n\t\t\t}\n\t\t\t\n\t\t// Can we login?\n\t\tif(!empty($correctpass)) {\n\t\t\n\t\t\t// The user agent\n\t\t\t$login['user_agent'] = mysqli_real_escape_string($aulis['connection'], $_SERVER['HTTP_USER_AGENT']);\n\t\t\t\n\t\t\t// The IP address\n\t\t\t$login['user_ip'] = addslashes($_SERVER['REMOTE_ADDR']);\n\t\t\n\t\t\t// How long should we keep the session active?\n\t\t\t$sessionlength = (!empty($_POST['au_forever']) ? '0' : '60');\n\t\t\n\t\t\t// Set the session\n\t\t\t$_SESSION[$setting['session_name']] = array(\n\t\t\t\t'user' => $userid,\n\t\t\t\t'agent' => $login['user_agent'],\n\t\t\t\t'ip' => $login['user_ip'],\n\t\t\t\t'sessionlength' => $sessionlength\n\t\t\t);\n\t\t\t\n\t\t\t// Show a nice information page\n\t\t\ttemplate_info(\n\t\t\t\t'login_success',\n\t\t\t\t'login_success_title',\n\t\t\t\t'user_green.png',\n\t\t\t\t$basefilenq,\n\t\t\t\t'login_link'\n\t\t\t);\n\t\t}\n\t}\n\t\n\t// This array is used in the login template\n\t$logindata = array(\n\t\t'errors' => (empty($_POST['au_login']) ? 0 : 1),\n\t\t'error_message' => $errormsg,\n\t\t'username' => (!empty($login['username']) ? $login['username'] : ''),\n\t);\n\n\t// Okay, load this app's template\n\tau_load_template('login', false);\n\t\n\t// Show the registration template\n\tau_template_login((!empty($login_complete) ? true : false));\n}", "public function login()\n {\n if ($this->getCurrentUser()->get('id')) {\n $this->redirect($this->Auth->redirectUrl());\n }\n\n if ($user = $this->Auth->identify()) {\n $this->Auth->setUser($user);\n\n // set cookie\n if (!empty($this->getRequest()->getData('remember_me'))) {\n if ($CookieAuth = $this->Auth->getAuthenticate('Lil.Cookie')) {\n $CookieAuth->createCookie($this->getRequest()->getData());\n }\n }\n } else {\n if ($this->getRequest()->is('post') || env('PHP_AUTH_USER')) {\n $this->Flash->error(__d('lil', 'Invalid username or password, try again'));\n }\n }\n\n if ($this->getCurrentUser()->get('id')) {\n $redirect = $this->Auth->redirectUrl();\n $event = new Event('Lil.Auth.afterLogin', $this->Auth, [$redirect]);\n $this->getEventManager()->dispatch($event);\n\n return $this->redirect($redirect);\n }\n }", "public function login(){\n\t\t\trequire_once(MODEL.\"ProcessAccount.php\");\n\t\t\t$this->model = new ProcessAccount();\n\t\t\t//Make sure username and password not empty\n\t\t\tif(!empty($_POST[\"username\"]) && !empty($_POST[\"password\"])){\n\t\t\t\t//Check exist account\n\t\t\t\tif($this->model->checkAccount($_POST['username'],$_POST['password'])){\n\t\t\t\t\t//Make seesion to account \n\t\t\t\t\t$this->model->getInfo($_POST['username'],$_POST['password']);\n\t\t\t\t}else{\n\t\t\t\t\t$error = \"Wrong username or password\";\n\t\t\t\t\t$this->view->render('admin/login.php',$error);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function login() {\n $this->data['welcome_txt'] = NULL;\n // Set login message to null so nothing will be displayed when no one is logged in\n $this->data['login_msg'] = NULL;\n // get the login and action from get/post\n $username = $this->input->get_post('username');\n $action = $this->input->get_post('action');\n $this->data['debug'] = print_r($username, TRUE);\n\n if ($this->session->userdata('username') && $action === 'logout') {\n // if someone is logged in and wants to logout, remove login session data\n $this->session->unset_userdata('username');\n $this->data['logout_msg'] = 'Logout successful!';\n } else if (!empty($username) && $action === 'login') {\n // if an user is log in, check against users \n $this->load->model('player');\n\n // if user exists, log in by adding session data \n $this->session->set_userdata('username', $username);\n $this->data['login_msg'] = 'Log in successful!';\n }\n }", "public function login()\n\t{\n if($this->_identity===null)\n {\n $this->_identity=new UserIdentity($this->username,$this->password);\n $this->_identity->setUserType($this->usertype); //设置用户种类\n $this->_identity->authenticate();\n }\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tYii::app()->user->login($this->_identity,$duration); //调用Yii::app()->user->login()保存数据(session)\n\t\t\t\n\t\t\t$cookie = new CHttpCookie('usernamecookie',$this->username); //用户名cookie\n\t\t\t$cookie->expire = time()+60*60*24*30; //有限期30天 \n\t\t\tYii::app()->request->cookies['mycookie']=$cookie;\n\t\t\t\n\t\t\t$cookie = new CHttpCookie('usertypecookie',$this->usertype); //用户类型cookie\n\t\t\t$cookie->expire = time()+60*60*24*30; //有限期30天\n\t\t\tYii::app()->request->cookies['usertypecookie']=$cookie;\n\t\t\t\n\t\t\tif(!empty($this->rememberMe))\n\t\t\t{\n\t\t\t\t$cookie = new CHttpCookie('remcookie',$this->rememberMe);\n\t\t\t\t$cookie->expire = time()+60*60*24*30; //有限期30天\n\t\t\t\tYii::app()->request->cookies['remcookie']=$cookie;\n\t\t\t}else { //清空cookie\n\t\t\t\t$cookie=Yii::app()->request->getCookies();\n\t\t\t\tunset($cookie['remcookie']);\n\t\t\t\t$cookie=Yii::app()->request->getCookies();\n\t\t\t\tunset($cookie['mycookie']);\n\t\t\t\t$cookie=Yii::app()->request->getCookies();\n\t\t\t\tunset($cookie['usertypecookie']);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "function log_in($username, $password) {\n global $db;\n global $current_user;\n\n if ( isset($username) && isset($password) ) {\n // check if user exists in db\n $sql = \"SELECT * FROM users WHERE username = :username;\";\n $params = array(\n ':username' => $username\n );\n\n $records = exec_sql_query($db, $sql, $params)->fetchAll();\n\n if ($records) {\n\n $user_account = $records[0]; // users are unique\n\n // check if password is valid\n if ( password_verify($password, $user_account['password']) ) {\n\n $session = session_create_id();\n\n // store session ID\n $sql = \"INSERT INTO sessions (user_id, session) VALUES (:user_id, :session);\";\n $params = array(\n ':user_id' => $user_account['id'],\n ':session' => $session\n );\n\n $result = exec_sql_query($db, $sql, $params);\n\n if ($result) {\n // session successfully stored in DB\n setcookie(\"session\", $session, time() + SESSION_COOKIE_DURATION);\n\n $current_user = $user_account;\n return $current_user;\n }\n }\n }\n }\n $current_user = NULL;\n return NULL;\n}", "public function loginUser() {\n $this->form_validation->set_rules('username', 'Username', 'trim|required');\n $this->form_validation->set_rules('password', 'Password', 'required');\n\n if ($this->form_validation->run() == FALSE) {\n $this->login();\n\n } else {\n $formUsername = $this->input->post('username');\n $formPassword = $this->input->post('password');\n $userData = $this->UserManager->loginUser($formUsername, $formPassword);\n\n if (gettype($userData) !== 'string') {\n $this->session->set_userdata($userData);\n redirect('/SiteController/homepage');\n\n }else{\n $this->session->set_userdata('errorMsg', $userData);\n $this->login();\n }\n }\n }", "function requestLogin() {\n $username = $_GET['username'];\n $password = $_GET['password'];\n\n $response = attemptLogin($username, $password);\n \n if ($response['status'] == 'SUCCESS') {\n session_start();\n $_SESSION['firstName'] = $response['response']['firstName'];\n $_SESSION['lastName'] = $response['response']['lastName'];\n $_SESSION['username'] = $username;\n $_SESSION['profilePicture'] = $response['response']['profilePicture'];\n\n if ($_GET['rememberMe'] == 'true') {\n setcookie('username', $username, time() + 3600 * 24 * 30, '/', '', 0);\n }\n\n echo json_encode($response['response']['message']);\n } else {\n errorHandler($response['status'], $response['code']);\n }\n }", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->phone,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n $duration = 3600*24*30;\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\t\t\n return false;\n\t}", "static function userLogin($username = \"\", $password = \"\")\r\n {\r\n $user = self::getSingleUser('username', $username, 'password', $password);\r\n\r\n if ($user !== NULL && $user->getOffline() == 1) //is offline\r\n {\r\n $user->setOffline(\"0\");\r\n $user->setAddressIP($_SERVER['REMOTE_ADDR']);\r\n\r\n self::updateUser($user);\r\n\r\n $_SESSION[\"user_id\"] = $user->getId();\r\n $_SESSION[\"user_name\"] = $user->getUsername();\r\n $_SESSION[\"user_type\"] = $user->getType();\r\n $_SESSION[\"user_church\"] = $user->getIdChurch();\r\n $_SESSION[\"last_page\"] = \"\";\r\n $_SESSION[\"curr_page\"] = \"\";\r\n\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }", "public function login() {\n $flash = null;\n // if the user has tried logging in\n if(isset($_POST['login'])){\n // try verifying the user\n if($this->User->login($_POST['username'], $_POST['password'])) {\n session_write_close();\n header(\"Location: \".app::site_url(array(config::get('default_controller'), 'index')));\n exit(0);\n } else {\n $flash = \"That username and/or password is not valid.\";\n }\n }\n return array(\n 'flash' => $flash,\n 'title' => 'Login'\n );\n }", "public function login() {\n $email = $this->input->post('email');\n $pass = $this->input->post('password');\n if (!empty($email) && !empty($pass)) {\n $user = $this->users_model->login($email, $pass);\n if (!$user) {\n return $this->send_error('ERROR');\n }\n $this->event_log();\n return $this->send_response(array(\n 'privatekey' => $user->privatekey,\n 'user_id' => $user->id,\n 'is_coach' => (bool) $this->ion_auth->in_group('coach', $user->id)\n ));\n }\n return $this->send_error('LOGIN_FAIL');\n }", "public function login($login) {\n $userName = '';\n $userId=0;\n $password = '';\n $roleId=0;\n\n $stmt = $this->connection -> prepare('SELECT id, name, password FROM users WHERE email = ? AND is_active = 1 LIMIT 1');\n $stmt -> bind_param('s', $login['email']);\n $stmt -> execute();\n $stmt -> store_result();\n $stmt -> bind_result($userId, $userName, $password);\n $stmt -> fetch();\n if($userId > 0){ \n //if(password_verify($login['password'], $password)){\n if(password_verify($login['password'], $password)){\n $this->setSession($userId);\n $this->setSessionDb($userId);\n return json_encode([\"success\" => 1,\n \"user_id\" => $userId,\n \"name\" => $userName,\n \"msg\"=> \"You are now logged in.\"]);\n }\n }\n return json_encode([\"success\"=> 0,\"msg\"=> \"Login failed.\"]);\n }", "function login()\n\t\t{\n\t\t\t// Redirect logged in users and admins to the home page.\n\t\t\tif ($this->ion_auth->logged_in() OR $this->ion_auth->is_admin()) redirect();\n\n\t\t\t//validate form input\n\t\t\t$this->form_validation->set_rules('username', 'Username', 'required');\n\t\t\t$this->form_validation->set_rules('password', 'Password', 'required');\n\n\t\t\tif ($this->form_validation->run() == true)\n\t\t\t{\n\t\t\t\t// check for \"remember me\"\n\t\t\t\t$remember = (bool) $this->input->post('remember');\n\n\t\t\t\tif ($this->ion_auth->login($this->input->post('username'), $this->input->post('password'), $remember, 'username'))\n\t\t\t\t{\n\t\t\t\t\t//The login is successful\n\n\t\t\t\t\t// Check if the user is an admin!\n\t\t\t\t\tif ($this->ion_auth->is_admin())\n\t\t\t\t\t{\n\t\t\t\t\t\t// Log the admin out\n\t\t\t\t\t\t$this->ion_auth->logout();\n\n\t\t\t\t\t\t// Let admin know what happened\n\t\t\t\t\t\t$this->flexi_cart->set_error_message('You cannot log in here', 'public', TRUE);\n\t\t\t\t\t\t$this->session->set_flashdata('message', $this->flexi_cart->get_messages('public'));\n\n\t\t\t\t\t\t// Reload login page.\n\t\t\t\t\t\tredirect('login');\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->load->model('users_model');\n\t\t\t\t\t$user = $this->users_model->current();\n\n\t\t\t\t\t// Welcome user by first name.\n\t\t\t\t\t$this->flexi_cart->set_status_message('Hi, '.$user->first_name.'. welcome back!', 'public', TRUE);\n\t\t\t\t\t$this->session->set_flashdata('message', $this->flexi_cart->get_messages('public'));\n\n\t\t\t\t\tredirect();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Login was un-successful, set appropriate message\n\t\t\t\t\t$this->flexi_cart->set_error_message($this->ion_auth->errors(), 'public', TRUE);\n\t\t\t\t\t$this->session->set_flashdata('message', $this->flexi_cart->get_messages('public'));\n\n\t\t\t\t\t// use redirects instead of loading views for compatibility with MY_Controller libraries\n\t\t\t\t\tredirect('login', 'refresh');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Get any status message that may have been set.\n\t\t\t$this->data['message'] = $this->session->flashdata('message');\n\n\t\t\t$this->load->view('public/auth/login_view', $this->data);\n\t\t}", "public function login($user, $pass, $persistent);", "function login()\r\n{\r\n append_content(\"<h2>Login</h2>\");\r\n\r\n // var_dump($_POST);\r\n\r\n if (!empty($_POST['Submit']) && ($_POST['Submit']==\"Login\"))\r\n {\r\n //authenticate User\r\n if (empty($_POST['username']) || empty($_POST['password']))\r\n {\r\n append_content(\"<h3 id='error'> Empty Username or Password </h3>\");\r\n append_content(DisplayLoginForm());\r\n }\r\n else\r\n {\r\n $username = Security::Sanitize_Text($_POST['username']);\r\n $password = Security::Sanitize_Text($_POST['password']);\r\n // echo $username.\" \".$password;\r\n $user = new User($username,$password);\r\n\r\n\r\n $uid = $user->GetUserID();\r\n\r\n\r\n if ($uid)\r\n {\r\n $_SESSION['userid'] = $uid;\r\n $_SESSION['username'] = $username;\r\n URL::Redirect('home');\r\n }\r\n else\r\n {\r\n append_content(\"<h3 id='error'> Login Failed! </h3>\");\r\n append_content(DisplayLoginForm());\r\n }\r\n }\r\n }\r\n else\r\n {\r\n append_content(DisplayLoginForm());\r\n }\r\n}", "function login() {\n\t\tif (isset($_REQUEST['username'])) {\n\t\t\t$username = $_REQUEST['username'];\n\t\t\t$password = $_REQUEST['password'];\n\n\t\t\tinclude_once(\"login.php\");\n\n\t\t\t$log = new login();\n\t\t\t$authenticate = $log->userLogin($username, $password);\n\n\t\t\t// checking if bookings have been gotten from database\n\t\t\tif (!$authenticate) {\n\t\t\t echo '{\"result\":0,\"message\":\"Error authenticating\"}';\n\t\t\t return;\n\t\t\t}\n\n\t\t\t$row = $log->fetch();\n\t\t\tif (!$row) {\n\t\t\t echo '{\"result\":0, \"message\":\"username or password is wrong\"}';\n\t\t\t return;\n\t\t\t} else {\n\t\t\t\techo '{\"result\":1,\"userInfo\": ';echo json_encode($row);echo '}'; \n\t\t\t}\n\t\t}\n\t}", "public function login() {\n autoLogin($this->userModel);\n\n //Initialize Error Data Array- Reset Value\n $keys = ['uname_err', 'password_err'];\n $post_err = initData($keys);\n\n //Initialize array that will hold the flash messages\n $login_message = array();\n\n if ( isset($_POST['inputSubmit']) && ($_SERVER['REQUEST_METHOD'] == 'POST') ) {\n //Require_once Constants and FormSanitizer for POST DATA processing\n require_once '../app/classes/AccountService.php';\n require_once '../app/classes/FormSanitizer.php';\n\n $account = new AccountService($this->userModel);\n\n //Batch Sanitize POST Data\n // $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n \n //Process the Form data - TRIM ONLY\n $keys = ['inputUserName', 'inputLoginPassword'];\n $post_data = populateData($keys);\n\n //Sanitize username and password\n $post_data['inputUserName'] = FormSanitizer::formUserNameSanitizer($post_data['inputUserName']);\n $post_data['inputLoginPassword'] = FormSanitizer::formPasswordSanitizer($post_data['inputLoginPassword']);\n \n \n $validationErrors = $account->validateLoginCredentials($keys, $post_data, $post_err);\n\n //Check if no errors in the POST DATA\n if ( isErrorFree($validationErrors) ) {\n \n //Check if username exists in the database\n if ( $user = $this->userModel->getUserByUsername($post_data[\"inputUserName\"]) ) {\n //Check if account is activated\n $activated = (int)$user->activated;\n if ( $activated != 0 ) {\n //verify password\n if ( password_verify($post_data[\"inputLoginPassword\"], $user->password) ) {\n //Create User Sessions\n createUserSessions($user);\n\n //Set Fingerprint\n setFingerprint();\n\n //Check if Remember me is checked\n $remember = ( isset($_POST['inputRememberMe']) ) ? \"yes\" : '';\n\n if ( $remember == \"yes\" ) {\n $encryptedID = getBase64EncodedValue(Constants::$cookie_key, $user->userId);\n \n //set a cookie that will expire after 30days\n setcookie(\"rememberMeCookie\", $encryptedID, time()+60*60*24*100,\"/\");\n }\n \n //Redirect to upload page\n redirectTo(\"pages/upload/$_SESSION[uid]\"); \n exit();\n }\n else {\n array_push($login_message, \"Invalid username or password!\");\n flash(\"flash_message\", $login_message, \"alert alert-danger\");\n }\n }\n else {\n array_push($login_message, \"Your account is not yet activated. Please check your email to activation link.\");\n flash(\"flash_message\", $login_message,\"alert alert-danger\");\n }\n }\n else { //No Username found\n array_push($login_message, \"Invalid username or password!\");\n flash(\"flash_message\", $login_message, \"alert alert-danger\");\n }\n redirectTo('users/login');\n exit();\n }\n else {\n \n //Merge POST DATA and encountered POST ERRORS \n $data = array_merge($post_data, $validationErrors);\n // Load register view with validation error(s)\n \n $this->loadView('users/login', $data);\n }\n\n }\n else {\n //Initialize POST DATA values to ''\n $keys = ['inputUserName', 'inputPassword'];\n $post_data = initData($keys);\n\n //Merge POST DATA and INITIALIZED POST ERRORS\n $data = array_merge($post_data, $post_err); \n //Load view\n $this->loadView(\"users/login\", $data);\n }\n \n \n\n }", "public function authUser(){\n\t\t\t\n\t\tif($this->view->userTryLogin()){\n\t\t\t\n\t\t \t// UC 1 3: user provides username and password\n\t\t\t$inpName = $this->view->getInputName(false);\n\t\t\t\n\t\t\tif($inpName == null){\n\t\t\t\t$this->view->storeMessage(\"Användarnamn saknas\");\n\t\t\t\treturn $this->view->showLogin(false);\n\t\t\t}\n\t\t\t\n\t\t\t$inpPass = $this->view->getInputPassword(false);\n\n\t\t\tif($inpPass == null){\n\t\t\t\t$this->view->storeMessage(\"Lösenord saknas\");\n\t\t\t\treturn $this->view->showLogin(false);\n\t\t\t}\n\t\t\t\t\t\n\t\t\t// UC 1 3a: user wants system to keep user credentials for easier login\n\t\t\t$keepCreds = $this->view->keepCredentials();\n\t\t\t\n\t\t\t// UC 1 4: authenticate user...\n\t\t\t$answer = $this->model->loginUser($inpName, $inpPass, $this->view->getServerInfo());\n\t\t\t\n\t\t\t// UC 1 4a: user could not be authenticated\n\t\t\tif($answer === false){\n\t\t\t\t\n\t\t\t\t// 1. System presents an error message\n\t\t\t\t// 2. Step 2 in main scenario\n\t\t\t\t$this->view->storeUserInput($inpName);\n\t\t\t\t$this->view->storeMessage(\"Felaktigt användarnamn och/eller lösenord\");\n\t\t\t\treturn $this->view->showLogin(false);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tif($keepCreds){\n\t\t\t\t\t\n\t\t\t\t\t// UC 1 3a-1: ...system presents that...the user credentials were saved\n\t\t\t\t\t$this->view->storeCredentials($inpName, $inpPass);\n\t\t\t\t\t$this->model->storeCookieTime($inpName);\n\t\t\t\t\t$this->view->storeMessage(\"Inloggning lyckades och vi kommer ihåg dig nästa gång\");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t// ...and present success message\n\t\t\t\t\t$this->view->storeMessage(\"Inloggningen lyckades\");\n\t\t\t\t}\t\n\t\t\t\treturn $this->view->showLogin(true);\n\t\t\t}\n\t\t} else {\n\t\t\t\n\t\t\t// UC 1 1: user wants to authenticate\n\t\t \t// UC 1 2: system asks for username, password and if system should save the user credentials\n\t\t\treturn $this->view->showLogin(false);\n\t\t}\n\t}", "private function loginWithPostData() {\n \n $this->user_name = $this->connection->real_escape_string($_POST['user_name']); \n $checklogin = $this->connection->query(\"SELECT user_name, user_email, user_password_hash FROM users WHERE user_name = '\".$this->user_name.\"';\");\n \n if($checklogin->num_rows == 1) {\n \n $result_row = $checklogin->fetch_object();\n \n if (crypt($_POST['user_password'], $result_row->user_password_hash) == $result_row->user_password_hash) {\n \n /**\n * write user data into PHP SESSION [a file on your server]\n */\n $_SESSION['user_name'] = $result_row->user_name;\n $_SESSION['user_email'] = $result_row->user_email;\n $_SESSION['user_logged_in'] = 1;\n $_SESSION['user_name'] = $result_row->user_name;\n \n\t\t\t\t\t// session security\n $_SESSION['agent'] = $_SERVER['HTTP_USER_AGENT'] ;\n\t\t\t\t\t$_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];\n\t\t\t\t\t$_SESSION['count'] = 0; \n\t\t\t\t\t\t\t\t\t\t \n /**\n * write user data into COOKIE [a file in user's browser]\n */\n setcookie(\"user_name\", $result_row->user_name, time() + (3600*24*100));\n setcookie(\"user_email\", $result_row->user_email, time() + (3600*24*100));\n $this->user_is_logged_in = true;\n return true; \n \n } else {\n $this->errors[] = \"Wrong password or username. Try again.\";\n $this->login_delay();\n return false; \n } \n \n } else {\n $this->errors[] = \"Wrong password or username. Try again.\";\n $this->login_delay();\n return false;\n } \n }", "public function actionLogin() {\n return;\n $session = Yii::$app->session;\n $session->removeFlash('error');\n if (isset($_POST['username'])) {\n $model = new $this->modelClass;\n $username = $_POST['username'];\n $password = $_POST['password'];\n $mUser = User::findOne(['username' => $username]);\n\n if ($mUser) {\n if (Yii::$app->security->validatePassword($password, $mUser->password_hash)) {\n $mUser->storeToSession();\n $userPublic = $mUser->toArrayPublic();\n $session->set('user', $mUser);\n\n //if already a user\n return $this->redirect(\\Yii::$app->urlManager->createUrl(\"app#/research/my\"));\n } else {\n $data = array(\n 'message' => \"Invalid Credentials\"\n );\n $session->setFlash('error', \"Invalid Credentials\");\n }\n } else {\n $data = array(\n 'message' => \"Invalid Credentials\"\n );\n $session->setFlash('error', \"Invalid Credentials\");\n }\n }\n\n return $this->render('login');\n }", "public function connectUser () {\n\n if (!empty($_POST)) {\n // Suppresion du isset et mis du 2eme if en else if\n if (empty($_POST['login'])) {\n $_SESSION['errors']['login'] = \"Veuillez indiquez votre login ou votre adresse mail pour vous connecter.\";\n } else if (UsersClass::checkLogin($_POST['login'], true) === false) {\n $_SESSION['errors']['login'] = \"Le login ou l'adresse e-mail indiqué n'existe pas. Il se peut aussi qu'il n'est pas encore activé.\";\n } else if (empty($_POST['password'])) {\n $_SESSION['errors']['password'] = \"Veuillez indiquez votre mot de passe pour vous connecter.\";\n } else if ($this->checkPassword($_POST['password'], $_POST['login']) === false) {\n $_SESSION['errors']['password'] = \"Le mot de passe indiqué est éronné, veuillez entrer le bon mot de passe pour vous connecter.\";\n } else {\n $login = htmlentities($_POST['login']);\n $sql = \"SELECT * FROM users WHERE :login = username OR :login = email AND activated = 1\";\n $query = $this->bdd->prepare($sql);\n $query->bindParam(':login', $_POST['login']);\n $query->execute();\n $result = $query->fetch();\n\n $_SESSION['auth']['id_user'] = $result['id_user'];\n header('Location: ' . URL . '/pages/users/profil.php');\n }\n }\n }", "public function login() {\n\t\t/* if($this->Session->check('Auth.User')){\n\t\t\t$this->redirect(array('action' => 'home'));\t\n\t\t\t\t\t\n\t\t} */\n\t\t\n\t\t// if we get the post information, try to authenticate\n\t\tif ($this->request->is('post')) {\n\t\t\tif ($this->Auth->login()) {\n\t\t\t\t$this->Session->setFlash(__('Welcome, '. $this->Auth->user('username')));\n\t\t\t\t//$this->redirect($this->Auth->redirectUrl());\n\t\t\t\t$this->User->id = $this->Auth->user('id'); // target correct record\n\t\t\t\t$this->User->saveField('last_login_time', date(DATE_ATOM)); // save login time\n\t\t\t\t\n\t\t\t\t$this->redirect(array('action' => 'home'));\t\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash('Invalid username or password');\n\t\t\t}\n\t\t}\n\n\t}" ]
[ "0.75616276", "0.7542298", "0.7539375", "0.74898446", "0.74624556", "0.7413393", "0.73520154", "0.7333756", "0.7300886", "0.72897387", "0.72496456", "0.72196776", "0.72187316", "0.72020835", "0.71899796", "0.7184783", "0.71790147", "0.7174712", "0.7156235", "0.7153245", "0.7149784", "0.7144034", "0.714039", "0.71398336", "0.71371394", "0.71326786", "0.7131057", "0.71280044", "0.71059805", "0.7094214", "0.7093298", "0.7085764", "0.7055254", "0.7031813", "0.7030114", "0.7019439", "0.7019439", "0.70099235", "0.70069677", "0.7003426", "0.69865495", "0.6986372", "0.6984032", "0.6967466", "0.69279045", "0.69164264", "0.6914804", "0.689618", "0.6890276", "0.6885486", "0.68824965", "0.6880911", "0.68715703", "0.68639207", "0.6862126", "0.68620354", "0.6859488", "0.6852618", "0.68481433", "0.6845486", "0.68416864", "0.6841424", "0.68398535", "0.6828771", "0.681788", "0.6810737", "0.68029964", "0.6800781", "0.679243", "0.67896426", "0.6787318", "0.67817324", "0.6776646", "0.67712224", "0.6769807", "0.6768415", "0.6766662", "0.6761296", "0.6759622", "0.67502385", "0.67419446", "0.67301005", "0.6722532", "0.6720116", "0.67198515", "0.671867", "0.6713841", "0.67121756", "0.6710424", "0.67056924", "0.6701687", "0.66991276", "0.66988546", "0.6694623", "0.66936165", "0.669269", "0.6690481", "0.6670431", "0.6670366", "0.6663673", "0.6662136" ]
0.0
-1
///////////////////////////////////////////////////////////////////////// / createJSONResponse() / / This method will return the JSON response to output so that the iPhone / application can parse the profile along with status object. If the / operation was not successul (i.e. the status object holds anything but / SUCCESS) then it will only send the error object. /////////////////////////////////////////////////////////////////////////
public function createJSONResponse() { $json_array = array(); if ($this->status->getCode() != Status::SUCCESS) { // The operation failed. Send only the error $json_array['Status'] = $this->status->membersToJsonFormat(); } else { // Send the profile and the error $json_array['Profile'] = $this->user->membersToJsonFormat(); $json_array['Status'] = $this->status->membersToJsonFormat(); } return json_encode($json_array); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function jsonResponse($status, $code, $html, $message = null) {\n $this->getResponse()\n ->setHeader('Content-Type', 'application/json')\n ->setHttpResponseCode($code)\n ->setBody(Zend_Json::encode(array(\"status\" => $status, \"html\" => $html, \"message\" => $message)))\n ->sendResponse();\n exit;\n }", "public function json_response($message = null, $code = 200)\n\t{\n\t header_remove();\n\t // set the actual code\n\t http_response_code($code);\n\t // set the header to make sure cache is forced\n\t header(\"Cache-Control: no-transform,public,max-age=300,s-maxage=900\");\n\t // treat this as json\n\t header('Content-Type: application/json');\n\t $status = array(\n\t 200 => '200 OK',\n\t 400 => '400 Bad Request',\n\t 422 => 'Unprocessable Entity',\n\t 500 => '500 Internal Server Error'\n\t );\n\t // ok, validation error, or failure\n\t header('Status: '.$status[$code]);\n\t // return the encoded json\n\t return json_encode(array(\n\t 'status' => $code < 300, // success or not?\n\t 'message' => $message\n\t ));\n\t}", "function jsonResponse($status, $message, $details) {\n\t\t\t$jsonData = array(\n\t\t\t\t'status' => $status,\n\t\t\t\t'message' => $message,\n\t\t\t\t'details' => $details\n\t\t\t);\n\n\t\t\techo json_encode($jsonData);\n\t\t}", "function json_response($code = 200, $message = null, $error = false)\n{\n header_remove();\n // set the actual code\n http_response_code($code);\n // set the header to make sure cache is forced\n header('Cache-Control: no-transform,public,max-age=300,s-maxage=900');\n // treat this as json\n header('Content-Type: application/json');\n $status = array(\n 200 => '200 OK',\n 201 => '201 Created',\n 400 => '400 Bad Request',\n 401 => '401 Unauthorized',\n 404 => '404 Not Found',\n 409 => '409 Conflict',\n 422 => 'Unprocessable Entity',\n 500 => '500 Internal Server Error'\n );\n // ok, validation error, or failure\n header('Status: '.$status[$code]);\n // return the encoded json\n if ($error){\n return json_encode(array(\n 'status' => $status[$code] === 200,\n 'error' => array('errorCode'=>0,'message' => $message)\n ));\n }\n return json_encode(array(\n 'success' => array('message' => $message)\n ));\n}", "public function getResponse(): JsonResponse\n {\n return response()->json(['error' => [ 'code' => $this->error_code, 'message' => $this->message]], $this->httpCode);\n }", "public function json()\n {\n $code = 200;\n\n if (!Request::has(\"no_response_code\") || Request::input('no_response_code') != \"yes\") {\n $code = $this->getCode();\n }\n\n return response()->json($this->getResponse(), $code);\n }", "private function return_json($status = 200,$message = 'success',$data = null){\n\t\texit(json_encode(\n\t\t\tarray(\n\t\t\t\t'status' => $status,\n\t\t\t\t'message' => $message,\n\t\t\t\t'data' => $data\n\t\t\t)\n\t\t)\n\t\t);\n\t}", "public static function jsonResponse($status,$array)\n {\n $array = [\n \"data\" => $array\n ];\n return self::respond($status,$array);\n }", "public function return_json(){\n\t\t$this->output\n\t ->set_content_type('application/json')\n\t ->set_output(json_encode($this->response));\n\t}", "function json_response($data = [], $message = null, $status = 200, array $headers = [], $options = 0)\n {\n return new JsonResponse(compact('data', 'status', 'message'), $status, $headers, $options);\n }", "protected function responseJSON() {\n $response = array('success' => TRUE, 'shortUrl' => $this->shortUrl, 'images' => $this->response);\n header('Content-Type: application/json');\n echo json_encode($response);\n return TRUE;\n }", "function json_response($code = 200, $message = null, $error = false)\n{\n header_remove();\n // set the actual code\n http_response_code($code);\n // set the header to make sure cache is forced\n header('Cache-Control: no-transform,public,max-age=300,s-maxage=900');\n // treat this as json\n header('Content-Type: application/json');\n $status = array(\n 200 => '200 OK',\n 400 => '400 Bad Request',\n 404 => '404 Not Found',\n 422 => 'Unprocessable Entity',\n 500 => '500 Internal Server Error'\n );\n // ok, validation error, or failure\n header('Status: '.$status[$code]);\n // return the encoded json\n if ($error){\n return json_encode(array(\n 'status' => $status[$code] === 200,\n 'error' => array('errorCode'=>0,'message' => $message)\n ));\n }\n return json_encode(array(\n 'success' => array('message' => $message)\n ));\n}", "private function __response( $json, $status = 200 )\n {\n header(\"HTTP/1.1 \" . $status . \" \" . $this->__requestStatus($status));\n header( \"Access-Control-Allow-Orgin: *\" );\n header( \"Access-Control-Allow-Methods: *\" );\n header( \"Content-Type: application/json\" );\n \n if(is_array($json) )\n {\n echo json_encode($json);\n }\n\n exit;\n }", "protected function createResponse($json = NULL) {\n $response = new ResourceResponse();\n if ($json) {\n $response->setContent($json);\n }\n return $response;\n }", "private function build_response_json( $success = false, $error = true, $code =null, $message = null, $type = null, $data = null, $breadcrumb = null, $html = null )\n\t{\n\t\treturn json_encode( array(\n\t\t\t'success' => $success,\n\t\t\t'error' => $error,\n\t\t\t'code' => (int) $code,\n\t\t\t'message' => $message,\n\t\t\t'type' => $type,\n\t\t\t'data' => $data,\n\t\t\t'breadcrumb' => $breadcrumb,\n\t\t\t'html' => $html,\n\t\t) );\n\t}", "public function json_response($status = 0, $val = array(), $message = FALSE)\n {\n $success = FALSE;\n \n if ($status == $this->json_status['error']) {\n $message = $message ? $message : lang('json_error');\n } else \n if ($status == $this->json_status['success']) {\n $message = $message ? $message : lang('json_success');\n $success = TRUE;\n } else \n if ($status == $this->json_status['no_data']) {\n $message = $message ? $message : lang('no_data');\n } else {\n $message = $message ? $message : lang('no_data');\n }\n \n return json_encode(array(\n 'success' => $success,\n 'status' => $status,\n 'message' => $message,\n 'result' => $val\n ));\n }", "public function toJson(){\n $info = array(\n \"status\" => $this->status,\n \"authorizedAmount\" => $this->authorizedAmount,\n \"lastFour\" => $this->lastFour,\n \"cardType\" => $this->cardType,\n \"currency\" => $this->currency,\n \"paymentProfileId\" => $this->paymentProfileId\n );\n\n $error = array(\n \"status\" => \"Server returned a \" . $this->status . \"status code.\",\n \"body\" => \"Response Body: <pre>\" . print_r($this->respBody,true) . \"</pre>\",\n \"curlInfo\" => \"Curl Info: <pre>\" . print_r($this->log,true) . \"</pre>\"\n );\n\n return json_encode($this->hasError ? $error : $info);\n }", "public function json($datas = [], $status = 200) {\n\t\t$this->response\t\t= new Response();\n\n\t\t$this->response->setContent(\n\t\t\t$datas\n\t\t);\n\n\t\t$this->response->setStatusCode($status);\n\n\t\treturn $this->response;\n\t}", "private function Response( $status, $message ) {\n\t\t// create response object\n\t\t$oResponse = new stdClass();\n\t\t$oResponse->status = $status;\n\t\t$oResponse->message = $message;\n\n\t\t// log response\n\t\t$this->LogResponse($oResponse);\n\n\t\t// output response to api client\n\t\techo json_encode($oResponse);\n\t\texit;\n\t}", "public function jsonResponse(): string {\n\n header_remove();\n http_response_code(200);\n header('Content-Type: application/json');\n header('Status: 200');\n $response = [\n 'visited' => $this->visited,\n 'cleaned' => $this->cleaned,\n 'final' => $this->final,\n 'battery' => $this->battery\n ];\n\n return json_encode($response,JSON_PRETTY_PRINT);\n }", "function get_json_result($message, $success) {\n\t\t$status = ($success) ? \"success\" : \"error\"; \n\t\techo json_encode([\n\t\t\t\"message\" => $message,\n\t\t\t\"status\" => $status\n\t\t]);\n\t}", "protected function _json_response($data = array())\n\t{\n\t\t// set ajax headers\n\t\t$this->_ci->output->set_header(\"Expires: 0\");\n\t\t$this->_ci->output->set_header(\"Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0\");\n\t\t$this->_ci->output->set_header(\"Pragma: no-cache\");\n\t\t$this->_ci->output->set_header('Content-type: application/json; charset=utf-8');\n\n\t\t// output the json\n\t\tdie(json_encode($data));\n\t}", "function json_response($message = 'Error', $code = 500, $data = null)\n{\n header('Content-Type: application/json');\n $response = array(\n 'code' => $code,\n 'data' => $data,\n 'message' => $message\n );\n http_response_code($code);\n echo json_encode($response);\n}", "function response($status,$status_message,$data){\n header(\"HTTP/1.1 \".$status);\n $response['status']=$status;\n $response['status_message']=$status_message;\n $response['data']=$data;\n $json_response = json_encode($response);\n echo $json_response;\n}", "function registerAPIResponse(){\n \n $authentication = new Authentication();\n \n if(isset($_POST['username'], $_POST['password'])){\n \n $username = $_POST['username'];\n $password = $_POST['password'];\n\n //Username is too long or short\n if(strlen($username) > 50 || strlen($username) < 1){\n\n $return = array(\n 'status' => 409,\n 'message' => \"Unable to register $username. Username must be between 1 and 50 characters.\"\n );\n\n http_response_code(409);\n\n }\n //Password is too long or short\n else if(strlen($password) > 255 || strlen($password) < 8){\n\n $return = array(\n 'status' => 409,\n 'message' => \"Unable to register $username. Password must be between 8 and 255 characters.\"\n );\n\n http_response_code(409);\n\n }\n else {\n\n $registerValidaton = $authentication->register($username, $password);\n \n //Unable to register\n if($registerValidaton === LoginConstants::UNABLE_REGISTER){\n \n $return = array(\n 'status' => 409,\n 'message' => \"Unable to register $username. This may be due to the username being already taken or an error.\"\n );\n \n http_response_code(409);\n \n \n }\n else {\n \n $return = array(\n 'status' => 200 ,\n 'message' => \"Register for $username was successful. Please login.\"\n );\n \n http_response_code(200);\n \n }\n\n }\n }\n \n //Send back response to client. \n print_r(json_encode($return));\n \n}", "public function responseJson() {\n return Response::json($this->_responseData, $this->_responseCode);\n }", "function failure($error) {\r\n $data = array();\r\n $data['success'] = false;\r\n $data['error'] = $error;\r\n\r\n header('Content-Type: application/json');\r\n exit(json_encode($data));\r\n}", "public function prepareJSONResponse(int $status, $data): string\n {\n return json_encode(['status' => $status, 'message' => $data]);\n }", "private function jsonResponse() {\n return json_format($this->response, $this->pretty);\n }", "function response(\n $_status,\n $_info = false,\n $_data = false,\n $_error = false,\n $_success = false,\n $_default = false\n ) {\n header('Content-Type: application/json');\n print json_encode([\n 'status' => $_status,\n 'info' => $_info,\n 'data' => $_data,\n 'error' => $_error,\n 'success' => $_success,\n 'default' => $_default\n ]);\n exit(0);\n }", "function set_Json_Response()\n {\n $this->setCommand();\n //Fire Script \n $this->fire_Script();\n $response = array(\"status\"=>$this->status,\n \"script_ouput\"=>$this->script_output,\n \"executation_time\"=>$this->time_interval,\n \"message\"=>$this->message);\n \n echo json_encode($response, JSON_PRETTY_PRINT);\n }", "public function jsonAction()\n {\n $response = new Response(json_encode(['name' => 'John Doe']));\n $response->headers->set('Content-Type', 'application/json');\n\n return $response;\n }", "function json_response($code = 200, $message = null)\n{\n header_remove();\n // set the actual code\n http_response_code($code);\n // set the header to make sure cache is forced\n header(\"Cache-Control: no-transform,public,max-age=300,s-maxage=900\");\n // treat this as json\n header('Content-Type: application/json');\n $status = array(\n 200 => '200 OK',\n 400 => '400 Bad Request',\n 422 => 'Unprocessable Entity',\n 500 => '500 Internal Server Error'\n );\n // ok, validation error, or failure\n header('Status: '.$status[$code]);\n // return the encoded json\n return json_encode(array(\n 'status' => $code < 300, // success or not?\n 'message' => $message\n ));\n}", "protected function responseJSON($data) {\n \t// Convert to JSON\n \t$dataJSON = $this->serializeJson($data);\n \t$response = new Response($dataJSON);\n \t$response->headers->set('Content-Type', 'application/json');\n \treturn $response;\n }", "private function createStatusSuccessResponse(): stdClass\n {\n $response = new stdClass();\n $response->statusSuccess = new stdClass();\n $response->statusSuccess->_ = 'Operation successful.';\n $response->statusSuccess->code = 'SUCCESS';\n $response->statusSuccess->report = new stdClass();\n $response->statusSuccess->report->approximateTotals = new stdClass();\n $response->statusSuccess->report->approximateTotals->totalRegistered = 1000;\n $response->statusSuccess->report->approximateTotals->totalShopperPending = 0;\n $response->statusSuccess->report->approximateTotals->totalAcquirerPending = 0;\n $response->statusSuccess->report->approximateTotals->totalAcquirerApproved = 1000;\n $response->statusSuccess->report->approximateTotals->totalCaptured = 0;\n $response->statusSuccess->report->approximateTotals->totalRefunded = 0;\n $response->statusSuccess->report->approximateTotals->totalChargedback = 0;\n $response->statusSuccess->report->approximateTotals->totalReversed = 0;\n $response->statusSuccess->report->approximateTotals->exchangedTo = 'EUR';\n $response->statusSuccess->report->approximateTotals->exchangeRateDate = '2020-03-10 10:58:16';\n $response->statusSuccess->report->payment = new stdClass();\n $response->statusSuccess->report->payment->id = 3058909231;\n $response->statusSuccess->report->payment->paymentMethod = 'ELV';\n $response->statusSuccess->report->payment->authorization = new stdClass();\n $response->statusSuccess->report->payment->authorization->status = 'AUTHORIZED';\n $response->statusSuccess->report->payment->authorization->amount = new stdClass();\n $response->statusSuccess->report->payment->authorization->amount->_ = 1000;\n $response->statusSuccess->report->payment->authorization->amount->currency = 'EUR';\n $response->statusSuccess->report->payment->authorization->amount->confidenceLevel = 'ACQUIRER_APPROVED';\n $response->statusSuccess->report->consideredSafe = new stdClass();\n $response->statusSuccess->report->consideredSafe->value = true;\n $response->statusSuccess->report->consideredSafe->level = 'SAFE';\n $response->statusSuccess->report->consideredSafe->date = '2020-03-06T12:05:50.846+01:00';\n $response->statusSuccess->report->consideredSafe->reason = 'EXACT_MATCH';\n $response->statusSuccess->report->apiInformation = new stdClass();\n $response->statusSuccess->report->apiInformation->originalVersion = '1.3';\n $response->statusSuccess->report->apiInformation->conversionApplied = false;\n $response->statusSuccess->ddpXsdVersion = '1.3.14';\n\n return $response;\n }", "function response($status,$message,$data){\n\n $result = array();\n $result['status'] = $status;\n $result['message'] = $message;\n $result['data'] = $data;\n\n $result = json_encode($result);\n echo $result;\n exit();\n\n }", "function json_response($code = 200, $response = null)\n{\n header_remove();\n // set the actual code\n http_response_code($code);\n // set the header to make sure cache is forced\n header(\"Cache-Control: no-transform,public,max-age=300,s-maxage=900\");\n // treat this as json\n header('Content-Type: application/json');\n $status = array(\n 200 => '200 OK',\n 400 => '400 Bad Request',\n 422 => 'Unprocessable Entity',\n 500 => '500 Internal Server Error'\n );\n // ok, validation error, or failure\n header('Status: '.$status[$code]);\n // return the encoded json\n return json_encode(array(\n 'status' => $code < 300, // success or not?\n 'response' => $response\n ));\n}", "private function _response($data, $status = 200) {\n header(\"Access-Control-Allow-Orgin: *\");\n header(\"Access-Control-Allow-Methods: *\");\n header(\"Content-Type: application/json\");\n header(\"HTTP/1.1 \" . $status . \" \" . $this->_requestStatus($status));\n return json_encode($data);\n }", "private function _response($data, $status = 200) { \n header(\"HTTP/1.1 \" . $status . \" \" . $this->_requestStatus($status));\n if($data) {\n return json_encode($data, JSON_PRETTY_PRINT); // JSON_PRETTY_PRINT only works in PHP >= 5.4\n }\n return '{}';\n }", "public function generateJsonResponse(bool $validity, array $data, int $status = 200)\n {\n return response()->json(\n [\n 'isvalid' => $validity,\n 'data' => $data,\n 'status' => $status\n ], $status\n );\n }", "public function returnResponse()\n\t{\n\t$this->errorLogging->logInfo(__CLASS__, __METHOD__, \"Called.\");\n\n\t$final_array = array(\"session\" => $this->sessionHeaderArray, \"apiResponse\" => $this->apiHeaderArray, \"error\" => $this->errorHeaderArray);\n\t\t\n\t\tif (!$responseJson = json_encode($final_array))\n\t\t{\n\t\t$this->errorLogging->logError(__CLASS__, __METHOD__, \"Failed json_encode.\");\n\n\t\t}\n\t\n\t$this->errorLogging->logInfo(__CLASS__, __METHOD__, $responseJson);\t\n\treturn $responseJson;\n\t}", "protected static function returnJson($response, $data, $status)\n {\n return $response->withHeader('Content-type', 'application/json')->withJson($data, $status);\n }", "function responseJSON($code, $data = null, $message = null)\n {\n $response = [\n 'status' => in_array($code, [200, 201, 204]),\n 'code' => (int) $code,\n 'data' => empty($data) ? null : $data,\n 'message' => empty($message) ? null : $message,\n 'language' => __LANGUAGE__,\n ];\n\n return $response;\n }", "private function createResponse(string $message, int $code, array $errors = []): JsonResponse\n {\n return new JsonResponse(\n [\n 'code' => $code,\n 'message' => $message,\n 'field_errors' => $errors,\n ],\n $code\n );\n }", "function GenerateJSONResponseData()\n {\n $link = mysql_connect($this->servername, $this->username, $this->password);\n if (!$link) {\n die('Could not connect: ' . mysql_error());\n }\n \n //Make Players the current database\n $db_selected = mysql_select_db($this->dbname, $link);\n \n #Code for JSON Response\n $result = mysql_query(\"SELECT * FROM Player\");\n \n $json = array();\n $total_records = mysql_num_rows($result);\n \n if($total_records >= 1){\n while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){\n $json[] = $row;\n }\n }\n \n #Creating file for JSON to read from for response html page http://localhost/~randallmeyer/Players.html\n #The generated JSON php file is located http://localhost/~randallmeyer/players_mysql.php\n $fp=fopen('players_mysql.php','w');\n fwrite($fp, json_encode($json));\n fclose($fp);\n \n mysql_close($link);\n }", "public function createAction(): string\n {\n $status = self::STATUS_200;\n $message = '';\n return $this->prepareJSONResponse($status, $message);\n }", "public function json(array $data = [], int $status = 200, array $headers = []): ResponseInterface;", "private function notActiveResponse() : JsonResponse\n\t{\n\t\treturn $this->jsonResponse(['active' => false]);\n\t}", "public function response() {\n $response = (object)[\n 'count' => $this->response,\n 'errors' => $this->errors\n ];\n echo json_encode($response); \n }", "function errorJSON(){\n header('Content-Type: application/json');\n $output['Error'] = \"Invalid Request\";\n die(json_encode($output));\n }", "protected function jsonResponse(array $data = null, int $code = 200): string\n {\n header_remove();\n http_response_code($code);\n header(\"Cache-Control: no-transform,public,max-age=300,s-maxage=900\");\n header('Content-Type: application/json');\n\n $status = array(\n 200 => '200 OK',\n 400 => '400 Bad Request',\n 422 => 'Unprocessable Entity',\n 500 => '500 Internal Server Error'\n );\n\n header('Status: '.$status[$code]);\n\n return json_encode([\n 'error' => $code > 300,\n 'code' => $code,\n 'data' => $data,\n ]);\n }", "function deliverResponse($status,$status_msg,$data)\n{\n $response['status'] = $status;\n $response['status_msg'] = $status_msg;\n $response['data'] = $data;\n $json_response = json_encode($response);\n echo $json_response;\n}", "function deliverResponse($status,$status_msg,$data)\n{\n $response['status'] = $status;\n $response['status_msg'] = $status_msg;\n $response['data'] = $data;\n $json_response = json_encode($response);\n echo $json_response;\n}", "function deliverResponse($status,$status_msg,$data)\n{\n $response['status'] = $status;\n $response['status_msg'] = $status_msg;\n $response['data'] = $data;\n $json_response = json_encode($response);\n echo $json_response;\n}", "function deliverResponse($status,$status_msg,$data)\n{\n $response['status'] = $status;\n $response['status_msg'] = $status_msg;\n $response['data'] = $data;\n $json_response = json_encode($response);\n echo $json_response;\n}", "function returnResult($status, $message){\r\t$result = array(\r\t\t'status' => $status,\r\t\t'message' => $message\r\t);\r\techo json_encode($result);\r\texit();\r}", "public function json($data = array(), $status = 200, array $headers = array())\n\t{\n\t\treturn new JsonResponse($data, $status, $headers);\n\t}", "function print_json($status, $message, $data)\n {\n header(\"HTTP/1.1 $status $message\");\n header(\"Content-Type: application/json; charset=UTF-8\");\n\n $response['statusCode'] = $status;\n $response['statusMessage'] = $message;\n $response['data'] = $data;\n\n echo json_encode($response, JSON_PRETTY_PRINT);\n }", "public function formatResponse($response, $status = \"200\")\n {\n $ci = &get_instance();\n header('Content-type: application/json');\n $ci->output->set_content_type('application/json');\n $ci->output->set_status_header($status);\n\n $response = $ci->input->get('pretty')\n ? json_encode($response, JSON_PRETTY_PRINT)\n : json_encode($response);\n\n if (!$response) {\n monolog(\"Failed encoding string: \". json_last_error_msg(), \"error\");\n }\n\n return $response;\n }", "protected function getCreateResponse()\n\t{\n\t\treturn new Api\\Response\\Create();\t\n\t}", "public static function objToJsonResponse($result) {\n $response = new JsonResponse();\n $response->setData($result);\n return $response;\n }", "public function returnJson($json)\n {\n $response = $this->getResponse();\n $response->setStatusCode(200);\n $util = new Util(null);\n\n header('Content-type: application/json');\n\n $response->setContent(json_encode($util->utf8ize($json)));\n\n return $response;\n }", "function deliverResponse($status,$status_msg,$data){\n $response['status'] = $status;\n $response['status_msg'] = $status_msg;\n $response['data'] = $data;\n\n $json_response = json_encode($response);\n echo $json_response;\n}", "function sendJsonResult($inMessage, $inStatus) {\n\t\t$this->setCacheLevelNone();\n\t\t\n\t\t$response = json_encode(\n\t\t\tarray(\n\t\t\t\t'status' => $inStatus === mvcSession::MESSAGE_INFO ? 'info' : ($inStatus === mvcSession::MESSAGE_OK ? 'success' : 'error'),\n\t\t\t\t'message' => $inMessage,\n\t\t\t)\n\t\t);\n\t\techo $response;\n\t}", "function exitYieldingJSON(\n bool $success = TRUE,\n bool $userNotLoggedIn = FALSE,\n bool $accountAlreadyExists = FALSE\n) {\n // Initialize the response object by building its \"success\" parameter and\n // assigning it the value of $success.\n $responseObject = array('success' => $success);\n\n if(!$success) {\n // If the account addition was unsuccessful, we need to add one or two\n // more parameters to the response object, so ...\n\n // Add the response object's \"userNotLoggedIn\" parameter, and assign it\n // the value of $userNotLoggedIn.\n $responseObject['userNotLoggedIn'] = $userNotLoggedIn;\n\n if(!$userNotLoggedIn) {\n // If the account addition was unsuccessful and a user is logged-in,\n // we need to add one more parameter to the response object, so ...\n\n // Add the response object's \"accountAlreadyExists\" parameter, and\n // assign it the value of $accountAlreadyExists.\n $responseObject['accountAlreadyExists'] = $accountAlreadyExists;\n }\n }\n\n // Encode the response object in JSON and output it to the browser.\n echo(json_encode($responseObject));\n\n // Exit.\n exit();\n}", "function jsonRespnse($status_code, $response){\n $app = \\Slim\\Slim::getInstance();\n // Http response code\n $app->status($status_code);\n // setting response content type to json\n $app->contentType('application/json');\n\n echo json_encode($response);\n}", "private function _createJson()\n {\n return new SlimBootstrap\\ResponseOutputWriter\\Json(\n $this->_request,\n $this->_response,\n $this->_headers,\n $this->_shortName\n );\n }", "public static function init(int $status, $message)\n {\n return new JsonResponse($status, $message);\n }", "public function create()\n {\n // Define objet to be returned as a json string\n $data = new \\stdClass();\n $data->success = false;\n $data->error = \"Not allowed\";\n\n return \\Response::json($data);\n }", "protected function construct_response()\n {\n $this->feedback['ok'] = $this->ok;\n $this->feedback['code'] = $this->code;\n $this->feedback['resource'] = $this->resource;\n }", "public function createJsonResponse($data, $status = 200, array $headers = [])\n {\n array_walk_recursive($data, function (&$data) {\n if (is_object($data)) {\n $data = $this->normalizer->normalize($data);\n if (is_array($data) && isset($data[\"timezone\"]) && isset($data[\"timestamp\"])) {\n $data = date(\\DateTime::RFC3339, $data[\"timestamp\"]);\n } else {\n array_walk($data, function (&$d) {\n if (is_array($d) && isset($d[\"timezone\"]) && isset($d[\"timestamp\"])) {\n $d = date(\\DateTime::RFC3339, $d[\"timestamp\"]);\n }\n });\n }\n }\n });\n\n $headers[\"Content-Type\"][] = \"application/json\";\n $json = $this->serializer->serialize($data, \"json\");\n\n return new HttpResponse($json, $status, $headers);\n }", "public function createdResponse($message, $data = null): JsonResponse\n {\n $response = [\n 'statusCode' => config('jobberman.status_codes.created'),\n 'statusText' => config('jobberman.status_texts.created'),\n 'message' => $message,\n ];\n\n if (null !== $data) {\n $response['data'] = $data;\n }\n\n return Response::json($response, config('jobberman.status_codes.created'));\n }", "protected function buildResponse($json)\n {\n //log the http response to the timeline\n $this->dispatch('utilbundle.symfout', new SymfonyEvent($this->get('g4_container')->getManifestId(), $json, get_class($this), $this->getRequest()->getRequestUri(), $this->get('g4_container')->getRequestPairKey(), 200));\n\n return new Response($json);\n }", "public function generateResponse($success, $message) {\n return json_encode(array(\n \"success\" => $success,\n \"message\" => $message,\n ), JSON_PRETTY_PRINT);\n }", "protected function json(\n $data,\n int $status = Response::HTTP_OK,\n array $headers = [],\n array $context = []\n ): JsonResponse\n {\n $container = AppHelper::getKernelContainer();\n\n if ($container->has('jms_serializer')) {\n $json = $container->get('jms_serializer')->serialize($data, 'json');\n\n $data = json_decode($json, TRUE);\n }\n\n return new JsonResponse($data, $status, $headers);\n }", "private function createJsonResponse(\n string $filename,\n \\GuzzleHttp\\Psr7\\Response $response\n )\n {\n $json_response = new \\stdClass();\n $json_response->fileName = $filename;\n $json_response->statusCode = $response->getStatusCode();\n $json_response->reasonPhrase = $response->getReasonPhrase();\n\n return $json_response;\n }", "protected function responseJson($json, int $code = 200)\n {\n return $this->response\n ->withStatus($code)\n ->withType('application/json')\n ->withStringBody(json_encode($json));\n }", "function response($type = 'success', $message = null)\n {\n switch (strtolower($type)) {\n case 'deleted':\n $code = 204;\n break;\n case 'unauthorized':\n $code = 401;\n break;\n case 'forbidden':\n $code = 403;\n break;\n case 'not found':\n $code = 404;\n break;\n default:\n $code = 200;\n break;\n }\n\n header('HTTP/1.1 '.$this->codes[$code]);\n header(\"Status: $code\");\n http_response_code($code);\n \n if($message) echo json_encode($message);\n\n exit();\n }", "function json_response($data = [], $msg = null, $flag = 0, $error_fields = [])\n {\n echo json_encode([\n 'data' => $data,\n 'msg' => $msg,\n 'flag' => $flag,\n 'error_fields' => $error_fields,\n ]);\n exit;\n }", "public function successJsonResponse(string $message): JsonResponse\n {\n return response()->json([\n 'code' => 200,\n 'message' => $message\n ]);\n }", "protected function serviceResponse()\n {\n if ($this->_serviceMediatorStructure) {\n $this->_service->pullServiceMessages();\n }\n\n if ($this->_service->getError()) {\n $response = [\n 'error_message' => $this->_service->getError(),\n 'error' => 'true'\n ];\n } else {\n $response = [\n 'error' => 'false',\n 'message' => $this->_service->getMessage()\n ];\n }\n\n if ($this->_service->getFormMessages()) {\n $response['formMessages'] = $this->_service->getFormMessages();\n }\n\n $jsonData = $this->_service->getJsonData();\n if ($jsonData == true && !empty($jsonData)) {\n $response['data'] = $jsonData;\n }\n $data = Zend_Json::encode($response);\n\n // DO NOT CHANGE THIS. DO THIS ONLY LOCALLY\n $this->ajaxResponse($data, 'text/html');\n }", "public function respond($response = array('Nothing to show'), $status = 200, $format = 'json'){\n // My application needed only JSON support. You can use $format and extend support for XML etc.\n header('Content-Type: application/json');\n $message_body = array(\n \"status\" => $status,\n \"response\" => $response\n );\n echo json_encode($message_body);\n // I'm specifically using this as I do not want control transferred back to application.\n exit(0);\n }", "function _responseHttp($data,$status = 0){\n $this->CodeHTTP = ($status > 0) ? $status : 200;\n $this->_setHeaders();\n echo json_encode($data);\n exit;\n }", "public static function JSON($data, $status = 200) {\n $requestHeaders = Rock::getHeaders();\n $origin = array_key_exists('Origin', $requestHeaders) === true ? $requestHeaders['Origin'] : '*';\n\n header(\"HTTP/1.1 $status \". Util::$codes[$status]);\n header(\"Access-Control-Allow-Origin: $origin\");\n header('Access-Control-Allow-Methods: '. implode(', ', Config::get('CORS_METHODS')));\n header('Access-Control-Allow-Headers: '. implode(', ', Config::get('CORS_HEADERS')));\n header('Access-Control-Allow-Credentials: true');\n header('Access-Control-Max-Age: '. Config::get('CORS_MAX_AGE'));\n header('Content-Type: application/json');\n echo json_encode($data);\n }", "private function getJSON(){\n return json_encode($this->getResponseStructure());\n }", "function jsonSuccessResponse($message = 'Success', $code = 200)\n{\n $data = [\n 'success' => true,\n 'code' => $code,\n ];\n\n if (is_array($message)) {\n $data['data'] = $message;\n } else {\n $data['message'] = $message;\n }\n \n return\n response()\n ->json($data, $code);\n}", "public function json($data, $status = 200, $headers = array(), $context = array())\n {\n return (new JsonResponse($data, $status, $headers));\n }", "protected function outputJSONResponse($data){\n\t\t$this->setResponse('json');\n\t\techo json_encode($data);\n\t}", "private function throwJsonError($status, $error)\n\t\t{\n\t\t\t$response = array('status' => $status, 'error' => $error);\n\t\t\techo json_encode($response);\n\t\t\texit;\n\t\t}", "protected function setupSuccessResponse($data){\n $response['status_code_header'] = 'HTTP/1.1 200 OK';\n $response['body'] = json_encode($data);\n return $response;\n }", "public function responseJSON($status = false, $msg, $code = 404, $data = [], $header = [])\n {\n return response()->json([\n 'status' => $status,\n 'msg' => $msg,\n 'data' => $data\n ], $code, $header);\n }", "protected function createJsonResponse($data, $code = 200)\n {\n $response = new JsonResponse($data, $code);\n return $response;\n }", "private function renderJsonResponse($json, $code = 200)\n {\n return new Response($json, $code, ['application/json']);\n }", "public function json() {\n return json_encode($this->response);\n }", "public function create(): JsonResponse\n {\n return response()->json([\n 'product' => null,\n 'warehouses' => $this->wareHouseRepository->getData(new WarehouseRequest()),\n 'suppliers' => $this->supplierRepository->getData(new SupplierRequest()),\n ]);\n }", "function json_response() {\n return app(JsonResponse::class);\n }", "function result($success, $msg) {\n $response[\"success\"] = $success;\n $response[\"message\"] = $msg;\n echo json_encode($response);\n}", "function result($success, $msg) {\n $response[\"success\"] = $success;\n $response[\"message\"] = $msg;\n echo json_encode($response);\n}", "function api_response($res)\n{\n $response_code = $res['code'];\n $response_data = $res['data'];\n\n header('Content-Type: application/json');\n if(DEBUG)\n {\n exit('<pre>' . print_r(\n array(\n 'response'=>$response_code,\n 'data'=>$response_data\n\n ),true));\n }\n exit(json_encode(\n array(\n 'response'=>$response_code,\n 'data'=>$response_data\n )\n ));\n}", "public function json()\n {\n // if dirty data exists\n $this->swallow();\n // if redirecting\n if ($this->redirect) {\n /*header(\"Location: {$this->redirect}\");\n // more headers\n foreach ( $this->headers as $header ) {\n header($header);\n }*/\n $this->redirect($this->redirect, array(), false);\n } else {\n // header json data\n header('Content-Type: application/json');\n // more headers\n foreach ($this->headers as $header) {\n header($header);\n }\n //过滤$CFG\n if (!empty($this->vars['CFG'])) {\n unset($this->vars['CFG']);\n }\n // if cli add time\n if ($cli = Utility::isCli()) {\n echo \"[\". date('Y-m-d H:i:s') . \"] \";\n }\n // set varibales data\n if ($cli && version_compare(phpversion(), '5.4.0') > 0) {\n $results = json_encode($this->vars, JSON_PRETTY_PRINT);\n } else {\n $results = json_encode($this->vars);\n }\n // send\n echo $results;\n // if cli add \\n\n if ($cli) {\n echo \"\\n\";\n }\n }\n }" ]
[ "0.655637", "0.6509824", "0.63844895", "0.63839203", "0.63462466", "0.6301859", "0.6283636", "0.6273224", "0.62719935", "0.62586755", "0.621284", "0.62051564", "0.61972684", "0.6192168", "0.61861074", "0.6154327", "0.61485696", "0.61400616", "0.6078888", "0.6058823", "0.603277", "0.60252464", "0.59967816", "0.59796834", "0.5971953", "0.5947036", "0.59397817", "0.59389156", "0.59358716", "0.59310263", "0.5902112", "0.5888164", "0.5869915", "0.5865046", "0.58642924", "0.5858393", "0.584496", "0.58440924", "0.58361024", "0.58354056", "0.58267444", "0.5816102", "0.58154845", "0.57945806", "0.5761136", "0.5758898", "0.5748747", "0.574848", "0.5735829", "0.5735023", "0.5734715", "0.57151836", "0.57151836", "0.57151836", "0.57151836", "0.5714719", "0.5711646", "0.5703854", "0.5698432", "0.5697419", "0.56910086", "0.56909525", "0.56870145", "0.5684672", "0.56805056", "0.5673544", "0.5671093", "0.5667591", "0.56631434", "0.56558144", "0.5654446", "0.5640274", "0.56360567", "0.5609817", "0.5607392", "0.5593887", "0.55695724", "0.5557561", "0.5551215", "0.5546626", "0.55392826", "0.55322737", "0.55300456", "0.5529527", "0.5519106", "0.5514429", "0.55119824", "0.5510861", "0.55062336", "0.55024874", "0.54986566", "0.54980785", "0.54973733", "0.5495086", "0.54936886", "0.5490114", "0.5485067", "0.5485067", "0.54841465", "0.5482231" ]
0.8476488
0
Creates a mock reference.
public static function createMockReference($location = null, $subLocation = null) { $prophet = new Prophet(); $prophecy = $prophet->prophesize('Kreait\Firebase\ReferenceInterface'); if (!$location) { return $prophecy; } $prophecy->getLocation()->willReturn($location); $locationParts = explode('/', $location); $prophecy->getKey()->willReturn(array_pop($locationParts)); if (!count($locationParts) && (!is_string($subLocation) || strlen($subLocation) === 0)) { $prophecy->getReference(Argument::any())->willReturn(self::createMockReference(null)); } else { $subLocationParts = explode('/', $subLocation); while (count($subLocationParts)) { $nextKey = array_shift($subLocationParts); $nextSubLocationString = implode('/', $subLocationParts); $subReference = self::createMockReference($nextKey, $nextSubLocationString); $prophecy->getReference($nextKey)->willReturn($subReference); } } return $prophecy; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testCanCreateMockMethodWithReturnByReference()\n {\n //If the return by ref doesn't come from an interface derived types can override it\n $mock = Phockito::mock(FooReturnsByReferenceNoImplements::class);\n $res = &$mock->Foo();\n $this->assertNull($res);\n\n //we need to ensure derived type returns by ref\n $clazz = new ReflectionClass($mock);\n $fooMethod = $clazz->getMethod(\"Foo\");\n $this->assertTrue($fooMethod->returnsReference());\n }", "function testCanSpecifyReturnObjectForReferenceInterfaceImplemented()\n {\n //This is because it's defined like this in the interface (weird..)\n $mock = Phockito::mock(FooReturnsByReferenceImplements::class);\n $obj = new stdClass();\n\n Phockito::when($mock->Foo())->return($obj);\n $res = &$mock->Foo();\n $this->assertEquals($obj, $res);\n }", "public function createInstance()\n {\n $mock = $this->mock('Dhii\\\\SimpleTest\\\\Writer\\\\WriterAwareInterface')\n ->getWriter()\n ->new();\n\n return $mock;\n }", "function testCanCreateMockMethodWithReturnByReferenceImplementingInterfaceWithReturnByRef()\n {\n //This is because it's defined like this in the interface (weird..)\n $mock = Phockito::mock(FooReturnsByReferenceImplements::class);\n\n $res = &$mock->Foo();\n $this->assertNull($res);\n\n //we need to ensure derived type returns by ref\n $clazz = new ReflectionClass($mock);\n $fooMethod = $clazz->getMethod('Foo');\n $this->assertTrue($fooMethod->returnsReference());\n }", "protected function createMockClient()\n {\n $mock = new MockHandler([\n new Response(200),\n ]);\n\n $container = [];\n $history = Middleware::history($container);\n\n $stack = HandlerStack::create($mock);\n $stack->push($history);\n\n $this->mockedClient = new Client(['handler' => $stack]);\n $this->container = $container;\n }", "private function getBaseMockLink()\n {\n return $this->getMock('Mremi\\UrlShortener\\Model\\LinkInterface');\n }", "function testCanSpecifyReturnObjectForReferenceNoInterfaceImplemented()\n {\n //This is because it's defined like this in the interface (weird..)\n $mock = Phockito::mock(FooReturnsByReferenceImplements::class);\n $obj = new MockMe();\n Phockito::when($mock->Foo())->return($obj);\n $res = $mock->Foo();\n $this->assertEquals($obj, $res);\n }", "function testCanSpecifyReturnValueForReferenceInterfaceImplemented()\n {\n //This is because it's defined like this in the interface (weird..)\n $mock = Phockito::mock(FooReturnsByReferenceImplements::class);\n Phockito::when($mock->Foo())->return(4);\n $res = &$mock->Foo();\n $this->assertEquals(4, $res);\n }", "public function createInstance()\n {\n $mock = $this->mock('Dhii\\\\SimpleTest\\\\Locator\\\\ResultSetInterface')\n ->getTests()\n ->new();\n\n return $mock;\n }", "public static function makeInstance(): MockInterface\n {\n $redis = \\Mockery::mock(\\Redis::class);\n $redisGetMethod = $redis->shouldReceive('get');\n $redisGetMethod->andReturnUsing(\n function ($key) {\n return $key;\n }\n );\n $redisSetMethod = $redis->shouldReceive('set');\n $redisSetMethod->andReturnUsing(\n function ($key, $value, $timeout = 0) {\n return true;\n }\n );\n $redisSaveMethod = $redis->shouldReceive('save');\n $redisSaveMethod->andReturnUsing(\n function () {\n return true;\n }\n );\n\n return $redis;\n }", "private function createRewriterInterfaceMock()\n {\n return $this->getMockBuilder(RewriterInterface::class)->getMock();\n }", "private function createClientInterfaceMock()\n {\n return $this->getMockBuilder(ClientInterface::class)->getMock();\n }", "private function getMockAuthentication()\n {\n return $this->getMock('Mremi\\UrlShortener\\Provider\\Bitly\\AuthenticationInterface');\n }", "public function createInstance()\n {\n $mock = $this->mock(static::TEST_SUBJECT_CLASSNAME)\n\t ->getStateMachine()\n ->getTransition()\n ->abortTransition()\n ->isTransitionAborted()\n // EventInterface\n ->getName()\n ->setName()\n ->getTarget()\n ->setTarget()\n ->getParams()\n ->setParams()\n ->getParam()\n ->setParam()\n ->stopPropagation()\n ->isPropagationStopped();\n\n return $mock->new();\n }", "public function testNewInstance()\n {\n $className = 'TechDivision\\ApplicationServer\\Api\\Mock\\MockService';\n $instance = $this->service->newInstance($className, array(\n $this->service->getInitialContext(),\n \\Mutex::create(false)\n ));\n $this->assertInstanceOf($className, $instance);\n }", "public function createCacheContainer()\n {\n $mock = $this->getMockBuilder('Dhii\\Cache\\MemoryMemoizer')\n ->setMethods(null)\n ->getMock();\n\n return $mock;\n }", "public function testMockCanBeCreated()\n {\n $this->assertInstanceOf(EngineInterface::class, $this->mockEngine);\n $this->assertInstanceOf(Blocker::class, $this->mockEngine);\n }", "function testCanSpecifyReturnValueForReferenceNoInterfaceImplemented()\n {\n //If the return by ref doesn't come from an interface derived types can override it\n $mock = Phockito::mock(FooReturnsByReferenceNoImplements::class);\n Phockito::when($mock->Foo())->return(4);\n $res = &$mock->Foo();\n $this->assertEquals(4, $res);\n\n }", "public function createCallable()\n {\n $mock = $this->getMockBuilder('MyCallable')\n ->setMethods(['__invoke'])\n ->getMock();\n\n return $mock;\n }", "public function setUp()\n {\n $this->stubRefProperty = new stubReflectionProperty('stubTestProperty1', 'property');\n }", "public function createInstance()\n {\n $mock = $this->getMockBuilder(static::TEST_SUBJECT_CLASSNAME)\n ->setMethods(\n [\n 'setup',\n 'run',\n ]\n )\n ->getMockForAbstractClass();\n\n return $mock;\n }", "private function getMockGuzzle()\n {\n $mock = new MockHandler(array_merge([\n new Response(200, [], json_encode([]))\n ]));\n\n $stack = HandlerStack::create($mock);\n return new Guzzle(['handler' => $stack]);\n }", "final protected function getMockHandler(): MockHandler\n {\n $this->mockHandler = new MockHandler();\n\n return $this->mockHandler;\n }", "public function &create()\n {\n $obj = null;\n\n if (class_exists($this->_class_name)) {\n // Assigning the return value of new by reference\n $obj = new $this->_class_name();\n }\n\n return $obj;\n }", "public function createMock($originalClassName) {\n $mock = parent::createMock($originalClassName);\n $this->addMockedMethods($mock, $originalClassName);\n return $mock;\n }", "public static function buildTokenmapClientMock()\n {\n $builder = new MockeryBuilder();\n return $builder->buildMock();\n }", "public function getMock($originalClassName,\n $methods = array(),\n array $arguments = array(),\n $mockClassName = '',\n $callOriginalConstructor = true,\n $callOriginalClone = true,\n $callAutoload = true\n )\n {\n $originalClassName = Enlight_Class::getClassName($originalClassName);\n return parent::getMock($originalClassName,\n $methods,\n $arguments,\n $mockClassName,\n $callOriginalConstructor,\n $callOriginalClone,\n $callAutoload\n );\n }", "function testCanCreateBasicMockClass()\n {\n $mock = Phockito::mock(MockMe::class);\n $this->assertInstanceOf(MockMe::class, $mock);\n $this->assertNull($mock->Foo());\n $this->assertNull($mock->Bar());\n }", "function __construct(&$reference) {\n $this->reference = &$reference;\n }", "protected function _useMock() {\n\t\t$request = new CakeRequest(null, false);\n\n\t\t$this->Js = new JsHelper($this->View, array('TestJs'));\n\t\t$this->Js->TestJsEngine = $this->getMock('JsBaseEngineHelper', array(), array($this->View));\n\t\t$this->Js->request = $request;\n\t\t$this->Js->Html = new HtmlHelper($this->View);\n\t\t$this->Js->Html->request = $request;\n\t\t$this->Js->Form = new FormHelper($this->View);\n\t\t$this->Js->Form->request = $request;\n\t\t$this->Js->Form->Html = new HtmlHelper($this->View);\n\t}", "protected function createMockedLoggerAndLogManager() {}", "private function mockCache()\n {\n $this->objectManager->configure([\n 'preferences' => [\n Cache::class => DummyCache::class\n ]\n ]);\n }", "public function __construct()\n {\n $this->mock = Mockery::mock('User');\n\n }", "private function createReplacementPatternInterfaceMock()\n {\n return $this->getMockBuilder(ReplacementPatternInterface::class)->getMock();\n }", "private function createRsaMock()\n {\n return $this->getMockBuilder(Rsa::class)->getMock();\n }", "protected function getMockDrupalHandlerForConstructor() {\n $observerDrupal = $this->getMock('EntityXliff\\Drupal\\Utils\\DrupalHandler');\n $observerDrupal->expects($this->once())\n ->method('entityXliffGetFieldHandlers')\n ->willReturn(array());\n\n return $observerDrupal;\n }", "protected function createTestAuthExternalService() {\n\t\treturn $this->getMock('QsAuthExternalServiceOpenId', array('fake'));\n\t}", "private function createRsaFactoryProxyInterfaceMock()\n {\n return $this->getMockBuilder(RsaFactoryProxyInterface::class)->getMock();\n }", "private function createVehicleVariantsFetcherInterfaceMock()\n {\n return $this->getMockBuilder(VehicleVariantsFetcherInterface::class)->getMock();\n }", "static function mock(string $class, array $config = null)\n {\n return new self('mock', $class, $config);\n }", "public function createInstance()\n {\n $mock = $this->getMockForTrait(static::TEST_SUBJECT_CLASSNAME);\n $mock->method('_createInvalidArgumentException')\n ->will($this->returnCallback(function ($message = null) {\n return $this->createInvalidArgumentException($message);\n }));\n $mock->method('__')\n ->will($this->returnArgument(0));\n\n return $mock;\n }", "private function createHttpHandler()\n {\n $this->httpMock = new MockHandler();\n\n $handlerStack = HandlerStack::create($this->httpMock);\n $handlerStack->push(Middleware::history($this->curlHistory));\n\n $this->client = new Client(['handler' => $handlerStack]);\n\n app()->instance(Client::class, $this->client);\n }", "private function createContainerBuilderMock()\n {\n return $this->getMockBuilder(ContainerBuilder::class)\n ->setMethods(['get'])\n ->getMock();\n }", "private function getMockShortLink()\n {\n $link = $this->getBaseMockLink();\n\n $link\n ->expects($this->once())\n ->method('getShortUrl')\n ->will($this->returnValue('http://bit.ly/ze6poY'));\n\n return $link;\n }", "public function setUp() {\n $this->request = $this->getMock('Imbo\\Http\\Request\\RequestInterface');\n $this->response = $this->getMock('Imbo\\Http\\Response\\ResponseInterface');\n $this->database = $this->getMock('Imbo\\Database\\DatabaseInterface');\n $this->storage = $this->getMock('Imbo\\Storage\\StorageInterface');\n $this->event = $this->getMock('Imbo\\EventManager\\EventInterface');\n $this->manager = $this->getMock('Imbo\\EventManager\\EventManager');\n $this->event->expects($this->any())->method('getRequest')->will($this->returnValue($this->request));\n $this->event->expects($this->any())->method('getResponse')->will($this->returnValue($this->response));\n $this->event->expects($this->any())->method('getDatabase')->will($this->returnValue($this->database));\n $this->event->expects($this->any())->method('getStorage')->will($this->returnValue($this->storage));\n $this->event->expects($this->any())->method('getManager')->will($this->returnValue($this->manager));\n\n $this->resource = $this->getNewResource();\n }", "function testObjReference() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n \r\n\t\t// Create an object to reference\r\n\t\t$obj = new CAntObject($dbh, \"customer\", null, $this->user);\r\n\t\t$obj->setValue(\"name\", \"testGenSave\");\r\n\t\t$oid = $obj->save(false);\r\n\r\n\t\t// Create an activity with the reference\r\n\t\t$objAct = new CAntObject($dbh, \"activity\", null, $this->user);\r\n\t\t$objAct->setValue(\"obj_reference\", \"customer:$oid\");\r\n\t\t$aid = $objAct->save(false);\r\n\t\t$this->assertTrue($aid > 0 );\r\n\t\tunset($objAct);\r\n\r\n\t\t// Close and then open again\r\n\t\t$objAct = new CAntObject($dbh, \"activity\", $aid, $this->user);\r\n\t\t$this->assertEquals($objAct->getValue(\"obj_reference\"), \"customer:$oid\");\r\n\t\tunset($objAct);\r\n\r\n\t\t// Test with the list cache\r\n\t\t$list = new CAntObjectList($dbh, \"activity\", $this->user);\r\n\t\t$list->addCondition(\"and\", \"id\", \"is_equal\", $aid);\r\n\t\t$list->getObjects();\r\n\t\t$this->assertEquals($list->getNumObjects(), 1);\r\n\t\t$objAct = $list->getObject(0);\r\n\t\t$this->assertEquals($objAct->getValue(\"obj_reference\"), \"customer:$oid\");\r\n \r\n\t\t// Cleanup\r\n\t\t$obj->removeHard();\r\n\t\t$objAct->removeHard();\r\n\t}", "public static function setUpBeforeClass(){\n self::$urlify=m::mock('alias:URLify');\n }", "private function getNewUserMock() {\n $user_mock = $this->getMockForAbstractClass('\\Drupal\\Core\\Session\\AccountProxyInterface', ['id']);\n $user_mock->method('id')->willReturn(1);\n return $user_mock;\n }", "public static function bindTokenmapClientMock()\n {\n $builder = new MockeryBuilder();\n app()->instance(TokenmapClient::class, $builder->buildMock());\n return $builder;\n }", "protected function createMailMock()\n {\n $mailMock = $this->getMock(\\Sys25\\RnBase\\Utility\\Email::class, ['sendMessage']);\n $mailMock->expects($this->any())->method('sendMessage')->will($this->returnArgument(0));\n\n return $mailMock;\n }", "function SimpleMock() {\n $this->actions = new SimpleCallSchedule();\n $this->expectations = new SimpleCallSchedule();\n $this->call_counts = array();\n $this->expected_counts = array();\n $this->max_counts = array();\n $this->expected_args = array();\n $this->expected_args_at = array();\n $this->getCurrentTestCase()->tell($this);\n }", "protected function setUp()\r\n {\r\n $this->object = new AuthClientResource;\r\n $this->ref = new \\ReflectionObject($this->object);\r\n $this->identityRef = $this->ref->getProperty('identity');\r\n $this->identityRef->setAccessible(true);\r\n $this->propertiesRef = $this->ref->getProperty('properties');\r\n $this->propertiesRef->setAccessible(true);\r\n $this->innerIdRef = $this->ref->getProperty('innerId');\r\n $this->innerIdRef->setAccessible(true);\r\n }", "protected function mock($class) {\n $mock = Mockery::mock($class);\n $this->app->instance($class, $mock);\n return $mock;\n }", "private function mockEmployee()\n {\n $this->employeeS = $this->getMockBuilder('Employee')\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->employeeS\n ->method('can')\n ->willReturn(true);\n }", "public function createInstance()\n {\n $mock = $this->getMockBuilder(static::TEST_SUBJECT_CLASSNAME)\n ->getMockForTrait();\n $mock->method('__')\n ->will($this->returnArgument(0));\n $mock->method('_createInvalidArgumentException')\n ->will($this->returnCallback(function ($message) {\n return new InvalidArgumentException($message);\n }));\n\n return $mock;\n }", "private function createAlgorithmRegistrationHandlerInterfaceMock()\n {\n return $this->getMockBuilder(AlgorithmRegistrationHandlerInterface::class)->getMock();\n }", "public function testNewWithAliasFile()\n {\n $fileLoggerMock = $this->getMockBuilder(File::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $fileLoggerMock->expects($this->once())\n ->method('log');\n\n $fileLoggerFactoryMock = $this->getMockBuilder(FileFactory::class)\n ->disableOriginalConstructor()\n ->setMethods(['create'])\n ->getMock();\n\n $fileLoggerFactoryMock->expects($this->once())\n ->method('create')\n ->willReturn($fileLoggerMock);\n\n $quietLoggerMock = $this->getMockBuilder(Quiet::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $quietLoggerMock->expects($this->never())\n ->method('log');\n\n $quietLoggerFactoryMock = $this->getMockBuilder(QuietFactory::class)\n ->disableOriginalConstructor()\n ->setMethods(['create'])\n ->getMock();\n\n $this->loggerProxy = $this->objectManager->getObject(\n LoggerProxy::class,\n [\n 'fileFactory' => $fileLoggerFactoryMock,\n 'quietFactory' => $quietLoggerFactoryMock,\n 'loggerAlias' => LoggerProxy::LOGGER_ALIAS_FILE,\n ]\n );\n\n $this->loggerProxy->log('test');\n }", "protected function createMock($originalClassName)\n {\n if (is_callable('parent::createMock')) {\n return parent::createMock($originalClassName);\n }\n\n return $this->getMock($originalClassName);\n }", "protected function prepareViewMock()\n {\n /** @var Mockery\\Mock $viewMock */\n $viewMock = Mockery::mock(Factory::class);\n $viewMock->shouldReceive('make')->andReturn('testing');\n $viewMock->shouldReceive('share')->andReturnSelf();\n\n $this->app->instance(Factory::class, $viewMock);\n }", "private function createVehicleDataConverterFacadeInterfaceMock()\n {\n return $this->getMockBuilder(VehicleDataConverterFacadeInterface::class)->getMock();\n }", "function mockCreateInitialProducts() {\n $listaProdutos = &obterListaProdutos();\n\n $produto = createProduct(\"Caneca de Vidro\", \"Caneca\", \"Suporta 350 ml\", 100, 50.00, \"camiseta.png\");\n $listaProdutos[$produto['id']] = $produto;\n\n $produto = createProduct(\"Caneca de Plastico\", \"Caneca\", \"Suporta 500 ml\", 200, 20.00, \"camiseta.png\");\n $listaProdutos[$produto['id']] = $produto;\n}", "protected function setUp(): void\n {\n $this->mock = new FileSystem;\n }", "function test_object_refs() {\n\t\t$key = rand_str();\n\t\t$object_a = new stdClass;\n\t\t$object_a->foo = 'alpha';\n\t\t$this->cache->set( $key, $object_a );\n\t\t$object_a->foo = 'bravo';\n\t\t$object_b = $this->cache->get( $key );\n\t\t$this->assertEquals( 'alpha', $object_b->foo );\n\t\t$object_b->foo = 'charlie';\n\t\t$this->assertEquals( 'bravo', $object_a->foo );\n\n\t\t$key = rand_str();\n\t\t$object_a = new stdClass;\n\t\t$object_a->foo = 'alpha';\n\t\t$this->cache->add( $key, $object_a );\n\t\t$object_a->foo = 'bravo';\n\t\t$object_b = $this->cache->get( $key );\n\t\t$this->assertEquals( 'alpha', $object_b->foo );\n\t\t$object_b->foo = 'charlie';\n\t\t$this->assertEquals( 'bravo', $object_a->foo );\n\t}", "public function testBasicMockUsage() {\n // create a mock which expects that someMethod is called once\n $mock = $this->simpleMock('SomeClass')\n ->expects('someMethod')\n ->create();\n // The param: \"SomeClass\" corresponds to phpunit's first param on the getMock method.\n // The +create+ call returns the mock. This is should allways be the last call.\n\n // Same with pure PHPUnit:\n // $mock = $this->getMock('SomeClass', array('someMethod'));\n // $mock->expects($this->once())\n // ->method('someMethod');\n\n // satisfy the expectations\n $mock->someMethod();\n }", "public function __construct()\n {\n $agency = new \\Bpi\\ApiBundle\\Domain\\Aggregate\\Agency('200100', self::AGENCY_NAME, 'moderator', 'public_key', 'secret');\n\n $repository = $this->getMock('\\Doctrine\\Common\\Persistence\\ObjectRepository');\n $repository->expects($this->once())\n ->method('findOneBy')\n ->will($this->returnValue($agency))\n ;\n\n $om = $this->getMock('\\Doctrine\\Common\\Persistence\\ObjectManager');\n $om->expects($this->once())\n ->method('getRepository')\n ->will($this->returnValue($repository))\n ;\n\n $fsm = $this->getMockBuilder('\\Knp\\Bundle\\GaufretteBundle\\FilesystemMap')\n ->setConstructorArgs(array(array()))\n ->getMock()\n ;\n\n $this->service = new PushService($om, $fsm);\n $this->author = new Author(new AgencyId(1), 1, 'Bush', 'George');\n\n $util = new Util();\n $this->resource = $util->createResourceBuilder()\n ->body('bravo_body')\n ->teaser('bravo_teaser')\n ->title('bravo_title')\n ->ctime(new \\DateTime())\n ;\n }", "private function createCipherGeneratorInterfaceMock()\n {\n return $this->getMockBuilder(CipherGeneratorInterface::class)->getMock();\n }", "protected function getMockWriteStream()\n {\n return $this->getMock('\\Phergie\\Irc\\Client\\React\\WriteStream', array(), array(), '', false);\n }", "private function create_s3_client_partial_mock( $expected, $response ) {\n\t\t$s3_helper = new S3_helper();\n\t\t$mock_s3_client = Mockery::mock( $s3_helper->init_s3( '', '' ) );\n\t\t$mock_s3_client->shouldReceive( 'putObject' )\n\t\t->with( $expected )\n\t\t->andReturn( $response );\n\t\treturn $mock_s3_client;\n\t}", "protected function createTestAuthExternalService() {\n\t\treturn $this->getMock('QsAuthExternalService', array('authenticate'));\n\t}", "public static function createOrderReferenceFixture()\n {\n PlacedOrderFixture::createOrderReferenceFixture();\n }", "private function registerMock(): UnitMock\n {\n $this->currentMock = Mockery::mock(\"{$this->unit}[handle]\", $this->getCurrentConstructorArgs());\n $this->mocks[] = $this->currentMock;\n\n // $args will be what the developer passed to the unit in actual execution\n app()->bind($this->unit, function ($app, $args) {\n foreach ($this->constructorExpectations as $key => $expectations) {\n if ($args == $expectations) {\n return $this->mocks[$key];\n }\n }\n\n throw new Mockery\\Exception\\NoMatchingExpectationException(\n \"\\n\\nExpected one of the following arguments sets for {$this->unit}::__construct(): \" .\n print_r($this->constructorExpectations, true) . \"\\nGot: \" .\n print_r($args, true)\n );\n });\n\n return $this;\n }", "function makeMockHttpClient(\n \\GuzzleHttp\\Psr7\\Response ...$responses\n): GuzzleHttp\\Client {\n $mock = new GuzzleHttp\\Handler\\MockHandler($responses);\n $handlerStack = GuzzleHttp\\HandlerStack::create($mock);\n return new GuzzleHttp\\Client(['handler' => $handlerStack]);\n}", "public function createInstance()\n {\n $mock = $this->mock(static::TEST_SUBJECT_CLASSNAME)\n ->getMessage();\n\n return $mock->new();\n }", "public function setUp() {\n $loanMock = $this->createMock(Loan::class);\n // Add on mocked object the `checkAvailability` method, which returns TRUE\n $loanMock->method('checkAvailability')->willReturn(true);\n // Instantiate `Tranche` object\n // - interest rate of 3%\n // - max. amount of 1000\n $this->tranche = new Tranche(3, 1000, $loanMock);\n }", "public function setRef($ref);", "protected function createMock($originalClassName)\n {\n if (is_callable('parent::createMock')) {\n return parent::createMock($originalClassName);\n }\n\n return $this->getMock($originalClassName);\n }", "public function setUp(): void\n {\n $this->proxy = NewInstance::of(Verified::class);\n }", "function __construct($class, $mock_class) {\n $this->class = $class;\n $this->mock_class = $mock_class;\n if (! $this->mock_class) {\n $this->mock_class = 'Mock' . $this->class;\n }\n $this->mock_base = SimpleTest::getMockBaseClass();\n $this->reflection = new SimpleReflection($this->class);\n }", "public function generate(\n string $reference\n ): ReferenceInterface;", "public function testSimple() {\n// $default = $this->getMock(\"\\Bonder\\Controller\");\n// $cp = new \\Bonder\\Controllers\\RegexControllerProvider($multiplexor, $default);\n }", "public function setUp(): void\n {\n $this->tokenMock = $this->createMock('Omise\\Payment\\Helper\\TokenHelper');\n $this->urlMock = $this->createMock('Magento\\Framework\\UrlInterface');\n $this->model = new ReturnUrlHelper($this->urlMock, $this->tokenMock);\n }", "protected function createMongoDBMock()\n {\n return m::mock(\\MongoDB\\Database::class);\n }", "protected function getGuzzleClientMock()\n\t{\n\t\t$c = m::mock('GuzzleHttp\\Client');\n\t\treturn $c;\n\t}", "protected function getMockStream()\n {\n return $this->getMock('\\React\\Stream\\Stream', array(), array(), '', false);\n }", "protected function mock(string $class): MockObject\n {\n if (!class_exists($class)) {\n throw new InvalidArgumentException(sprintf('Class not found: %s', $class));\n }\n\n $mock = $this->getMockBuilder($class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->container->set($class, $mock);\n\n return $mock;\n }", "public function mockConnection()\n\t{\n\t\treturn $this->getMockBuilder('Illuminate\\Database\\Connection')\n\t\t\t\t\t->disableOriginalConstructor()\n\t\t\t\t\t->setMethods(array('beginTransaction', 'commit', 'rollback'))\n\t\t\t\t\t->getMock();\n\t}", "abstract public function getMockBuilder($className): MockBuilder;", "public function setUp() {\n\t\t$this->mockDecoratedRequestEngine = $this->getMockBuilder('TYPO3\\Flow\\Http\\Client\\RequestEngineInterface')->getMock();\n\t\t$this->cacheAwareRequestEngine = new CacheAwareRequestEngine($this->mockDecoratedRequestEngine);\n\n\t\t$this->mockRequestCache = $this->getMockBuilder('TYPO3\\Flow\\Cache\\Frontend\\VariableFrontend')->disableOriginalConstructor()->getMock();\n\t\t$this->inject($this->cacheAwareRequestEngine, 'requestCache', $this->mockRequestCache);\n\n\t\t# simulating a date in order to test absolute expiration dates\n\t\t$this->mockNow = new Now('Sat, 13 Dec 2014 20:00:00 +0100');\n\t\t$this->inject($this->cacheAwareRequestEngine, 'now', $this->mockNow);\n\n\t\t# we use real request/response objects by intention (otherwise there are too many mocks to create)\n\t\t$this->mockRequest = new Request(array(), array(), array(), array());\n\t\t$this->mockResponse = new Response();\n\t}", "protected function createClient()\n {\n $oauthClient = $this->getMockBuilder(BaseClient::className())\n ->setMethods(['initUserAttributes'])\n ->getMock();\n return $oauthClient;\n }", "public function make() {}", "public function constructionWithObject()\n {\n $equalValidator = new stubEqualValidator(new stdClass());\n }", "private function createBaseCipherMock()\n {\n return $this->getMockBuilder(BaseCipher::class)->getMock();\n }", "private function createMockedSmartwaiver(&$container, $response, $numResponses = 1)\n {\n // Convert responses to Guzzle Responses\n $mockResponse = [];\n for($i=0; $i<$numResponses; $i++)\n array_push($mockResponse, new Response(200, [], $response));\n\n // Set up the Mock Handler\n $mock = new MockHandler($mockResponse);\n $history = Middleware::history($container);\n $handler = HandlerStack::create($mock);\n $handler->push($history);\n\n // Create the Smartwaiver object with the mocked handler\n $sw = new Smartwaiver(self::TEST_API_KEY, ['handler' => $handler]);\n\n return $sw;\n }", "private function createMockedSmartwaiver(&$container, $response, $numResponses = 1)\n {\n // Convert responses to Guzzle Responses\n $mockResponse = [];\n for($i=0; $i<$numResponses; $i++)\n array_push($mockResponse, new Response(200, [], $response));\n\n // Set up the Mock Handler\n $mock = new MockHandler($mockResponse);\n $history = Middleware::history($container);\n $handler = HandlerStack::create($mock);\n $handler->push($history);\n\n // Create the Smartwaiver object with the mocked handler\n $sw = new Smartwaiver(self::TEST_API_KEY, ['handler' => $handler]);\n\n return $sw;\n }", "private function getMockedObject(array $allowedMethods)\n {\n return $this->getMockBuilder(LinguaLeo::class)\n ->setMethods($allowedMethods)\n ->disableOriginalConstructor()\n ->getMock();\n }", "public function createTemplate()\n {\n $mock = $this->getMockBuilder('Dhii\\Output\\TemplateInterface')\n ->setMethods(['render'])\n ->getMockForAbstractClass();\n\n return $mock;\n }", "public function createContainer()\n {\n $mock = $this->getMockBuilder('Psr\\Container\\ContainerInterface')\n ->getMock();\n\n return $mock;\n }", "public function usingReference($reference)\n {\n $this->reference = $reference;\n\n return $this;\n }", "public function usingReference($reference)\n {\n $this->reference = $reference;\n\n return $this;\n }", "protected function setUp() {\n $this->object = new XG_PersonRef;\n }" ]
[ "0.6913172", "0.67155665", "0.6602933", "0.6525306", "0.63454586", "0.63134843", "0.628404", "0.6211032", "0.61159116", "0.60593474", "0.6026771", "0.59836614", "0.59658664", "0.5877068", "0.58284694", "0.5779687", "0.5765337", "0.57647663", "0.57615286", "0.5750453", "0.5731229", "0.5690716", "0.5677481", "0.56414914", "0.5601113", "0.56003064", "0.5600051", "0.55995804", "0.55991054", "0.5592397", "0.55895627", "0.5589329", "0.5574235", "0.5561273", "0.55461967", "0.55410576", "0.5537164", "0.55288285", "0.5521497", "0.5503369", "0.5495667", "0.54707783", "0.54640913", "0.5443735", "0.543177", "0.542407", "0.5421178", "0.5411488", "0.5397633", "0.53931135", "0.53859156", "0.5383129", "0.53792655", "0.5369858", "0.5364282", "0.536182", "0.53611195", "0.53448164", "0.533583", "0.5326018", "0.5323067", "0.5320941", "0.5319602", "0.5309278", "0.53010213", "0.529449", "0.52863437", "0.5286144", "0.5279797", "0.5270364", "0.52612454", "0.52602595", "0.52480704", "0.5241644", "0.5238735", "0.52386594", "0.52365875", "0.52364415", "0.5231713", "0.5229398", "0.5225735", "0.52204466", "0.52197385", "0.5217017", "0.5212131", "0.52065754", "0.5202453", "0.5188379", "0.5187392", "0.5185723", "0.51815075", "0.5178215", "0.51780826", "0.51780826", "0.51775813", "0.517367", "0.5173149", "0.51721233", "0.51721233", "0.517079" ]
0.5402348
48
Seed the application's database.
public function run() { User::factory(20)->create(); Comment::factory(1000)->create(); Comment::where('id','<', 101)->update(['parent_id' => null]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function dbSeed(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Turn foreign key checks off\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0;');// <- USE WITH CAUTION!\n\t\t\t//Seed tables\n\t\t\tArtisan::call('db:seed');\n\t\t\t//Turn foreign key checks on\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=1;');// <- SHOULD RESET ANYWAY BUT JUST TO MAKE SURE!\n\t\t}\n\t}", "protected function seedDB()\n {\n $ans = $this->ask('Seed your database?: ', 'y');\n\n // Check if the answer is true\n if (preg_match('/^y/', $ans))\n {\n $this->call('db:seed');\n $this->comment('');\n $this->comment('Database successfully seeded.');\n $this->comment('=====================================');\n echo \"Your app is now ready!\";\n }\n }", "protected function seedDatabase(): void\n {\n $this->seedProductCategories();\n $this->seedProducts();\n }", "public function setupDatabase()\n {\n Artisan::call('migrate:refresh');\n Artisan::call('db:seed');\n\n self::$setupDatabase = false;\n }", "public function run()\n {\n $this->seed('FormsMenuItemsTableSeeder');\n $this->seed('FormsDataTypesTableSeeder');\n $this->seed('FormsDataRowsTableSeeder');\n $this->seed('FormsPermissionsTableSeeder');\n $this->seed('FormsSettingsTableSeeder');\n $this->seed('FormsTableSeeder');\n }", "public function run()\n {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"\\n--- Seeding ---\\n\", TRUE));\n\n if (App::environment('production')) {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- ERROR: Seeding in Production is prohibited ---\\n\", TRUE));\n return;\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(ConfigsTableSeeder::class);\n $this->call(ConfigContentsTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n if (defined('STDERR')) fwrite(STDERR, print_r(\"Set FOREIGN_KEY_CHECKS=1 --- DONE\\n\", TRUE));\n\n // \\Artisan::call('command:regenerate-user-feeds');\n\n \\Cache::flush();\n\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- End Seeding ---\\n\\n\", TRUE));\n }", "protected function setupDatabase()\n {\n $this->call('migrate');\n $this->call('db:seed');\n\n $this->info('Database migrated and seeded.');\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function seedDatabase(): void\n {\n echo \"Running seeds\";\n\n // Folder where all the seeds are.\n $folder = __DIR__ . '/../seeds/';\n\n // Scan all files/folders inside database.\n $files = \\scandir($folder);\n\n $seeders = [];\n foreach ($files as $key => $file) {\n\n // All files that don't start with a dot.\n if ($file[0] !== '.') {\n\n // Load the file.\n require_once $folder . $file;\n\n // We have to call the migrations after because\n // some seeds are dependant from other seeds.\n $seeders[] = explode('.', $file)[0];\n }\n }\n\n // Run all seeds.\n foreach ($seeders as $seeder) {\n (new $seeder)->run();\n }\n }", "protected function seedDatabase()\n {\n //$this->app->make('db')->table(static::TABLE_NAME)->delete();\n\n TestExtendedModel::create([\n 'unique_field' => '999',\n 'second_field' => null,\n 'name' => 'unchanged',\n 'active' => true,\n 'hidden' => 'invisible',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1234567',\n 'second_field' => '434',\n 'name' => 'random name',\n 'active' => false,\n 'hidden' => 'cannot see me',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1337',\n 'second_field' => '12345',\n 'name' => 'special name',\n 'active' => true,\n 'hidden' => 'where has it gone?',\n ]);\n }", "public function initDatabase()\n {\n $this->call('migrate');\n\n $userModel = config('admin.database.users_model');\n\n if ($userModel::count() == 0) {\n $this->call('db:seed', ['--class' => AdminSeeder::class]);\n }\n }", "public function run ()\n {\n if (App::environment() === 'production') {\n exit('Seed should be run only in development/debug environment.');\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('role_user')->truncate();\n\n // Root user\n $user = User::find(1);\n $user->assignRole('owner');\n\n $user = User::find(2);\n $user->assignRole('admin');\n\n $user = User::find(3);\n $user->assignRole('admin');\n\n $user = User::find(4);\n $user->assignRole('moderator');\n\n $user = User::find(5);\n $user->assignRole('moderator');\n \n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n Model::unguard();\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(EntrustTableSeeder::class);\n\n $this->call(AccounttypeSeeder::class);\n $this->call(AppUserTableSeeder::class);\n $this->call(AppEmailUserTableSeeder::class);\n\n\n $this->call(CountryTableSeeder::class);\n $this->call(CityTableSeeder::class);\n\n\n $this->call(PostTypeTableSeeder::class);\n $this->call(PostSubTypeTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(AppPostSolvedTableSeeder::class);\n\n\n $this->call(AppCommentTypeTableSeeder::class);\n // $this->call(AppCommentTableSeeder::class);\n // $this->call(AppSubCommentTableSeeder::class);\n\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }\n\n Model::reguard();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('users')->truncate();\n DB::table('password_resets')->truncate();\n DB::table('domains')->truncate();\n DB::table('folders')->truncate();\n DB::table('bookmarks')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n $this->seedUserAccount('[email protected]');\n $this->seedUserAccount('[email protected]');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n // $this->call(UsersTableSeeder::class);\n /* Schema::dropIfExists('employees');\n Schema::dropIfExists('users');\n Schema::dropIfExists('requests');\n Schema::dropIfExists('requeststatus');*/\n User::truncate();\n InstallRequest::truncate();\n RequestStatus::truncate();\n\n $cantidadEmployyes = 20;\n $cantidadUsers = 20;\n $cantidadRequestStatus = 3;\n $cantidadRequests = 200;\n\n factory(User::class, $cantidadUsers)->create();\n factory(RequestStatus::class, $cantidadRequestStatus)->create();\n factory(InstallRequest::class, $cantidadRequests)->create();\n }", "public function run()\n {\n Model::unguard();\n foreach (glob(__DIR__ . '/seeds/*.php') as $filename) {\n require_once($filename);\n }\n // $this->call(UserTableSeeder::class);\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n// $this->call('CustomerTableSeeder');\n $this->call('PhotoTableSeeder');\n// $this->call('ProductTableSeeder');\n// $this->call('StaffTableSeeder');\n// $this->call('PasswordResetsTableSeeder');\n// $this->call('UsersTableSeeder');\n $this->call('CustomersTableSeeder');\n $this->call('EmployeesTableSeeder');\n $this->call('InventoryTransactionTypesTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrderDetailsStatusTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('InvoicesTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrdersStatusTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n\n $this->call('OrdersTaxStatusTableSeeder');\n $this->call('PrivilegesTableSeeder');\n $this->call('EmployeePrivilegesTableSeeder');\n $this->call('ProductsTableSeeder');\n $this->call('InventoryTransactionsTableSeeder');\n $this->call('PurchaseOrderDetailsTableSeeder');\n\n $this->call('PurchaseOrderStatusTableSeeder');\n $this->call('PurchaseOrdersTableSeeder');\n $this->call('SalesReportsTableSeeder');\n $this->call('ShippersTableSeeder');\n $this->call('StringsTableSeeder');\n $this->call('SuppliersTableSeeder');\n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n Model::reguard();\n }", "public function run()\n\t{\n $this->cleanDatabase();\n\n Eloquent::unguard();\n\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('CartsTableSeeder');\n $this->call('StoreTableSeeder');\n $this->call('AdvertisementsTableSeeder');\n \n\t}", "public function run()\n {\n \tDB::table('seeds')->truncate();\n\n $seeds = array(\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_18_2013',\n ),\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_20_2013',\n ),\n );\n\n // Uncomment the below to run the seeder\n DB::table('seeds')->insert($seeds);\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "protected function setUp(): void\n {\n $db = new DB;\n\n $db->addConnection([\n 'driver' => 'sqlite',\n 'database' => ':memory:',\n ]);\n\n $db->bootEloquent();\n $db->setAsGlobal();\n\n $this->createSchema();\n }", "public function run()\n {\n //$this->call('UserTableSeeder');\n //$this->call('ProjectTableSeeder');\n //$this->call('TaskTableSeeder');\n\n /**\n * Prepare seeding\n */\n $faker = Faker::create();\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Model::unguard();\n\n /**\n * Seeding user table\n */\n App\\User::truncate();\n factory(App\\User::class)->create([\n 'name' => 'KCK',\n 'email' => '[email protected]',\n 'password' => bcrypt('password')\n ]);\n\n /*factory(App\\User::class, 9)->create();\n $this->command->info('users table seeded');*/\n\n /**\n * Seeding roles table\n */\n Spatie\\Permission\\Models\\Role::truncate();\n DB::table('model_has_roles')->truncate();\n $superAdminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '최고 관리자'\n ]);\n $adminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '관리자'\n ]);\n $regularRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '정회원'\n ]);\n $associateRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '준회원'\n ]);\n\n App\\User::where('email', '!=', '[email protected]')->get()->map(function ($user) use ($regularRole) {\n $user->assignRole($regularRole);\n });\n\n App\\User::whereEmail('[email protected]')->get()->map(function ($user) use ($superAdminRole) {\n $user->assignRole($superAdminRole);\n });\n $this->command->info('roles table seeded');\n\n /**\n * Seeding articles table\n */\n App\\Article::truncate();\n $users = App\\User::all();\n\n $users->each(function ($user) use ($faker) {\n $user->articles()->save(\n factory(App\\Article::class)->make()\n );\n });\n $this->command->info('articles table seeded');\n\n /**\n * Seeding comments table\n */\n App\\Comment::truncate();\n $articles = App\\Article::all();\n\n $articles->each(function ($article) use ($faker, $users) {\n for ($i = 0; $i < 10; $i++) {\n $article->comments()->save(\n factory(App\\Comment::class)->make([\n 'author_id' => $faker->randomElement($users->pluck('id')->toArray()),\n //'parent_id' => $article->id\n ])\n );\n };\n });\n $this->command->info('comments table seeded');\n\n /**\n * Seeding tags table\n */\n App\\Tag::truncate();\n DB::table('article_tag')->truncate();\n $articles->each(function ($article) use ($faker) {\n $article->tags()->save(\n factory(App\\Tag::class)->make()\n );\n });\n $this->command->info('tags table seeded');\n\n /**\n * Seeding attachments table\n */\n App\\Attachment::truncate();\n if (!File::isDirectory(attachment_path())) {\n File::deleteDirectory(attachment_path(), true);\n }\n\n $articles->each(function ($article) use ($faker) {\n $article->attachments()->save(\n factory(App\\Attachment::class)->make()\n );\n });\n\n //$files = App\\Attachment::pluck('name');\n\n if (!File::isDirectory(attachment_path())) {\n File::makeDirectory(attachment_path(), 777, true);\n }\n\n /*\n foreach ($files as $file) {\n File::put(attachment_path($file), '');\n }\n */\n\n $this->command->info('attachments table seeded');\n\n /**\n * Close seeding\n */\n Model::reguard();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(CountriesTableSeeder::class);\n $this->call(StatesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n\n factory(Group::class)->create();\n factory(Contact::class, 5000)->create();\n }", "public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t// $this->call('AdminTableSeeder');\n\t\t// $this->call('UserTableSeeder');\n\t\t// $this->call('MenuTableSeeder');\n\t\t// $this->call('ProductTableSeeder');\n\t\t// $this->call('CategoryTableSeeder');\n\t\t// $this->call('OptionTableSeeder');\n\t\t// $this->call('OptionGroupTableSeeder');\n\t\t// $this->call('TypeTableSeeder');\n\t\t// $this->call('LayoutTableSeeder');\n\t\t// $this->call('LayoutDetailTableSeeder');\n\t\t// $this->call('BannerTableSeeder');\n\t\t// $this->call('ConfigureTableSeeder');\n\t\t// $this->call('PageTableSeeder');\n\t\t// $this->call('ImageTableSeeder');\n\t\t// $this->call('ImageableTableSeeder');\n\t\t// ======== new Seed =======\n\t\t$this->call('AdminsTableSeeder');\n\t\t$this->call('BannersTableSeeder');\n\t\t$this->call('CategoriesTableSeeder');\n\t\t$this->call('ConfiguresTableSeeder');\n\t\t$this->call('ImageablesTableSeeder');\n\t\t$this->call('ImagesTableSeeder');\n\t\t$this->call('LayoutsTableSeeder');\n\t\t$this->call('LayoutDetailsTableSeeder');\n\t\t$this->call('MenusTableSeeder');\n\t\t$this->call('OptionablesTableSeeder');\n\t\t$this->call('OptionsTableSeeder');\n\t\t$this->call('OptionGroupsTableSeeder');\n\t\t$this->call('PagesTableSeeder');\n\t\t$this->call('PriceBreaksTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('ProductsCategoriesTableSeeder');\n\t\t$this->call('SizeListsTableSeeder');\n\t\t$this->call('TypesTableSeeder');\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ContactsTableSeeder');\n\t\t$this->call('RolesTableSeeder');\n\t\t$this->call('PermissionsTableSeeder');\n\t\t$this->call('PermissionRoleTableSeeder');\n\t\t$this->call('AssignedRolesTableSeeder');\n\t\t$this->call('OrdersTableSeeder');\n\t\t$this->call('OrderDetailsTableSeeder');\n\t\tCache::flush();\n\t\t// BackgroundProcess::copyFromVI();\n\t}", "public function run()\n {\n Model::unguard();\n\n User::create([\n 'email' => '[email protected]',\n 'name' => 'admin',\n 'password' => Hash::make('1234'),\n 'email_verified_at' => Carbon::now()\n ]);\n\n factory(User::class, 200)->create();\n\n // $this->call(\"OthersTableSeeder\");\n }", "public function run()\n {\n $this->seedRegularUsers();\n $this->seedAdminUser();\n }", "public function run()\n {\n if (\\App::environment() === 'local') {\n\n // Delete existing data\n\n\n Eloquent::unguard();\n\n //disable foreign key check for this connection before running seeders\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // Truncate all tables, except migrations\n $tables = array_except(DB::select('SHOW TABLES'), ['migrations']);\n foreach ($tables as $table) {\n $tables_in_database = \"Tables_in_\" . Config::get('database.connections.mysql.database');\n DB::table($table->$tables_in_database)->truncate();\n }\n\n // supposed to only apply to a single connection and reset it's self\n // but I like to explicitly undo what I've done for clarity\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n //get roles\n $this->call('AccountSeeder');\n $this->call('CountrySeeder');\n $this->call('StateSeeder');\n $this->call('CitySeeder');\n $this->call('OptionSeeder');\n $this->call('TagSeeder');\n $this->call('PrintTemplateSeeder');\n $this->call('SettingsSeeder');\n\n\n\n if(empty($web_installer)) {\n $admin = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"admin\",\n 'first_name' => 'Admin',\n 'last_name' => 'Doe',\n ));\n $admin->user_id = $admin->id;\n $admin->save();\n\n $adminRole = Sentinel::findRoleById(1);\n $adminRole->users()->attach($admin);\n }\n else {\n $admin = Sentinel::findById(1);\n }\n\n //add dummy staff and customer\n $staff = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"staff\",\n 'first_name' => 'Staff',\n 'last_name' => 'Doe',\n ));\n $admin->users()->save($staff);\n\n foreach ($this->getPermissions() as $permission) {\n $staff->addPermission($permission);\n }\n $staff->save();\n\n $customer = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"customer\",\n 'first_name' => 'Customer',\n 'last_name' => 'Doe',\n ));\n Customer::create(array('user_id' => $customer->id, 'belong_user_id' => $staff->id));\n $staff->users()->save($customer);\n\n //add respective roles\n\n $staffRole = Sentinel::findRoleById(2);\n $staffRole->users()->attach($staff);\n $customerRole = Sentinel::findRoleById(3);\n $customerRole->users()->attach($customer);\n\n\n\n DB::table('sales_teams')->truncate();\n DB::table('opportunities')->truncate();\n\n //Delete existing seeded users except the first 4 users\n User::where('id', '>', 3)->get()->each(function ($user) {\n $user->forceDelete();\n });\n\n //Get the default ADMIN\n $user = User::find(1);\n $staffRole = Sentinel::getRoleRepository()->findByName('staff');\n $customerRole = Sentinel::getRoleRepository()->findByName('customer');\n\n //Seed Sales teams for default ADMIN\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($user->id, $j, $user);\n $this->createOpportunity($user, $user->id, $j);\n }\n\n\n //Get the default STAFF\n $staff = User::find(2);\n $this->createSalesTeam($staff->id, 1, $staff);\n $this->createSalesTeam($staff->id, 2, $staff);\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $staff->id, $j);\n }\n\n foreach (range(1, 3) as $i) {\n $staff = $this->createStaff($i);\n $user->users()->save($staff);\n $staffRole->users()->attach($staff);\n\n $customer = $this->createCustomer($i);\n $staff->users()->save($customer);\n $customerRole->users()->attach($customer);\n $customer->customer()->save(factory(\\App\\Models\\Customer::class)->make());\n\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 5) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $i, $j);\n }\n\n }\n\n //finally call it installation is finished\n file_put_contents(storage_path('installed'), 'Welcome to LCRM');\n }\n }", "public function run()\n {\n if (env('DB_DATABASE') == 'connection') {\n Connection::create([\n \"ruc\" => \"12312312312\",\n \"basedata\" => \"nbdata2018_1\",\n ]);\n \n Connection::create([\n \"ruc\" => \"12312312315\",\n \"basedata\" => \"nbdata2018_2\",\n ]);\n \n $this->call(ConnectionTableSeeder::class);\n } else {\n $this->call(AppSeeder::class);\n }\n }", "public function setupDatabase()\n {\n exec('rm ' . storage_path() . '/testdb.sqlite');\n exec('cp ' . 'database/database.sqlite ' . storage_path() . '/testdb.sqlite');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n # truncates tables before seeding\n foreach ($this->toTruncate as $table) {\n DB::table($table)->delete();\n }\n\n factory(App\\Models\\Product::class, 25)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Post::truncate();\n Comment::truncate();\n // CommentReply::truncate();\n \n\n\n factory(User::class,10)->create();\n factory(Post::class,20)->create();\n factory(Comment::class,30)->create();\n // factory(CommentReply::class,30)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n\t{\n \n Eloquent::unguard();\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\t\t$this->call('UserTableSeeder');\n\t $this->call('LayerTableSeeder');\n $this->call('UserLevelTableSeeder');\n $this->call('RoleUserTableSeeder');\n $this->call('RoleLayerTableSeeder');\n $this->call('BookmarkTableSeeder');\n \n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\t}", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n DB::statement('SET foreign_key_checks = 0');\n DB::table('topics')->truncate();\n\n factory(\\App\\Topic::class, 100)->create();\n // ->each(function($topic) {\n\n // // Seed para a relação com group\n // $topic->group()->save(factory(App\\Group::class)->make());\n\n // // Seed para a relação com topicMessages\n // $topic->topicMessages()->save(factory(App\\TopicMessage::class)->make());\n\n // // Seed para a relação com user\n // $topic->user()->save(factory(App\\User::class)->make());\n // });\n \n DB::statement('SET foreign_key_checks = 1');\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n Categoria::truncate();\n Atractivo::truncate();\n Galeria::truncate();\n User::truncate();\n\n $this->call(CategoriasTableSeeder::class);\n $this->call(AtractivosTableSeeder::class);\n $this->call(GaleriasTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n }", "public function run(Faker $faker)\n {\n Schema::disableForeignKeyConstraints();\n DB::table('users')->insert([\n 'name' => $faker->name(),\n 'email' => '[email protected]',\n 'password' => Hash::make('12345678'),\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n\t $this->call(CategoryTableSeed::class);\n\t $this->call(ProductTableSeed::class);\n\t $this->call(UserTableSeed::class);\n }", "public function run()\n {\n \t// DB::table('webapps')->delete();\n\n $webapps = array(\n\n );\n\n // Uncomment the below to run the seeder\n // DB::table('webapps')->insert($webapps);\n }", "public function run()\n {\n $this->cleanDatabase();\n\n factory(User::class, 50)->create();\n factory(Document::class, 30)->create();\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $tables = array(\n 'users',\n 'companies',\n 'stands',\n 'events',\n 'visitors',\n 'api_keys'\n );\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n }\n\n foreach ($tables as $table) {\n DB::table($table)->truncate();\n }\n\n $this->call(UsersTableSeeder::class);\n $this->call(EventsTableSeeder::class);\n $this->call(CompaniesTableSeeder::class);\n $this->call(StandsTableSeeder::class);\n $this->call(VisitorsTableSeeder::class);\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n $clear = $this->command->confirm('Wil je de database leegmaken? (Dit haalt alle DATA weg)');\n\n if ($clear):\n $this->command->callSilent('migrate:refresh');\n $this->command->info('Database Cleared, starting seeding');\n endif;\n\n $this->call([\n SeedSeeder::class,\n RoleSeeder::class,\n UserSeeder::class,\n // BoardgameSeeder::class,\n BoardgamesTableSeeder::class,\n StatusSeeder::class,\n TournamentSeeder::class,\n AchievementsSeeder::class,\n TournamentUsersSeeder::class,\n ]);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n $this->call(PaisSeeder::class);\n $this->call(DepartamentoSeeder::class);\n $this->call(MunicipioSeeder::class);\n $this->call(PersonaSeeder::class);\n }", "public function run()\n {\n //\n if (App::environment() === 'production') {\n exit('Do not seed in production environment');\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // disable foreign key constraints\n\n DB::table('events')->truncate();\n \n Event::create([\n 'id' => 1,\n 'name' => 'Spot Registration For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n Event::create([\n 'id' => 2,\n 'name' => 'Spot Screening For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'screen',\n 'formId'\t\t=> 1,\n ]);\n \n Event::create([\n 'id' => 3,\n 'name' => 'Spot Registration For Skin Cancer',\n 'cancerId' => 2,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n\n Event::create([\n 'id' => 3,\n 'name' => 'Registration cum Screening camp for Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addWeeks(1),\n 'eventType'\t\t=> 'register_screen',\n 'formId'\t\t=> 1,\n ]);\n \n DB::statement('SET FOREIGN_KEY_CHECKS = 1'); // enable foreign key constraints\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // Para que no verifique el control de claves foráneas al hacer el truncate haremos:\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n\t\t// Primero hacemos un truncate de las tablas para que no se estén agregando datos\n\t\t// cada vez que ejecutamos el seeder.\n\t\t//Foto::truncate();\n\t\t//Album::truncate();\n\t\t//Usuario::truncate();\n DB::table('users')->delete();\n DB::table('ciudades')->delete();\n DB::table('tiendas')->delete();\n DB::table('ofertas')->delete();\n DB::table('ventas')->delete();\n\n\n\t\t// Es importante el orden de llamada.\n\t\t$this->call('UserSeeder');\n $this->call('CiudadSeeder');\n\t\t$this->call('TiendaSeeder');\n $this->call('OfertaSeeder');\n $this->call('VentaSeeder');\n }", "public function run()\n {\n $this->call(\\Database\\Seeders\\GroupByRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\SingleIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\MultiIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\JoinFiveTablesSeeder::class);\n\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// // 試しに一回流す\n// $data = $this->makeData(0, 'userFactory', 1);\n// DB::table('users')->insert($data);\n// $data = $this->makeData(0, 'userDetailFactory', 1);\n// DB::table('user_details')->insert($data);\n//\n// // $this->call(UsersTableSeeder::class);\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userFactory', 2500);\n// DB::table('users')->insert($data);\n// }\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userDetailFactory', 2500);\n// DB::table('user_details')->insert($data);\n// }\n }", "public function run()\n {\n $this->truncateTables([\n 'users',\n 'categories',\n 'types',\n 'courses',\n 'classrooms',\n 'contents',\n 'companies',\n ]);\n\n $this->call(CompanyTableSeeder::class);\n $this->call(TypeTableSeeder::class);\n $this->call(RoleTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(CoursesTableSeeder::class);\n $this->call(PermissionTableSeeder::class);\n $this->call(ContentTableSeeder::class);\n $this->call(UserTableSeeder::class);\n $this->call(ClassroomTableSeeder::class);\n $this->call(TestTableSeeder::class);\n $this->call(BankTableSeeder::class);\n\n\n // factory(\\App\\User::class, 50)\n // ->create()\n // ->each(function ($user) {\n // // $user->companies()->save();\n // $company = \\App\\Company::inRandomOrder()->first();\n // $user->companies()->attach($company->id);\n // $user->assignRole(['participante']);\n // });\n /*\n factory(\\App\\User::class, 50)\n ->create()\n ->each(function ($user) {\n $user->assignRole(['participante']);\n });*/\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n User::truncate();\n Question::truncate();\n Option::truncate();\n// Answer::truncate();\n Quiz::truncate();\n QuizQuestion::truncate();\n\n //for admin\n $admin = factory(User::class)->create([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'is_admin' => 1,\n ]);\n\n //for user\n $user = factory(User::class)->create([\n 'name' => 'User',\n 'email' => '[email protected]',\n ]);\n\n factory(Question::class, 100)->create()->each(function ($question) {\n factory(Option::class, mt_rand(2, 4))->create([\n 'question_id' => $question->id,\n ]);\n });\n\n factory(Quiz::class, 10)->create()->each(function ($quiz) {\n\n factory(QuizQuestion::class, mt_rand(5, 10))->create();\n });\n\n\n }", "public function run()\n {\n $this->call([\n SiteSettingsSeeder::class,\n LaratrustSeeder::class,\n CountrySeeder::class,\n GovernorateSeeder::class,\n FaqSeeder::class,\n SitePageSeeder::class,\n UsersSeeder::class,\n ]);\n\n Country::whereiso(\"EG\")->update(['enable_shipping' => true]);\n\n factory(User::class, 400)->create();\n\n Category::create([\n 'en' => [\n 'name' => \"cake tools\"\n ]\n ]);\n\n Category::create([\n 'en' => [\n 'name' => \"Party Supplies\"\n ]\n ]);\n\n $this->call([\n ProductCategorySeeder::class,\n ProductSeeder::class\n ]);\n }", "public function run()\n {\n $this->call(PermissionsTableSeeder::class);\n\n if (App::environment('local')) {\n $this->call(FakeUsersTableSeeder::class);\n $this->call(FakeArticlesTableSeeder::class);\n $this->call(FakeEventsTableSeeder::class);\n }\n }", "public function run()\n {\n Model::unguard();\n\n $this->call(CategoryTypesTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(AccountTypesTableSeeder::class);\n $this->call(TransactionTypesTableSeeder::class);\n\n if (App::environment() !== 'production') {\n $this->call(UserTableSeeder::class);\n $this->call(AccountBudgetTableSeeder::class);\n $this->call(TransactionTableSeeder::class);\n }\n\n Model::reguard();\n }", "public function run()\n {\n User::truncate();\n Product::truncate();\n User::forceCreate([\n 'name' => 'foo',\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n ]);\n factory(User::class, 5)->create();\n factory(Product::class, 5)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n {\n $this->call([UsersTableSeeder::class]);\n $this->call([ContratosTableSeeder::class]);\n $this->call([UsuariosTableSeeder::class]);\n $this->call([UnidadesTableSeeder::class]);\n $this->call([AtestadosTableSeeder::class]);\n }", "public function run()\n {\n Model::unguard();\n\n // $this->call(\"OthersTableSeeder\");\n\n // DB::table('locations')->insert([\n // 'id' => 1,\n // 'name' => 'Default',\n // 'name' => 'district',\n // 'district_id' => 1,\n // 'province_id' => 1,\n // ]);\n }", "public function run()\n {\n $data = include env('DATA_SEED');\n\n \\Illuminate\\Support\\Facades\\DB::table('endpoints')->insert((array)$data);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('admins')->truncate();\n\n for ($i = 0; $i < 10; $i++)\n {\n $faker = Factory::create('en_US');\n $values = [\n 'name' => $faker->userName,\n 'email' => $faker->freeEmail,\n 'password' => bcrypt($faker->password),\n 'phone' => $faker->phoneNumber,\n 'status' => random_int(0,1)\n ];\n admin::create($values);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n \\DB::table('provinces')->delete();\n \\DB::table('cities')->delete();\n \\DB::table('districts')->delete();\n // import provinces and cities from sql file\n $sqlFile = app_path() . '/../database/raw/administrative_indonesia_without_districts.sql';\n DB::unprepared(file_get_contents($sqlFile));\n $this->command->info('Successfully seed Provinces and Cities!');\n\n // import districts with latitude and longitude from csv file\n $csvFile = app_path() . '/../database/raw/administrative_indonesia_districts_with_lat_lng.csv';\n $districts = $this->csvToArray($csvFile);\n // check if lat lng exists\n foreach ($districts as $i => $d) {\n if ($d['latitude'] == '') $districts[$i]['latitude'] = 0;\n if ($d['longitude'] == '') $districts[$i]['longitude'] = 0;\n }\n // insert it\n $insert = District::insert($districts);\n if ($insert) $this->command->info('Successfully seed Districts!');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n DB::beginTransaction();\n// $this->seed();\n DB::commit();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n User::create([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n ]);\n\n User::create([\n 'name' => 'Leonardo',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789')\n ]);\n\n // seed sin model\n /* DB::table('users')->insert([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s')\n ]); */\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(RegionsTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(SubDistrictsTableSeeder::class);\n $this->call(PostcodesTableSeeder::class);\n\n if (env('APP_ENV') !== 'production') {\n // Wipe up 5 churches, and each church has 5 cells, and each cell has 20 members associated with.\n // In other word, we wipe up 500 church members.\n for ($i = 0; $i < 2; $i++) {\n $church = factory(\\App\\Models\\Church::class)->create();\n\n $church->areas()->saveMany(factory(\\App\\Models\\Area::class, 2)->create([\n 'church_id' => $church->id\n ])->each(function($area) {\n $area->cells()->saveMany(factory(\\App\\Models\\Cell::class, 2)->create([\n 'area_id' => $area->id\n ])->each(function($cell) {\n $cell->members()->saveMany(factory(App\\Models\\Member::class, 10)->create([\n 'cell_id' => $cell\n ]));\n }));\n }));\n }\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n $this->environmentPath = env('APP_ENV') === 'production' ||\n env('APP_ENV') === 'qa' ||\n env('APP_ENV') === 'integration' ?\n 'Production':\n 'local';\n //disable FK\n Model::unguard();\n DB::statement(\"SET session_replication_role = 'replica';\");\n\n // $this->call(HrEmployeeTableSeeder::class);\n $this->call(\"Modules\\HR\\Database\\Seeders\\\\$this->environmentPath\\HrEmployeePosTableSeeder\");\n // $this->call(HrEmployeePresetsDiscountTableSeeder::class);\n\n // Enable FK\n DB::statement(\"SET session_replication_role = 'origin';\");\n Model::reguard();\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "protected static function seed()\n {\n foreach (self::fetch('database/seeds', false) as $file) {\n Bus::need($file);\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n $faker = F::create('App\\Proovedores');\n for($i=0; $i < 10; $i++){\n DB::table('users')->insert([\n 'usuario' => $i,\n 'password' => $i,\n 'email' => $faker->email,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Delete all records.\n DB::table('users')->delete();\n // Reset AUTO_INCREMENT.\n DB::table('users')->truncate();\n\n // Dev user.\n App\\Models\\User::create([\n 'email' => '[email protected]',\n 'password' => '$2y$10$t6q81nz.XrMrh20NHDvxUu/szwHBwgzPd.01e8uuP0qVy0mPa6H/e',\n 'first_name' => 'L5',\n 'last_name' => 'App',\n 'username' => 'l5-app',\n 'is_email_verified' => 1,\n ]);\n\n // Dummy users.\n TestDummy::times(10)->create('App\\Models\\User');\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n User::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // We did this for test purposes. Shouldn't be doing this for production\n $password = Hash::make('123456');\n\n User::create([\n 'name' => 'Administrator',\n 'email' => '[email protected]',\n 'password' => $password,\n ]);\n }", "public function run()\n {\n Model::unguard();\n \n factory('App\\User','admin')->create();\n factory('App\\Evento',100)->create();\n //factory('App\\User','miembro',10)->create();\n factory('App\\Telefono',13)->create();\n factory('App\\Notificacion',10)->create();\n factory('App\\Rubro',10)->create();\n factory('App\\Tecnologia',10)->create();\n factory('App\\Cultivo',10)->create();\n factory('App\\Etapa',10)->create();\n factory('App\\Variedad',10)->create();\n factory('App\\Caracteristica',10)->create();\n factory('App\\Practica',30)->create();\n factory('App\\Tag',15)->create();\n // $this->call(PracticaTableSeeder::class);\n $this->call(TrTableSeeder::class);\n $this->call(MesTableSeeder::class);\n $this->call(SemanasTableSeeder::class);\n $this->call(PsTableSeeder::class);\n $this->call(MsTableSeeder::class);\n $this->call(CeTableSeeder::class);\n $this->call(CvTableSeeder::class);\n $this->call(PtSeeder::class);\n \n\n Model::unguard();\n }", "public function run() {\n $this->call(UserSeeder::class);\n $this->call(PermissionSeeder::class);\n $this->call(CreateAdminUserSeeder::class);\n // $this->call(PhoneSeeder::class);\n // $this->call(AddressSeeder::class);\n\n $this->call(ContactFormSeeder::class);\n //$this->call(ContactSeeder::class);\n\n User::factory()->count(20)->create()->each(function ($user) {\n // Seed the relation with one address\n $address = Address::factory()->make();\n $user->address()->save($address);\n\n // Seed the relation with one phone\n $phone = Phone::factory()->make();\n $user->phone()->save($phone);\n\n // Seed the relation with 15 contacts\n $contact = Contact::factory()->count(25)->make();\n $user->contacts()->saveMany($contact);\n });\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Activity::truncate();\n User::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n $this->call(UserTableSeeder::class);\n $this->call(ActivityTableSeeder::class);\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n \\App\\User::truncate();\n \\App\\Category::truncate();\n \\App\\Product::truncate();\n \\App\\Transaction::truncate();\n DB::table('category_product')->truncate();\n\n \\App\\User::flushEventListeners();\n \\App\\Category::flushEventListeners();\n \\App\\Product::flushEventListeners();\n \\App\\Transaction::flushEventListeners();\n\n\n $usersQuentity = 1000;\n $categoriesQuentity = 30;\n $productsQuentity = 1000;\n $transactionsQuentity = 1000;\n\n factory(\\App\\User::class, $usersQuentity)->create();\n factory(\\App\\Category::class, $categoriesQuentity)->create();\n factory(\\App\\Product::class, $productsQuentity)->create()->each(\n function ($product){\n $categories = \\App\\Category::all()->random(mt_rand(1, 5))->pluck('id');\n\n $product->categories()->attach($categories);\n }\n );\n factory(\\App\\Transaction::class, $transactionsQuentity)->create();\n\n }", "public static function setUpBeforeClass()\n {\n parent::setUpBeforeClass();\n $app = require __DIR__ . '/../../bootstrap/app.php';\n /** @var \\Pterodactyl\\Console\\Kernel $kernel */\n $kernel = $app->make(Kernel::class);\n $kernel->bootstrap();\n $kernel->call('migrate:fresh');\n\n \\Artisan::call('db:seed');\n }", "public function run()\n {\n Eloquent::unguard();\n \n $this->call('AdminMemberTableSeeder');\n $this->call('BankInfoTableSeeder');\n $this->call('LocationLookUpTableSeeder');\n $this->call('OrderStatusTableSeeder');\n $this->call('AdminRoleTableSeeder');\n\n }", "public function run()\n {\n Model::unguard();\n\n if( !User::where('email', '[email protected]')->count() ) {\n User::create([\n 'nombre'=>'Nick'\n ,'apellidos'=>'Palomino'\n ,'email'=>'[email protected]'\n ,'password'=> Hash::make('1234567u')\n ,'celular'=>'966463589'\n ]);\n }\n\n $this->call('CategoriaTableSeeder');\n $this->call('WhateverSeeder');\n $this->call('ProductTableSeeder');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n Model::unguard();\n\n $this->command->info('seed start!');\n\n // 省市县\n $this->call('RegionTableSeeder');\n // 用户、角色\n $this->call('UserTableSeeder');\n // 权限\n $this->call('PurviewTableSeeder');\n // 博文分类\n $this->call('CategoryTableSeeder');\n // 博文、评论、标签\n $this->call('ArticleTableSeeder');\n // 心情\n $this->call('MoodTableSeeder');\n // 留言\n $this->call('MessageTableSeeder');\n // 文件\n $this->call('StorageTableSeeder');\n\n $this->command->info('seed end!');\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n {\n $this->call(RolesDatabaseSeeder::class);\n $this->call(UsersDatabaseSeeder::class);\n $this->call(LocalesDatabaseSeeder::class);\n $this->call(MainDatabaseSeeder::class);\n }", "public function run()\n {\n // DB::table('users')->insert([\n // ['id'=>1, 'email'=>'nhat','password'=>bcrypt(1234), 'lever'=>0]\n // ]);\n // $this->call(UsersTableSeeder::class);\n // $this->call(CatTableSeeder::class);\n // $this->call(TypeTableSeeder::class);\n // $this->call(AppTableSeeder::class);\n // $this->call(GameTableSeeder::class);\n \n \n }", "public function run()\n {\n\n Schema::disableForeignKeyConstraints(); //in order to execute truncate before seeding\n\n $this->call(UsersTableSeeder::class);\n $this->call(PostCategoriesSeeder::class);\n $this->call(TagsSeeder::class);\n $this->call(PostsSeeder::class);\n\n Schema::enableForeignKeyConstraints();\n\n\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n $this->seedUsers();\n $this->seedAdmins();\n $this->seedMeals();\n\n $this->seedOrder();\n $this->seedOrderlist();\n\n $this->seedReload();\n }", "public function run()\n\t{\n\t\t//composer require fzaninotto/faker\n\t\t\n\t\t$this->call(populateAllSeeder::class);\n\t\t\n\t}", "public function run()\n {\n Model::unguard();\n\n $faker =Faker\\Factory::create();\n\n // $this->call(UserTableSeeder::class);\n\n $this->seedTasks($faker);\n $this->seedTags($faker);\n\n Model::reguard($faker);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n\n $this->call([\n CountriesSeeder::class,\n ProvincesSeeder::class,\n SettingsSeeder::class,\n AdminsTableSeeder::class,\n ]);\n }" ]
[ "0.8065584", "0.7848217", "0.76748335", "0.7244791", "0.7217673", "0.7133266", "0.70984626", "0.70752525", "0.7050456", "0.69926506", "0.6988436", "0.6985116", "0.69669306", "0.68992233", "0.68682885", "0.6847507", "0.6831097", "0.68208444", "0.68041754", "0.68041754", "0.68032914", "0.6790816", "0.67898446", "0.6787946", "0.678716", "0.6777025", "0.6775358", "0.67726433", "0.67660606", "0.67634314", "0.6758109", "0.673368", "0.67331403", "0.6729675", "0.67294586", "0.67255825", "0.67230934", "0.6722171", "0.67213213", "0.6715509", "0.67079365", "0.67062575", "0.6703651", "0.670358", "0.6702433", "0.6702257", "0.66971296", "0.66941136", "0.6686706", "0.6684891", "0.6678387", "0.66765666", "0.66730577", "0.66660666", "0.66496396", "0.6641152", "0.66396993", "0.66393507", "0.66372746", "0.6633904", "0.6630109", "0.66281164", "0.66259885", "0.6617708", "0.66098803", "0.6602503", "0.66002655", "0.659939", "0.6597011", "0.6596365", "0.6592976", "0.65928084", "0.6592367", "0.6589387", "0.6581892", "0.6581305", "0.65805703", "0.6579974", "0.6576225", "0.65749776", "0.6574433", "0.6571225", "0.6569767", "0.6568897", "0.65635324", "0.65631485", "0.6559915", "0.6558022", "0.6556394", "0.65548515", "0.6551606", "0.6548489", "0.6548293", "0.65458405", "0.6545289", "0.6544641", "0.6543904", "0.6543258", "0.65430623", "0.6542044", "0.6539481" ]
0.0
-1
Display a listing of the resource.
public function index() { $estudiantes = Estudiante::orderBy('id', 'des'); $estudiantes_t = Estudiante::orderBy('apellidoEst', 'asc') ->join('proyecto_estudiante', 'estudiante.idEstudiante', '=', 'proyecto_estudiante.idEstudiante') ->where('estado', 'inactivo') ->get(); $idEst = collect([]); foreach ($estudiantes_t as $est) { $idEst->push($est->idEstudiante); } $estudiantes_v = Estudiante::orderBy('apellidoEst', 'asc') // ->join('proyecto_estudiante', 'estudiante.idEstudiante', '=', 'proyecto_estudiante.idEstudiante') ->whereNotIn('estudiante.idEstudiante', $idEst) ->get(); // dd([$idEst, $estudiantes_v]); return view('estudiante.index', compact(['estudiantes_v', 'estudiantes_t'])); foreach ($estudiantes_v as $key => $value) { $value->estadoE = Proyecto_estudiante::where('idEstudiante', $value->idEstudiante) ->where('estado', 'activo') ->where('estado', 'cancelado') ->where('estado', 'inactivo') ->echo ("asignado"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $this->validate($request, [ 'ciEst' => 'required|string', 'nombreEst' => 'required|string', 'apellidoEst' => 'required|string', 'emailEst' => 'required|email', 'telefono' => 'required|integer', ]); Estudiante::create([ 'ciEst' => $request['ciEst'], 'nombreEst' => $request['nombreEst'], 'apellidoEst' => $request['apellidoEst'], 'emailEst' => $request['emailEst'], 'telefono' => $request['telefono'], 'idCarrera' => $request['idCarrera'], ]); // return response()->json([ // 'message' => 'Se agrego correctamente!', // ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { /* $tribunales = Estudiante::select('docente.apeMaternoDoc','docente.apePaternoDoc','docente.nombreDoc') ->join('proyecto_estudiante', 'estudiante.idEstudiante', '=', 'proyecto_estudiante.idEstudiante') ->where('proyecto_estudiante.idEstudiante' , '=', $id) ->join('proyecto', 'proyecto_estudiante.idProyecto', '=', 'proyecto.idProyecto') ->join('asignacion', 'proyecto.idProyecto', '=', 'asignacion.idProyecto') ->where('rol', '=' ,'tribunal') ->where('estado', '=' ,'Activo') ->join('docente', 'asignacion.idDoc', '=', 'docente.idDoc') ->get(); $tutores = Estudiante::select('docente.apeMaternoDoc','docente.apePaternoDoc','docente.nombreDoc') ->join('proyecto_estudiante', 'estudiante.idEstudiante', '=', 'proyecto_estudiante.idEstudiante') ->where('proyecto_estudiante.idEstudiante' , '=', $id) ->join('proyecto', 'proyecto_estudiante.idProyecto', '=', 'proyecto.idProyecto') ->join('asignacion', 'proyecto.idProyecto', '=', 'asignacion.idProyecto') ->where('rol', '=' ,'tutor') ->join('docente', 'asignacion.idDoc', '=', 'docente.idDoc') ->get(); $titulo = Estudiante::select('proyecto.titulo') ->join('proyecto_estudiante', 'estudiante.idEstudiante', '=', 'proyecto_estudiante.idEstudiante') ->where('proyecto_estudiante.idEstudiante' , '=', $id) ->join('proyecto', 'proyecto_estudiante.idProyecto', '=', 'proyecto.idProyecto') ->firstOrFail(); */ $estudiante = Estudiante::where('idEstudiante', $id)->firstOrFail(); $titulo = ""; $tutores = collect([]); $tribunales = collect([]); // dd($estudiante->proyecto_estudiante); foreach ($estudiante->proyecto_estudiante as $pe) { $titulo = $pe->proyecto->titulo; foreach ($pe->proyecto->asignacion as $asig) { if ($asig->rol == "tutor") { $tutores->push($asig->docente->nombreDoc." ".$asig->docente->apePaternoDoc." ".$asig->docente->apeMaternoDoc); } if ($asig->rol == "tribunal") { $tribunales->push($asig->docente->nombreDoc." ".$asig->docente->apePaternoDoc." ".$asig->docente->apeMaternoDoc); } } } return response()->json([ 'estudiante' => $estudiante, 'titulo' => $titulo,//$titulo?$titulo:'NULL', 'tutores' => $tutores,//$tutores?$tutores:'NULL', 'tribunales' => $tribunales,//$tribunales?$tribunales:'NULL', //->where('estado', 'terminado') ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show(Resena $resena)\n {\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function show()\n\t{\n\t\t\n\t}", "public function get_resource();", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "public function display() {\n echo $this->render();\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n {\n //\n $this->_show($id);\n }", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public abstract function display();", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "abstract public function resource($resource);", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8232636", "0.81890994", "0.68296117", "0.64987075", "0.649589", "0.64692974", "0.64633286", "0.63640857", "0.6307513", "0.6281809", "0.621944", "0.61926234", "0.61803305", "0.6173143", "0.61398774", "0.6119022", "0.61085826", "0.6106046", "0.60947937", "0.6078597", "0.6047151", "0.60409963", "0.6021287", "0.5989136", "0.5964405", "0.5962407", "0.59518087", "0.59309924", "0.5921466", "0.5908002", "0.5908002", "0.5908002", "0.59051657", "0.5894554", "0.5871459", "0.5870088", "0.586883", "0.5851384", "0.58168566", "0.58166975", "0.5815869", "0.58056176", "0.5799148", "0.5795126", "0.5791158", "0.57857597", "0.5783371", "0.5761351", "0.57592535", "0.57587147", "0.5746491", "0.57460666", "0.574066", "0.5739448", "0.5739448", "0.57295275", "0.57293373", "0.5729069", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57214445", "0.57149816", "0.5712036", "0.5710076", "0.57073003", "0.5707059", "0.5705454", "0.5705454", "0.5700382", "0.56997055", "0.5693362", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { /*return response()->json([ 'message' => $id, ]);*/ $this->validate($request, [ 'ciEst' => 'required|string', 'nombreEst' => 'required|string', 'apellidoEst' => 'required|string', //'emailEst' => 'required|email', 'telefono' => 'integer', ]); Estudiante::where('idEstudiante', $id)->update( array( 'ciEst' => $request->ciEst, 'nombreEst' => $request->nombreEst, 'apellidoEst' => $request->apellidoEst, 'emailEst' => $request->emailEst, 'telefono' => $request->telefono, 'idCarrera' => $request->idCarrera, ) ); return response()->json([ 'message' => 'Se modifico correctamente!', ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { Estudiante::where('idEstudiante', $id)->delete(); return response()->json([ 'mensaje' => 'Se elimino correctamente!', ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Add CSS via ResourceLoader
public function initPage( OutputPage $out ) { $out->addMeta( 'viewport', 'width=device-width, initial-scale=1.0, ' . 'user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0' ); $out->addModuleStyles( [ // 'mediawiki.skinning.interface', // 'mediawiki.skinning.content.externallinks', 'skins.ims' ] ); $out->addModules( [ 'skins.ims.js' ] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function loadCss() {}", "public static function appendCss($resource)\n {\n self::append('css', $resource);\n }", "private static function defCssLoader() {\n\n\t\t$loadedResources = Yii::app()->user->getState('nlsLoadedResources');\n\t\tif (!isset($loadedResources))\n\t\t\t$loadedResources = array();\t\t\n\t\t\n\t\t$hk = '__defCssLoader';\n\t\t$inCache = isset($loadedResources[$hk]);\n\n\t\tif ($inCache)\n\t\t\treturn '';\n\t\n\t\t$loadedResources[$hk] = $hk;\n\t\tYii::app()->user->setState('nlsLoadedResources', $loadedResources);\n\n\t\treturn CHtml::script('\n//css loader\n__loadCss = function(f, media) {\n\tvar a = document.createElement(\"link\");\n\ta.rel=\"stylesheet\";\n\ta.type=\"text/css\";\n\ta.media=media||\"screen\";\n\ta.href=f;\n\t(document.getElementsByTagName(\"head\"))[0].appendChild(a);\n};\n');\n\t\t\t\n\t}", "private function _addCss() {\r\n JHtml::styleSheet( Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/list.css');\r\n }", "protected function addCSS() {\n foreach ($this->css_files as $css_file) {\n $this->header.=\"<link rel='stylesheet' href='\" . __ASSETS_PATH . \"/\" . $css_file . \"'/> \\n\";\n }\n }", "public function setStyleLoader($styleLoader);", "public function getStyleLoader();", "public function css() {\r\n\t\tif ($this->cssLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.BASE_REQUEST.'/default/skin/'.pzk_app()->name.'/css/'.$this->cssLink.'.css\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page())\r\n\t\t\t\t\t$page->addObjCss($this->cssLink);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tif ($this->cssExternalLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.$this->cssExternalLink.'\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page()) {\r\n\t\t\t\t\t$page->addExternalCss($this->cssExternalLink);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "private function load_css () {\n $buffer = '';\n if (count($this->css_files)) {\n foreach ($this->css_files as $file) {\n $file = explode('/', $file);\n // TODO: use $this->config->item('modules_locations') for modules path\n $file = 'application/modules/'.$file[0].'/views/'.$this->get_skin().'/skin/'.implode('/',array_slice($file, 1));\n $buffer .= \"\\n\".'<link rel=\"stylesheet\" href=\"'.base_url($file).'\">';\n }\n return $buffer.\"\\n\";\n } else {\n return \"\\n\";\n }\n }", "function loadCSS() {\n\t\t$first = true;\n\t\t$cssPart = '';\n\t\tforeach( $this->conf->css->file as $file ) {\n\t\t\tif( ! $first ) {\n\t\t\t\t$cssPart .= chr( 9 );\n\t\t\t}\n\t\t\t$cssPart .= '<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"';\n\t\t\t$cssPart .= $this->conf->path->baseUrl . $this->conf->path->css . $file;\n\t\t\t$cssPart .= '\" />' . chr( 10 );\n\t\t\t$first = false;\n\t\t}\n\t\t\n\t\tif( count( $this->additionalCSS ) >= 1 ) {\n\t\t\tforeach( $this->additionalCSS as $key => $value ) {\n\t\t\t\t$cssPart .= '<style type=\"text/css\">' . chr( 10 );\n\t\t\t\t$cssPart .= $value . chr( 10 );\n\t\t\t\t$cssPart .= '</style>' . chr( 10 );\n\t\t\t}\n\t\t\n\t\t}\n\t\treturn $cssPart;\n\t}", "private function addCSS()\n {\n Filters::add('head', array($this, 'renderRevisionsCSS'));\n }", "public function DefineCssResources()\n {\n $this->carabiner->css(array(\n array('assets/css/libs/bootstrap.css'),\n array('assets/css/views/normalize.css'),\n array('assets/css/libs/Chart.min.css')\n ));\n }", "protected function loadStylesheets() {}", "public function loadCss()\n {\n wp_register_style(\n 'fortytwo_two_factor_style_intl',\n plugin_dir_url(__FILE__) . '../Css/intlTelInput.css',\n false,\n '1.0.0'\n );\n wp_register_style(\n 'fortytwo_two_factor_style_plugin',\n plugin_dir_url(__FILE__) . '../Css/plugin.css',\n false,\n '1.0.0'\n );\n wp_enqueue_style('fortytwo_two_factor_style_intl');\n wp_enqueue_style('fortytwo_two_factor_style_plugin');\n }", "function ft_hook_add_css() {}", "public function loadAssets(): void\n {\n $this->printStyle('//resource.css', 'print_resource_page_assets');\n }", "function barjeel_css_loader() {\n\n wp_enqueue_style('barjeel', get_template_directory_uri().'/stylesheets/barjeel.css', false ,'0.90', 'all' );\n\n if (ICL_LANGUAGE_CODE == \"ar\") {\n\t wp_enqueue_style('barjeel-ar', get_template_directory_uri().'/stylesheets/barjeel-rtl.css', false ,'0.90', 'all' );\n\t}\n\n }", "function App_CSS_Add()\n {\n array_push($this->MyApp_Interface_Head_CSS_OnLine,\"CSS/sivent2.css\");\n }", "function add_css() \n {\n if( $this->options['use-css-file'] ) {\n wp_register_style( 'bbquotations-style' , $this->plugin_url . 'bbquotations-style.css');\n wp_enqueue_style( 'bbquotations-style' );\n } \n }", "public function kiwip_stylesheet_add_file(){\n\t\t//register\n\t\tforeach($this->stylesheet as $key){\n\t\t\twp_register_style('kiwip_shortcode-css-'.$key['stylesheetId'], $key['stylesheetURL']);\n\t\t}\n\t\t\n\t\t//load\n\t\tforeach($this->stylesheet as $eky){\n\t\t\twp_enqueue_style('kiwip_shortcode-css-'.$key['stylesheetId']);\n\t\t}\t\t\n\n\t\t// $this->debug($this->stylesheet); die();\n\t}", "protected function loadStylesheets()\n {\n if (!empty($GLOBALS['TBE_STYLES']['stylesheet'])) {\n $this->pageRenderer->addCssFile($GLOBALS['TBE_STYLES']['stylesheet']);\n }\n if (!empty($GLOBALS['TBE_STYLES']['stylesheet2'])) {\n $this->pageRenderer->addCssFile($GLOBALS['TBE_STYLES']['stylesheet2']);\n }\n }", "protected function doConcatenateCss() {}", "function load_css() {\n wp_register_style('main', get_template_directory_uri() . '/css/main.css', array(), false, 'all');\n wp_enqueue_style('main');\n }", "function addCSSFiles()\n\t{\n\t\t$this->getContainer()->AddCSSFile(\"include/zoombox/zoombox.css\");\n\t}", "private function _addResource()\n {\n //Add Resource\n $this->assets->collection('css_header')\n ->addCss('/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css');\n\n $this->assets->collection('js_footer')\n ->addJs('/plugins/nestable/jquery.nestable.js')\n ->addJs('/plugins/nestable/ui-nestable.js')\n ->addJs('/plugins/bootstrap-modal/js/bootstrap-modal.js')\n ->addJs('/plugins/bootstrap-modal/js/bootstrap-modalmanager.js')\n ->addJs('/templates/backend/default/js/ui-modals.js');\n }", "public function initResourceLoader()\n {\n $this->getResourceLoader();\n }", "public function addCSS($uri)\n {\n array_push($this->css, \\URL::to($uri));\n }", "protected function addCssToBackend() {\n\t\t$this->backendReference->addCssFile('newspaper-role', t3lib_extMgm::extRelPath($this->extkey) . 'mod_role/newspaper_role.css');\n\t}", "public function addCss($script) {\n\t\tLibraries::enqueueCss($script);\n\t}", "public function load_styles() {\n\t wp_enqueue_style( 'core', get_stylesheet_uri() );\n\t\twp_enqueue_style( 'main', get_stylesheet_directory_uri() . '/assets/css/main-style.min.css' );\n\n\t\t// ADD MORE STYLE HERE ...\n\t\t\n\t}", "public function addRessources()\n {\n // $this->context->controller->addCss(($this->_path . '/views/css/tab.css'), 'all');\n // $this->context->controller->addJquery();\n // $this->context->controller->addJS(($this->_path . '/views/js/script.js'));\n // $this->context->controller->addJS(($this->_path . '/views/js/configuration.js'));\n }", "public function addCSSFiles($css /* array */);", "protected function generateCSS() {}", "protected function addAssets(): void\n {\n $this->enqueue('assets/dashifen-2022.js');\n $font1 = $this->enqueue('//fonts.googleapis.com/css2?family=El+Messiri&display=swap');\n $font2 = $this->enqueue('//fonts.googleapis.com/css2?family=Roboto&display=swap');\n $css = $this->enqueue('assets/dashifen-2022.css', [$font1, $font2]);\n \n $dir = trailingslashit($this->getStylesheetDir());\n if (file_exists($dir . 'assets/dashifen-2022-components.css')) {\n $this->enqueue('assets/dashifen-2022-components.css', [$css]);\n }\n }", "protected function addCSS($id, $path, $deps = [], $version = false, $media = 'all')\n\t{\n\t\tif ( !Stringify::contains($path,'http') ) {\n\t\t $path = $this->getPluginUrl($path);\n\t\t}\n\t\twp_register_style($id,$path,$deps,$version,$media);\n\t\twp_enqueue_style($id);\n\t}", "function loadCSS($width, $height) {\n\t\t$header = (isset($this->conf['pathToCSS'])) ? '<link rel=\"stylesheet\" href=\"'.$this->getPath($this->conf['pathToCSS']).'\" type=\"text/css\" />' : '';\n\t\t$header.= '<style type=\"text/css\" media=\"screen\">\n\t\t\t#slider { width:'.$width.'px; }\n\t\t\t.scroll { height:'.$height.'px; }\n\t\t\t.scrollContainer div.panel { width:'.$width.'px; height:'.$height.'px; }\n\t\t</style\n\t\t';\n\t\t$GLOBALS['TSFE']->additionalHeaderData['tan3_glidercss'] = $header;\n\n\t}", "public function add_css($name, $data = array())\n\t{\n\t\t$this->add_asset('css', $name, $data);\n\t}", "public function addCSS($css) {\r\n\t\t\t$this->css.= \"<link rel='stylesheet' type='text/css' href='$css.css' >\";\r\n\t\t}", "function add_css($css, $append_path = TRUE)\r\n\t{\r\n\t $css = $this->append_ext($css, 'css', $append_path);\r\n\t \r\n\t if ( ! is_array($css)) \r\n\t {\r\n\t /* Assume its a string */\r\n\t $this->css_includes[] = $css;\r\n\t }\r\n\t else \r\n\t {\r\n\t $this->css_includes += $css;\r\n\t }\r\n\t \r\n\t return $this;\r\n\t}", "function loadStyles() {\n\t\twp_register_style('hashee_styles', $this->pluginPath . 'css/hashee_styles.css');\n\t\twp_enqueue_style('hashee_styles');\n\t}", "public function onLoad() {\n\t\t$this->plugin->wrapper = $this->plugin->factory->wrapper;\n\t\twp_enqueue_style( 'clrchs-admin', $this->plugin->wrapper->getURL('assets/admin.css'), [], $this->plugin->version);\n\t}", "function wp_style_loader_src($src, $handle)\n {\n }", "public function addCss($path)\n {\n if ($this->_isAbsolute($path)) {\n return $this->data(self::CSS, $path);\n }\n $this->data(self::CSS, $this->staticPath() . '/css/' . $path);\n }", "public static function enteteCSS() {\r\n foreach (Page::getInstance()->css as $link) {\r\n ?>\r\n <link type=\"text/css\" rel=\"stylesheet\" href=\"<?php echo $link; ?>\" />\r\n <?php\r\n }\r\n }", "public function loadResources() {}", "function wiki_api_import_css() {\n\twp_enqueue_style('style-name', get_stylesheet_uri());\n\twp_enqueue_script('script-name', get_template_directory_uri() . '/js/example.js', array(), '1.0.0', true);\n}", "function addcss()\n{\nwp_register_style('ahmed_css', plugin_dir_url(__file__).'/styles-ahmed.css');\nwp_enqueue_style('ahmed_css');\n}", "private function _getResourceCss()\n {\n return array(\n '../libs/css/plugins/validationEngine.jquery.css'\n );\n }", "public function loadAssets()\r\n {\r\n $this->app->document->addStylesheet('elements:imagebox/assets/css/edit.css');\r\n return parent::loadAssets();\r\n }", "function init() {\r\n $this->load_upcss();\r\n }", "function load_stylesheets()\n{\n // 1. Download bootstrap css from serwer (katalog otoedu)\n wp_register_style('bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', array(), false, 'all');\n wp_enqueue_style('bootstrap');\n\n // 2. Download style css from serwer (katalog otoedu)\n // It is my style (not bootstrap). That must be second position\n wp_register_style('style', get_template_directory_uri() . '/style.css', array(), false, 'all');\n wp_enqueue_style('style');\n}", "private function _initJsCss(){\n\t\t$cs = Yii::app()->clientScript;\n\t\t$cs->registerCssFile(Yii::app()->baseUrl . '/css/admin/admin.css');\n\n\t}", "function load_core_css() {\n\t\t\n\t\t\twp_enqueue_style('bootstrap',get_bloginfo('template_directory').'/assets/css/bootstrap.min.css');\n\n\t\t\twp_enqueue_style('app',get_bloginfo('template_directory').'/assets/css/app.css');\n\t\t\t\n\t\t}", "protected function loadCSS($sFilename){\n echoln('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . HOME_URI . '/asset/css/'. $sFilename . '.css\">');\n }", "function insert_resouces($resources) {\r\n foreach ($resources['css'] as $css) {\r\n echo '<link rel=\"stylesheet\" href=\"'. $css .'\">';\r\n }\r\n foreach ($resources['js'] as $js) {\r\n echo '<script src=\"'. $js .'\"></script>';\r\n }\r\n }", "private function addToTheme()\n {\n static $addedResource = false;\n\n if ($this->activated && !$addedResource) {\n if (isset($GLOBALS['xoTheme'])) {\n /*\n $xoops = Xoops::getInstance();\n $head = '</style>' . $this->renderer->renderHead()\n . '<style>.icon-tags:before { content: \"\"; width: 16px; background-position: -25px -48px;}';\n $xoops->theme()->addStylesheet(null, null, $head);\n */\n $addedResource = true;\n }\n }\n }", "function do_add_css(){\n\t\tglobal $jcf_included_assets;\n\t\t\n\t\tif( !empty($jcf_included_assets['styles'][get_class($this)]) )\n\t\t\treturn false;\n\t\t\n\t\tif( method_exists($this, 'add_css') ){\n\t\t\tadd_action( 'jcf_admin_edit_post_styles', array($this, 'add_css'), 10 );\n\t\t}\n\n\t\t$jcf_included_assets['styles'][get_class($this)] = 1;\n\t}", "public function add_css($css) {\n $current = $this->dwoo_data->css_files;\n $current[] = $css;\n $this->dwoo_data->css_files = $current;\n }", "function SA_dev_register_style($handle, $src, $ver){echo '<link rel=\"stylesheet\" href=\"'.$src.'\" type=\"text/css\" charset=\"utf-8\" />'.\"\\n\";}", "public function acfedu_add_css() {\n\t\t\t\twp_enqueue_style( 'acf-faculty-selector', plugins_url( 'assets/css/acf-faculty-selector.css', __FILE__ ) );\n\t\t\t}", "public function add_css($file)\n {\n $this->add(\"css\", $file);\n }", "public function styles() {\n $this->addStyle(CORE_WWW_ROOT.\"ressources/css/externals/bootstrap.core.min.css\", true);\n\n\n $this->addStyle($this->directory().\"css/reset.less\");\n $this->addStyle($this->directory().\"css/animations.less\");\n $this->addStyle($this->directory().\"css/main.less\");\n $this->addStyle($this->directory().\"css/overlay.less\");\n $this->addStyle($this->directory().\"css/header.less\");\n $this->addStyle($this->directory().\"css/footer.less\");\n\n // externals\n $this->addStyle(\"//fonts.googleapis.com/css?family=Lora:400,400i,700,700i\", true);\n $this->addStyle('//fonts.googleapis.com/css?family=Roboto:700', true);\n\n // blocks\n $this->addStyle($this->directory().\"css/blocks/rd_arrow.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_button.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_bigteaser.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_smallteaser.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_longtext.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_forms.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_listings.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_collection.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_components.less\");\n\n $this->addStyle($this->directory().\"css/responsive.less\");\n }", "function load_stylesheets() {\n\n\twp_register_style('myCSS' , get_template_directory_uri() . '/style.css', array(), false, 'all');\n\twp_enqueue_style('myCSS');\n}", "private function addCSS($filename, $set_path = false) {\r\n if(is_array($filename)){\r\n foreach ($filename as $file) {\r\n array_push($this->css_files, 'css/'.$file.'.css');\r\n }\r\n } else if($set_path) {\r\n array_push($this->css_files, $filename);\r\n } else {\r\n array_push($this->css_files, 'css/'.$filename.'.css');\r\n }\r\n }", "public function includeCSS($strUri) {\n\n\t\t$this->response->includeCSS($strUri);\n\t}", "function add_style($name, $file)\n{\n\tglobal $styles_included;\n\t$styles_included[$name] = \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"\".site_url.$file.\"\\\"/>\\n\";\n}", "private function load_admin_styles() {\n\n\t}", "function addThemeStyles() \n {\n global $blog_id;\n \n // need for wordpress MU and WP3\n if (!$blog_id) {\n $blog_id = 1;\n }\n\n // load style\n if (file_exists(CONSTRUCTOR_DIRECTORY .'/cache/style'.$blog_id.'.css')) {\n wp_enqueue_style('constructor-style', CONSTRUCTOR_DIRECTORY_URI .'/cache/style'.$blog_id.'.css');\n } else {\n wp_enqueue_style('constructor-style', get_option('home').'/?theme-constructor=css');\n }\n \n // load constructor subtheme style\n if (file_exists(CONSTRUCTOR_DIRECTORY .'/themes/'.$this->getTheme().'/style.css')) {\n wp_enqueue_style( 'constructor-theme', CONSTRUCTOR_DIRECTORY_URI.'/themes/'.$this->getTheme().'/style.css');\n }\n }", "public function loadAssets()\n {\n add_action('admin_enqueue_scripts', [$this, 'enqueueAdminAssets']);\n add_filter('script_loader_tag', [$this, 'addAssetAttribute'], 10, 3);\n }", "public function enableConcatenateCss() {}", "private function loadStyles() {\n\t\tif(isset($this->styles) && $this->styles != \"\") {\n\t\t\tforeach (explode(\",\", $this->styles) as $style) {\n\t\t\t\tOCP\\Util::addStyle('ocDashboard', 'widgets/'.$this->id.'/'.$style);\n\t\t\t}\n\t\t}\n\t}", "function load_css() {\n\twp_register_style( 'blockcategories_bootstrap_css', plugin_dir_url( __FILE__ ) . 'css/bootstrap-grid.css' );\n\twp_enqueue_style( 'blockcategories_bootstrap_css' );\n\n\twp_register_style( 'blockcategories_css', plugin_dir_url( __FILE__ ) . 'css/blockcategories.css' );\n\twp_enqueue_style( 'blockcategories_css' );\n}", "public function build_css() {\n\t\t\t\n\t\t}", "public function include_css($env) {\n global $CFG;\n $css = '';\n $cssurl = $CFG->dirroot . '/course/format/ludimoodle/motivators/' . $this->get_short_name() . '/styles.css';\n\n // We can't require css like this in format because <head> is already closed\n //$page = $env->get_page();\n //$page->requires->css($cssurl);\n\n // if css is not already in page\n if (file_exists($cssurl) && (!in_array($cssurl, $env->cssinitdata))) {\n // mark that this css is in page\n $env->cssinitdata[] = $cssurl;\n $css = '<style>' . file_get_contents($cssurl) . '</style>';\n }\n return $css;\n }", "public static function bkap_resource_css_file(){\n\n if ( get_post_type() == 'bkap_resource' ) {\n wp_dequeue_style( 'wc_bookings_admin_styles' );\n }\n }", "function tn_sh_loadcss() {\n\n wp_enqueue_style('tn_sh_obsidian', plugin_dir_url(__FILE__) . '/lib/highlight/styles/obsidian.css');\n}", "function register_css() {\n $myStyleUrl = plugins_url(__WP_PLUGIN__.'.css', __FILE__); \n wp_register_style(__WP_PLUGIN__, $myStyleUrl);\n wp_enqueue_style(__WP_PLUGIN__);\n }", "public static function load_dashboard_css()\n\t{\n global $settings;\n\n\t\tforeach($settings['css'] as $css) {\n\t\t\twp_register_style( $css['id'], plugins_url( $css['url'], __FILE__ ), array(), $settings['version'], 'all' );\n\t\t wp_enqueue_style( $css['id'] );\n\t\t}\n\t}", "public function addStyling()\n {\n \\wp_enqueue_style(self::REACT_WP_THEME, \\get_template_directory_uri() . '/frontend/dist/style.css', [], '0.1');\n }", "public function add_css ( $filename )\n {\n\n \n if(substr($filename,0,1) != \"/\"){\n $path = basedir . $this->templatePath . 'css' . DS . $filename;\n $fileLoc = DS . $this->templatePath . 'css' . DS . $filename;\n } else {\n $path = basedir . $filename;\n $fileLoc = $filename;\n }\n if( in_array( $fileLoc, $this->css_files ) == true )\n {\n return null;\n }\n \n if( file_exists($path) == false )\n {\n /*------------ERROR------------*/\n // $this->reg->debug->error('Error','Function add_css()', 'Css file not found. File: '.$path, DateTime, $this);\n \n //log::write(\"Css file not found. File: `$path`\", $this, 'add_css()');\n return false;\n }\n $this->css_files[] = str_replace(\"\\\\\",\"/\", $fileLoc);\n $this->includeLibs();\n }", "public function addCssFile($name)\n {\n $this->fileStyles[] = $name;\n }", "protected function addSystemCssJs()\n\t{\n\t\tglobal $cWebPath;\n\t\t\t\t\n\t\t$this->mStyles[] = $cWebPath . '/style/mainstyle.css';\n\t\t$this->mStyles[] = $cWebPath . '/style/svwp_style.css';\n\t\t\n\t\t$this->mScripts[] = $cWebPath . '/scripts/jquery.slideViewerPro.1.5.js';\n\t\t$this->mScripts[] = $cWebPath . '/scripts/jquery.timers-1.2.js';\n\t\t$this->mScripts[] = $cWebPath . '/scripts/imageslider.js';\n\t}", "protected function addResources(t3lib_PageRenderer $renderer) {\n\t\t$renderer->addJsFooterFile(\n\t\t\t$this->getScriptUrl(),\n\t\t\t'text/javascript',\n\t\t\tFALSE\n\t\t);\n\n\t\t$stylesheet = $this->getTypoScriptService()->resolveFilePath('settings.stylesheet');\n\t\tif (!empty($stylesheet)) {\n\t\t\t$renderer->addCssFile(\n\t\t\t\t$stylesheet\n\t\t\t);\n\t\t}\n\t}", "function XT_load_css($params){\n if($params['media'] == \"\"){\n $params['media']= \"screen\";\n }\n if(empty($params['file'])) {\n return false;\n } else {\n if(empty($GLOBALS['loadedcss'][$params['file']])){\n // js ausgeben und als geladen merken\n $GLOBALS['loadedcss'][$params['file']] = '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . STYLES_DIR . 'live/' . $params['file'] . '\" media=\"' . $params['media'] . '\" />';\n return NULL;\n }else{\n return false;\n }\n }\n}", "function csu_hcfw_resources_load_scripts() {\n\twp_enqueue_style( 'csu-hcfw-resources-styles', plugin_dir_url( __FILE__ ) . 'includes/css/styles.css' );\n}", "function queue_css_url($url, $media = 'all', $conditional = false)\n{\n get_view()->headLink()->appendStylesheet($url, $media, $conditional);\n}", "public function enqueue_additional_css_file() {\n\t\tif (is_page() || is_single()) {\n\t\t\twhile (have_posts()) {\n\t\t\t\tthe_post();\n\t\t\t\t$additional_css_file = get_post_meta(get_the_ID(), 'im8_additional_css_file', true);\n\t\t\t\t$path = get_stylesheet_directory().'/css/'.$additional_css_file;\n\t\t\t\t$url = get_stylesheet_directory_uri().'/css/'.$additional_css_file;\n\t\t\t\tif ($additional_css_file && file_exists($path))\n\t\t\t\t\twp_enqueue_style('im8_additional_css_file', $url, array(), filemtime($path), 'screen, projection');\n\t\t\t}\n\t\t\trewind_posts();\n\t\t}\n\t}", "public function appendCssUrl($url) {\n $this->appendToHead(<<<HTML\n <link rel=\"stylesheet\" type=\"text/css\" href=\"{$url}\">\nHTML\n) ;\n }", "public function CSS($file,$hook=''){\n \n $file=$this->getFileName($file);\n $incl=pinCSSLinkInclusion::make($file,$hook)->file($file);\n pinIncluder::i()->add($incl);\n return $incl; \n }", "public function dt_testimonial_simple_loadCssAndJs() {\n wp_register_style( 'dt_extend_style', plugins_url('assets/droit-wbpakery-addons.css', __FILE__) );\n }", "protected function registerCustomCSS() {\r\n $this->cssCustoms = array(\r\n 'baseCSS' => CSS_PATH . 'screen.css',\r\n );\r\n }", "protected function buildCssAndRegisterIcons() {}", "public function addStyle($css, $cacheable = true) {\n if(is_null($this->Styles))\n $this->Styles = array();\n\n $this->Styles[] = array('file'=>$css, 'cache'=>$cacheable);\n }", "function cookiebar_insert_head_css($flux){\n $flux .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.find_in_path(\"css/jquery.cookiebar.css\").'\" />';\n return $flux;\n}", "function load_custom_css(){\r\n wp_enqueue_style( 'custom-css', get_template_directory_uri().\"/divi-custom/css/divi-custom.css\");\r\n}", "function add_css($acss=array()) {\n\t\tforeach ($acss as $css) {\n\t\t\tif (isset($css[\"path\"]) && $css[\"path\"]!=\"\") {\n\t\t\t\t$priority = 0;\n\t\t\t\tif (isset($css[\"priority\"])) {\n\t\t\t\t\t$priority = $css[\"priority\"];\n\t\t\t\t}\n\t\t\t\t$condition = \"\";\n\t\t\t\tif (isset($css[\"condition\"])) {\n\t\t\t\t\t$condition = $css[\"condition\"];\n\t\t\t\t}\n\t\t\t\t$is_local = true;\n\t\t\t\tif (isset($css[\"is_local\"])) {\n\t\t\t\t\t$is_local = $css[\"is_local\"];\n\t\t\t\t}\n\t\t\t\t$this->custom_css[] = array(\"css\" => $css[\"path\"], \"priority\" => $priority, \"condition\" => $condition, \"is_local\" => $is_local);\n\t\t\t}\n\t\t}\n\t}", "function theme_css($uri, $tag=true)\n{\n\t$path_css = theme_url(assets_dir('css').'/'.$uri);\n\treturn _css($path_css,$tag);\n}", "function css($filename){\n\t\t// If its an array we have to load separately.\n\t\tif(is_array($filename)){\n\t\t\tforeach($filename as $file){\n\t\t\t\t// Calls recursively this function for each file\n\t\t\t\t// on the received array.\n\t\t\t\t$this->css($file);\n\t\t\t}\n\t\t} else {\n\t\t\tif($file = $this->_has_extension($filename)){\n\t\t\t\tarray_pop($file);\n\t\t\t\t$this->css[] = implode('.', $file);\n\t\t\t} else {\n\t\t\t\t$this->css[] = $filename;\n\t\t\t}\n\t\t}\n\t}", "static function emAddCssFile($cssPath, $media=\"all\", $levelStr=\"\") {\n\t$timestamp = filemtime( __DIR__ . \"/\" . $cssPath );\n self::$emHeader_line[] = \"<link rel='stylesheet' type='text/css' media='{$media}' href='{$levelStr}{$cssPath}?v={$timestamp}'>\";\n}", "function add_my_stylesheet() {\n}", "public function addCss($file)\n\t{\n\t\t$this->_themeExtras['css'][] = array('file' => $file);\n\t}" ]
[ "0.73147994", "0.71999764", "0.7056463", "0.6875748", "0.681634", "0.67804253", "0.6746531", "0.6696955", "0.6664494", "0.6631029", "0.6591192", "0.6535578", "0.65086675", "0.64745843", "0.641187", "0.638663", "0.63371277", "0.6333775", "0.63267523", "0.631587", "0.6287945", "0.6286473", "0.62731624", "0.62515944", "0.62238294", "0.61976975", "0.61886805", "0.6166587", "0.61593676", "0.6157077", "0.61320585", "0.612552", "0.60867083", "0.6072702", "0.6071212", "0.6057421", "0.6050811", "0.6048539", "0.6041921", "0.60262233", "0.60176873", "0.60014564", "0.5988226", "0.598582", "0.59836423", "0.5977969", "0.59760004", "0.5973646", "0.59521085", "0.5928196", "0.5927179", "0.5925571", "0.5894851", "0.58902264", "0.58794606", "0.58722425", "0.5869836", "0.58632433", "0.5848469", "0.5816728", "0.5805512", "0.5799772", "0.5764799", "0.57589394", "0.57499975", "0.57462305", "0.5737571", "0.5736745", "0.57245517", "0.57210934", "0.57158315", "0.5714005", "0.5709845", "0.57092494", "0.5707091", "0.5699017", "0.5698873", "0.56983984", "0.5695751", "0.5694564", "0.56914204", "0.56906116", "0.56903833", "0.5688948", "0.56887645", "0.5682212", "0.56694806", "0.56689256", "0.5662084", "0.56587887", "0.5650847", "0.5645785", "0.5642502", "0.56336564", "0.56290466", "0.56261826", "0.56203127", "0.56073576", "0.56037277", "0.5603401", "0.5602652" ]
0.0
-1
/ Action: Insert, Delete, Update
function executarSQLAction($query) { global $basedados; try { $stmt = $basedados->prepare($query); $stmt->execute(); return( $stmt ); } catch (PDOException $e) { imprimir($e->getMessage()); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n\t{\n $this->actionUpdate();\n\t}", "public function actionCreate() {\n $this->actionUpdate();\n }", "function saveAction()\n {\n\t\t$params = $this->_request->getParams();\n \t$id=(int)$params[\"id\"];\n\t\t$name = $params[\"txtName\"];\n\t\t$address = $params[\"txtAddress\"];\n\t\t$email = $params[\"txtEmail\"];\n\t\t$phone = $params[\"txtPhone\"];\n\n\t\t$customers = new CustomersModel();\n\t\tif($id > 0)\n\t\t{\n\t\t\t$customers->updateCustomersById($id, $name, $address, $email, $phone);\n\t\t\t$this->_redirect('/qtht/customers');\n\t\t} else {\n\t\t\t$customers->insertCustomers($name, $address, $email, $phone);\n\t\t\t$this->_redirect('/qtht/customers');\n\t\t}\n }", "public function actionUpdate() {}", "public function actionUpdate() {}", "public function index_post()\n {\n $input = $this->input->post();\n $this->write_db->insert($_table,$input);\n \n $this->response(['Item created successfully.'], REST_Controller::HTTP_OK);\n }", "private function actionListPut() {\n $put_vars = $this->actionListPutConvert();\n $donneur = $this->loadModel($put_vars['id']);\n $donneur->first_name = $put_vars['first_name'];\n $donneur->last_name = $put_vars['last_name'];\n $donneur->age = $put_vars['age'];\n $donneur->gender = $put_vars['gender'];\n $donneur->address = $put_vars['address'];\n $donneur->phone = $put_vars['phone'];\n $donneur->groupe_sangun = $put_vars['groupe_sangun'];\n $donneur->vehicle = $put_vars['vehicle'];\n\n if ($donneur->save()) {\n header(\"HTTP/1.1 200 ok\");\n } else {\n header(\"HTTP/1.1 500 Internal Server Error\");\n echo \"Update failed for EmployeeID: \";\n }\n }", "function insert()\n\t{\n\t\t$this->edit(true);\n\t}", "public function insert() {\n return $this->getActionByName('Insert');\n }", "public function insertStatAndRoyalitiesAction(){\n \n }", "public function insertAction()\r\n\t{\r\n\t\tif ($this->request->getPost('submit')) {\r\n\t\t\t$name = $this->request->getPost('name');\r\n\t\t\t$phone = $this->request->getPost('phone');\r\n\t\t\t$arrPost = array('name' => $name, 'phone' => $phone);\r\n\t\t\t$room = new Room();\r\n\t\t\tif ($room->save($arrPost)) {\r\n\t\t\t\t$this->response->redirect(\"/users/index\", true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public function putAction() {}", "public function action_create()\n {\n $this->action_edit(FALSE);\n }", "protected function saveInsert()\n {\n }", "public function editAction() {}", "public function save() {\n $db = Db::instance();\n $db_properties = array(\n 'action' => $this->action,\n 'url_mod' => $this->url_mod,\n 'description' => $this->description,\n 'target_id' => $this->target_id,\n 'target_name' => $this->target_name,\n 'creator_id' => $this->creator_id,\n 'creator_username' => $this->creator_username\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function insert()\n {\n # code...\n }", "public function putAction()\n {\n \n }", "public function store(Request $request) //插入\n {\n\t\t//\n }", "public function index_post(){\n // insert data method\n\n }", "public function updateAction()\n {\n }", "public function index_post()\n {\n $input = $this->input->post();\n $this->db->insert('items',$input);\n \n $this->response(['Item created successfully.'], REST_Controller::HTTP_OK);\n }", "public function insert(){\n\n }", "public function actionCreate() {}", "public function actionCreate() {}", "function dbInsert($edit)\r\n\t{\r\n\r\n\t}", "public function action() {\n\t\tif( ! $this->request_method )\n\t\t\treturn false;\n\t\tswitch ($this->request_method) {\n\t\t\tcase 'read':\n\t\t\t\t$this->read();\t\t\t\t\t\n\t\t\tbreak;\t\t\t\t\n\t\t\tcase 'create':\t\n\t\t\t\t$this->create();\t\t\t\t\t\n\t\t\tbreak;\n\t\t\tcase 'update':\n\t\t\t\t$this->update();\t\t\t\t\t\n\t\t\tbreak;\n\t\t\tcase 'delete':\n\t\t\t\t$this->delete();\t\t\t\t\t\n\t\t\tbreak;\n\t\t}\n\t}", "function actionsForPutMethod()\n {\n if (isset($this->id)) {\n /* Check first that there is actually an element with the id before modifying */\n $info = $this->api->get($this->id);\n array_pop($info);\n\n /* If $info is different from 0, the element exists, therefore proceed to modify */\n if (count($info) != 0) {\n /* Decode the body of the request and save it in an array */\n parse_str(html_entity_decode($this->bodyRequest), $array);\n\n $this->api->data = $this->renderizeData(array_keys($array), array_values($array));\n $this->api->id = $this->id;\n $data = $this->api->put();\n\n if ($data) {\n $data = $this->api->get($this->id);\n\n if (count($data) == 0) {\n $this->print_json(200, false, null);\n } else {\n array_pop($data);\n $this->print_json(200, \"OK\", $data);\n }\n } else {\n $this->print_json(200, false, null);\n }\n } else { /* If $info is equal to 0, the element does not exist and there is nothing to modify */\n $this->print_json(404, \"Not Found\", null);\n }\n } else {\n $this->print_json(405, \"Method Not Allowed\", null);\n }\n }", "public function store()\n\t{\n\t\t$this->actions->create(Input::all());\n\t\treturn Redirect::route('actions.index');\n\t}", "public function putAction() {\n\t\t// TODO: Implement putAction() method.\n\t}", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "function insert(){\r\n $this->model->randomInsert();\r\n $this->index();\r\n }", "public function Do_insert_Example1(){\n\n\t}", "public function editAction()\r\n {\r\n }", "public static function Insert(){\r\n }", "public function annimalEditAction()\n {\n }", "public function getPrepStat($action, $table, $data){\n switch($action){\n //PUT\n case 0:\n $query = \"INSERT INTO \"; \n $query .= $table . \" (\"; \n $i = 0; $count = count($data) - 1;\n for($u = 0; $u < 2; $u++){\n foreach ($data as $columnName => $value) {\n if($i !== 0 && $i !== $count+1){\n $query .= \", \";\n }\n if($u === 1){\n if($i === $count+1){\n $query .= \") VALUES (\";\n }\n $query .= $columnName;\n if($i === ($count * 2)+1 ){\n $query .= \")\";\n }\n }else{\n $query .= ltrim($columnName, ':');\n }\n $i++;\n }\n }\n break;\n\n //GET\n case 1:\n $query = \"SELECT * FROM \" . $table; \n if(!empty($data)){\n $query .= \" WHERE \";\n $i = 0;\n foreach ($data as $columnName => $value) {\n if($i !== 0){\n $query .= \" AND \";\n }\n \n $query .= ltrim($columnName, ':').\" = \".$columnName;\n \n\n $i++;\n }\n }\n\n break;\n\n //PATCH\n case 2:\n $query = \"UPDATE \"; \n $query .= $table . \" SET \"; \n $i = 0;\n foreach ($data as $columnName => $value) {\n if($i !== 0 && $i !== count($data) - 1 ){\n $query .= \", \";\n }\n if($i !== count($data) - 1){\n $query .= ltrim($columnName, ':').\" = \".$columnName;\n }\n $i++;\n }\n end($data);\n $query .= \" WHERE id = \".key($data);\n break;\n\n //DELETE\n case 3:\n $query = \"DELETE FROM \".$table; \n end($data);\n $query .= \" WHERE id = \".key($data);\n break;\n\n default: return false; break;\n }\n\n\n return $this->db->prepare($query);\n\n\n\n }", "function admin_bulk_action(){\n\t\t\n\t\t$this->layout = \"\";\n\t\t$this->autoRender = false;\n\t\tif(isset($this->data['Model']['id']) && count($this->data['Model']['id'])>0 && isset($this->data['Model']['action'])){\n\t\t\t\n\t\t\t$infected_records = array();\n\t\t\tforeach($this->data['Model']['id'] as $ids){\n\t\t\t\t$infected_records[] = DECRYPT_DATA($ids);\n\t\t\t}\n\t\t\t$model_name = $this->data['Model']['model_name'];\n\t\t\t$action = $this->data['Model']['action'];\n\t\t\tApp::import(\"Model\",$model_name);\n\t\t\t$this->$model_name = new $model_name();\n\t\t\tif($action == 0){//Activate Status\n\t\t\t $this->$model_name->updateAll(array(\"$model_name.is_active\"=>\"'1'\"),array(\"$model_name.id\"=>$infected_records));\n\t\t\t $this->Session->setFlash(RECORD_ACTIVATED, 'message/green');\n\t\t\t}\n\t\t\telse if($action == 1){//Inactivate Status\n\t\t\t $this->$model_name->updateAll(array(\"$model_name.is_active\"=>\"'0'\"),array(\"$model_name.id\"=>$infected_records));\n\t\t\t $this->Session->setFlash(RECORD_DEACTIVATED, 'message/green');\n\t\t\t}else if($action == 2){//Delete selected records\n\t\t\t\t\n\t\t\t $this->$model_name->updateAll(array(\"$model_name.is_deleted\"=>\"'1'\"),array(\"$model_name.id\"=>$infected_records));\n\t\t\t if($model_name == \"Vendor\"){\n\t\t\t\tApp::import(\"Model\",\"Product\");\n\t\t\t\t$this->Product = new Product();\n\t\t\t\t$this->Product->updateAll(array(\"Product.is_deleted\"=>\"'1'\"),array(\"Product.vendor_id\"=>$infected_records));\n\t\t\t\tApp::import(\"Model\",\"Coupon\");\n\t\t\t\t$this->Coupon = new Coupon();\n\t\t\t\t$this->Coupon->updateAll(array(\"Coupon.is_deleted\"=>\"'1'\"),array(\"Coupon.vendor_id\"=>$infected_records));\n\t\t\t }\n\t\t\t \n\t\t\t \n\t\t\t $this->Session->setFlash(RECORD_DELETED, 'message/green');\n\t\t\t}\n\t\t\t$this->redirect($this->referer());exit();\t\n\t\t}\n\t}", "protected function updateAction()\n {\n }", "public function insert()\n {\n }", "public function insert()\n {\n }", "public function action($query = array()) { // action record\n $result = false;\n\n if (isset($query['table']) && isset($query['type'])) {\n switch ($query['type']) {\n case $this->CREATE:\n if (isset($query['data'])) {\n $result = $this->db->insert($query['table'], $query['data']);\n }\n break;\n\n case $this->UPDATE:\n if (isset($query['at']) && isset($query['data'])) {\n $this->db->where($query['at']); // at is an array\n $result = $this->db->update($query['table'], $query['data']);\n } else {\n $result = false;\n }\n break;\n\n case $this->DELETE: // delete ;)\n $result = $this->db->delete($query['table'], $query['at']); // at is an array\n break;\n }\n }\n\n return $result;\n }", "public function actionDelete() {}", "public function actionDelete() {}", "public function actionAdd(){\r\n \r\n }", "public function insert($tblUpdate);", "public function saveAction()\n {\n return $this->dispatcher->forward(array('controller' => 'people', 'action' => 'index'));\n }", "public function saveAction() :void\n {\n $data = $this->request->getPost();\n $record = ModuleTemplate::findFirst();\n if ($record === null) {\n $record = new ModuleTemplate();\n }\n $this->db->begin();\n foreach ($record as $key => $value) {\n switch ($key) {\n case 'id':\n break;\n case 'checkbox_field':\n case 'toggle_field':\n if (array_key_exists($key, $data)) {\n $record->$key = ($data[$key] === 'on') ? '1' : '0';\n } else {\n $record->$key = '0';\n }\n break;\n default:\n if (array_key_exists($key, $data)) {\n $record->$key = $data[$key];\n } else {\n $record->$key = '';\n }\n }\n }\n\n if ($record->save() === FALSE) {\n $errors = $record->getMessages();\n $this->flash->error(implode('<br>', $errors));\n $this->view->success = false;\n $this->db->rollback();\n return;\n }\n\n $this->flash->success($this->translation->_('ms_SuccessfulSaved'));\n $this->view->success = true;\n $this->db->commit();\n }", "public function insert()\n\t{\n\t\t$crud = $this->crud->data([\n\t\t\t'first_name' => $_POST['first_name'],\n\t\t\t'last_name' => $_POST['last_name'],\n\t\t]);\n\t\t$crud->insert();\n\t\t$this->redirect('crud');\n\t}", "public function saveAction() {\n parent::saveAction();\n }", "public function createAction()\r\n\t{\r\n\t\treturn $this->_crud();\r\n\t}", "public function save($action = '', $data = '', $customer_id = ''){\n if($data !== '' && $action === 'new'){\n $result = $this->db->insert('customers_tb', $data);\n return $result;\n }else if($data !== '' && $action === 'existing'){\n $result = $this->db->where('customer_id', $customer_id)->update('customers_tb', $data);\n return $result;\n }\n }", "public function crudUpdated()\n {\n }", "public abstract function Insert();", "public function insert()\n {\n \n }", "private function insert2Action(){\n\t\t$p = $this -> filterRecvParam($this -> getRequest() -> getParams());\n\t\t$this -> actParam = $p;\n\t\t//Forward only if an error occurs\n\t\tif(isset($p['error'])){\t\t\n\t\t\t//$this -> loadBikeModelsBrands();\n\t\t\t$this -> view -> error = $p['error'];\n\t\t\t//$this -> render('insert1');\n\t\t\t//$this -> _forward('insert', null, null, array('error' => $error));\n\t\t\t$this -> insert1Action();\n\t\t}\t\t\n\t\telse{\t\t\t\n\t\t\t//Set session namespace\n\t\t\t$this -> loadBikeCat();\n\t\t\t$this -> adminNS -> bikeAds = $p;\t\t\t\n\t\t\t$this -> view -> bike = $p;\n\t\t\t//$this -> view -> bikePhoto = $this -> bikeNS -> bikePhoto;\n\t\t\t\n\t\t\t$this -> render('insert2');\t\n\t\t}\t\n\t}", "public function annimalAddAction()\n {\n }", "public function db_update() {}", "public function actionInsert()\n\t{\n\t\t$model=new Knowledgecatalogue();\n\t\t$model->fCatalogueNo=GuidUtil::getUuid();\n\t\t$model->fFatherCatalogueNo=$_POST['no'];\n\t\t$model->fCatalogueName=$_POST['name'];\n\t\t$model->fStatus=$_POST['statu'];\n\t\t$model->fIsDownLoad=$_POST['down'];\n\t\t$model->fCreateUser=Yii::app()->params->loginuser->fUserName;\n\t\t$model->fCreateDate=time();\n\t\t$model->fUpdateUser=Yii::app()->params->loginuser->fUserName;\n\t\t$model->fUpdateDate=time();\n\t\tif($model->save())\n\t\t{\n\t\t\t$this->renderPartial('update',array(\n\t\t\t\t\t'data'=>UFSBaseUtil::printJson(array(\n\t\t\t\t\t\t\t'fCatalogueNo'=>CHtml::encode($model->fCatalogueNo),\n\t\t\t\t\t\t\t'fIsDownLoad'=>CHtml::encode($model->fIsDownLoad),\n\t\t\t\t\t\t\t'fCatalogueName'=>CHtml::encode($model->fCatalogueName),\n\t\t\t\t\t\t\t'fFatherNo'=>$model->fFatherCatalogueNo,\n\t\t\t\t\t\t\t'fStatus'=>CHtml::encode($model->fStatus),\n\t\t\t\t\t\t\t'fCreateDate'=>CHtml::encode(empty($model->fCreateDate)?'':date('Y-m-d',$model->fCreateDate)),\n\t\t\t\t\t\t\t'fCreateUser'=>CHtml::encode($model->fCreateUser),\n\t\t\t\t\t\t\t'fUpdateDate'=>CHtml::encode(empty($model->fUpdateDate)?'':date('Y-m-d',$model->fUpdateDate)),\n\t\t\t\t\t\t\t'fUpdateUser'=>CHtml::encode($model->fUpdateUser),\n\t\t\t\t\t\t\t'msg'=>$this->FrameInfo(Yii::app()->params['layouttype']['top'],Yii::t('message','Add Success'),Yii::app()->params['notytype']['success']),\n\t\t\t\t\t))\n\t\t\t));\n\t\t}\n\t}", "public function submit()\n\t{\n\t\t$identifier = $this->sql_id_field;\n\n\t\tif (!$this->$identifier)\n\t\t{\n\t\t\treturn $this->insert();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->update();\n\t\t}\n\t}", "function process_bulk_action()\n {\n global $wpdb;\n $table_name = $wpdb->prefix . 'google_location_form'; // do not forget about tables prefix\n\n if ('delete' === $this->current_action()) {\n $ids = isset($_REQUEST['id']) ? $_REQUEST['id'] : array();\n if (is_array($ids)) $ids = implode(',', $ids);\n\n if (!empty($ids)) {\n $wpdb->query(\"DELETE FROM $table_name WHERE id IN($ids)\");\n }\n }\n }", "public function Insert_act()\n {\n if ($this->Auth) {\n // Logging\n // user_log($this->Session['username'], 'Heeft een activiteit toegevoegd');\n\n $this->Activiteiten->Insert();\n redirect('backend');\n } else {\n // If no session, redirect to login page\n redirect('Admin', 'refresh');\n }\n }", "public function insert() {\n \n }", "public function save($action = '', $data = '', $site_id = ''){\n if($data !== '' && $action === 'new'){\n $result = $this->db->insert('sites_tb', $data);\n return $result;\n }else if($data !== '' && $action === 'existing' && $site_id !== ''){\n $result = $this->db->where('site_id', $site_id)->update('sites_tb', $data);\n return $result;\n }\n }", "protected function _insert()\n\t{\n\t}", "protected function _insert()\n {\n \n }", "protected function _insert()\n {\n \n }", "public function editAction()\n {\n $this->createEditParameters = $this->createEditParameters + $this->_editExtraParameters;\n\n parent::editAction();\n }", "public function processInsert()\n {\n // Validate Request\n $validationRules = $this->getValidationRules();\n // Hook Filter insertModifyValidationRules\n $validationRules = $this->doFilter(\"insertModifyValidationRules\", $validationRules);\n $validationMessages = array();\n // Hook Filter insertModifyValidationMessages\n $validationMessages = $this->doFilter(\"insertModifyValidationMessages\", $validationMessages);\n $validator = Validator::make($this->Request->all(), $validationRules, $validationMessages);\n if ($validator->fails()) {\n if ($this->Request->ajax()) {\n // Send Response\n $JsonResponse = new JsonResponse($validator->errors(), 400);\n $JsonResponse->send();\n exit;\n } else {\n $Response = back()->withErrors($validator)->withInput();\n $this->redirect($Response);\n }\n }\n // Set value for BIT columns\n $this->setValueBitColumns();\n // Set value for BLOB columns\n $requestParameters = $this->Request->all();\n $requestParameters = $this->setValueBlobColumns($requestParameters);\n // Hook Filter insertModifyRequest\n $requestParameters = $this->doFilter(\"insertModifyRequest\", $requestParameters);\n // Insert record\n if ($this->getIsTransaction()) {\n DB::transaction(function ($db) use ($requestParameters) {\n $this->Model->dkCreate($requestParameters);\n // Hook Action insertAfterInsert\n $this->doHooks(\"insertAfterInsert\", array($this->Model));\n });\n } else {\n $this->Model->dkCreate($requestParameters);\n // Hook Action insertAfterInsert\n $this->doHooks(\"insertAfterInsert\", array($this->Model));\n }\n if ($this->Request->ajax()) {\n // Send Response\n $JsonResponse = new JsonResponse(trans('dkscaffolding.notification.insert.success'), 200);\n $JsonResponse = $this->doFilter(\"insertModifyResponse\", $JsonResponse);\n $JsonResponse->send();\n exit;\n } else {\n // Set response redirect to list page and set session flash\n $Response = redirect($this->getFormAction())\n ->with('dk_' . $this->getIdentifier() . '_info_success', trans('dkscaffolding.notification.insert.success'));\n // Hook Filter insertModifyResponse\n $Response = $this->doFilter(\"insertModifyResponse\", $Response);\n $this->redirect($Response);\n }\n }", "public function save(){\r\n return isset($this->id) ? $this->update() : $this->create();\r\n }", "public function deleteAction() {\n \n }", "public function deleteAction()\n {\n \n }", "public function putAction() {\n\t\t$this->_notImplemented();\n\t}", "function inserts()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t$object = ( $this->tasks['inserts'] == 1 ) ? 'Database Row' : 'Database Rows';\n\t\t$operation = ( $this->ipsclass->input['un'] ) ? 'removed' : 'inserted';\n\t\t\n\t\tforeach ( $this->xml_array['inserts_group']['insert'] as $k => $v )\n\t\t{\n\t\t\tif ( !$this->ipsclass->input['un'] )\n\t\t\t{\n\t\t\t\tunset( $f );\n\t\t\t\t\n\t\t\t\tforeach ( $v['fields'] as $kk => $vv )\n\t\t\t\t{\n\t\t\t\t\tif ( strtolower( $kk ) == 'value' )\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$f[ $kk ] = $vv['VALUE'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => $v['table']['VALUE'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => $v['delete_key']['VALUE'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\t\t);\n\t\t\t\t\n\t\t\t\tif ( !$this->ipsclass->DB->get_num_rows() )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->DB->do_insert( $v['table']['VALUE'], $f );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( in_array( SQL_PREFIX.$v['table']['VALUE'], $this->ipsclass->DB->get_table_names() ) )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->DB->do_delete( $v['table']['VALUE'], $v['delete_key']['VALUE'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />{$this->tasks['inserts']} {$object} {$operation}....\" );\n\t}", "public function postAction() {}", "protected function _postInsert()\n\t{\n\t}", "public function deleteAction()\n {\n }", "public function bulk_actions(){\n\t\t$this->autoRender = false;\n\t\t$this->layout = false;\n\t\t\n\t\tif(!$this->_checkSession()){\n\t\t\t$this->Session->setFlash(__(\"<div class=\\\"alert alert-danger\\\" role=\\\"alert\\\">Acess Denied!</div>\"), 'flash_custom');\n\t\t\t$this->redirect(array('action'=>'login'));\n\t\t}\n\t\t\n\t\tif(!$this->request->is('post')){\n\t\t\tdie(\"Access denied!\");\n\t\t}\n\t\t$process_action = $this->request->data['process_action'];\n\t\t$process_model = $this->request->data['process_model'];\n\t\t\n\t\tswitch($process_action){\n\t\t\tcase 'delete':\n\t\t\t\t\t\tif(isset($this->request->data['item_id']) && !empty($this->request->data['item_id'])){\n\t\t\t\t\t\t\tforeach($this->request->data['item_id'] as $item_id){\n\t\t\t\t\t\t\t\t$this->$process_model->id = $item_id;\n\t\t\t\t\t\t\t\t$this->$process_model->delete();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this->Session->setFlash(__('<div class=\"alert alert-success\" role=\"alert\">Records deleted successfully!</div>'), 'flash_custom');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t\t\n\t\t}\n\t\t\t\n\t\t$this->redirect($this->referer());\n\t}", "public function postAction()\n {\n \n }", "public function transactionAction() {\n try {\n $this->datasource->beginTransaction();\n\n $article_id = $this->datasource->insertArticle('John Smith', 'Nice writing');\n\n $this->datasource->deleteArticle($article_id);\n\n $this->datasource->commit();\n\n return ['success' => true];\n\n } catch(Exception $ex) {\n $this->datasource->rollBack();\n throw $ex;\n }\n }", "function insert(){\n //Declarar variables para recibir los datos del formuario nuevo\n $nombre=$_POST['nombre'];\n $apellido=$_POST['apellido'];\n $telefono=$_POST['telefono'];\n\n $this->model->insert(['nombre'=>$nombre,'apellido'=>$apellido,'telefono'=>$telefono]);\n $this->index();\n }", "public function execute()\n {\n DatabaseManager::getInstance()->query(Constants::getInstance()->get('addServiceAction'), [\n ':ACT_NAME' => $this->getRequest()->query->get('name'),\n ':ACT_TYPE' => $this->getRequest()->query->get('type')\n ]);\n\n $this->setMessage('ServiceInsertion', [\n 'item_id' => $this->getInstruction()->getInsertId(),\n 'action_id' => $actionId = DatabaseManager::getInstance()->getLastInsertId()\n ]);\n\n DatabaseManager::getInstance()->query(Constants::getInstance()->get('addServiceActionRelation'),\n [':SRVC_ID' => $this->getInstruction()->getInsertId(), ':ACT_ID' => $actionId]);\n }", "function index_put() {\n $id = $this->put('id');\n $data = array(\n 'id' => $this->put('id'),\n 'nama' => $this->put('nama'),\n 'kode' => $this->put('kode'),\n 'detail' => $this->put('detail'),\n 'created_date' => $this->put('created_date'),\n 'created_by' => $this->put('created_by'),\n 'updated_date' => $this->put('updated_date'),\n 'updated_by' => $this->put('updated_by') \n );\n $this->db->where('id', $id);\n $update = $this->db->update('barang', $data);\n if ($update) {\n $this->response($data, 200);\n } else {\n $this->response(array('status' => 'fail', 502));\n }\n }", "public function index_post()\n {\n $input = $this->input->post();\n $this->db->insert('users',$input);\n \n $this->response(['User created successfully.'], REST_Controller::HTTP_OK);\n }", "public function updateAllActions(){\n\t\t//on recupere toutes les actions\n\t\t$allControleurs = $this->listAllActions();\n\t\t//on filtre celles qui ne sont pas encore en base (active = 0)\n\t\t$updateList = [];\n\t\t$deleteList= [];\n\t\tforeach ($allControleurs as $controleur => $nameControleur):\n\t\t\tforeach ($nameControleur as $action):\n\t\t\t\tif ($action['isActive'] == 0){\n\t\t\t\t\tarray_push($updateList,[$controleur,$action['name']]);\n\t\t\t\t}\n\t\t\t\tif ($action['isActive'] == 2){\n\t\t\t\t\tarray_push($deleteList,[$action['id']]);\n\t\t\t\t}\n\t\t\tendforeach;\n\t\tendforeach;\n\t\tprint_r($deleteList);\n\t\t//insertion en base des actions\t\t\t\t\n\t\t//préparation du sql\n\t\t$sqlValueInsert = '';\n\t\t$sqlValueDelete = '';\n\t\tforeach ($updateList as $item):\n\t\t\t$sqlValueInsert = $sqlValueInsert.\"('\".$item[0].\"','\".$item[1].\"'),\";\n\t\tendforeach;\n\t\tforeach ($deleteList as $item):\n\t\t\t$sqlValueDelete = $sqlValueDelete.\"\".$item[0].\",\";\n\t\tendforeach;\n\t\t$sqlValueDelete= rtrim($sqlValueDelete, \",\");\n\t\t$sqlValueInsert= rtrim($sqlValueInsert, \",\");\n\t\t\n\t\tif ($sqlValueInsert != ''){\n\t\t\t$sql = \"INSERT INTO `actions` (`controleur`, `name`) VALUES \".$sqlValueInsert;\n\t\t\t$insert_actions = $this->executerRequete($sql);\n\t\t\tif ($insert_actions->rowCount() > 0)\n\t\t\t\t$success_insert = 1; // Accès à la première ligne de résultat\n\t\t\telse\n\t\t\t\t$success_insert = 0; \n\t\t}else{\n\t\t\t\t$success_insert = 1; \n\t\t}\n\t\tif ($sqlValueDelete != ''){\n\t\t\t$sql = \"delete from `actions` where id in (\".$sqlValueDelete.\")\";\n\t\t\tvar_dump($sql);\n\t\t\t$delete_actions = $this->executerRequete($sql);\n\t\t\tif ($delete_actions->rowCount() > 0)\n\t\t\t\t$success_delete = 1; // Accès à la première ligne de résultat\n\t\t\telse\n\t\t\t\t$success_delete = 0; \n\t\t}else{\n\t\t\t$success_delete = 1;\n\t\t}\t\t\n\t\tif( $success_delete == 1 && $success_insert == 1){\n\t\t\treturn 1;\n\t\t}else{\n\t\t\treturn 0;\n\t\t}\t\t\n }", "public function postAction()\n {\n }", "public function save() \n\t{\n\t\tif (isset($this->id)) {\t\n\t\t\n\t\t\t// Return update when id exists\n\t\t\treturn $this->update();\n\t\t\t\n\t\t} else {\n\t\t\n\t\t\t// Return insert when id does not exists\n\t\t\treturn $this->insert();\n\t\t}\n\t}", "function insert(){\n $nombre= $_POST['nombre'];\n $apellido= $_POST['apellido'];\n $telefono= $_POST['telefono'];\n\n $this->model->insert(['nombre'=>$nombre , 'apellido'=>$apellido,'telefono'=>$telefono]);\n $url= constant('URL').\"alumno\";\n header(\"Location: $url\");\n // $this->index();\n }", "public function insert(){\n // Access-controlled resource\n if (!$this->_app->user->checkAccess('uri_drone_insert')){\n $this->_app->notFound();\n }\n // do something here\n }", "public function save(){\n\t\ttry {\n\t\t\t$params = array();\n\n\t\t\t//insert\n\t\t\tif( empty($this->_data['id']) ){\n\t\t\t\t$action = 'add';\n\n\t\t\t\t//build the insert starting from self::$fields\n\t\t\t\t$fields = array();\n\t\t\t\t$values = array();\n\n\t\t\t\tforeach( self::$_fields[$this->_table] as $key ){\n\t\t\t\t\tif( $key != 'id' ){\n\t\t\t\t\t\t$fields[] = $key;\n\n\t\t\t\t\t\tif( isset($this->_data[$key]) && !is_null($this->_data[$key]) ){\n\t\t\t\t\t\t\t$values[] = ':'.$key;\n\t\t\t\t\t\t\t$params[':'.$key] = $this->_data[$key];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$values[] = 'NULL';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$fields = implode(', ', $fields);\n\t\t\t\t$values = implode(', ', $values);\n\t\t\t\t$sql = \"INSERT INTO \".$this->_table.\" (\".$fields.\") VALUES (\".$values.\")\";\n\n\t\t\t//update\n\t\t\t} else {\n\t\t\t\t$action = 'update';\n\n\t\t\t\t//build the update starting from self::$fields\n\t\t\t\t$where = '';\n\t\t\t\t$field_value = '';\n\n\t\t\t\tforeach( self::$_fields[$this->_table] as $key ){\n\t\t\t\t\tif( $key == 'id' ){\n\t\t\t\t\t\t$where = ' '.$key.' = :id';\n\t\t\t\t\t\t$params[':id'] = $this->_data[$key];\n\n\t\t\t\t\t} elseif( isset($this->_data[$key]) and !is_null($this->_data[$key]) ){\n\t\t\t\t\t\t$field_value .= ' '.$key.' = :'.$key.',';\n\t\t\t\t\t\t$params[':'.$key] = $this->_data[$key];\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$field_value .= ' '.$key.' = NULL,';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$field_value = substr($field_value, 0, -1);\n\t\t\t\t$sql = \"UPDATE \".$this->_table.\" SET \".$field_value.\" WHERE \".$where;\n\t\t\t}\n\n\t\t\t$q = $this->_db->prepare($sql);\n\n\t\t\t$q->execute($params);\n\n\t\t\tif( empty($this->_data['id']) ){\n\t\t\t\t$this->_data['id'] = $this->_db->lastInsertId();\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t} catch ( PDOException $e ){\n\t\t\terreur_pdo( $e, get_class( $this ), __FUNCTION__ );\n\t\t}\n\t}", "public function save(){\n return isset($this->id) ? $this->update() : $this->create();\n \n }", "protected function deleteAction()\n {\n }", "function handle_actions() {\n $id = filter_input(INPUT_GET, 'id');\n global $subscribers;\n global $log;\n\n // POST\n $action = filter_input(INPUT_POST, 'action');\n if ($action == 'create') { \n $log->log('Subscriber CREATE'); // CREATE\n $subscribers->add();\n }\n \n\n // GET\n $action = filter_input(INPUT_GET, 'action');\n if (empty($action)) { \n $log->log('Subscriber READ'); // READ\n return $subscribers->list_view();\n }\n if ($action == 'add') {\n $log->log('Subscriber Add View');\n return $subscribers->add_view();\n }\n }", "public function index () {\r\n $method = strtoupper($_SERVER['REQUEST_METHOD']);\r\n \r\n switch ($method) {\n case 'GET':\n $this->view();\n break;\n case 'POST':\r\n $this->insert();\r\n break;\r\n case 'PUT':\r\n $this->update();\r\n break;\r\n case 'DELETE':\r\n $this->delete();\r\n break;\n default:\n break;\n }\r\n }", "public function run()\n {\n $user = User::get();\n $action_templates = ActionTemplate::get();\n $now = Carbon::now();\n\n $param = [\n [\n 'user_id' => $user[0]->id,\n 'action_template_id' => $action_templates[0]->id,\n 'created_at' => $now,\n 'updated_at' => $now\n ],\n [\n 'user_id' => $user[0]->id,\n 'action_template_id' => $action_templates[1]->id,\n 'created_at' => $now,\n 'updated_at' => $now\n ],\n [\n 'user_id' => $user[0]->id,\n 'action_template_id' => $action_templates[2]->id,\n 'created_at' => $now,\n 'updated_at' => $now\n ],\n ];\n\n DB::table('users_actions')->insert($param);\n }", "public function index_post()\n {\n $input = $this->input->post();\n $this->db->insert('mst_raw_material',$input);\n \n $this->response(['Item created successfully.','201'], REST_Controller::HTTP_OK);\n }", "public function actionUpdate()\n\t{\n\t parent::actionUpdate();\n\t $dodetail=new Dodetail('search');\n\t $dodetail->unsetAttributes(); // clear any default values\n\t if(isset($_GET['Dodetail']))\n\t\t$dodetail->attributes=$_GET['Dodetail'];\n\n\t\t$customer=new Customer('search');\n\t $customer->unsetAttributes(); // clear any default values\n\t if(isset($_GET['Customer']))\n\t\t$customer->attributes=$_GET['Customer'];\n\n\t\t$product=new Product('search');\n\t $product->unsetAttributes(); // clear any default values\n\t if(isset($_GET['Product']))\n\t\t$product->attributes=$_GET['Product'];\n\n\t\t$unitofmeasure=new Unitofmeasure('search');\n\t $unitofmeasure->unsetAttributes(); // clear any default values\n\t if(isset($_GET['Unitofmeasure']))\n\t\t$unitofmeasure->attributes=$_GET['Unitofmeasure'];\n\n $soheader=new Soheader('search');\n\t $soheader->unsetAttributes(); // clear any default values\n\t if(isset($_GET['Soheader']))\n\t\t$soheader->attributes=$_GET['Soheader'];\n\n $project=new Project('search');\n\t $project->unsetAttributes(); // clear any default values\n\t if(isset($_GET['Project']))\n\t\t$project->attributes=$_GET['Project'];\n\n\t\t$id=$_POST['id'];\n\t $model=$this->loadModel($id[0]);\nif ($model != null)\n {\n if ($this->CheckDataLock($this->menuname, $id[0]) == false)\n {\n $this->InsertLock($this->menuname, $id[0]);\n echo CJSON::encode(array(\n 'status'=>'success',\n\t\t\t\t'doheaderid'=>$model->doheaderid,\n\t\t\t\t'dono'=>$model->dono,\n\t\t\t\t'dodate'=>$model->dodate,\n\t\t\t\t'postdate'=>$model->postdate,\n 'soheaderid'=>$model->soheaderid,\n 'sono'=>($model->soheader!==null)?$model->soheader->sono:\"\",\n 'projectid'=>$model->projectid,\n 'projectno'=>($model->project!==null)?$model->project->projectno:\"\",\n\t\t\t\t'addressbookid'=>$model->addressbookid,\n\t\t\t\t'fullname'=>($model->customer!==null)?$model->customer->fullname:\"\",\n\t\t\t\t'recordstatus'=>$model->recordstatus,\n 'div'=>$this->renderPartial('_form', array('model'=>$model,\n\t\t\t\t\t'dodetail'=>$dodetail,\n\t\t\t\t\t'customer'=>$customer,\n\t\t\t\t\t'product'=>$product,\n\t\t\t\t\t'unitofmeasure'=>$unitofmeasure,\n 'soheader'=>$soheader,\n 'project'=>$project), true)\n\t\t\t\t));\n Yii::app()->end();\n }\n }\n\t}", "public function Create($params = array()) \n { \n $this->Update($params); \n }", "public function Create($params = array()) \n { \n $this->Update($params); \n }", "protected function SaveActionIdToComment()\n {\n $sActionId = TTools::GetUUID();\n $this->sqlData['action_id'] = $sActionId;\n $this->AllowEditByAll(true);\n $this->Save();\n $this->AllowEditByAll(false);\n }", "public function commit() {\n\t$idAvailable = \\is_numeric($this->getId());\n\t//We're checking if the id is available and it's marked for delete. If not, we need to check if the id is available.\n\t//Finally, we need to make sure it hasn't been marked for delete. if it has and there's no id, nothing needs to be\n\t//done.\n\tif ($idAvailable && $this->_markForDelete) {\n\t $this->delete();\n\t}\n\telse if ($idAvailable) {\n\t $this->update();\n\t}\n\telse if (!$this->_markForDelete) {\n\t $this->insert();\n\t}\n }" ]
[ "0.72144425", "0.7141254", "0.67431885", "0.6656521", "0.6656521", "0.66423965", "0.6595205", "0.6592592", "0.64974916", "0.6487419", "0.6466672", "0.6415162", "0.6410732", "0.6296168", "0.6285263", "0.6277352", "0.6265169", "0.62626046", "0.6243847", "0.6233441", "0.62292176", "0.6214185", "0.62078214", "0.6199261", "0.6199261", "0.6194861", "0.61897814", "0.6161337", "0.6121931", "0.6112573", "0.6111399", "0.6106797", "0.6048375", "0.6046243", "0.6038464", "0.6035309", "0.6034455", "0.60196686", "0.6016855", "0.6004826", "0.6004826", "0.59870905", "0.59736127", "0.59736127", "0.59732926", "0.59700644", "0.59690666", "0.59686095", "0.59656817", "0.59636235", "0.5962654", "0.5961975", "0.5949993", "0.5945138", "0.59425354", "0.59387285", "0.5937732", "0.5932294", "0.5930932", "0.59236187", "0.591847", "0.5915543", "0.58957344", "0.58908236", "0.5890319", "0.5886488", "0.5886488", "0.5879679", "0.587242", "0.5863809", "0.5847828", "0.5840083", "0.58321285", "0.58238536", "0.58216166", "0.5812378", "0.58107847", "0.5807005", "0.5800998", "0.57998025", "0.5795694", "0.5795514", "0.57942027", "0.5792987", "0.5777892", "0.57768387", "0.5768552", "0.5767804", "0.5767532", "0.5765215", "0.5762997", "0.5762742", "0.5761014", "0.57588774", "0.57570994", "0.57553077", "0.5752004", "0.57515943", "0.57515943", "0.5744513", "0.57444745" ]
0.0
-1
For internal only. DO NOT USE IT.
public function deserialize($param) { if ($param === null) { return; } if (array_key_exists("Time",$param) and $param["Time"] !== null) { $this->Time = $param["Time"]; } if (array_key_exists("CompanyId",$param) and $param["CompanyId"] !== null) { $this->CompanyId = $param["CompanyId"]; } if (array_key_exists("ShopId",$param) and $param["ShopId"] !== null) { $this->ShopId = $param["ShopId"]; } if (array_key_exists("StartDay",$param) and $param["StartDay"] !== null) { $this->StartDay = $param["StartDay"]; } if (array_key_exists("EndDay",$param) and $param["EndDay"] !== null) { $this->EndDay = $param["EndDay"]; } if (array_key_exists("Limit",$param) and $param["Limit"] !== null) { $this->Limit = $param["Limit"]; } if (array_key_exists("Offset",$param) and $param["Offset"] !== null) { $this->Offset = $param["Offset"]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function __init__() { }", "private function __() {\n }", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "private function __construct()\t{}", "private function init()\n\t{\n\t\treturn;\n\t}", "final private function __construct() {}", "final private function __construct() {}", "final private function __construct(){\r\r\n\t}", "final private function __construct() {\n\t\t\t}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "private function _i() {\n }", "protected function fixSelf() {}", "protected function fixSelf() {}", "protected final function __construct() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function init()\n\t{\n\t\t\n\t}", "private function __construct() {\r\n\t\r\n\t}", "private function __construct() {\r\n\t\t\r\n\t}", "protected function init() {return;}", "final private function __construct()\n\t{\n\t}", "private function __construct () {}", "final private function __construct()\n {\n }", "private final function __construct() {}", "public function __init(){}", "public function helper()\n\t{\n\t\n\t}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct()\n\t{\n\t\t\n\t}" ]
[ "0.62662613", "0.6151871", "0.5989886", "0.5989886", "0.5989886", "0.5989886", "0.5989418", "0.5989418", "0.5989418", "0.5989418", "0.5989418", "0.5989418", "0.5988404", "0.5988404", "0.5949015", "0.5939596", "0.59168774", "0.59168774", "0.58703923", "0.58665824", "0.5855589", "0.5855589", "0.5855589", "0.5799749", "0.5797107", "0.5797107", "0.57807934", "0.5749856", "0.5749856", "0.5749856", "0.5749856", "0.57458705", "0.5741364", "0.571247", "0.5701768", "0.5694139", "0.5680823", "0.5673589", "0.5668696", "0.5640213", "0.5639332", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5626381", "0.56240404", "0.56240404", "0.5610547" ]
0.0
-1
Grocery Crud callback functions
public function callback_before_create_user($post_array) { $post_array['password'] = hash_pw($post_array['password']); return $post_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function distributors_list(){\r\n \r\n $crud = new grocery_CRUD();\r\n \r\n $crud->set_table('distributors');\r\n $crud->set_subject('Distributor');\r\n\r\n $crud->columns('id','company_name','contact_name','number','email','address');\r\n $crud->display_as('contact_name','Contact Person'); \r\n $crud->display_as('number','Phone Number'); \r\n\r\n $crud->callback_column('company_name',array($this,'_callback_distributor_links')); \r\n\r\n $crud->unset_delete();\r\n $crud->unset_add();\r\n $crud->unset_edit();\r\n\r\n //this is for tracking because i cannot pass a table var to the tracking functions below\r\n $this->session->set_userdata(array('table' => 'distributors'));\r\n\r\n $crud->callback_after_insert(array($this, 'track_insert'));\r\n $crud->callback_after_update(array($this, 'track_update'));\r\n\r\n $output = $crud->render();\r\n\r\n $output->page_title = 'Spazapp Distributors Orders';\r\n\r\n $this->crud_view($output);\r\n }", "public function index(){\n $crud = new grocery_CRUD();\n $crud->set_subject('Datos de la importadora');\n $crud->set_crud_url_path(base_url('importadora/index'));\n\n $crud->set_table('importadora');\n $crud->columns('nombre', 'ruc', 'direccion', 'telefono', 'correo');\n $crud->display_as('nombre', 'Nombre')\n ->display_as('ruc', 'RUC')\n ->display_as('direccion', 'Dirección')\n ->display_as('telefono', 'Teléfono celular')\n ->display_as('correo', 'Correo de la importadora');\n //$crud->unset_columns('idimportadora');\n\n $crud->edit_fields('nombre', 'ruc', 'telefono', 'correo', 'direccion');\n $crud->required_fields('nombre','ruc','telefono', 'correo');\n\n $crud->field_type('ruc', 'integer');\n $crud->set_rules('nombre', 'Nombre', 'min_length[5]|max_length[50]|callback_validar_edit_ruc|required' );\n $crud->set_rules('ruc', 'RUC', 'min_length[13]|max_length[13]|callback_validar_edit_ruc|required' );\n $crud->set_rules('correo', 'Correo de la importadora', 'trim|valid_email|max_length[100]|required');\n $crud->set_rules('telefono', 'Teléfono de la importadora', 'min_length[8]|max_length[10]|required');\n $crud->field_type('telefono', 'integer');\n $crud->field_type('direccion', 'string');\n\n $crud->callback_field('nombre',function ($value = '', $primary_key = null) {\n return '<input type=\"text\" maxlength=\"50\" value=\"'.$value.'\" class=\"form-control\" required id=\"nombre\" name=\"nombre\">';\n });\n $crud->callback_field('correo',function ($value = '', $primary_key = null) {\n return '<input type=\"email\" maxlength=\"50\" value=\"'.$value.'\" title=\"Introduzca una dirección de correo válida\" class=\"form-control\" pattern=\"[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*@[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{1,5}\" required name=\"correo\">';\n });\n\n $crud->unset_add();\n $crud->unset_delete();\n $this->_example_output($crud);\n }", "function customers_management()\n\t{\n\t\t\t//GROCERY CRUD SETUP\n\t\t\t$crud = new grocery_CRUD();\n\n\t\t\t$crud->set_table('customers');\n\t\t\t$crud->columns('salesRepEmployeeNumber','customerName','contactLastName','phone','countryID','stateID','cityID');\n\t\t\t$crud->display_as('salesRepEmployeeNumber','From Employeer')\n\t\t\t\t ->display_as('customerName','Name')\n\t\t\t\t ->display_as('cityID','City/Town')\n\t\t\t\t ->display_as('stateID','State/Province')\n\t\t\t\t ->display_as('countryID','Country')\n\t\t\t\t ->display_as('contactLastName','Last Name');\n\t\t\t$crud->set_subject('Customer');\n\t\t\t$crud->set_relation('salesRepEmployeeNumber','employees','extension');\n\t\t\t$crud->set_relation('countryID','country','country_title');\n\t\t\t$crud->set_relation('stateID','state','state_title');\n\t\t\t$crud->set_relation('cityID','city','city_title');\n\t\t\t$crud->fields('customerName','contactLastName','phone','countryID','stateID','cityID');\n\t\t\t$crud->required_fields('countryID','stateID','cityID');\t\t\n\t\t\t\n\t\t\t//IF YOU HAVE A LARGE AMOUNT OF DATA, ENABLE THE CALLBACKS BELOW - FOR EXAMPLE ONE USER HAD 36000 CITIES AND SLOWERD UP THE LOADING PROCESS. THESE CALLBACKS WILL LOAD EMPTY SELECT FIELDS THEN POPULATE THEM AFTERWARDS\n\t\t\t$crud->callback_add_field('stateID', array($this, 'empty_state_dropdown_select'));\n\t\t\t$crud->callback_edit_field('stateID', array($this, 'empty_state_dropdown_select'));\n\t\t\t$crud->callback_add_field('cityID', array($this, 'empty_city_dropdown_select'));\n\t\t\t$crud->callback_edit_field('cityID', array($this, 'empty_city_dropdown_select'));\n\t\t\t\t\t\t\n\t\t\t$output = $crud->render();\n\t\t\t\n\t\t\t//DEPENDENT DROPDOWN SETUP\n\t\t\t$dd_data = array(\n\t\t\t\t//GET THE STATE OF THE CURRENT PAGE - E.G LIST | ADD\n\t\t\t\t'dd_state' => $crud->getState(),\n\t\t\t\t//SETUP YOUR DROPDOWNS\n\t\t\t\t//Parent field item always listed first in array, in this case countryID\n\t\t\t\t//Child field items need to follow in order, e.g stateID then cityID\n\t\t\t\t'dd_dropdowns' => array('countryID','stateID','cityID'),\n\t\t\t\t//SETUP URL POST FOR EACH CHILD\n\t\t\t\t//List in order as per above\n\t\t\t\t'dd_url' => array('', site_url().'/examples/get_states/', site_url().'/examples/get_cities/'),\n\t\t\t\t//LOADER THAT GETS DISPLAYED NEXT TO THE PARENT DROPDOWN WHILE THE CHILD LOADS\n\t\t\t\t'dd_ajax_loader' => base_url().'ajax-loader.gif'\n\t\t\t);\n\t\t\t$output->dropdown_setup = $dd_data;\n\t\t\t\n\t\t\t$this->_example_output($output);\n\t}", "public function index()\n {\n try{\n $crud = new grocery_CRUD();\n $crud->set_theme('mybootstrap');\n $crud->unset_delete();//grid\n $crud->set_table('project');\n $crud->set_subject('Projects');\n $crud->fields('name', 'template', 'slug','status');\n $crud->required_fields('name');\n $crud->callback_before_insert(array($this,'configure_slug'));\n $crud->callback_before_update(array($this,'configure_slug'));\n $crud->unset_export();\n $crud->unset_print();\n $output = $crud->render();\n $output->title_page = $this->lang->line('admin_project_title');\n $output->main_content = $this->config->item('rpt_views') . 'admin';\n $this->load->view( $this->config->item('rpt_base_template'),$output);\n }catch(Exception $e){\n show_error($e->getMessage().' --- '.$e->getTraceAsString());\n }\n }", "public function index()\n\t{\n if(!$this->esta_logueado()){\n\n redirect(site_url('proyect/login'));\n\n }else{\n\n\n\n\n\n try{\n\n //crear crud\n $crud = new grocery_CRUD();\n $crud->set_theme('twitter-bootstrap');\n $crud->set_table('tareas');\n\n\n\n\n $crud->unset_operations();\n\n $crud->columns('nombre','proyecto','empleado','fecha_inicio','fecha_fin','prioridad','estado');\n\n $crud->set_subject('Mis tareas pendientes');\n\n\n $usuario = $this->session->userdata('logged_in');\n $crud->where('empleado',$usuario['id']);\n\n $crud->where('fecha_fin', date('Y/m/d') );\n $crud->where('estado != ', '2' );\n\n\n $crud->order_by('prioridad','desc');\n\n $crud->callback_after_insert(array($this, 'notificar1'));\n $crud->callback_after_update(array($this, 'notificar2'));\n\n $crud->set_relation('proyecto','proyectos','Nombre');\n $crud->set_relation('empleado','empleados','Nombres');\n\n $crud->field_type('estado','dropdown',\n array('1' => 'Activa', '2' => 'Terminanda','3' => 'retrasada'));\n\n $crud->field_type('prioridad','dropdown',\n array('1' => 'Vida o Muerte', '2' => 'Alto','3' => 'Medio' , '4' => 'Bajo'));\n\n\n //buscar tareas no terminadas el dia de ayer para auto agendarlas\n $fecha_actual = date('Y/m/d');\n $ayer = strtotime ( '-1 day' , strtotime ( $fecha_actual ) ) ;\n $ayer = date ( 'Y/m/d' , $ayer );\n\n $tareas_retrazadas = $this->db->query(\"select id from tareas where fecha_fin = '$ayer' and estado <> '2'\")->result();\n\n $ids = array();\n //hay tareas retrazadas?\n if($tareas_retrazadas > 0){\n\n\n //actualizar fecha final y colocar estado en atrazada\n foreach($tareas_retrazadas as $tarea){\n $tarea->id;\n $id = $tarea->id;\n\n $this->db->query(\"update tareas set estado = '3' and fecha_fin = '$fecha_actual' where (id = '$id')\");\n\n\n }\n\n\n\n\n\n }\n\n\n\n $output = $crud->render();\n\n $this->load->view('dashboard.php',$output);\n\n }catch(Exception $e){\n show_error($e->getMessage().' --- '.$e->getTraceAsString());\n }\n\n }\n\n\t}", "public function tasksCrud(){\n\t\t// Istanzio Grocery Crud\n\t\t$crud = new grocery_CRUD();\n\t\t$crud->set_model('Mod_GCR');\n\t\t$crud->set_theme('bootstrap');\n\t\t$crud->set_language('italian');\n\t\t$crud->set_table('tasks');\n\t\t// Imposto le relazioni con la tabella tasks_categorie\n\t\t$crud->set_relation('id_categoria','tasks_categorie','categoria');\n\t\t// Nascondo\n\t\t$crud->unset_columns(array('id_reparto'));\n\t\t$crud->unset_delete();\n\t\t$crud->unset_bootstrap();\n\t\t$output = $crud->render();\n\n\t\t// Definisco le opzioni\n\t\t$opzioni=array();\n\t\t// Carico la vista\n\t\t$this->opzioni=array(\"datatables\",\"fullcalendar\");\n\t\t$this->codemakers->genera_vista_aqp('crud',$output,$this->opzioni);\n\t}", "public function crudUpdated()\n {\n }", "function listar1()\n\t{\n\t\t\t//GROCERY CRUD SETUP\n\t\t\t\n\t\t\t\n\t\t\t// aca tomo la sede:\n\t\t\t$permiso_sede = $this->session->userdata('sede');\n\t\t\t$crud = new grocery_CRUD();\n\t\t\t$crud->set_table('entregas');\n\t\t\t$crud->set_language('spanish');\n\t\t\t$crud->where('entregas.id_sede',$permiso_sede);\n\t\t\t$crud->unset_delete();\n\t\t\n\t\t\t//agregar habilitado\n\t\t\t$crud->set_relation('id_equipo','equipos','codigo_equipo','id_sede= \"'.$this->session->userdata('sede_filtro').'\" and estado_equipo=\"'.$this->parametros_model->obtener_id_parametro(\"estado equipo\",\"Operativa\").'\"');\n\t\t\t\n\t\t\t$crud->columns('id_insumo','id_equipo','id_sector','nro_ticket','fecha_entrega','estado','observaciones','usuario_entrega');\n\t\t\t//$crud->add_fields('id_sede','id_sector','estado','id_equipo','id_insumo','fecha_entrega','observaciones','nro_ticket','usuario_entrega', 'cantidad', 'contador');\n\t\t\t\n\t\t\t$crud->display_as('id_insumo','Insumo')\n\t\t\t\t ->display_as('id_equipo','Equipo')\n\t\t\t\t ->display_as('id_sector','Sector');\n\t\t\t$crud->set_subject('Entrega');\n\t\t\t\t\t//anulo todas las acciones salvo agregar para usar solo el crud definido en listar\n\t\t\t $crud->unset_list(); \n\t\t\t $crud->unset_delete();\n \t $crud->unset_read();\n $crud->unset_edit();\n $crud->unset_export();\n $crud->unset_print();\n\t\t\t\n\t\t\t$crud->set_relation('id_insumo','Insumos','codigo_insumo', 'habilitado=\"1\"');\n\t\t\t\n\t\t\t//por algun no olcutaba el campo preguntando si el estado era add y era a causa del relation... y como la necestio en list y edit lo deje asi\n\n\t\t\tif ($crud->getState() != 'add') \n{\n\t $crud->set_relation('estado','parametros','valor','nombre_parametro=\"estado_entrega\" and habilitado=\"1\"');\n\t \n\t\n}\n// idem estado pero con sector\n\t\t\tif (($crud->getState() != 'add') and ($crud->getState() != 'edit'))\n{\n\t \n\t $crud->set_relation('id_sector','sectores','nombre_sector');\n\t\n}\n\n\t\t\tif ($crud->getState() == 'add') \n{\n\n$crud->change_field_type('id_sector','invisible');\n$crud->change_field_type('estado','invisible');\n $crud->change_field_type('id_sede','invisible');\n $crud->change_field_type('usuario_entrega','invisible');\n $crud->change_field_type('fecha_entrega','invisible');\n $crud->change_field_type('cantidad','invisible');\n \n}\n\t\t\tif ($this->grocery_crud->getState() == 'edit') \n{\n/*$uri = $this->uri->segment(3);\n $this->session->set_userdata('insumo_actual', $uri);*/\n $crud->change_field_type('id_sede','invisible');\n $crud->change_field_type('usuario_entrega','invisible');\n $crud->change_field_type('fecha_entrega','invisible');\n $crud->change_field_type('id_sector','invisible');\n $crud->change_field_type('cantidad','invisible');\n \t\n \n}\n\t\t/* validaciones */\n\t\t\n\t\t$crud->set_rules('id_equipo', 'Equipo','trim|required');\n\t\t $crud->set_rules('id_insumo', 'Insumo','trim|required|callback_insumo_check');\n\t\t//$crud->set_rules('observaciones', 'observaciones','trim|required');\n\t\t//$crud->set_rules('id_equipo','id_equipo','required');\n\t\t//$crud->set_rules('nro_ticket','nro_ticket','numeric');\n\t\t//$crud->set_rules('id_insumo', 'Insumo', 'callback_insumo_check');\n\t\t//$crud->required_fields('id_equipo','id_insumo');\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t//IF YOU HAVE A LARGE AMOUNT OF DATA, ENABLE THE CALLBACKS BELOW - FOR EXAMPLE ONE USER HAD 36000 CITIES AND SLOWERD UP THE LOADING PROCESS. THESE CALLBACKS WILL LOAD EMPTY SELECT FIELDS THEN POPULATE THEM AFTERWARDS\n\t\t\n\t\t $crud->callback_add_field('id_insumo', array($this, 'empty_state_dropdown_select'));\n\t\t\t$crud->callback_edit_field('id_insumo', array($this, 'empty_state_dropdown_select'));\n\t\t\t$crud->callback_after_insert(array($this, 'after_insert1'));\n\t\t\t\n\t\t\t$crud->callback_before_insert(array($this,'before_insert1')); \t\n\t\t\t$crud->callback_before_update(array($this,'before_update1'));\t\n\t\t\ttry {\n \n $output = $crud->render(); //this will raise an exception when the action is list\n\n //$this->template->load('template', 'default_view', $output);\n \n } catch (Exception $e) {\n\n if ($e->getCode() == 14) { //The 14 is the code of the error on grocery CRUD (don't have permission).\n //redirect using your user id\n redirect(strtolower(__CLASS__) . '/listar');\n \n } else {\n show_error($e->getMessage());\n return false;\n }\n\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t//DEPENDENT DROPDOWN SETUP\n\t\t\t$dd_data = array(\n\t\t\t\t//GET THE STATE OF THE CURRENT PAGE - E.G LIST | ADD\n\t\t\t\t'dd_state' => $crud->getState(),\n\t\t\t\t//SETUP YOUR DROPDOWNS\n\t\t\t\t//Parent field item always listed first in array, in this case countryID\n\t\t\t\t//Child field items need to follow in order, e.g stateID then cityID\n\t\t\t\t'dd_dropdowns' => array('id_equipo','id_insumo'),\n\t\t\t\t//SETUP URL POST FOR EACH CHILD\n\t\t\t\t//List in order as per above\n\t\t\t\t'dd_url' => array('', site_url().'/entregas/get_states/'),\n\t\t\t\t//LOADER THAT GETS DISPLAYED NEXT TO THE PARENT DROPDOWN WHILE THE CHILD LOADS\n\t\t\t\t'dd_ajax_loader' => base_url().'ajax-loader.gif'\n\t\t\t);\n\t\t\t$output->dropdown_setup = $dd_data;\n\t\t\t$output->content_view='crud_content_view';\n\t\t\t$this->_example_output($output);\n\t}", "function listar2()\n\t{\n\t\t\n\t\t\t$permiso_sede = $this->session->userdata('sede');\n\t\t\t//GROCERY CRUD SETUP\n\t\t\t$crud = new grocery_CRUD();\n\t\t\t$crud->set_table('entregas');\n\t\t\t$crud->where('entregas.id_sede',$permiso_sede);\n\t\t\t$crud->set_language('spanish');\n\t\t\t$crud->set_relation('id_equipo','equipos','codigo_equipo');\n\t\t\t\t\t\n\t\t\t$crud->unset_delete();\n\t\t\t$crud->columns('id_insumo','id_equipo','id_sector','fecha_entrega','estado','observaciones','usuario_entrega');\n\t\t\t$crud->add_fields('id_sede','id_sector','estado','id_insumo','id_equipo','fecha_entrega','observaciones','nro_ticket','usuario_entrega', 'cantidad');\n\t\t\t\n\t\t\t$crud->display_as('id_insumo','Insumo')\n\t\t\t\t ->display_as('id_equipo','Equipo')\n\t\t\t\t ->display_as('id_sector','Sector');\n\t\t\t$crud->set_subject('Entrega');\n\t\t\t\n\t\t\t$crud->set_relation('id_insumo','Insumos','codigo_insumo');\n\t\t\t\n\t\t\t//anulo todas las acciones salvo agregar para usar solo el crud definido en listar\n\t\t\t $crud->unset_list(); \n\t\t\t $crud->unset_delete();\n \t $crud->unset_read();\n $crud->unset_edit();\n $crud->unset_export();\n $crud->unset_print();\n\t\t\t\n\t\t\t//por algun no olcutaba el campo preguntando si el estado era add y era a causa del relation... y como la necestio en list y edit lo deje asi\n\t\t\tif ($crud->getState() != 'add') \n{\n\t $crud->set_relation('estado','parametros','valor','nombre_parametro=\"estado_entrega\"');\n\t \n\t\n}\n// idem estado pero con sector\n\t\t\tif (($crud->getState() != 'add') and ($crud->getState() != 'edit'))\n{\n\t \n\t $crud->set_relation('id_sector','sectores','nombre_sector');\n\t\n}\n\n\t\t\tif ($crud->getState() == 'add') \n{\n\n$crud->change_field_type('id_sector','invisible');\n$crud->change_field_type('estado','invisible');\n $crud->change_field_type('id_sede','invisible');\n $crud->change_field_type('usuario_entrega','invisible');\n $crud->change_field_type('fecha_entrega','invisible');\n $crud->change_field_type('cantidad','invisible');\n \n}\n\t\t\tif ($this->grocery_crud->getState() == 'edit') \n{\n\t$uri = $this->uri->segment(3);\n $this->session->set_userdata('insumo_actual', $uri);\n $crud->change_field_type('id_sede','invisible');\n $crud->change_field_type('usuario_entrega','invisible');\n $crud->change_field_type('fecha_entrega','invisible');\n $crud->change_field_type('id_sector','invisible');\n $crud->change_field_type('cantidad','invisible');\n \t\n \n}\n\t\t\t\n\t\t\t//IF YOU HAVE A LARGE AMOUNT OF DATA, ENABLE THE CALLBACKS BELOW - FOR EXAMPLE ONE USER HAD 36000 CITIES AND SLOWERD UP THE LOADING PROCESS. THESE CALLBACKS WILL LOAD EMPTY SELECT FIELDS THEN POPULATE THEM AFTERWARDS\n\t\t\n\t\t $crud->callback_add_field('id_equipo', array($this, 'empty_state_dropdown_select1'));\n\t\t //si no viene del abm insumos la variable de arriba trae el valor \"add\" caso contrario trae id de insumo y ahi llamo al callback\n\t\t if ($this->uri->segment(3) != \"add\")\n\t\t {$crud->callback_add_field('id_insumo', array($this, 'carga_insumo1'));}\n\t\t\t\n\t\t\t$crud->callback_edit_field('id_equipo', array($this, 'empty_state_dropdown_select1'));\n\t\t\t$crud->callback_after_insert(array($this, 'after_insert1'));\n\t\t\t$crud->callback_before_update(array($this,'before_update1'));\n\t\t\t$crud->callback_before_insert(array($this,'before_insert1')); \t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\ttry {\n \n $output = $crud->render(); //this will raise an exception when the action is list\n\n //$this->template->load('template', 'default_view', $output);\n \n } catch (Exception $e) {\n\n if ($e->getCode() == 14) { //The 14 is the code of the error on grocery CRUD (don't have permission).\n //redirect using your user id\n redirect(strtolower(__CLASS__) . '/listar');\n \n } else {\n show_error($e->getMessage());\n return false;\n }\n\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t//DEPENDENT DROPDOWN SETUP\n\t\t\t$dd_data = array(\n\t\t\t\t//GET THE STATE OF THE CURRENT PAGE - E.G LIST | ADD\n\t\t\t\t'dd_state' => $crud->getState(),\n\t\t\t\t//SETUP YOUR DROPDOWNS\n\t\t\t\t//Parent field item always listed first in array, in this case countryID\n\t\t\t\t//Child field items need to follow in order, e.g stateID then cityID\n\t\t\t\t'dd_dropdowns' => array('id_insumo','id_equipo'),\n\t\t\t\t//SETUP URL POST FOR EACH CHILD\n\t\t\t\t//List in order as per above\n\t\t\t\t'dd_url' => array('', site_url().'/entregas/get_states1/'),\n\t\t\t\t//LOADER THAT GETS DISPLAYED NEXT TO THE PARENT DROPDOWN WHILE THE CHILD LOADS\n\t\t\t\t'dd_ajax_loader' => base_url().'ajax-loader.gif'\n\t\t\t);\n\t\t\t$output->dropdown_setup = $dd_data;\n\t\t\t$output->content_view='crud_content_view';\n\t\t\t$this->_example_output($output);\n\t}", "function reporte000()\n\t{\n\t\t\t//GROCERY CRUD SETUP\n\t\t\t\n\t\t\t\n\t\t\t// aca tomo la sede:\n\t\t\t$permiso_sede = $this->session->userdata('sede');\n\t\t\t$crud = new grocery_CRUD();\n\t\t\t$crud->set_table('entregas');\n\t\t\t$crud->set_language('spanish');\n\t\t\t$crud->where('entregas.id_sede',$permiso_sede);\n\t\t\t$crud->set_relation('id_equipo','equipos','codigo_equipo','id_sede= \"'.$this->session->userdata('sede_filtro').'\" and estado_equipo=\"'.$this->parametros_model->obtener_id_parametro(\"estado equipo\",\"deshabilitado\").'\"');\n\t\t\t$crud->columns('id_insumo','id_equipo','id_sector','nro_ticket','fecha_entrega','estado','observaciones','usuario_entrega');\n\t\t\t$crud->add_fields('id_sede','id_sector','estado','id_equipo','id_insumo','fecha_entrega','observaciones','nro_ticket','usuario_entrega', 'cantidad', 'contador');\n\t\t\t\n\t\t\t$crud->display_as('id_insumo','Insumo')\n\t\t\t\t ->display_as('id_equipo','Equipo')\n\t\t\t\t ->display_as('id_sector','Sector');\n\t\t\t$crud->set_subject('Entrega');\n\t\t\t\t\t//anulo todas las acciones salvo agregar para usar solo el crud definido en listar\n\t\t\t $crud->unset_list(); \n\t\t\t $crud->unset_delete();\n \t $crud->unset_read();\n $crud->unset_edit();\n $crud->unset_export();\n $crud->unset_print();\n\t\t\t\n\t\t\t$crud->set_relation('id_insumo','Insumos','codigo_insumo');\n\t\t\t\n\t\t\t//por algun no olcutaba el campo preguntando si el estado era add y era a causa del relation... y como la necestio en list y edit lo deje asi\n\n\t\t\tif ($crud->getState() != 'add') \n{\n\t $crud->set_relation('estado','parametros','valor','nombre_parametro=\"estado_entrega\"');\n\t \n\t\n}\n// idem estado pero con sector\n\t\t\tif (($crud->getState() != 'add') and ($crud->getState() != 'edit'))\n{\n\t \n\t $crud->set_relation('id_sector','sectores','nombre_sector');\n\t\n}\n\n\t\t\tif ($crud->getState() == 'add') \n{\n\n$crud->change_field_type('id_sector','invisible');\n$crud->change_field_type('estado','invisible');\n $crud->change_field_type('id_sede','invisible');\n $crud->change_field_type('usuario_entrega','invisible');\n $crud->change_field_type('fecha_entrega','invisible');\n $crud->change_field_type('cantidad','invisible');\n \n}\n\t\t\tif ($this->grocery_crud->getState() == 'edit') \n{\n/*$uri = $this->uri->segment(3);\n $this->session->set_userdata('insumo_actual', $uri);*/\n $crud->change_field_type('id_sede','invisible');\n $crud->change_field_type('usuario_entrega','invisible');\n $crud->change_field_type('fecha_entrega','invisible');\n $crud->change_field_type('id_sector','invisible');\n $crud->change_field_type('cantidad','invisible');\n \t\n \n}\n\t\t/* validaciones */\n\t\t\n\t\t$crud->set_rules('id_equipo', 'Equipo','trim|required');\n\t\t $crud->set_rules('id_insumo', 'id_insumo','trim|required|callback_insumo_check');\n\t\t//$crud->set_rules('observaciones', 'observaciones','trim|required');\n\t\t//$crud->set_rules('id_equipo','id_equipo','required');\n\t\t//$crud->set_rules('nro_ticket','nro_ticket','numeric');\n\t\t//$crud->set_rules('id_insumo', 'Insumo', 'callback_insumo_check');\n\t\t//$crud->required_fields('id_equipo','id_insumo');\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t//IF YOU HAVE A LARGE AMOUNT OF DATA, ENABLE THE CALLBACKS BELOW - FOR EXAMPLE ONE USER HAD 36000 CITIES AND SLOWERD UP THE LOADING PROCESS. THESE CALLBACKS WILL LOAD EMPTY SELECT FIELDS THEN POPULATE THEM AFTERWARDS\n\t\t\n\t\t $crud->callback_add_field('id_insumo', array($this, 'empty_state_dropdown_select'));\n\t\t\t$crud->callback_edit_field('id_insumo', array($this, 'empty_state_dropdown_select'));\n\t\t\t$crud->callback_after_insert(array($this, 'after_insert1'));\n\t\t\t\n\t\t\t$crud->callback_before_insert(array($this,'before_insert1')); \t\n\t\t\t$crud->callback_before_update(array($this,'before_update1'));\t\n\t\t\ttry {\n \n $output = $crud->render(); //this will raise an exception when the action is list\n\n //$this->template->load('template', 'default_view', $output);\n \n } catch (Exception $e) {\n\n if ($e->getCode() == 14) { //The 14 is the code of the error on grocery CRUD (don't have permission).\n //redirect using your user id\n redirect(strtolower(__CLASS__) . '/listar');\n \n } else {\n show_error($e->getMessage());\n return false;\n }\n\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t//DEPENDENT DROPDOWN SETUP\n\t\t\t$dd_data = array(\n\t\t\t\t//GET THE STATE OF THE CURRENT PAGE - E.G LIST | ADD\n\t\t\t\t'dd_state' => $crud->getState(),\n\t\t\t\t//SETUP YOUR DROPDOWNS\n\t\t\t\t//Parent field item always listed first in array, in this case countryID\n\t\t\t\t//Child field items need to follow in order, e.g stateID then cityID\n\t\t\t\t'dd_dropdowns' => array('id_equipo','id_insumo'),\n\t\t\t\t//SETUP URL POST FOR EACH CHILD\n\t\t\t\t//List in order as per above\n\t\t\t\t'dd_url' => array('', site_url().'/entregas/get_states/'),\n\t\t\t\t//LOADER THAT GETS DISPLAYED NEXT TO THE PARENT DROPDOWN WHILE THE CHILD LOADS\n\t\t\t\t'dd_ajax_loader' => base_url().'ajax-loader.gif'\n\t\t\t);\n\t\t\t$output->dropdown_setup = $dd_data;\n\t\t\t$output->content_view='crud_content_view';\n\t\t\t$this->_example_output($output);\n\t}", "public function run(){\t\t\n\t\t/* this startup function for any controller */\n\t\t\n\t\t//$data = $this->db->DB_Fetch_Grid(\"users\");\n\t\t//return $this->json($data);\n\n\t\treturn $this->json([\"test\"=>\"done\",\"response\"=>2244234,\"route\"=>\"users\"]);\n\t\n\t}", "public function index(){\n\t\t$crud \t\t= new grocery_CRUD();\n\n\t\t$crud->set_table('program_studi');\n\t\t$crud->set_subject('Daftar Program Studi');\n\n\t\t/*VALIDATION*/\n\t\t$crud->required_fields('nama_program_studi', 'singkatan_prodi');\n\t\t/*------------*/\n\n\t\t/*CALLBACK*/\n\t\t#$crud->callback_column('nama_program_studi',array($this,'prodi_callback'));\n\t\t/*--------------*/\n\n\n\t\t$output \t\t= $crud->render();\n\t\t$data['judul'] \t= 'Daftar Program Studi';\n\t\t#$data['crumb'] \t= ['Alamat' => ''];\n\t\t$template \t\t= 'admin_template';\n\t\t$view \t\t\t= 'grocery';\n\n\t\t$this->outputview->output_admin($view, $template, $data, $output);\n\t}", "public function run()\n {\n DB::transaction(function () {\n DataType::updateOrCreate([\n 'slug' => 'providers',\n ], [\n 'name' => 'providers',\n 'display_name_singular' => 'Provider',\n 'display_name_plural' => 'Providers',\n 'icon' => 'voyager-certificate',\n 'model_name' => config('marqant-pay.provider_model'),\n 'policy_name' => null,\n 'controller' => '',\n 'description' => '',\n 'generate_permissions' => 1,\n 'server_side' => 0,\n ]);\n });\n }", "public function run()\n {\n \n \t$couponsRecords = [\n \t[\n \t\t'id' => 1,\n \t\t'coupon_option' => 'Manual',\n \t\t'coupon_code' => 'test10',\n \t\t'categories' => '1,2',\n \t\t'users' => '[email protected],[email protected]',\n \t\t'coupon_type' => 'Single',\n \t\t'amount_type' => 'Percentage',\n \t\t'amount' => '10',\n \t\t'expiry_date' => '2021-01-27',\n \t\t'status' => 1\n \t]\n ];\n\n Coupon::insert($couponsRecords);\n\n }", "public function run()\n {\n $data = [\n [\n 'id' => '1',\n 'name' => 'Brooks',\n 'photo' => 'logo.png',\n 'address' => '159 Overland Road',\n 'contact' => '98832423423',\n 'photo_dir' => 'webroot\\\\files\\\\Companies\\\\photo\\\\',\n 'photo_size' => '16367',\n 'photo_type' => 'image/png',\n 'email' => NULL,\n 'activated' => '',\n ],\n [\n 'id' => '2',\n 'name' => 'Omnierps',\n 'photo' => 'omnierps_logo.png',\n 'address' => '220 Merrill Ln, APT 4',\n 'contact' => '9784579809',\n 'photo_dir' => 'webroot\\\\files\\\\Companies\\\\photo\\\\',\n 'photo_size' => '8130',\n 'photo_type' => 'image/png',\n 'email' => NULL,\n 'activated' => 'yes',\n ],\n ];\n\n $table = $this->table('companies');\n $table->insert($data)->save();\n }", "public function run()\n {\n \t// Insert some stuff\n DB::table('clients')->insert(\n array(\n 'id' => 1,\n 'name' => 'walk-in-customer',\n 'code' => 1,\n 'email' => '[email protected]',\n 'country' => 'indonesia',\n 'city' => 'jakarta',\n 'phone' => '123456780',\n 'adresse' => 'DKI Jakarta',\n )\n\n );\n }", "abstract function get_crud_service();", "function listar(){\n \t \t if(isset($_POST['insumo']))\n \t{\n $sede_consulta = $this->input->post('insumo');//sede nueva\n $this->auth_model->cambio_sede($sede_consulta);\n \n \t}\n \telse\n \t{\n\t\t\t$sede_consulta= $this->general_model->ou_sede_id($this->session->userdata('sede'));\n\t\t}\n \t\n \t\n \t\n$this->grocery_crud->set_table('sectores');\n$this->grocery_crud->set_theme('Datatables');\n\nif ($this->session->userdata('sede_filtro'))\n $this->grocery_crud->where('id_sede',$this->session->userdata('sede_filtro'));\n\t \telse\n \t$this->grocery_crud->where('id_sede',$sede_consulta);\n \t\n\n\n\n$this->grocery_crud->set_language('spanish');\n$this->grocery_crud->columns('nombre_sector','habilitado');\n$this->grocery_crud->add_fields('nombre_sector','id_sede', 'habilitado');\n$this->grocery_crud->edit_fields('nombre_sector','habilitado');\n$this->grocery_crud->unset_read_fields('id_sede','habilitado');\n$this->grocery_crud->unset_read();\n\n//validacion\n $this->grocery_crud->unique_fields('nombre_sector');\n$this->grocery_crud->set_rules('nombre_sector', 'Nombre Sector','trim|required|min_length[2]');\n$this->grocery_crud->callback_before_delete(array($this,'before_delete'));\n$this->grocery_crud->set_lang_string('delete_error_message', 'Imposible eliminar el sector, el mismo posee registros asociados');\n$this->grocery_crud->set_lang_string('delete_success_message', 'El sector se ha eliminado correctamente');\t\nif ($this->grocery_crud->getState() == 'add') \n{\n\n $this->grocery_crud->change_field_type('habilitado','invisible');\n}\n//$this->grocery_crud->callback_column('habilitado',array($this,'_callback_columna'));\n $this->grocery_crud->change_field_type('id_sede','invisible');\n$this->grocery_crud->callback_before_insert(array($this,'before_insert1'));\n//$this->grocery_crud->callback_edit_field('habilitado',array($this,'edit_field_callback_1'));\n$output = $this->grocery_crud->render();\n\t$output->content_view='crud_content_view';\n$this->_example_output($output);\n\n}", "public function run()\n {\n $rec=[\n [ 'id'=>1,'name'=>'test-1','status'=>1],\n [ 'id'=>2,'name'=>'test-2','status'=>1],\n [ 'id'=>3,'name'=>'test-3','status'=>1],\n [ 'id'=>4,'name'=>'test-5','status'=>1],\n [ 'id'=>5,'name'=>'test-6','status'=>1],\n ];\n Brand::insert($rec);\n }", "protected function beforeSaveInDB(){}", "public function run()\n {\n \n DB::table('user_client_status')->insert(\n [\n 'description' => 'Ativo',\n ] \n );\n DB::table('user_client_status')->insert(\n [\n 'description' => 'Bloqueado',\n ]\n );\n DB::table('user_client_status')->insert(\n [\n 'description' => 'Excluido',\n ]\n\n );\n }", "public function run()\n {\n $customer = new Customer();\n $customer->id = 1;\n $customer->name = 'Trung';\n $customer->email = '[email protected]';\n $customer->city_id = 1;\n $customer->save();\n\n $customer = new Customer();\n $customer->id = 2;\n $customer->name = 'Nam';\n $customer->email = '[email protected]';\n $customer->city_id = 1;\n $customer->save();\n\n $customer = new Customer();\n $customer->id = 3;\n $customer->name = 'Hoa';\n $customer->email = '[email protected]';\n $customer->city_id = 2;\n $customer->save();\n \n $customer = new Customer();\n $customer->id = 4;\n $customer->name = 'Hang';\n $customer->email = '[email protected]';\n $customer->city_id = 2;\n $customer->save();\n }", "public function run()\n {\n //\n \\DB::statement(\"SET FOREIGN_KEY_CHECKS=0\");\n\n // \\DB::table('users')->truncate();\n\n \\DB::table('users')->insert(array(\n 0 =>\n array(\n 'id' => 1,\n 'role_id' => 1,\n 'full_name' => Config::get('constant.HELAPAY_ADMIN_NAME'),\n 'mobile_number' => Config::get('constant.ADMIN_MOBILE_NO'),\n 'email' => Config::get('constant.ADMIN_EMAIL_NO'),\n 'password' => bcrypt('12345678'),\n 'otp' => NULL,\n 'otp_date' => NULL,\n 'otp_created_date' => NULL,\n 'verification_status' => 1,\n 'created_at' => '2018-04-01 17:04:00',\n 'updated_at' => '2018-04-01 17:04:00',\n 'deleted_at' => NULL,\n ),\n ));\n\n \\DB::statement(\"SET FOREIGN_KEY_CHECKS=1\");\n }", "public function run()\n {\n crud::create([\n \t'nama' => 'andi',\n \t'kelas' => '4B',\n \t'alamat' =>'Lamongan'\n ]);\n }", "public function run()\n {\n StatusPayment::insert([\n ['name'=>'approved'],\n ['name'=>'create'],\n ['name'=>'pending'],\n ['name'=>'cancel'],\n ]);\n }", "public function afterRetrieve($data){ }", "public function index_onCreate()\n\t{\n\t\tparent::create_onSave();\n\t\treturn $this->controller->listRefresh();\n\t}", "public function run()\n {\n $adminRole = Role::where('slug','admin')->first();\n // Create admin\n $escrow = User::updateOrCreate([\n 'role_id' => $adminRole->id,\n 'first_name' => 'Admin',\n 'last_name' => 'User',\n 'username' => 'admin',\n 'email' => '[email protected]',\n 'phone' => '134567',\n 'password' => Hash::make('password'),\n 'status' => true\n ])->escrow()->updateOrCreate([\n 'btc' => 0,\n ])->user->kyc()->updateOrCreate([\n 'id_status' => 'not_submit',\n ]);\n\n // Create user\n $userRole = Role::where('slug','user')->first();\n User::updateOrCreate([\n 'role_id' => $userRole->id,\n 'first_name' => 'John',\n 'last_name' => 'Doe',\n 'username' => 'johndoe',\n 'email' => '[email protected]',\n 'phone' => '1345767',\n 'password' => Hash::make('password'),\n 'status' => true\n ])->escrow()->updateOrCreate([\n 'btc' => 0,\n ])->user->kyc()->updateOrCreate([\n 'id_status' => 'not_submit',\n ]);\n\n\n Bank::factory()->count(8)->create();\n }", "public function gestioneUtenti(){\n\t\t// Istanzio Grocery Crud\n\t\t$crud = new grocery_CRUD();\n\t\t$crud->set_model('Mod_GCR');\n\t\t$crud->set_theme('bootstrap');\n\t\t$crud->set_language('italian');\n\t\t// Determino la tabella di riferimento\n\t\t//$crud->set_table('utenti');\n\t\t$crud->set_table('users');\n\t\t// Imposto la relazione n-n\n\t\t$crud->set_relation_n_n('elenco_categorie', 'utenti_categorie', 'tasks_categorie', 'id', 'id_categoria', 'categoria');\n\t\t$crud->unset_columns(array('ip', 'password','salt'));\n\t\t//$crud->unset_fields(array('id_cliente','username','last_login','ip_address', 'password','salt','activation_code','forgotten_password_code','forgotten_password_time','remember_code','created_on','phone'));\n\t\t$crud->fields(array('last_name','first_name','email','active','elenco_categorie'));\n\t\t$crud->columns(array('last_name','first_name','email','active','elenco_categorie'));\n\t\t$crud->display_as('first_name', 'Nome');\n\t\t$crud->display_as('last_name', 'Cognome');\n\t\t$crud->display_as('active', 'Abilitato');\n\n\t\t$crud->unset_delete();\n\t\t$crud->unset_bootstrap();\n\t\t$output = $crud->render();\n\t\t// Definisco le opzioni\n\t\t$opzioni=array();\n\t\t// Carico la vista\n\t\t$this->opzioni=array();\n\t\t$this->codemakers->genera_vista_aqp('crud',$output,$this->opzioni);\n\t}", "public function run()\n {\n OrderStatus::create(['id' => OrderStatus::PENDING, 'name' => 'Pendente']);\n OrderStatus::create(['id' => OrderStatus::APPROVED, 'name' => 'Aprovado']);\n OrderStatus::create(['id' => OrderStatus::COMPLETE, 'name' => 'Completo']);\n OrderStatus::create(['id' => OrderStatus::RETURNED, 'name' => 'Devolvido']);\n OrderStatus::create(['id' => OrderStatus::CANCELED, 'name' => 'Cancelado']);\n }", "public function run()\n {\n $customer = new Customer();\n $customer->id = 1;\n $customer->name = \"customer 1\";\n $customer->phone = \"2018-09-26\";\n $customer->email = \"[email protected]\";\n $customer->city_id = 5;\n $customer->save();\n $customer = new Customer();\n $customer->id = 2;\n $customer->name = \"customer 2\";\n $customer->phone = \"2018-09-26\";\n $customer->email = \"[email protected]\";\n $customer->city_id = 5;\n $customer->save();\n $customer = new Customer();\n $customer->id = 3;\n $customer->name = \"customer 3\";\n $customer->phone = \"2018-09-26\";\n $customer->email = \"[email protected]\";\n $customer->city_id = 6;\n $customer->save();\n }", "public function run()\n {\n $response = Http::get('https://api.rawg.io/api/genres?key=a8175a54c4164e2ebb75d41fe6fba77b');\n $body = json_decode($response->body(), true);\n $results = $body['results'];\n foreach ($results as $result) {\n // dd($result);\n Genre::firstOrCreate(['id'=> $result['id'],'name' => $result['name'],'slug' => $result['slug']]);\n }\n echo \"DB Genre Created For Page 1 \\n\";\n }", "private function crud(){\n DB::table('crud_route_groups')->truncate();\n foreach($this->tables as $table){\n $params = $this->prepareParams($table);\n $this->line('CRUD for '.$table->table_name);\n (new Controller($params))->build();\n (new Router($params))->build();\n (new Model($params))->build();\n (new ModelFactory($params))->build();\n (new UnitTest($params))->build();\n }\n $this->call('make:swagger');\n $this->info('OpenApi annotations created successfully');\n $this->newLine();\n }", "public function run()\n {\n \t$user = User::find(1);\n \t$customer_type = CustomerType::find(1);\n \tfactory(App\\Customer::class)->create(['user_id' => $user->id, 'last_updated_user_id' => $user->id,\n \t\t\t'customer_type_id' => $customer_type->id\n \t]);\n }", "function listar()\n\t{\n\t\t\n\t \t //si hubo cambio de sede actualizo permisos y filtro sede\n \t \t if(isset($_POST['insumo']))\n \t{\n $sede_consulta = $this->input->post('insumo');//sede nueva\n $this->auth_model->cambio_sede($sede_consulta);\n \n \t}\n \telse\n \t{\n\t\t\t$sede_consulta= $this->general_model->ou_sede_id($this->session->userdata('sede'));\n\t\t}\n\t\t\n\t\t\n\t\t\t//$permiso_sede = $this->session->userdata('sede');\n\t\t\t//GROCERY CRUD SETUP\n\t\t\t$crud = new grocery_CRUD();\n\t\t\t$crud->set_table('entregas');\n\t\t\t$crud->set_theme('Datatables');\n\t\t\t$aux=$this->session->userdata('sede_filtro');\n\t\tif ($this->session->userdata('sede_filtro'))\n {$crud->where('entregas.id_sede',$this->session->userdata('sede_filtro'));}\n\t \telse\n \t{$crud->where('entregas.id_sede',$sede_consulta);}\n\t\t\t//$crud->where('entregas.id_sede',$permiso_sede);\n\t\t\n\t\t\t$crud->set_language('spanish');\n\t\t\t$crud->unset_delete();\n\t\t\t\n\t\t\t//$crud->set_relation('id_proveedor','equipos','id_proveedor');\t\t\n\t\t\t\n\t\t\t$crud->columns('id_equipo','id_insumo','id_sector','fecha_entrega','estado','observaciones','usuario_entrega');\n\t\t\t$crud->add_fields('id_sede','id_sector','estado','id_equipo','id_insumo','fecha_entrega','observaciones','usuario_entrega', 'cantidad');\n\t\t\t\n\t\t\t$crud->edit_fields('id_sede','id_sector','estado','id_equipo','id_insumo','fecha_entrega','observaciones','usuario_entrega', 'cantidad');\n\t\t\t$crud->display_as('id_insumo','Insumo')\n\t\t\t\t ->display_as('id_equipo','Equipo')\n\t\t\t\t ->display_as('id_sector','Sector');\n\t\t\t$crud->set_subject('Entrega');\n\t\t\t\n\t\t\t $crud->set_relation('id_insumo','Insumos','codigo_insumo','habilitado=\"1\"');\n \t\n $crud->set_relation('id_equipo','Equipos','codigo_equipo');\n \n\t\t\t\n\t\t\t//la validacion del estado debe estar presente en todas las instancias\n\t\t $crud->set_rules('estado', 'estado','required');\n\t\t \n\t\t\t\n\t\t\t\n\t\t\tif ($crud->getState() != 'add') \n{\n\t $crud->set_relation('estado','parametros','valor','nombre_parametro=\"estado_entrega\" and habilitado=\"1\"');\n\t \n\t\n}\n\t\t\t\n\t\t\t//por algun no olcutaba el campo preguntando si el estado era add y era a causa del relation... y como la necestio en list y edit lo deje asi\n\n// idem estado pero con sector\n\t\t\tif (($crud->getState() != 'add') and ($crud->getState() != 'edit'))\n{\n\t \n\t $crud->set_relation('id_sector','sectores','nombre_sector');\n\t\n}\n\n\t\t\tif ($crud->getState() == 'add') \n{\n\t//trabajo el add por listar1 el 2 no se usa.\n\tredirect('/entregas/listar1/add');\n\t$crud->change_field_type('id_sector','invisible');\n\t$crud->change_field_type('estado','invisible');\n $crud->change_field_type('id_sede','invisible');\n $crud->change_field_type('usuario_entrega','invisible');\n $crud->change_field_type('fecha_entrega','invisible');\n $crud->change_field_type('cantidad','invisible');\n //coloco las validaciones aca para que no las haga innecesariamente en el edit\n $crud->set_relation('id_equipo','equipos','codigo_equipo', 'estado_equipo='.$this->parametros_model->obtener_id_parametro(\"estado equipo\",\"Operativa\"));\n \t$crud->set_relation('id_insumo','Insumos','codigo_insumo','habilitado=\"1\"');\n \t\n\t\t\t$crud->set_rules('id_equipo', 'Equipo','trim|required');\n\t\t \n\t\t \n\t\t //pongo validacion aca si no me chequea el stock al modificar\n $crud->set_rules('id_insumo', 'id_insumo','trim|required|callback_insumo_check');\n\t\t\t\n}\n\t\t\tif ($this->grocery_crud->getState() == 'edit') \n{\n\t/*$a = $this->uri->segment(4);\n\t$b = '/entregas/listar1/edit/'.$a;\n redirect($b);*/\n \t $crud->change_field_type('id_sede','invisible');\n \t $crud->change_field_type('usuario_entrega','invisible');\n $crud->change_field_type('fecha_entrega','invisible');\n $crud->change_field_type('id_sector','invisible');\n $crud->change_field_type('cantidad','invisible');\n //$crud->set_relation('id_insumo','Insumos','codigo_insumo','habilitado=\"1\"');\n $crud->field_type('id_insumo','readonly'); \t\n // $crud->set_relation('id_equipo','Equipos','codigo_equipo');\n $crud->field_type('id_equipo','readonly');\n \n}\n\t\t\t\n\t\t\t//IF YOU HAVE A LARGE AMOUNT OF DATA, ENABLE THE CALLBACKS BELOW - FOR EXAMPLE ONE USER HAD 36000 CITIES AND SLOWERD UP THE LOADING PROCESS. THESE CALLBACKS WILL LOAD EMPTY SELECT FIELDS THEN POPULATE THEM AFTERWARDS\n\t\t\n\t\t $crud->callback_add_field('id_insumo', array($this, 'empty_state_dropdown_select'));\n\t\t\t//$crud->callback_edit_field('id_insumo', array($this, 'empty_state_dropdown_select'));\n\t\t\t$crud->callback_after_insert(array($this, 'after_insert1'));\n\t\t\t$crud->callback_before_insert(array($this,'before_insert1')); \t\n\t\t\t$crud->callback_before_update(array($this,'before_update1'));\n\t\t\t$crud->callback_after_update(array($this, 'after_update1'));\n\t\n\t\t\t\t\n\t\t\t$output = $crud->render();\n\t\t\t\n\t\t\t\n\t\t\t\t\t\n\t\t\t//DEPENDENT DROPDOWN SETUP\n\t\t\t$dd_data = array(\n\t\t\t\t//GET THE STATE OF THE CURRENT PAGE - E.G LIST | ADD\n\t\t\t\t'dd_state' => $crud->getState(),\n\t\t\t\t//SETUP YOUR DROPDOWNS\n\t\t\t\t//Parent field item always listed first in array, in this case countryID\n\t\t\t\t//Child field items need to follow in order, e.g stateID then cityID\n\t\t\t\t'dd_dropdowns' => array('id_equipo','id_insumo'),\n\t\t\t\t//SETUP URL POST FOR EACH CHILD\n\t\t\t\t//List in order as per above\n\t\t\t\t'dd_url' => array('', site_url().'/entregas/get_states/'),\n\t\t\t\t//LOADER THAT GETS DISPLAYED NEXT TO THE PARENT DROPDOWN WHILE THE CHILD LOADS\n\t\t\t\t'dd_ajax_loader' => base_url().'ajax-loader.gif'\n\t\t\t);\n\t\t\t$output->dropdown_setup = $dd_data;\n\t\t\t\n\t\t\t$output->content_view='crud_content_view';\n\t\t\t$this->_example_output($output);\n\t}", "public function createAction()\r\n\t{\r\n\t\treturn $this->_crud();\r\n\t}", "public function run()\n {\n $data = [\n 'name' => \"DOOCODE\",\n 'expired' => date(date_create(\"2020-02-10 13:40:00\"),'Y-m-d H:i:s'),\n 'lat' => -6.179027,\n 'ltg' => 106.777600,\n 'disc' => 0.3,\n 'created' => date('Y-m-d H:i:s'),\n 'updated' => date('Y-m-d H:i:s'),\n ];\n $this->table('promo')->insert($data)->save();\n }", "public function run()\n {\n \n\n \\DB::table('companies')->delete();\n \n \\DB::table('companies')->insert(array (\n 0 => \n array (\n 'created_at' => NULL,\n 'description' => 'Initialized Company Created by the application on setup',\n 'id' => 1,\n 'logo' => NULL,\n 'name' => 'Shibie Company',\n 'updated_at' => NULL,\n 'user_id' => 1,\n ),\n 1 => \n array (\n 'created_at' => NULL,\n 'description' => 'this is a second test company',\n 'id' => 2,\n 'logo' => NULL,\n 'name' => 'Company test2',\n 'updated_at' => NULL,\n 'user_id' => 1,\n ),\n ));\n \n \n }", "public function run()\n {\n \t//\\CodeProject\\Entities\\Project::truncate();\n $data = array(\n 'id'=>'appid1',\n 'secret'=>'secret',\n 'name'=>'AngularApp',\n 'created_at' => date('Y-m-d H:i:s', time()),\n 'updated_at' => date('Y-m-d H:i:s', time())\n );\n\n \tDB::table('oauth_clients')->insert($data);\n }", "public function run()\n {\n tbl_company::create([\n 'name' => 'company',\n 'email' => '[email protected]',\n 'phone' =>'09-111111111',\n 'address'=>'yangon',\n 'ref_initials'=>'ADM',\n ]);\n }", "public function run()\n {\n $status = [\n 'In Transit...',\n 'In Storage...',\n 'Received'\n ];\n // Cargo::factory()->count(50)->make();\n // \\QrCode::size(100)->format('svg')->generate('name','/'. 'name' .'.svg');\n $faker = Faker::create();\n foreach (range(1,10) as $value) {\n DB::table('cargos')->insert([\n 'name' => $faker->name,\n 'cargo_code' => strtoupper(Str::random(10)),\n 'cargo_status' => $status[rand(0,2)],\n 'cargo_description' => $faker->name,\n 'official_address' => $faker->city,\n 'contact_person' => $faker->name\n ]);\n }\n User::create([\n 'name' => 'admin',\n 'address' => Str::random(20),\n 'email' => '[email protected]',\n 'password' => bcrypt('password')\n ]);\n\n }", "public function run()\n {\n DB::table('customer')->insert([ \n 'external_id'=> '#123456',\n 'type'=> 'individual',\n 'country'=> 'br',\n 'document_type'=> 'cpf',\n 'document_number'=> '08828926651',\n 'name'=> 'Sidnei da Silva Simeão',\n 'email'=> '[email protected]',\n 'password'=> md5('*admin12345'),\n 'birthday'=> '1986-30-06', \n 'gender'=> 'M',\n 'status'=> 'A',\n 'crea+at'=> date('Y-d-m')\n ]);\n }", "public function run()\n {\n// create 50 jobs announce in database\n if(job_announce::count() == 0)$this->call('Job');\n \n// create just only one user admin\n User::create([\n 'name' => 'mahdi',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456')\n ]);\n }", "public function run()\n {\n Service::insert(\n [\n [\n 'name' => '商标',\n 'sign' => 'trademark',\n 'status' => 1,\n 'thumbnail' => 'static/images/service-icon.svg',\n ],\n [\n 'name' => '版权登记',\n 'sign' => 'copyright-registration',\n 'status' => 1,\n 'thumbnail' => 'static/images/service-icon.svg',\n ],\n [\n 'name' => '专利申请',\n 'sign' => 'patent-application',\n 'status' => 1,\n 'thumbnail' => 'static/images/service-icon.svg',\n ],\n [\n 'name' => '公司注册',\n 'sign' => 'patent-application',\n 'status' => 1,\n 'thumbnail' => 'static/images/service-icon.svg',\n ],\n [\n 'name' => '法务咨询',\n 'sign' => 'legal-advice',\n 'status' => 1,\n 'thumbnail' => 'static/images/service-icon.svg',\n ],\n ]\n );\n }", "protected function _crud() {\n\t\treturn $this->_container->crud;\n\t}", "public function run()\n {\n Customer::create(array(\n 'first_name' => 'Louis',\n 'last_name' => 'De Smet',\n 'email' => '[email protected]',\n ));\n Customer::create(array(\n 'first_name' => 'Oscar',\n 'last_name' => 'De Smet',\n 'email' => '[email protected]',\n ));\n Customer::create(array(\n 'first_name' => 'Evelien',\n 'last_name' => 'Van Oudenhove',\n 'email' => '[email protected]',\n ));\n }", "public function run()\n {\n Status::create([\n 'name'=>'pending confirmation'\n ]);\n Status::create([\n 'name'=>'confirmed'\n ]);\n Status::create([\n 'name'=>'treated'\n ]);\n Status::create([\n 'name'=>'cancelled'\n ]);\n Status::create([\n 'name'=>'requested'\n ]);\n }", "public function run()\n {\n \t$now = date('Y-m-d H:i:s');\n\n DB::table('todo')->insert([\n \t'user_id' => 1,\n 'name' => Str::random(10),\n 'description' => Str::random(100),\n 'status' => 'completed',\n 'date_time' => $now,\n 'category' => Str::random(10),\n ]);\n\n DB::table('todo')->insert([\n \t'user_id' => 1,\n 'name' => Str::random(10),\n 'description' => Str::random(100),\n 'status' => 'Snoozed',\n 'date_time' => $now,\n 'category' => Str::random(10),\n ]);\n\n DB::table('todo')->insert([\n \t'user_id' => 1,\n 'name' => Str::random(10),\n 'description' => Str::random(100),\n 'status' => 'Overdue',\n 'date_time' => $now,\n 'category' => Str::random(10),\n ]);\n }", "public function run()\n {\n $check = Company::first();\n if(!$check){\n $data = new Company;\n $data->fullname = 'Jesus Care Prayer Ministry';\n $data->shortname = 'Jesus Care';\n $data->save();\n }\n }", "public function run()\n\t{\n\t\tDB::table('responsibility')->delete();\n \n DB::table('responsibility')->insert(array(\n array('id'=>'1000','name'=>'Manage Project','description'=>'One who manages project'),\n array('id'=>'1001','name'=>'Manage User','description'=>'One who manages user')\n ));\n\t}", "public function run()\n {\n //\n $param=[\n 'message'=>'google',\n 'url'=>'google',\n ];\n $restdata=new Restdata;\n $restdata->fill($param)->save();\n $param=[\n 'message'=>'yahoo',\n 'url'=>'yahoo',\n ];\n $restdata=new Restdata;\n $restdata->fill($param)->save();\n $param=[\n 'message'=>'MSN',\n 'url'=>'msn',\n ];\n $restdata=new Restdata;\n $restdata->fill($param)->save();\n }", "public function run()\n {\n \n\n \\DB::table('authen')->delete();\n \\DB::table('authen')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'guid' => 'xxx01',\n 'role' => '1',\n 'created_at' => date('Y-m-d'),\n 'updated_at' => date('Y-m-d'),\n ),\n 1 => \n array (\n 'id' => 2,\n 'guid' => 'xxx02',\n 'role' => '1,2',\n 'created_at' => date('Y-m-d'),\n 'updated_at' => date('Y-m-d'),\n ),\n 2 => \n array (\n 'id' => 3,\n 'guid' => 'xxx03',\n 'role' => '1,2',\n 'created_at' => date('Y-m-d'),\n 'updated_at' => date('Y-m-d'),\n ),\n ));\n }", "public function run()\n {\n //\n $chantier= new Chantier();\n $chantier->id=1;\n $chantier->libelle=\"PHB\";\n $chantier->id_pays=110;\n $chantier->save();\n\n $chantier= new Chantier();\n $chantier->id=2;\n $chantier->libelle=\"AZITO\";\n $chantier->id_pays=110;\n $chantier->save();\n\n $chantier= new Chantier();\n $chantier->id=3;\n $chantier->libelle=\"PAHSA\";\n $chantier->id_pays=110;\n $chantier->save();\n }", "public function run()\n {\n $data=[\n \t[\n \t\t\"name\"=>\"dinesh\",\n \t\t\"email\"=>\"[email protected]\",\n \t\t\"password\"=>Hash::make(\"123\"),\n \t]\n\n\n ];\n\n\n Admin::insert($data);\n\n }", "public function run()\n {\n //\n $tipo_act = new TipoActividad();\n $tipo_act->tipo= \"Examen\";\n $tipo_act->save();\n\n $tipo_act = new TipoActividad();\n $tipo_act->tipo= \"Tarea\";\n $tipo_act->save();\n\n $tipo_act = new TipoActividad();\n $tipo_act->tipo= \"Concurso\";\n $tipo_act->save();\n\n }", "public function run()\n {\n //\n /* $producto = new producto();\n $producto->id = 1;\n $producto->barcode = \"1234\";\n $producto->descripcion = \"Cuarto de aceite para motor a gasolina warco 20W50\";\n $producto->stock = 40;\n $producto->min_stock = 20;\n $producto->max_stock = 120;\n $producto->precio = 120;\n $producto->tipo_producto_id = 3;\n $producto->save();*/\n Producto::factory(50)->create();\n }", "public function run()\n {\n suppliers::insert([\n 'name' => 'dostawca 1',\n 'email' => '[email protected]',\n 'phone' => 159159852,\n ]);\n\n suppliers::insert([\n 'name' => 'dostawca 2',\n 'email' => '[email protected]',\n 'phone' => 123654789,\n ]);\n }", "public function run()\n {\n\n \t$sql = <<<SQL\n \tinsert into require_data (id, name_en, name_ar, created_at) values\n (1, 'Marital Status', 'Marital Status', now()),\n (2, 'Civil ID Number', 'Civil ID Number', now()),\n (3, 'Passport Number', 'Passport Number', now()),\n (4, 'Passport Copy', 'Passport Copy', now()),\n (5, 'Bibendum', 'Bibendum', now()),\n (6, 'Nulla Tempus', 'Nulla Tempus', now()),\n (7, 'Quisque Commodo', 'Quisque Commodo', now()),\n (8, 'Scelerisque', 'Scelerisque', now()),\n (9, 'Quisque', 'Quisque', now()),\n (10, 'Curabitur', 'Curabitur', now()),\n (11, 'Finibus Sit', 'Finibus Sit', now()),\n (12, 'Sed Euismod', 'Sed Euismod', now()),\n (13, 'Imterdum Libero', 'Imterdum Libero', now()),\n (14, 'Scelerisque', 'Scelerisque', now()),\n (15, 'Bibendum', 'Bibendum', now()),\n (16, 'Etiam Fermentu', 'Etiam Fermentu', now()),\n (17, 'Consectetur', 'Consectetur', now()),\n (18, 'Curabitur', 'Curabitur', now()),\n (19, 'Vulputate Turpis', 'Vulputate Turpis', now()),\n (20, 'Curabituer', 'Curabituer', now())\non duplicate key update name_en = values(name_en), name_ar = values(`name_ar`), updated_at=now()\nSQL;\n\n\t DB::insert($sql);\n }", "public function creating()\n {\n # code...\n }", "public function cabor()\n\t{\n\t\tif ($this->session->userdata('logged_in')) {\n\n\t\t\t$crud = new grocery_CRUD();\n\t\t\t$crud->set_table('cabor');\n\t\t\t$crud->set_field_upload('image', 'assets/uploads/files/cabor');\n\n\t\t\t$output = $crud->render();\n\t\t\t$this->view_crud($output);\n\t\t} else {\n\t\t\tredirect('dev/access');\n\t\t}\n\t}", "public function run()\n {\n \n\n \\DB::table('orchardpools_socials')->delete();\n \n \\DB::table('orchardpools_socials')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'title' => 'Facebook',\n 'url' => '#',\n 'icon' => 'fa fa-facebook',\n ),\n 1 => \n array (\n 'id' => 2,\n 'title' => 'Twitter',\n 'url' => '#',\n 'icon' => 'fa fa-twitter',\n ),\n 2 => \n array (\n 'id' => 3,\n 'title' => 'Google Plus',\n 'url' => '#',\n 'icon' => 'fa fa-google-plus',\n ),\n 3 => \n array (\n 'id' => 4,\n 'title' => 'Instagram',\n 'url' => '#',\n 'icon' => 'fa fa-instagram',\n ),\n ));\n \n \n }", "public function run()\n\t{\n\t\t// Insert ACL types\n\t\tDB::table('acl_types')->insert(array(\n\t\t\tarray('id' => 1, 'name' => 'Self'),\n\t\t\tarray('id' => 2, 'name' => 'All'),\n\t\t\tarray('id' => 3, 'name' => 'User'),\n\t\t\tarray('id' => 4, 'name' => 'Group'),\n\t\t));\n\n\t\t// Insert ACL flags\n\t\tDB::table('acl_flags')->insert(array(\n\t\t\tarray('id' => 1, 'name' => 'acl_manage'),\n\t\t\tarray('id' => 2, 'name' => 'field_edit'),\n\t\t\tarray('id' => 3, 'name' => 'field_manage'),\n\t\t\tarray('id' => 4, 'name' => 'field_view'),\n\t\t\tarray('id' => 5, 'name' => 'group_edit'),\n\t\t\tarray('id' => 6, 'name' => 'group_manage'),\n\t\t\tarray('id' => 7, 'name' => 'user_edit'),\n\t\t\tarray('id' => 8, 'name' => 'user_manage'),\n\t\t));\n\n\t\t// Insert the user status values\n\t\tDB::table('user_status')->insert(array(\n\t\t\tarray('id' => 1, 'name' => 'Inactive'),\n\t\t\tarray('id' => 2, 'name' => 'Active'),\n\t\t\tarray('id' => 3, 'name' => 'Blocked'),\n\t\t));\n\n\t\t// Insert token types\n\t\tDB::table('token_types')->insert(array(\n\t\t\tarray('id' => 1, 'name' => 'Email'),\n\t\t\tarray('id' => 2, 'name' => 'Password'),\n\t\t));\n\n\t\t// Insert device types\n\t\tDB::table('device_types')->insert(array(\n\t\t\tarray('id' => 1, 'name' => 'Computer'),\n\t\t\tarray('id' => 2, 'name' => 'Mobile'),\n\t\t\tarray('id' => 3, 'name' => 'Tablet'),\n\t\t));\n\n\t\t// Insert group types\n\t\tDB::table('group_types')->insert(array(\n\t\t\tarray('id' => 1, 'name' => 'Open'),\n\t\t\tarray('id' => 2, 'name' => 'Request'),\n\t\t\tarray('id' => 3, 'name' => 'Closed'),\n\t\t));\n\n\t\t// Insert field categories\n\t\tDB::table('field_categories')->insert(array(\n\t\t\tarray('id' => 1, 'name' => 'Basic'),\n\t\t\tarray('id' => 2, 'name' => 'Contact'),\n\t\t\tarray('id' => 3, 'name' => 'Other'),\n\t\t));\n\n\t\t// Insert field types\n\t\tDB::table('field_types')->insert(array(\n\t\t\tarray('id' => 1, 'name' => 'TextBox', 'option' => Flags::NO),\n\t\t\tarray('id' => 2, 'name' => 'TextArea', 'option' => Flags::NO),\n\t\t\tarray('id' => 3, 'name' => 'Radio', 'option' => Flags::YES),\n\t\t\tarray('id' => 4, 'name' => 'CheckBox', 'option' => Flags::YES),\n\t\t\tarray('id' => 5, 'name' => 'Dropdown', 'option' => Flags::YES),\n\t\t\tarray('id' => 6, 'name' => 'DatePicker', 'option' => Flags::NO),\n\t\t));\n\n\t\t// Insert admin user account\n\t\tDB::table('users')->insert(array(\n\t\t\t'name' => 'John Doe',\n\t\t\t'gender' => 'M',\n\t\t\t'date_of_birth' => '1980-07-01',\n\t\t\t'timezone' => 'America/Chicago',\n\t\t\t'password' => Hash::make('password'),\n\t\t\t'title' => 'Site administrator',\n\t\t\t'hash' => str_random(8),\n\t\t\t'status' => UserStatus::ACTIVE,\n\t\t));\n\n\t\t// Insert admin email addresses\n\t\tDB::table('user_emails')->insert(array(\n\t\t\t'user_id' => 1,\n\t\t\t'address' => '[email protected]',\n\t\t\t'primary' => Flags::YES,\n\t\t\t'verified' => Flags::YES,\n\t\t));\n\n\t\t// Insert the group entries\n\t\tDB::table('groups')->insert(array(\n\t\t\t'name' => 'Registered users',\n\t\t\t'description' => 'All registered users on the website.',\n\t\t\t'type' => GroupTypes::CLOSED,\n\t\t\t'hash' => str_random(8),\n\t\t\t'auto_join' => Flags::YES,\n\t\t));\n\n\t\tDB::table('groups')->insert(array(\n\t\t\t'name' => 'Sysadmins',\n\t\t\t'description' => 'System administrators with full control over the website.',\n\t\t\t'type' => GroupTypes::CLOSED,\n\t\t\t'hash' => str_random(8),\n\t\t));\n\n\t\t// Link the user to registered users group\n\t\tDB::table('user_groups')->insert(array(\n\t\t\t'user_id' => 1,\n\t\t\t'group_id' => 1,\n\t\t));\n\n\t\t// Link user to the sysadmin group\n\t\tDB::table('user_groups')->insert(array(\n\t\t\t'user_id' => 1,\n\t\t\t'group_id' => 2,\n\t\t));\n\n\t\t// Allow sysadmins to edit all users\n\t\tDB::table('acl')->insert(array(\n\t\t\t'flag' => ACLFlags::USER_EDIT,\n\t\t\t'subject_id' => 2,\n\t\t\t'subject_type' => ACLTypes::GROUP,\n\t\t\t'object_id' => 0,\n\t\t\t'object_type' => ACLTypes::ALL,\n\t\t));\n\n\t\t// Allow registered users to edit their own profiles\n\t\tDB::table('acl')->insert(array(\n\t\t\t'flag' => ACLFlags::USER_EDIT,\n\t\t\t'subject_id' => 1,\n\t\t\t'subject_type' => ACLTypes::GROUP,\n\t\t\t'object_id' => 0,\n\t\t\t'object_type' => ACLTypes::SELF,\n\t\t));\n\n\t\t// Allow sysadmins to manage all users\n\t\tDB::table('acl')->insert(array(\n\t\t\t'flag' => ACLFlags::USER_MANAGE,\n\t\t\t'subject_id' => 2,\n\t\t\t'subject_type' => ACLTypes::GROUP,\n\t\t\t'object_id' => 0,\n\t\t\t'object_type' => ACLTypes::ALL,\n\t\t));\n\n\t\t// Allow sysadmins to edit all groups\n\t\tDB::table('acl')->insert(array(\n\t\t\t'flag' => ACLFlags::GROUP_EDIT,\n\t\t\t'subject_id' => 2,\n\t\t\t'subject_type' => ACLTypes::GROUP,\n\t\t\t'object_id' => 0,\n\t\t\t'object_type' => ACLTypes::ALL,\n\t\t));\n\n\t\t// Allow sysadmins to manage all groups\n\t\tDB::table('acl')->insert(array(\n\t\t\t'flag' => ACLFlags::GROUP_MANAGE,\n\t\t\t'subject_id' => 2,\n\t\t\t'subject_type' => ACLTypes::GROUP,\n\t\t\t'object_id' => 0,\n\t\t\t'object_type' => ACLTypes::ALL,\n\t\t));\n\n\t\t// Allow sysadmins to manage fields\n\t\tDB::table('acl')->insert(array(\n\t\t\t'flag' => ACLFlags::FIELD_MANAGE,\n\t\t\t'subject_id' => 2,\n\t\t\t'subject_type' => ACLTypes::GROUP,\n\t\t\t'object_id' => 0,\n\t\t\t'object_type' => ACLTypes::ALL,\n\t\t));\n\n\t\t// Allow sysadmins to manage ACLs\n\t\tDB::table('acl')->insert(array(\n\t\t\t'flag' => ACLFlags::ACL_MANAGE,\n\t\t\t'subject_id' => 2,\n\t\t\t'subject_type' => ACLTypes::GROUP,\n\t\t\t'object_id' => 0,\n\t\t\t'object_type' => ACLTypes::ALL,\n\t\t));\n\t}", "public function run()\n {\n \t\t$companies = [\n [\n 'company_name' => 'Your Company',\n 'type' => '',\n 'telephone' => '(000) 000-000',\n 'email' => '[email protected]',\n 'website' => 'www.your-company.com',\n 'image_url' => 'logo-placeholder.png',\n 'is_enable' => 0,\n 'created_by' => 1,\n ],\n\n ];\n \n foreach ($companies as $item)\n DB::table('companies')->insert($item);\n }", "public function run()\n {\n //\n \n $curso = new Curso();\n $curso->nombre = 'Matemáticas';\n $curso->idProfesor = 2;\n $curso->save();\n\n $curso = new Curso();\n $curso->nombre = 'Química';\n $curso->idProfesor = 2;\n $curso->save();\n $curso = new Curso();\n $curso->nombre = 'Español';\n $curso->idProfesor = 2;\n $curso->save();\n\n $curso = new Curso();\n $curso->nombre = 'Inglés';\n $curso->idProfesor = 2;\n $curso->save();\n \n\n }", "public function run()\n {\n $data = [\n [\n 'id' => 1,\n 'name' => 'Waiting for Review',\n ],\n [\n 'id' => 2,\n 'name' => 'Admit'\n ],\n [\n 'id' => 3,\n 'name' => 'Deny'\n ],\n ];\n\n DB::table('status')->insert($data); \n }", "public function run()\n {\n $ticketsCount = DB::table('tickets')->count();\n\n if($ticketsCount !== 0){\n return;\n }\n\n $status = DB::table('ticket_status')->where('name', 'new')->first(); \n\n $admin = DB::table('users')->where('name', 'admin')->first(); \n\n $ticketId = DB::table('tickets')->insertGetId(\n ['name' => 'ticket1','description'=>'todo', 'assigned_id'=>$admin->id, 'ticket_status_id'=>$status->id, 'created_at'=>now()], \n );\n\n $ticketInfoId = DB::table('ticket_info')->insertGetId(\n ['ticket_id' => $ticketId, 'views'=>0, 'created_at'=>now()], \n );\n\n $ticketWatcher = DB::table('ticket_watchers')->insertGetId(\n ['ticket_id' => $ticketId, 'watcher_id'=>$admin->id, 'created_at'=>now()], \n );\n }", "public function run() {\n DB::table( 'rent_payment_status' )->insert( array(\n array(\n 'rent_status' => 'Fully paid'\n ),\n array(\n 'rent_status' => 'Partially paid'\n ),\n array(\n 'rent_status' => 'Due'\n )\n ) );\n }", "public function run()\n\t{\n\t\tDB::table('status_group')->delete();\n \n DB::table('status_group')->insert(array(\n array('id'=>'1000','name'=>'User Related','description'=>'Status related to user such as active,in-active etc..'),\n array('id'=>'1001','name'=>'Project Related','description'=>'Status related to project such as started,completed etc..'),\n array('id'=>'1002','name'=>'Role Related','description'=>'Status related to roles such as active,in-active etc..')\n ));\n\t}", "public function run()\n {\n \\Illuminate\\Support\\Facades\\DB::insert('insert into oauth_clients (id, user_id, name, secret, redirect, personal_access_client, password_client, revoked) values (?, ?, ?, ?, ?, ?, ?, ?)',\n [1, null, 'Laravel', '68PBboAl9SXvxmXF0BeKvmWIu4yShMFoP5e4H32B', 'http://localhost', 1, 0, 0]\n );\n \\Illuminate\\Support\\Facades\\DB::insert('insert into oauth_clients (id, user_id, name, secret, redirect, personal_access_client, password_client, revoked) values (?, ?, ?, ?, ?, ?, ?, ?)',\n [2, null, 'React client', 'YuMGy00bQjOewsIS2A9XNnvkkReoLNTpHWipAn3a', 'http://localhost', 0, 1, 0]\n );\n }", "public function crudSaved()\n {\n $this->fireModelEvent('crudSaved', false);\n }", "public function run()\n {\n Charge::create(['name' => 'genrente']);\n Charge::create(['name' => 'asistente operativo']);\n Charge::create(['name' => 'asesor comercial']);\n Charge::create(['name' => 'contador']);\n }", "public function run()\n {\n\n /**\n * Insert Google Shopping categories on insert\n */\n $google_shopping = \\App\\DfCore\\DfBs\\Import\\Category\\CategoryImportFactory::setChannel(\\App\\DfCore\\DfBs\\Enum\\CategoryChannels::GOOGLE_SHOPPING);\n foreach($google_shopping as $g_data) {\n DB::table('category')->insert($g_data);\n }\n\n\n\n\n }", "public function run()\n {\n // $data = [\n // [\n // 'username' => 'michaell',\n // 'password' => password_hash('michaell_x0hjKasL0!2', PASSWORD_DEFAULT),\n // 'status' => '1'\n // ]\n // ];\n\n // $insert = $this->table('app_users');\n // $insert->insert($data)\n // ->save();\n }", "public function activities(){\n\t\n\t\t$crud = new grocery_CRUD();\n\t\t\t\n\t\t$crud->set_theme('flexigrid');\n\t\t$crud->set_table(\"activities\");\n\t\t$crud->set_subject(\"Activity\");\n\t\t\n\t\t$crud->columns(\"id\",\"patient_id\",\"protocol_id\",\"date_time\",\"left_calc\",\"right_calc\");\n\t\t\n\t\t$output = $crud->render();\n\t\t$output->header_info = $this->header_info;\n\t\t$this->load->view('admin/table', $output);\n\t\n\t\n\t}", "public function run()\n {\n //Carrera::truncate();\n\n Carrera::firstOrCreate(['nombre'=>'Licenciatura en Ingeniería de Sistemas y Computación']);\n Carrera::create(['nombre'=>'Licenciatura en Ingeniería de Sistemas de Información']);\n Carrera::create(['nombre'=>'Licenciatura en Desarrollo de Software']);\n Carrera::create(['nombre'=>'Licenciatura en Redes Informáticas']);\n }", "public function run()\n {\n //$list = MytodoList::findOrFail(1);\n $item1 = new MyTodoItem();\n $item1->mytodo_list_id = 1;\n $item1->content = \"Belajar View\";\n $item1->save();\n\n $item2 = new MyTodoItem();\n $item2->mytodo_list_id = 1;\n $item2->content = \"Belajar Controller\";\n $item2->save();\n }", "public function run()\n {\n\n $user_id = 1;\n $names = ['Google', 'Facebook', 'Tweeter', 'SpaceX', 'Rustavi2'];\n\n foreach ($names as $name) {\n\n $newComp = new Company();\n $newComp->user_id = $user_id;\n $newComp->name = $name;\n $newComp->author_name = 'Nika';\n $newComp->position_in_company = 'HR';\n $newComp->company_email = $name . '@' . $name . '.com';\n $newComp->company_phone = '555555555';\n $newComp->save();\n $user_id++;\n }\n\n\n }", "public function execute()\n {\n\n }", "public function run()\n {\n //\n DB::table('clients')->insert([\n 'title' => 'Mr',\n 'name' => 'Hari',\n 'last_name' => 'Sharma',\n 'address' => 'Pokhara',\n 'zip_code' => '2000',\n 'city' => 'Pokhara',\n 'state' => 'Gandaki',\n 'email' => '[email protected]',\n ]);\n\n DB::table('clients')->insert([\n 'title' => 'Mrs',\n 'name' => 'Rupa',\n 'last_name' => 'Sharma',\n 'address' => 'Pokhara-10',\n 'zip_code' => '2001',\n 'city' => 'Pokhara1',\n 'state' => 'Gandaki1',\n 'email' => '[email protected]',\n ]);\n }", "public function index_post()\n {\n $input = $this->input->post();\n $this->write_db->insert($_table,$input);\n \n $this->response(['Item created successfully.'], REST_Controller::HTTP_OK);\n }", "public function run()\n {\n $param = [\n 'name' => 'taro',\n 'email' => '[email protected]',\n ];\n DB::table('contact')->insert($param);\n $param = [\n 'name' => 'jiro',\n 'email' => '[email protected]',\n ];\n DB::table('contact')->insert($param);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'ADITYA PADHI',\n 'mobile' => '7381110897',\n 're_id' => 1,\n 'email' => '[email protected]',\n 'password' => bcrypt('Aditya'),\n 'admin' => '1',\n 'confirmed' => '1'\n ]);\n DB::table('users')->insert([\n 'name' => 'SID',\n 'mobile' => '',\n 're_id' => 2,\n 'email' => '[email protected]',\n 'password' => bcrypt('siddas'),\n 'admin' => '1',\n 'confirmed' => '1'\n ]);\n\n DB::table('statuses')->insert([\n 'id' => '1',\n 'st_name' => 'Order Processing'\n\n ]);\n DB::table('statuses')->insert([\n 'id' => '5',\n 'st_name' => 'Order Cancelled'\n\n ]);\n }", "public function run()\n {\n DB::table('service_books')->insert(\n array(\n array(\n 'user_id' => 5,\n 'vin' => 'WDB1240521C250831',\n 'gos_number' => 'AA 57 30 OP',\n 'tcd_car_id' => '1',\n ),\n array(\n 'user_id' => 5,\n 'vin' => 'WF0JXXGAJJAM14991',\n 'gos_number' => 'XX 06 06 XX',\n 'tcd_car_id' => '2',\n ),\n ));\n }", "public function run()\n {\n $data = array(\n \t['id'=>1,\n \t 'name' => 'Food Coupon',\n \t 'amount' => 150.00\n \t],\n \t['id'=>2,\n \t 'name' => 'Hashhacks',\n \t 'amount' => 300.00\n \t]\n );\n DB::table('food_coupons')->insert($data);\n }", "public function run()\n {\n DB::table('reward_suppliers')->insert([\n 'name' => 'Саломон',\n 'name_jur' => 'ОАО Саломон',\n 'address_jur' => 'Россия, Ивановская обл., г. Пупок, ул. Сосновая, д. 28',\n 'address_fact' => 'Россия, Ивановская обл., г. Пупок, ул. Сосновая, д. 28',\n 'city_id' => 1,\n 'country_id' => 7,\n 'staff' => 'главарь',\n 'staff_name' => 'Игорёк',\n 'phone_contact' => '848534123431',\n 'email_contact' => '[email protected]',\n 'discount' => 12,\n 'money_earned_total' => 1000,\n 'debt' => 500\n ]);\n\n }", "public function run()\n {\n \t//Crear un cliente para password grants\n \\DB::insert('insert into oauth_clients (id, secret, name, created_at, updated_at) values (?, ?, \\'Password Grant Client\\', NOW(), NOW())', ['asd987qwekjl9768', '918dxh897gadogd8b8d92d98gaofs', ]);\n }", "public function run()\n {\n\n\n \\DB::table('cards')->delete();\n\n \\DB::table('cards')->insert(array (\n 0 =>\n array (\n 'id' => 1,\n 'user_id' => 1,\n 'card_type_id' => 1,\n 'currency_id' => 1,\n 'available_balance' => 5.0,\n 'ledger_balance' => 200.0,\n 'name' => 'Vinicius Siqueira',\n 'number' => '4685881824504879',\n 'month' => '02',\n 'year' => '22',\n 'cvv' => '506',\n 'billing_address' => '2681, Tao Sawgrass, Plantation, FL',\n 'zip_code' => '33323',\n 'created_at' => '2020-08-25 12:16:11',\n 'updated_at' => '2020-08-25 12:16:11',\n 'deleted_at' => NULL,\n ),\n ));\n\n\n }", "public function run()\n {\n $category1 = new MenuCategory();\n $category2 = new MenuCategory();\n $category3 = new MenuCategory();\n $category4 = new MenuCategory();\n\n $category1->category_title = \"Fast Food\";\n $category1->save();\n\n $category2->category_title = \"Extra Value Meals\";\n $category2->save();\n\n $category3->category_title = \"Sandwiches\";\n $category3->status = \"Inactive\";\n $category3->save();\n\n $category4->category_title = \"Happy Meal\";\n $category4->save();\n }", "public function run()\n {\n \tPaymentData::create([\n \t'id' => 1,\n 'name' => 'Uphold',\n 'description' => 'metodo de pago de transacciones electronicas',\n 'logo' => 'uphold.jpg',\n 'type' => 1,\n 'status' => 1,\n \n \t]);\n\n \tPaymentData::create([\n \t'id' => 2,\n 'name' => 'Banco de Bogota',\n 'description' => 'entidad bancaria de bogota',\n 'logo' => 'bancobogota.jpg',\n 'type' => 2,\n 'status' => 1,\n \n \t]);\n }", "public function run()\n {\n // $create = Status::create(\n // [\n // 'ahmed',\n // 'mohamed',\n // ]);\n }", "public function run()\n {\n //\n // Benoit\n DB::table('users')->insert([\n 'name' => 'DBIZA',\n 'prenom' => 'Mohammed',\n 'email' => '[email protected]',\n 'password' => bcrypt('Webforce3'),\n 'admin' => true,\n 'created_at' => now(),\n 'email_verified_at' => now(),\n 'api_token' => Str::random(60),\n ]);\n }", "public function run()\n {\n DB::table('companies')->insert([\n 'name' => 'Моя компания',\n 'requisites' => json_encode(array(\n \t'address' => 'Адрес',\n \t'phone' => '8(3952)000-000'\n ))\n ]);\n }", "public function run()\n {\n // $Accessory = Accessory::truncate();\n \t$Accessory = Accessory::create(['name_en' => 'Accessory 1',\n \t\t'name_ar'=>'مستلزمات 1',\n \t\t'img'=>'/uploads/partner1.png',\n \t\t'product_id' => '1'\n\n \t\t]);\n\n \t$Accessory = Accessory::create(['name_en' => 'Accessory 2',\n \t\t'name_ar'=>'مستلزمات 2',\n \t\t'img'=>'/uploads/partner2.png',\n \t\t'product_id' => '2'\n\n \t\t]);\n\n }", "public function run()\n\t{\n\t\t\\DB::table('purchases')->delete();\n \n\t\t\\DB::table('purchases')->insert(array (\n\t\t\t0 => \n\t\t\tarray (\n\t\t\t\t'id' => 1,\n\t\t\t\t'price' => '1930.00',\n\t\t\t\t'discount' => '360.00',\n\t\t\t\t'hn' => 5500300,\n\t\t\t\t'sale2_id' => 0,\n\t\t\t\t'sale_id' => 7,\n\t\t\t\t'doctor_id' => 9,\n\t\t\t\t'status' => 0,\n\t\t\t\t'created_at' => '2015-12-08 14:28:38',\n\t\t\t\t'updated_at' => '2015-12-08 16:16:01',\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'deleted_by' => 0,\n\t\t\t\t'deleted_at' => NULL,\n\t\t\t),\n\t\t));\n\t}", "public function run()\n {\n \\DB::table('action_document_user')->insert(array(\n 'action_id'=>4,\n 'document_id'=>1,\n 'username'=> \"116650288\",\n 'created_at'=> '2020-05-02 00:00:00',\n 'updated_at'=> '2020-05-02 00:00:00',\n \n ));\n }", "public function run()\n {\n //creando varias instancias de la tabla cola\n // $cola= new cola;\n //$cola->id_cola=\"1\";\n //$cola->vehiculo_id=\"120\";\n // $cola->parqueo_id=\"1\";\n //$cola->save();\n\n\n }", "public function run()\n {\n $proveedor = new Proveedor;\n $proveedor->nombre = 'centro de acopio';\n //privilegios\n $proveedor->save();\n\n $proveedor = new Proveedor;\n $proveedor->nombre = 'centro de distribucion';\n //privilegios\n $proveedor->save();\n\n $proveedor = new Proveedor;\n $proveedor->nombre = 'clap';\n //privilegios\n $proveedor->save();\n }", "public function run()\n {\n $embarcador1 = new Embarcador();\n $embarcador1->nombre='ALL CARRIER';\n $embarcador1->users_id=1;\n $embarcador1->save();\n }", "public function run()\n {\n //insert some data records\n DB::table('wc_backs')->insert(array(\n array('seating_type' => 'Recliners', 'seating_type_id' => '0',),\n array('seating_type' => 'Wheelchair Cushions', 'seating_type_id' => '1',),\n array('seating_type' => 'Wheelchair Backs', 'seating_type_id' => '2',),\n ));\n }", "public function run()\n {\n // EJECUTAR SEEDER PARA COUNTRIES\n \\DB::table('countries')->insert(array (\n 0 => array ( 'id' => 1, 'name_country' => 'Bolivia'),\n 1 => array ( 'id' => 2, 'name_country' => 'Colombia'),\n )\n );\n }", "public function run()\n {\n $subcategory = new Subcategory();\n $subcategory->description = 'Descripcion martillos';\n $subcategory->image = json_encode(['imagen1']);\n $subcategory->name = 'Martillos';\n $subcategory->category_id = 3;\n $subcategory->save();\n\n $subcategory = new Subcategory();\n $subcategory->description = 'Descripcion taladros';\n $subcategory->image = json_encode(['imagen1']);\n $subcategory->name = 'Taladros';\n $subcategory->category_id = 2;\n $subcategory->save();\n }" ]
[ "0.680696", "0.6621944", "0.66056025", "0.6406889", "0.63191915", "0.6300433", "0.61782837", "0.6100026", "0.59831005", "0.5965348", "0.59386766", "0.58565575", "0.58446", "0.58225316", "0.58103186", "0.58043706", "0.58038926", "0.57651114", "0.5750417", "0.57329994", "0.5709889", "0.56981564", "0.56951076", "0.5694452", "0.56933486", "0.5668324", "0.5666623", "0.5653001", "0.56417775", "0.56390315", "0.5622463", "0.56202704", "0.5617682", "0.56171966", "0.561711", "0.56156325", "0.5603595", "0.5587057", "0.55857956", "0.5575746", "0.5570448", "0.5552122", "0.5547963", "0.55459136", "0.553371", "0.55292153", "0.5523907", "0.55229616", "0.5522038", "0.55169165", "0.5514469", "0.5514205", "0.5513943", "0.55110997", "0.550686", "0.55050045", "0.5502104", "0.5497142", "0.5491228", "0.5490114", "0.5489142", "0.5488864", "0.5484494", "0.54843163", "0.5482421", "0.54803795", "0.5479484", "0.5478166", "0.54741454", "0.547117", "0.5470056", "0.54692185", "0.546514", "0.54581946", "0.5453341", "0.54512054", "0.54509383", "0.5450585", "0.5450127", "0.5450009", "0.5449223", "0.5447531", "0.54468155", "0.54461867", "0.54451925", "0.54438037", "0.5443651", "0.544231", "0.5441178", "0.544001", "0.5436311", "0.543583", "0.5434967", "0.543461", "0.5434092", "0.54316807", "0.5429928", "0.5427391", "0.5427347", "0.54259324", "0.54258806" ]
0.0
-1
/ Plugin Name: Note Taker Plugin URI: Description: Takes Notes on a page and saves them with ajax Version: 0.0.1 Author: Oyin Abatan Author URI: License: GPL2 License URI: Calls Notes if Template Pages
function nt_course_note_call() { // only show logged-in members on learn dash pages $post_type = get_post_type(); $types = array( 'sfwd-courses', 'sfwd-lessons', 'sfwd-topic', 'sfwd-assignment'); if (is_user_logged_in()){ if( in_array( $post_type, $types ) ) { return nt_course_note_entry_field(); } else { echo "<h1>THIS ISNT LEARN DASH</h1>"; } } else { echo '<h1>NOT LOGGED</h1>'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _addNotes()\n\t{\n\t\t$windowId = $this->_Admin_Form_Controller->getWindowId();\n\n\t\treturn Admin_Form_Entity::factory('Script')\n\t\t\t->value(\"$(function (){\n\t\t\t\t$.adminLoad({ path: '/admin/crm/project/note/index.php', additionalParams: 'crm_project_id=\" . $this->_object->id . \"', windowId: '{$windowId}_notes' });\n\t\t\t});\");\n\t}", "function cust_note_insert(){\r\n\t}", "function wiki_add_page($title, $description, $notes, $hide_posts, $member = null, $add_time = null, $views = 0, $meta_keywords = '', $meta_description = '', $edit_date = null, $send_notification = true)\n{\n if (is_null($member)) {\n $member = get_member();\n }\n if (is_null($add_time)) {\n $add_time = time();\n }\n\n require_code('comcode_check');\n check_comcode($description, null, false, null, true);\n\n // Update post count\n if ((addon_installed('points')) && (cms_mb_strlen($description) > 1024)) {\n require_code('points');\n $_count = point_info($member);\n $count = array_key_exists('points_gained_wiki', $_count) ? $_count['points_gained_wiki'] : 0;\n $GLOBALS['FORUM_DRIVER']->set_custom_field($member, 'points_gained_wiki', $count + 1);\n }\n\n $map = array(\n 'hide_posts' => $hide_posts,\n 'notes' => $notes,\n 'submitter' => $member,\n 'wiki_views' => $views,\n 'add_date' => time(),\n 'edit_date' => $edit_date,\n );\n if (multi_lang_content()) {\n $map['description'] = 0;\n } else {\n $map['description'] = '';\n $map['description__text_parsed'] = '';\n $map['description__source_user'] = get_member();\n }\n $map += insert_lang('title', $title, 2);\n if ($description != '') {\n $page_id = $GLOBALS['SITE_DB']->query_insert('wiki_pages', $map, true);\n\n require_code('attachments2');\n $GLOBALS['SITE_DB']->query_update('wiki_pages', insert_lang_comcode_attachments('description', 2, $description, 'wiki_page', strval($page_id), null, false, $member), array('id' => $page_id), '', 1);\n } else {\n $map = insert_lang_comcode('description', $description, 2) + $map;\n $page_id = $GLOBALS['SITE_DB']->query_insert('wiki_pages', $map, true);\n }\n\n update_stat('num_wiki_pages', 1);\n\n log_it('WIKI_ADD_PAGE', strval($page_id), $title);\n\n require_code('seo2');\n if (($meta_keywords == '') && ($meta_description == '')) {\n seo_meta_set_for_implicit('wiki_page', strval($page_id), array($title, $description), $description);\n } else {\n seo_meta_set_for_explicit('wiki_page', strval($page_id), $meta_keywords, $meta_description);\n }\n\n if ($send_notification) {\n if (post_param_integer('send_notification', null) !== 0) {\n dispatch_wiki_page_notification($page_id, 'ADD');\n }\n }\n\n if ((addon_installed('commandr')) && (!running_script('install')) && (!get_mass_import_mode())) {\n require_code('resource_fs');\n generate_resource_fs_moniker('wiki_page', strval($page_id), null, null, true);\n }\n\n require_code('sitemap_xml');\n notify_sitemap_node_add('_SEARCH:wiki:browse:' . strval($page_id), null, $edit_date, ($page_id == db_get_first_id()) ? SITEMAP_IMPORTANCE_HIGH : SITEMAP_IMPORTANCE_MEDIUM, 'weekly', has_category_access($GLOBALS['FORUM_DRIVER']->get_guest_id(), 'wiki', strval($page_id)));\n\n return $page_id;\n}", "function __updateNotes()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //prevent direct access\n if (!isset($_POST['posted'])) {\n //redirect to 'view' url instead\n $this_url = uri_string();\n $redirect = str_replace('update', 'view', $this_url);\n redirect($redirect);\n }\n\n //save sql here\n $result = $this->mynotes_model->updateNote($this->project_id, $this->data['vars']['my_id'], $this->input->post('mynotes_text'));\n $this->data['debug'][] = $this->mynotes_model->debug_data;\n\n //check\n if ($result) {\n $this->notices('success', $this->data['lang']['lang_request_has_been_completed'], 'noty'); //noty or html\n } else {\n $this->notices('error', $this->data['lang']['lang_request_could_not_be_completed'], 'noty'); //noty or html\n }\n\n //get the note\n $this->__viewNotes();\n\n }", "function AddNote(){\n global $wpdb;\n $id = esc_attr($_REQUEST['order_id']);\n $data = array('note' => $_REQUEST['note']);\n if(isset($_REQUEST['admin'])) $data['admin'] = 1;\n if(isset($_REQUEST['seller'])) $data['seller'] = 1;\n if(isset($_REQUEST['customer'])) $data['customer'] = 1;\n if(isset($_REQUEST['file'])) $data['file'] = $_REQUEST['file'];\n\n if(Order::add_note($id, $data)) {\n\n $copy = array();\n if(isset($data['admin'])) $copy[] = '<input type=checkbox checked=checked disabled=disabled /> Admin &nbsp; ';\n if(isset($data['seller'])) $copy[] = '<input type=checkbox checked=checked disabled=disabled /> Seller &nbsp; ';\n if(isset($data['customer'])) $copy[] = '<input type=checkbox checked=checked disabled=disabled /> Customer &nbsp; ';\n $copy = implode(\"\", $copy);\n ?>\n\n <div class=\"panel panel-default\">\n <div class=\"panel-body\">\n <?php $note = wpautop(strip_tags(stripcslashes($data['note']),\"<a><strong><b><img>\")); echo preg_replace('/((http|ftp|https):\\/\\/[\\w-]+(\\.[\\w-]+)+([\\w.,@?^=%&amp;:\\/~+#-]*[\\w@?^=%&amp;\\/~+#-])?)/', '<a target=\"_blank\" href=\"\\1\">\\1</a>', $note); ?>\n </div>\n <?php if(isset($_REQUEST['file'])){ ?>\n <div class=\"panel-footer text-right\">\n <?php foreach($_REQUEST['file'] as $file){ ?>\n <a href=\"#\" style=\"margin-left: 10px\"><i class=\"fa fa-paperclip\"></i> <?php echo $file; ?></a> &nbsp;\n <?php } ?>\n </div>\n <?php } ?>\n <div class=\"panel-footer text-right\"><small><em><i class=\"fa fa-clock-o\"></i> <?php echo date(get_option('date_format') . \" h:i\", time()); ?></em></small>\n <div class=\"pull-left\"><small><em><?php if($copy!='') echo \"Copy sent to \".$copy; ?></em></small></div>\n </div>\n </div>\n <?php }\n else\n echo \"error\";\n }", "function __editNotes()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //get the note\n $this->__viewNotes();\n\n //visibility\n $this->data['visible']['wi_my_note_edit'] = 1;\n $this->data['visible']['wi_my_note_view'] = 0;\n\n }", "function process_course_note() {\n\tif ( ! empty( $_POST[ 'submission' ] ) ) {\n\t\twp_send_json_error( 'Honeypot Check Failed' );\n\t}\n\tif ( ! check_ajax_referer( 'nt-course-note-nonce', 'security' ) ) {\n\t\twp_send_json_error( 'Security Check failed' );\n\t}\n\t$course_title = nt_generate_course_title($_POST[ 'data' ][ 'currentPostType' ] ,$_POST[ 'data' ][ 'currentLessonId' ]);\n\t$notes_data = array(\n\t\t'post_title' => $course_title.' - '.\n\t\t\t/*sanitize_text_field( $_POST[ 'data' ][ 'userId' ] ),\n\t\t\tsanitize_text_field( $_POST[ 'data' ][ 'currentLessonId' ] ),*/\n\n\t\t\tsanitize_text_field( $_POST[ 'data' ][ 'title' ] ),\n\t\t'post_status' => 'draft',\n\t\t'post_type' => 'coursenote',\n\t\t'post_content' => wp_kses_post( $_POST[ 'data' ][ 'body' ] )\n\t);\n\n\n\n//If note id already exists update exisiting note else insert new note\n$note_Id_update = get_post_id_by_meta_key_and_value('nt-note-current-lessson-id', $_POST[ 'data' ][ 'currentLessonId' ]);\n$post_author = get_post_field( 'post_author', $note_Id_update );\n\n\tif($note_Id_update && ($post_author == $_POST[ 'data' ][ 'userId' ])){\n\n\t\t$post_id = wp_update_post( array(\n\t\t\t'ID' => $note_Id_update,\n\t\t\t'post_content' => wp_kses_post( $_POST[ 'data' ][ 'body' ] )\n\t\t), true );\n\n\t\twp_send_json_success( $post_id );\n\t} else {\n\t\t$post_id = wp_insert_post( $notes_data, true );\n\t\tif ( $post_id ) {\n\n\t\t\tupdate_post_meta( $post_id, 'nt-note-user-id', $_POST[ 'data' ][ 'userId' ] );\n\t\t\tupdate_post_meta( $post_id, 'nt-note-current-lessson-id', $_POST[ 'data' ][ 'currentLessonId' ] );\n\n\t\t}\n\t\twp_send_json_success( $post_id );\n\t}\n\n}", "public function addnotesAction() {\n\t\t$this->_helper->viewRenderer->setNoRender();\n\t\t$this->_helper->layout()->disableLayout();\n\t\t$id = $this->_getParam('taid');\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t$notes = stripslashes(strip_tags($this->_getParam('value')));\n\t\t$ta->notes = preg_replace('/[\\r\\n]+/', ' ', $notes);\n\t\t$ta->save();\n\t\techo $ta->notes;\n\t}", "function projectpentagon_tastingnotes() {\n\t wp_nonce_field( plugin_basename( __FILE__ ), 'myplugin_noncename' );\n\t $post_idinhere\t=\t$_GET['post']; //GET THE ID OUTSIDE OF THE LOOP\n\t \n\t $get_field_name\t=\t get_option('projectpentagon-titleonpages');\n\t $meta_value_field = get_post_meta($post_idinhere, 'tasting-notes', true); \n\tif($meta_value_field1)\n\t\t{\n\t\t \t//echo \"we're at debut point a\";//debug\n\t\t \t$display1 = $meta_value_field1; \n\t\t}\n\telse \n\t\t{\n\t\t \t//echo \"we're at debut point b\". $meta_value_field1 .\"\";//debug\n\t\t \t$display1 = \"enter value here.\";\n\t\t}\n\n\t\t// we're not using _e because its user input text we're retrieving.\n\t // we'll assume that the user put it in the database in their preferred language\n\t\t\t echo '<label for=\"'. $get_field_name .'\">';\n\t\t\techo $get_field_name;\n\t\t \techo '</label> <br /> ';\n\t\t\techo '<textarea id=\"tasting-notes\" name=\"tasting-notes\" cols=\"60\" rows=\"4\" tabindex=\"30\" style=\"width: 97%;\">'. $meta_value_field .'</textarea>';\t\n}", "public function generateCommon(Page $page, User $user, $notes, $image_id, $editable)\n\t{\n\t\t$permission = $this->userPermission($user);\n\t\t$data_href = get_base_href();\n\t\t\n\t\t$page->add_header(<<<JS\n\n<!-- For Shortcuts -->\t\n<script type=\"text/javascript\" src=\"$data_href/lib/ext_notes/shortcut.js\"> </script>\n\n<!-- For common styles -->\n<link rel=\"stylesheet\" type=\"text/css\" href=\"$data_href/lib/ext_notes/ext_notes.css\" />\n\nJS\n);\n\t\t$string = <<<JS\n<!-- For Annotation -->\t\n<link rel=\"stylesheet\" type=\"text/css\" href=\"$data_href/lib/ext_notes/annotation.css\" />\n<script type=\"text/javascript\" src=\"$data_href/lib/ext_notes/jquery-ui-1.8.12.min.js\"> </script>\n<script type=\"text/javascript\" src=\"$data_href/lib/ext_notes/jquery.annotate.js\"> </script>\n\n<!-- For common functions -->\n<script type=\"text/javascript\" src=\"$data_href/lib/ext_notes/ext_notes.js\"> </script>\n<script type=\"text/javascript\">\n// <![CDATA[\n$.preLoadImages(\"$data_href/lib/ext_notes/images/accept.png\",\n\t\t\t\t\"$data_href/lib/ext_notes/images/asterisk_yellow.png\",\n\t\t\t\t\"$data_href/lib/ext_notes/images/cross.png\",\n\t\t\t\t\"$data_href/lib/ext_notes/images/history.png\",\n\t\t\t\t\"$data_href/lib/ext_notes/images/delete.png\");\n// ]]>\n</script>\nJS;\n\t\tif($editable)\n\t\t\t$string .= <<<JS\n<script type=\"text/javascript\">\n// <![CDATA[\nshortcut.add(\"Alt+N\",\nfunction()\n{\n\t$.add_note_init_center($image_id);\n});\n// ]]>\n</script>\nJS;\n\t\treturn($string);\n\t}", "function lb_save_page() {\n\tif ( ! isset( $_POST['save_page'] ) ) {\n\t\treturn;\n\t}\n\n\t$page_name = esc_html( $_POST['page_name'] );\n\t$page_content = $_POST['mytextarea'];\n\n\tif ( lb_add_page( $page_name, $page_content ) ) {\n\t\tlb_add_notice( 'success', 'Сторінку додано' );\n\t} else {\n\t\tlb_add_notice( 'error', 'Сторінку не додано' );\n\t}\n\n\theader( 'Location:?action=make_page' );\n\tdie();\n}", "public function updateBackupNote()\n {\n $encrypt = $this->services['encrypt'];\n $file_name = $encrypt->decode($this->getPost('backup'));\n $backup_type = stripslashes_deep($this->getPost('backup_type'));\n $note_text = stripslashes_deep($this->getPost('note_text')); \n if($note_text && $file_name)\n {\n $path = rtrim($this->settings['working_directory'], DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$backup_type;\n $this->services['backup']->getDetails()->addDetails($file_name, $path, array('note' => $note_text));\n echo json_encode(array('success'));\n }\n exit;\n }", "function wrapper(){\r\n\tadd_comments_page('Remarks', 'Remarks', 'manage_options', 'remarks', 'remarks_main');\r\n}", "public function process() {\r\n $notes = $this->getProperty('content','');\r\n if (empty($notes)) return $this->failure($this->modx->lexicon('admintools_err_empty_file'));\r\n $path = $this->modx->getOption('admintools_core_path', NULL, $this->modx->getOption('core_path') . 'components/admintools/').\"elements/tmp/\";\r\n $file = $path.'notes.txt';\r\n if (!file_exists($file)) {\r\n return $this->failure($this->modx->lexicon('admintools_err_file_nf'));\r\n }\r\n $notes = unserialize($notes);\r\n if (is_array($notes) && !empty($notes)) {\r\n foreach ($notes as $note) {\r\n $obj = $this->modx->newObject('adminNotes');\r\n $note['createdby'] = $this->modx->user->id;\r\n $note['createdon'] = time();\r\n $obj->fromArray($note);\r\n $obj->save();\r\n }\r\n }\r\n\r\n return $this->success();\r\n }", "public function generateNotes(Page $page, User $user, $notes, $image_id, $editable)\n\t{\n\t\t$permission = $this->userPermission($user);\n\t\t\n\t\t$add_link = make_link(\"note_add\");\n\t\t$change_link = make_link(\"note_change\");\n\t\t$remove_link = make_link(\"note_remove\");\n\t\t\n\t\t$editable = (isset($editable) && $editable) ? \"true\" : \"false\";\n\t\t\n\t\t$string = <<<JS\n<script type=\"text/javascript\">\n// <![CDATA[\n\n$(window).load(function()\n{\n\tvar annotations = new $(\"#Imagemain\").annotateImage({\n\t\t\taddUrl: \"$add_link\",\n\t\t\tsaveUrl: \"$change_link\",\n\t\t\tdeleteUrl: \"$remove_link\",\n\t\t\tpermission: $permission,\n\t\t\teditable: $editable,\n\t\t\tuseAjax: true,\n\t\t\tredirect: $(\"#main_image\"),\n\t\t\tnotes: [\nJS;\n\t\t\n\t\tforeach($notes as $note)\n\t\t{\n\t\t\t$text = json_encode($note[\"text\"]);\n\t\t\t$string .= <<<JS\n\t\t\t\t{\n\t\t\t\t\t\"top\": $note[y],\n\t\t\t\t\t\"left\": $note[x],\n\t\t\t\t\t\"width\": $note[w],\n\t\t\t\t\t\"height\": $note[h],\n\t\t\t\t\t\"text\": $text,\n\t\t\t\t\t\"id\": \"$note[id]\",\n\t\t\t\t\t\"editable\": true,\n\t\t\t\t\t\"new_note\": false\n\t\t\t\t},\nJS;\n\t\t\t//$string .= \"add_note($note[id], $text, $note[x], $note[y], $note[w], $note[h], $permission);\\n\";\n\t\t}\n\t\t\n\t\t$string .= <<<JS\n\t\t\t]\n\t\t});\n\t$(\"#Imagemain\").data(\"annotations\", annotations);\n});\n// ]]>\n</script>\n\nJS;\n\t\tif($editable)\n\t\t\t$string .= <<<JS\n\t\t\t\n<script type=\"text/javascript\">\n// <![CDATA[\n\n$(window).load(function()\n{\n\t$(\"#main_image\").dblclick(function(e)\n\t{\n\t\tvar offset = $(\"#main_image\").offset();\n\t\t$.add_note_init($image_id, e.pageX - offset.left, e.pageY - offset.top);\n\t});\n});\n\t\t\t\n// ]]>\n</script>\n\nJS;\n\t\t\n\t\treturn($string);\n\t}", "function createNote();", "function addNote()\n {\n $replace = array();\n\n //current logged in user details\n $userInfo = $this->userInfo();\n\n $patientId = $this->value('patient_id');\n\n $msg = \"\";\n\n //save button clicked!\n if(\"Save\" == $this->value('submitted'))\n {\n $newNote = $this->value('note');\n\n if(strlen(trim($newNote)) == 0)\n {\n $msg = '<div style=\"padding-left:5px;color:red;\">Please enter a note for this patient.</div>';\n }\n else\n {\n $insertArr = array(\n 'patient_id' => $patientId,\n 'provider_id' => $userInfo['user_id'],\n 'note' => $this->encrypt_data($this->value('note')),\n 'created' => date('Y-m-d H:i:s', time())\n );\n\n $result = $this->insert('notepad', $insertArr);\n\n /* if(!$result)\n {\n $msg = '<div style=\"padding-left:5px;\">Failed adding a note.</div>';\n } */\n }\n $privateKey = $this->config['private_key'];\n\n // patient details\n $query = \"SELECT \n AES_DECRYPT(UNHEX(name_first),'{$privateKey}') as name_first,\n AES_DECRYPT(UNHEX(name_last),'{$privateKey}') as name_last \n FROM \n user WHERE user_id = \" . $patientId;\n $result = $this->execute_query($query);\n\n $row = $this->fetch_array($result);\n\n $replace = $this->notesList($patientId);\n $patientName = $row['name_first'] . \"&nbsp;&nbsp;\" . $row['name_last'];\n $replace['patient_id'] = $patientId;\n $replace['patientName'] = $patientName;\n $replace['statusMessage'] = $msg;\n }\n else\n {\n $replace = $this->notesList($patientId);\n }\n\n $replace['patient_id'] = $patientId;\n\n $this->output = $this->build_template($this->get_template(\"addNote\"), $replace);\n }", "function bitsa_notes_viewnotes(){\n\n\t\twp_enqueue_script( 'bitwise_sidebar_content_public_js', plugin_dir_url( __FILE__ ) . '/public/js/bitwise-sidebar-content-public.js', array( 'jquery' ), '1.0.0', false );\n\t\twp_enqueue_script( 'learndash_sidebar_content_public_js', plugin_dir_url( __FILE__ ) . '/public/js/nt_notes.js', array( 'jquery' ), '1.0.0', false );\n\t\twp_enqueue_script( 'learndash_sidebar_print_public_js', plugin_dir_url( __FILE__ ) . '/public/js/nt_notes_lib.js', array( 'jquery' ), '1.0.0', false );\n\t\twp_enqueue_script( 'bitwise_lightbox_html5view', plugin_dir_url( __FILE__ ) . 'public/html5lightbox/html5lightbox.js', array(), '1.0.0', false );\n\t\twp_enqueue_style( 'bitwise_sidebar_content_public', plugin_dir_url( __FILE__ ) . 'public/css/bitwise-sidebar-content-public.css', array(), '1.0.0', 'all' );\n\n\t global $wpdb;\n\t\t$current_user\t= wp_get_current_user();\n\t\t$allowed_roles = array('administrator');\n \t$user_id = $current_user->ID;\n\t\t$table = $wpdb->prefix.'bitscr_notes';\n\t\tif(isset($_GET['currenttopicid'])){\n\t\t\t $currenttopicid = $_GET['currenttopicid'];\n\t\t\t $oldnotes=Bitscr_Common::selecttopicnotes( $user_id,$currenttopicid);\n\t\t\t }else{\n\t\t\t if( array_intersect($allowed_roles, $current_user->roles ) ) { //check if the user have admin access\n \n \t\t\t$oldnotes=Bitscr_Common::selectallnotes();\n \t\t} else{\n\t \t\t\t$oldnotes=Bitscr_Common::selectusernotes( $user_id); //select the notes for particular user\n \t\t }\n\t\t\t }\n\t\t ?>\n\t\t<div class=\"searchdiv\">\n <div class=\"notes_list_filter show_drpd\">\n <label>Show\n <select class=\"data_display\">\n <option value=\"10\">10</option>\n <option value=\"25\">25</option>\n <option value=\"50\">50</option>\n </select> entries</label>\n </div>\n\t\t<div class=\"col-md-6 auto nogap notes_list_filter pull-right\">\n <input class=\"form-control form-control-sm ml-3 w-75 search\" type=\"text\" placeholder=\"Search\" aria-label=\"Search\">\n </div>\n </div> \n <div class=\"notes_list_tablediv\">\n\t\t<form action=\"\" method=\"get\">\n <table class=\"notes-listing notes_list_table\">\n <thead>\n <tr style=\"background-color: black;color: white;\">\n <th>&nbsp;</th>\n <th><?php esc_html_e('Notes','sfwd-lms'); ?></th>\n <?php\n if( array_intersect($allowed_roles, $current_user->roles ) ) { \n ?>\n <th><?php esc_html_e( 'User', 'sfwd-lms' ); ?></th>\n <?php }?>\n \n <th><?php esc_html_e( 'Date', 'sfwd-lms' ); ?></th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n\n \t</tbody>\n \t<tfoot>\n \t<tr>\n \t<td colspan=\"5\">\n <input type=\"submit\" name=\"lds-bulk-download\" class=\"lds-bulk-download\" value=\"<?php esc_attr_e( 'Download Selected', 'sfwd-lms' ); ?>\" type=\"submit\">\n </td>\n </tr>\n </tfoot>\n </table>\n\n <div class=\"displaying_message\"></div>\n\t\t<ul class=\"pagination\"> </ul>\n\n </form></div>\n</div>\n\n <?php foreach($oldnotes as $oldnote){?>\n \t<form id=\"singlesubmit<?php echo $oldnote->id;?>\" method=\"get\" action=\"\">\n <input type=\"hidden\" name=\"lds-bulk-action-item[<?php echo $oldnote->topic_id; ?>]\" value=\"<?php echo $oldnote->topic_id; ?>\">\n </form>\n<?php }\n\t}", "function ajax_update_client_internal_notes() {\r\n\r\n if ( !isset( $_POST['id'] ) || !$_REQUEST['id'] ) {\r\n die( json_encode( array('status' => false, 'message' => 'Some problem with update.' ) ) );\r\n }\r\n\r\n $id = explode( '_', $_POST['id'] );\r\n\r\n //check id and hash\r\n if ( isset( $id[0] ) && $id[0] && isset( $id[1] ) && md5( 'wpcclientinternalnote_' . $id[0] ) == $id[1] ) {\r\n $client = get_userdata( $id[0] );\r\n\r\n if ( $client ) {\r\n $internal_notes = ( isset( $_POST['notes'] ) ) ? base64_decode( str_replace( '-', '+', $_POST['notes'] ) ) : '';\r\n\r\n update_user_meta( $id[0], 'wpc__internal_notes', $internal_notes );\r\n die( json_encode( array('status' => true, 'message' => 'Notes is updated.' ) ) );\r\n }\r\n }\r\n\r\n die( json_encode( array('status' => false, 'message' => 'Some problem with update.' ) ) );\r\n }", "function plugin_postinstall_nexcontent($pi_name)\r\n{\r\n global $_DB_dbms, $_CONF, $_DB_table_prefix, $_TABLES ;\r\n\r\n $sql= \"INSERT INTO {$_TABLES['nexcontent_pages']} (id,pid,type,pageorder,name,blockformat,heading,content,meta_description,meta_keywords) VALUES (1, 0, 'category', '10', 'frontpage', 'none', 'Front Page Folder', 'Create a page under this folder if you want to have a page loaded as the frontpage', '', '');\";\r\n DB_query($sql);\r\n\r\n return true;\r\n}", "public function showSysNotesForPage()\t{\n\t\tglobal $TCA;\n\n\t\t$out='';\n\n\t\t\t// Checking if extension is loaded:\n\t\tif (!t3lib_extMgm::isLoaded('sys_note'))\treturn '';\n\n\t\t\t// Create query for selecting the notes:\n\t\t$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','sys_note','pid IN ('.$this->id.') AND (personal=0 OR cruser='.intval($GLOBALS['BE_USER']->user['uid']).')'.t3lib_BEfunc::deleteClause('sys_note').t3lib_BEfunc::versioningPlaceholderClause('sys_note'));\n\n\t\t\t// Executing query:\n\t\t$dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);\n\n\t\t\t// If some notes were found, render them:\n\t\tif ($dbCount)\t{\n\t\t\t$cat = array();\n\n\t\t\t\t// Load full table description:\n\t\t\tt3lib_div::loadTCA('sys_note');\n\n\t\t\t\t// Traverse note-types and get labels:\n\t\t\tif ($TCA['sys_note'] && $TCA['sys_note']['columns']['category'] && is_array($TCA['sys_note']['columns']['category']['config']['items']))\t{\n\t\t\t\tforeach($TCA['sys_note']['columns']['category']['config']['items'] as $el)\t{\n\t\t\t\t\t$cat[$el[1]]=$GLOBALS['LANG']->sL($el[0]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\t// For each note found, make rendering:\n\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\t{\n\n\t\t\t\t\t// Create content:\n\t\t\t\t$iconImg = t3lib_iconWorks::getSpriteIconForRecord('sys_note', $row);\n\t\t\t\t$subject = htmlspecialchars($row['subject']);\n\t\t\t\t$fields = array();\n\t\t\t\t$fields['Author:'] = htmlspecialchars($row['author'].($row['email'] && $row['author'] ? ', ':'').$row['email']);\n\t\t\t\t$fields['Category:'] = htmlspecialchars($cat[$row['category']]);\n\t\t\t\t$fields['Note:'] = nl2br(htmlspecialchars($row['message']));\n\n\t\t\t\t\t// Compile content:\n\t\t\t\t$out.='\n\n\n\t\t\t\t<!--\n\t\t\t\t\tSys-notes for list module:\n\t\t\t\t-->\n\t\t\t\t\t<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" id=\"typo3-dblist-sysnotes\">\n\t\t\t\t\t\t<tr><td colspan=\"2\" class=\"bgColor2\">'.$iconImg.'<strong>'.$subject.'</strong></td></tr>\n\t\t\t\t\t\t<tr><td class=\"bgColor4\">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.category',1).'</td><td class=\"bgColor4\">'.$fields['Category:'].'</td></tr>\n\t\t\t\t\t\t<tr><td class=\"bgColor4\">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.author',1).'</td><td class=\"bgColor4\">'.$fields['Author:'].'</td></tr>\n\t\t\t\t\t\t<tr><td class=\"bgColor4\">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.note',1).'</td><td class=\"bgColor4\">'.$fields['Note:'].'</td></tr>\n\t\t\t\t\t</table>\n\t\t\t\t';\n\t\t\t}\n\t\t}\n\t\treturn $out;\n\t}", "function nt_course_note_entry_field() {\nglobal $post;\n\n//ID's\n$current_user = get_current_user_id();\n$current_lesson_id = $post->ID;\n$current_post_type = get_post_type();\n\n//Checks if note exists and changes title and body variables accordingly\n$args = array(\n\t'post_type' => 'coursenote',\n\t'post_status' => array('draft'),\n\t'meta_query' => array(\n\t\t//'relation' => 'AND',\n\t\tarray(\n\t\t\t'key' => 'nt-note-current-lessson-id',\n\t\t\t'value' => $current_lesson_id,\n\t\t\t'compare' => '=',\n\t\t)\n\t),\n\t 'author' => $current_user\n);\n\n$the_query = new WP_Query( $args );\n\nif ($the_query->have_posts()){\n while ( $the_query->have_posts() ) : $the_query->the_post();\n\n $title = get_the_title();\n $body = get_the_content();\n\n endwhile;\n wp_reset_postdata();\n} else {\n\n\t$title = 'Note Title';\n\t$body = 'Enter Lesson Notes here';\n}\n\n\n\n?>\n\n <div id=\"nt_note_cont\" class=\"note-container\">\n <div class=\"note-header\">\n <div class=\"note-header-title\">\n <?php _e('Notes'); ?>\n\t\t\t\t<div id=\"apf-response\"></div>\n </div>\n <div class=\"note-header-actions\">\n\n </div>\n </div>\n <div class=\"note-body\">\n <form id=\"nt-course-note\" action=\"\" method=\"post\">\n\t\t\t\t\t<?php wp_nonce_field( basename(__FILE__), 'nt-course-note-nonce') ?>\n\t\t\t\t\t<input type=\"text\" name=\"nt-note-title\" id=\"nt-note-title\" value=\"<?php echo $title; ?>\" placeholder=\"\" >\n\t\t\t\t\t<input type=\"hidden\" name=\"nt-note-user-id\" id=\"nt-note-user-id\" value=\"<?php echo $current_user; ?>\">\n\t\t\t\t\t<input type=\"hidden\" name=\"nt-note-current-lesson-id\" id=\"nt-note-current-lessson-id\" value=\"<?php echo $current_lesson_id; ?>\">\n\t\t\t\t\t<input type=\"hidden\" name=\"nt-note-current-post-type\" id=\"nt-note-current-post-type\" value=\"<?php echo $current_post_type; ?>\">\n\t\t\t\t\t<textarea rows=\"8\" name=\"nt-note-body\" id=\"nt-note-body\" class=\"\" placeholder=\"\"/><?php echo $body; ?></textarea>\n\t\t\t\t\t<input type=\"text\" id=\"xyz\" name=\"<?php echo apply_filters( 'honeypot_name', 'date-submitted') ?>\" value=\"\" style=\"display:none\">\n <input type=\"submit\" id=\"nt-note-submit\" value=\"<?php _e('Save Notes'); ?>\"/>\n </form>\n\n </div>\n\n </div>\n <?php\n\n}", "function plugin_insert_action()\n{\n\t//global $script, $vars, $cols, $rows;\n\tglobal $script, $cols, $rows;\n\tglobal $_title_collided, $_msg_collided, $_title_updated;\n\n\tif (PKWK_READONLY) die_message('PKWK_READONLY prohibits editing');\n\t//if (! isset($vars['msg']) || $vars['msg'] == '') return;\n\t$msg = WikiParam::getMsg();\n\tif ($msg == '') return;\n\n/*\t$vars['msg'] = preg_replace('/' . \"\\r\" . '/', '', $vars['msg']);\n\t$insert = ($vars['msg'] != '') ? \"\\n\" . $vars['msg'] . \"\\n\" : '';*/\n\t$msg = preg_replace('/' . \"\\r\" . '/', '', $msg);\n\t$insert = ($msg != '') ? \"\\n\" . $msg . \"\\n\" : '';\n\n\t$postdata = '';\n\t//$postdata_old = get_source($vars['refer']);\n\t$refer = WikiParam::getRefer();\n\t$postdata_old = get_source($refer);\n\t$insert_no = 0;\n\n\tforeach($postdata_old as $line) {\n\t\tif (! INSERT_INS) $postdata .= $line;\n\t\tif (preg_match('/^#insert$/i', $line)) {\n\t\t\t//if ($insert_no == $vars['insert_no'])\n\t\t\tif ($insert_no == WikiParam::getVar('insert_no'))\n\t\t\t\t$postdata .= $insert;\n\t\t\t$insert_no++;\n\t\t}\n\t\tif (INSERT_INS) $postdata .= $line;\n\t}\n\n\t$postdata_input = $insert . \"\\n\";\n\n\t$body = '';\n\t$digest = WikiParam::getVar('digest');\n\t//if (md5(@join('', get_source($vars['refer']))) != $vars['digest']) {\n\tif (md5(get_source($refer, true)) != $digest) {\n\t\t$title = $_title_collided;\n\t\t$body = $_msg_collided . \"\\n\";\n\n/*\t\t$s_refer = htmlspecialchars($vars['refer']);\n\t\t$s_digest = htmlspecialchars($vars['digest']);*/\n\t\t$s_refer = htmlspecialchars($refer);\n\t\t$s_digest = htmlspecialchars($digest);\n\t\t$s_postdata_input = htmlspecialchars($postdata_input);\n\t\t$postScript = $script . WikiParam::convQuery(\"?cmd=preview\");\n\t\t$body .= <<<EOD\n<form action=\"$postScript\" method=\"post\" class=\"form\">\n <div>\n <input type=\"hidden\" name=\"refer\" value=\"$s_refer\" />\n <input type=\"hidden\" name=\"digest\" value=\"$s_digest\" />\n <textarea name=\"msg\" class=\"wiki_edit\" rows=\"$rows\" cols=\"$cols\">$s_postdata_input</textarea><br />\n </div>\n</form>\nEOD;\n/*\t\t$body .= <<<EOD\n<form action=\"$script?cmd=preview\" method=\"post\" class=\"form\">\n <div>\n <input type=\"hidden\" name=\"refer\" value=\"$s_refer\" />\n <input type=\"hidden\" name=\"digest\" value=\"$s_digest\" />\n <textarea name=\"msg\" rows=\"$rows\" cols=\"$cols\" id=\"textarea\">$s_postdata_input</textarea><br />\n </div>\n</form>\nEOD;*/\n\t} else {\n\t\t//page_write($vars['refer'], $postdata);\n\t\tpage_write($refer, $postdata);\n\n\t\t$title = $_title_updated;\n\t}\n\t$retvars['msg'] = $title;\n\t$retvars['body'] = $body;\n\n\t//$vars['page'] = $vars['refer'];\n\tWikiParam::setPage($refer);\n\n\treturn $retvars;\n}", "public function save()\n {\n\n $url = parse_url($this->params->url);\n $path = $url['path'];\n $note = new Note(array('url' => $path));\n $note->load();\n\n // Get the new note config\n\n $config = json_decode($this->params->config);\n\n // Can we read or edit it?\n\n $can_read = $this->can_read($note);\n $can_edit = $can_read ? $this->can_edit($note) : FALSE;\n\n // Edit the note (if allowed)\n\n $old_notes = $note->notes;\n if ($config->notes)\n {\n $note->notes = json_encode($config->notes);\n $note->words = Note::words($config->notes);\n }\n if ($config->photo) $note->photo = $config->photo;\n if ($config->paper) $note->paper = $config->paper;\n if ($config->readers) $note->readers = $config->readers;\n if ($config->editors) $note->editors = $config->editors;\n if ($can_edit) $note->save();\n $this->render->data = array(\n 'now' => time(),\n 'diff' => $can_read ? $this->diff($old_notes, $note->notes) : NULL,\n 'paper' => $can_read ? $note->paper : 'secret',\n 'photo' => $note->photo,\n 'readers' => $note->readers,\n 'editors' => $note->editors,\n 'is_owner' => $this->is_owner,\n 'can_read' => $can_read,\n 'can_edit' => $can_edit,\n 'notelist' => $this->recent(),\n );\n\n // Log the info\n\n $action = $can_edit ? 'saved' : 'viewed';\n Log::info($this->host_ip . \" $action a note at $path\");\n }", "function saveSampleNotes() {\n\t \n\t \n\t \n\t $data = $this->input->post();\n\t \t \t \n\t if ($this->products_model->saveSampleNotes($data)) {\n\t \n\t \tdie(nl2br($data['notes']));\t \t \n\t \t \t \n\t } else {\n\t\t \n\t\t die(\"ERROR\");\n\t\t \n\t }\n\t \t \n\t \n\t \n }", "function plugin_insert_convert()\n{\n\tglobal $script;\n\tglobal $_btn_insert;\n\tstatic $numbers = array();\n\n\tif (PKWK_READONLY) return ''; // Show nothing\n\n\t//if (! isset($numbers[$vars['page']])) $numbers[$vars['page']] = 0;\n\t$page = WikiParam::getPage();\n\tif (! isset($numbers[$page])) $numbers[$page] = 0;\n\n\t//$insert_no = $numbers[$vars['page']]++;\n\t$insert_no = $numbers[$page]++;\n\n\t//$s_page = htmlspecialchars($vars['page']);\n\t//$s_digest = htmlspecialchars($digest);\n\t$s_page = htmlspecialchars($page);\n\t$s_digest = htmlspecialchars(WikiParam::getDigest());\n\t$postScript = $script . WikiParam::convQuery(\"?\");\n\t$s_cols = INSERT_COLS;\n\t$s_rows = INSERT_ROWS;\n\t$string = <<<EOD\n<form action=\"$postScript\" method=\"post\" class=\"form\">\n <div>\n <input type=\"hidden\" name=\"insert_no\" value=\"$insert_no\" />\n <input type=\"hidden\" name=\"refer\" value=\"$s_page\" />\n <input type=\"hidden\" name=\"plugin\" value=\"insert\" />\n <input type=\"hidden\" name=\"digest\" value=\"$s_digest\" />\n <textarea name=\"msg\" class=\"wiki_edit\" rows=\"$s_rows\" cols=\"$s_cols\"></textarea><br />\n <input type=\"submit\" name=\"insert\" class=\"button\" value=\"$_btn_insert\" />\n </div>\n</form>\nEOD;\n\treturn $string;\n}", "function textus_get_control()\n{\n global $urllink;\n\n if (is_server()) {\n \n // Load the relevant controller that contains the methods/\n \n switch($_SERVER['REQUEST_METHOD']) {\n case 'GET':\n $request = new get_text_controller();\n //$parse = parse_parameters();\n if ( $_GET['type'] == 'annotation' ) {\n if (intval($_GET['text'])) {\n return_response(textus_get_annotations($_GET['text']));\n #return_response(array(\"status\"=>200, \"notes\"=>textus_get_annotations($_GET['text'])));\n } else {\n return_response(array(\"status\" => 403, \"error\"=>\"You need to specify a text\"));\n }\n }\n break;\n case 'POST':\n $textid = json_decode(file_get_contents(\"php://input\"), TRUE);\n if (isset($textid['textid'])) {\n if ( ! is_user_logged_in()) {\n return_response(array(\"status\" => 403, \"note\"=>\"This user is not logged in\"));\n } else {\n\t\t $current_user = wp_get_current_user();\n\t\t $noteid = textus_insert_annotation(\n\t\t $current_user->ID, $textid['textid'], \n\t\t $textid['start'], $textid['end'], \n\t\t $textid['private'], \n\t\t $textid['payload']['language'], $textid['payload']['text']\n\t\t );\n\n\t\t if (intval($noteid) > 0) {\n\t\t return_response(array(\"status\" => 200, \"note\"=>\"The note has been stored\" + intval($noteid)));\n\t\t } else {\n\t\t return_response(array(\"status\" => 403, \"note\"=>\"The note could not updated\"));\n\t\t }\n\t\t \n\t\t break;\n }\n } else {\n break;\n }\n case 'PUT':\n $textid = json_decode(file_get_contents(\"php://input\"), TRUE);\n print \"PUT\";\n if (isset($textid['textid'])) {\n\t\t // returns the new noteid\n if ( ! is_user_logged_in()) {\n return_response(array(\"status\" => 403, \"note\"=>\"This user is not logged in\"));\n } else {\n $current_user = wp_get_current_user();\n\t\t $noteid = textus_updates_annotation(\n\t\t $current_user->ID, $textid['textid'], \n\t\t $textid['start'], $textid['end'], \n\t\t $textid['private'], \n\t\t $textid['payload']['language'], $textid['payload']['text'], $textid['id']);\n\t\t \n\t\t if (intval($noteid) > 0 ) {\n\t\t return_response(array(\"status\"=> 200, \"notes\" => $textid['id'] + \" has been updated\"));\n\t\t }\n\t\t break;\n }\n } else {\n break;\n }\n case 'DELETE':\n \n //@todo get the vars which the textus viewer sets\n $textid = json_decode(file_get_contents(\"php://input\"), TRUE);\n if ( ! is_user_logged_in()) {\n return_response(array(\"status\" => 403, \"note\"=>\"This user is not logged in\"));\n } else {\n $current_user = wp_get_current_user();\n\t\t $noteid = textus_delete_annotation($textid['id']);\n\t\t if (intval($noteid) > 0 ) {\n\t\t return_response(array(\"status\"=> 200, \"notes\" => $textid['id'] + \" has been deleted\"));\n\t\t }\n\t\t break;\n }\n\n default:\n $parse = parse_parameters();\n if ($parse['action'] == 'json') {\n return wp_send_json( array ('error' => 'Method is unsupported') );\n }\n break;\n }\n }\n}", "function _adminnews() {\r\n#echo dump($_GET);\r\n\t\tglobal $conf,$lang,$member;\r\n\t\t$u = $conf['site']['url'] . \"admin/news\";\r\n\t\t$r = '<a href=\\'' . $u . '\\'>&lt;--</a><br /><br />';\r\n\t\t#// wysiwyg = wysiwyg('textarea') //\r\n\t\tif ( isset ( $_GET['editpage'] ) )\r\n\t\t\t{\r\n\t\t\t\tif ( isset ( $_POST['opage'] ) && isset ( $_POST['page'] ) && isset ( $_POST['content'] ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$_POST['content'] = preg_replace(\"#\\\\\\\"#\",\"\\\"\",$_POST['content']);\r\n\t\t\t\t\t\t$w = $conf['database']['db'] -> query ( \"UPDATE `{$conf['database']['pref']}news` SET `name`='\" . secure($_POST['page']) . \"', `text`='\" . ($_POST['content']) . \"' WHERE `name`='\" . secure($_POST['opage']) . \"'\");\r\n\t\t\t\t\t\tif ($w)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$r .= $lang['news']['editedpage'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$r .= $lang['news']['noteditedpage'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} \r\n\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$w = $conf['database']['db'] -> query ( \"SELECT `name`,`text` FROM `{$conf['database']['pref']}news` WHERE `name`='{$_GET['editpage']}'\" );\r\n\t\t\t\t\t\t$w = $conf['database']['db'] -> fetch ( $w, 'array' );\r\n\t\t\t\t\t\t$w = $w[0];\r\n\t\t\t\t\t\t$r .= \"<form method='post' action='{$u}editpage/{$_GET['editpage']}'><table><tr><td>{$lang['news']['title']}</td><td><input type='hidden' name='opage' value='{$w['name']}'><input type='text' name='page' value='{$w['name']}'></td></tr><tr><td>{$lang['news']['content']}</td><td><textarea id='ncontent' name='content' rows='25' cols='50'>{$w['text']}</textarea></td></tr><tr><td></td><td><input type='submit' value='{$lang['news']['save']}'></td></tr></form></table>\" . wysiwyg('ncontent');\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\telseif ( isset ( $_GET['newpage'] ) )\r\n\t\t\t{\r\n\t\t\t\tif ( isset ( $_POST['page'] ) && isset ( $_POST['content'] ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$_POST['content'] = preg_replace(\"#\\\\\\\"#\",\"\\\"\",$_POST['content']);\r\n\t\t\t\t\t\t$w = $conf['database']['db'] -> query ( \"INSERT INTO `{$conf['database']['pref']}news` ( `id`,`by`,`datetime`,`name`,`text` ) \\n VALUES ( NULL, '\" . (isset($member['realname']) ? $member['realname'] : 'Admin') . \"', CURRENT_TIMESTAMP, '{$_POST['page']}','{$_POST['content']}' );\");\r\n\t\t\t\t\t\tif ($w)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$r .= $lang['news']['createdpage'];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$r .= $lang['news']['notcreatedpage'];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t} \r\n\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$r .= \"<form method='post' action='{$u}newpage'><table><tr><td>{$lang['news']['title']}</td><td><input type='text' name='page'></td></tr><tr><td>{$lang['news']['content']}</td><td><textarea id='content' name='content' rows='25' cols='50'></textarea></td></tr><tr><td></td><td><input type='submit' value='{$lang['news']['save']}'></td></tr></form></table>\" . wysiwyg('content');\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\telseif ( isset ( $_GET['deletepage'] ) )\r\n\t\t\t{\r\n\t\t\t\t$_GET['deletepage'] = secure($_GET['deletepage']);\r\n\t\t\t\t$w = $conf['database']['db'] -> query ( \"DELETE FROM `{$conf['database']['pref']}news` WHERE `name`='{$_GET['deletepage']}';\");\r\n\t\t\t\tif ($w)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$r .= $lang['news']['deletedpage'];\r\n\t\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$r .= $lang['news']['notdeletedpage'];\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\telse\r\n\t\t\t{\r\n\t\t\t\t$w = $conf['database']['db'] -> query ( \"SELECT `name` FROM `{$conf['database']['pref']}news`\" );\r\n\t\t\t\t$w = $conf['database']['db'] -> fetch ( $w, 'array' );\r\n\r\n\t\t\t\t$r .= '<table>';\r\n\t\t\t\tif ( $w!=\"the table is empty!\" )\r\n\t\t\t\t{\r\n \t\t\t\tfor($i=0; $i<sizeof($w); $i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$r .= \"<tr><td>{$w[$i]['name']}</td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td><a href='{$u}editpage/{$w[$i]['name']}'>{$lang['news']['edit']}</a></td><td>&nbsp;&nbsp;</td><td><a href='{$u}deletepage/{$w[$i]['name']}' onclick=\\\"return confirm('\" . sprintf($lang['news']['suredelpage'],$w[$i]['name']) . \"');\\\">{$lang['news']['del']}</a></td></tr>\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$r .= '</table>';\r\n\t\t\t\t$r .= \"<br /><a href='{$u}newpage'>{$lang['news']['newpage']}</a>\";\r\n\t\t\t}\r\n\t\treturn $r;\r\n}", "function add_note($module_key) {\r\n\r\n\tglobal $CONN, $CONFIG;\r\n\t$body = $_POST['body'];\r\n\t$sql = \"INSERT INTO {$CONFIG['DB_PREFIX']}notes(module_key,note) values ('$module_key','$body')\";\r\n\t\r\n\tif ($CONN->Execute($sql) === false) {\r\n\t\r\n\t\t$message = 'There was an error adding your note: '.$CONN->ErrorMsg().' <br />';\r\n\r\n\t\treturn $message;\r\n\t\t\r\n\t} else {\t \r\n\t\r\n\t\t\treturn true; \r\n\t}\r\n\t\r\n\r\n}", "public static function add_payment_note() {\n\n check_ajax_referer( 'sumo-pp-add-payment-note' , 'security' ) ;\n\n $note = _sumo_pp_add_payment_note( $_POST[ 'content' ] , $_POST[ 'post_id' ] , 'pending' , __( 'Admin Manually Added Note' , _sumo_pp()->text_domain ) ) ;\n\n if ( $note = _sumo_pp_get_payment_note( $note ) ) {\n ?>\n <li rel=\"<?php echo absint( $note->id ) ; ?>\" class=\"<?php echo isset( $note->meta[ 'comment_status' ] ) ? implode( $note->meta[ 'comment_status' ] ) : 'pending' ; ?>\">\n <div class=\"note_content\">\n <?php echo wpautop( wptexturize( wp_kses_post( $note->content ) ) ) ; ?>\n </div>\n <p class=\"meta\">\n <abbr class=\"exact-date\" title=\"<?php echo _sumo_pp_get_date_to_display( $note->date_created ) ; ?>\"><?php echo _sumo_pp_get_date_to_display( $note->date_created ) ; ?></abbr>\n <?php printf( ' ' . __( 'by %s' , _sumo_pp()->text_domain ) , $note->added_by ) ; ?>\n <a href=\"#\" class=\"delete_note\"><?php _e( 'Delete note' , _sumo_pp()->text_domain ) ; ?></a>\n </p>\n </li>\n <?php\n }\n die() ;\n }", "function managePollsPage() {\n include(plugin_dir_path(__FILE__) . '/add-poll.php');\n}", "function save()\r\n {\r\n // read the template\r\n\t $str = dirname(__FILE__); \r\n $content = file_get_contents(dirname(__FILE__).'/partinfo.php'); \r\n if (!$content){\r\n return \"fail read template\";\r\n } \t\r\n \r\n\t $tags = array(\"#TITLE#\", \r\n\t \t\"#BRAND#\", \r\n\t \t\"#MODULE#\", \r\n\t \t\"#ENGINE#\", \r\n \"#TYPE#\", \r\n \"#NAME#\", \r\n \"ADDRESS\", \r\n \"#DATE#\", \r\n \"#PRICE#\", \r\n \"DESCRIPTION\");\r\n\t \r\n $fields[0] = $this->title;\r\n $fields[1] = $this->brand;\r\n $fields[2] = $this->series;\r\n $fields[3] = $this->module;\r\n $fields[4] = \"配件\";\r\n $fields[5] = $this->module;\r\n $fields[6] = \"广州\";\r\n $fields[7] = $this->date;\r\n $fields[8] = $this->price;\r\n $fields[9] = $this->description;\r\n \r\n $content = str_replace($tags,$fields,$content); \r\n \r\n $date = date(\"Ymd-Hms\");\r\n $filename = sprintf(\"publish/%d-%d-%s.php\", $this->id, $this->uid, $date);\r\n $fp = fopen($filename, \"w\");\r\n if (!$fp) {\r\n return \"fail create file\";\r\n }\r\n \r\n if (fwrite($fp, $content) == FALSE) { \t \r\n fclose($fp);\r\n return \"fail wirte content\";\r\n }\r\n \r\n fclose($fp);\r\n return $filename;\r\n }", "function plugin_page() {\n\n echo '<div class=\"wrap\">';\n echo '<h2>'.esc_html__( 'WC Sales Notification Settings','wc-sales-notification-pro' ).'</h2>';\n $this->save_message();\n $this->settings_api->show_navigation();\n $this->settings_api->show_forms();\n echo '</div>';\n\n }", "function storyEdit($subject, $hometext, $bodytext, $notes, $topic, $ihome, $catid, $alanguage, $comm, $aid, $informant, $format_type=0)\n{\n if (empty($format_type)) {\n $format_type = 0;\n }\n\n // Get the format types. 'home' string is bits 0-1, 'body' is bits 2-3.\n $format_type_home = ($format_type%4);\n $format_type_body = (($format_type/4)%4);\n\n $dbconn =& pnDBGetConn(true);\n $pntable =& pnDBGetTables();\n\n echo '<strong>'._TITLE.'</strong><br />'\n .'<input type=\"text\" name=\"subject\" size=\"50\" value=\"' . pnVarPrepForDisplay($subject) . '\" /><br />';\n buildTopicsMenu($topic);\n SelectCategory($catid);\n echo '<br />';\n puthome($ihome);\n withcomments($comm);\n // new function !\n buildLanguageMenu(true,$alanguage);\n\n $bbcode = array('', '', '');\n if(pnModIsHooked('pn_bbcode', 'Submit_News') && pnModIsHooked('pn_bbcode', 'AddStory') && pnModIsHooked('pn_bbcode', 'News')) {\n $bbcode[0] = pnModFunc('pn_bbcode', 'user', 'bbcodes', array('textfieldid' => 'articletext'));\n $bbcode[1] = pnModFunc('pn_bbcode', 'user', 'bbcodes', array('textfieldid' => 'extendedtext'));\n $bbcode[2] = pnModFunc('pn_bbcode', 'user', 'bbcodes', array('textfieldid' => 'notestext'));\n }\n $bbsmile = array('', '', '');\n if(pnModIsHooked('pn_bbsmile', 'Submit_News') && pnModIsHooked('pn_bbsmile', 'AddStory') && pnModIsHooked('pn_bbsmile', 'News')) {\n pnModAPILoad('pn_bbsmile', 'user');\n $bbsmile[0] = pnModFunc('pn_bbsmile', 'user', 'bbsmiles', array('textfieldid' => 'articletext'));\n $bbsmile[1] = pnModFunc('pn_bbsmile', 'user', 'bbsmiles', array('textfieldid' => 'extendedtext'));\n $bbsmile[2] = pnModFunc('pn_bbsmile', 'user', 'bbsmiles', array('textfieldid' => 'notestext'));\n }\n\n echo '<br /><strong>'._STORYTEXT.'</strong><br />'\n .'<textarea cols=\"80\" rows=\"10\" name=\"hometext\" id=\"articletext\">';\n // Remove br tags only if format of hometext is 'text'.\n if ($format_type_home == 0)\n {\n echo pnVarPrepForDisplay(unnltobr($hometext));\n } else {\n echo pnVarPrepForDisplay($hometext);\n }\n echo '</textarea><br />'\n . $bbcode[0]\n . $bbsmile[0] ;\n\n // Choose format type for hometext.\n buildFormatTypeMenu(\"format_type_home\", $format_type_home);\n\n echo '<br /><strong>'._EXTENDEDTEXT.'</strong><br />'\n .'<textarea cols=\"80\" rows=\"10\" name=\"bodytext\" id=\"extendedtext\">';\n // Remove br tags only if format of bodytext is 'text'\n // The bodytext flag is in bits 2 and 3.\n if ($format_type_body == 0) {\n echo pnVarPrepForDisplay(unnltobr($bodytext));\n } else {\n echo pnVarPrepForDisplay($bodytext);\n }\n echo '</textarea><br />'\n . $bbcode[1]\n . $bbsmile[1]\n . _PAGEBREAK.'<br />';\n // Choose format type for hometext.\n buildFormatTypeMenu(\"format_type_body\", $format_type_body);\n\n echo '<br />'._AREYOUSURE.'<br />';\n if (pnSecAuthAction(0, 'Stories::', \"$subject::\", ACCESS_EDIT)) {\n echo '<strong>'._NOTES.'</strong><br />'\n . '<textarea cols=\"80\" rows=\"5\" name=\"notes\" id=\"notestext\">'\n . pnVarPrepForDisplay(unnltobr($notes)) . '</textarea>'\n . '<br />'\n . $bbcode[2]\n . $bbsmile[2];\n } else {\n echo '<input type=\"hidden\" value=\"' . pnVarPrepForDisplay($notes). '\" />';\n }\n}", "public function noteTaking() {\n\t\t$pageTitle = 'Note-Taking';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/note-taking.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "public function notesAction() {\n\t$notes = new Findofnotereasons();\n\t$this->view->notes = $notes->getReasonsList();\n\t}", "function wp_ajax_press_this_save_post()\n {\n }", "function save_page() {\n \t$forceXHR = setXHRDebug($this, 0);\n $this->layout = null;\n $ret = 0;\n\t\tif ($this->data) {\n /*\n\t\t\t * COPIED FROM /pagemaker/save_page !!!\n * POST - save/append/delete PageGallery file\n */ \t\n // allow guest users to save\n $dest = $this->data['dest'];\t// dest\tfile, book\n if (isset($this->data['key']) && $this->data['key']!=='undefined') $secretKeyDest = $this->data['key'];\n\t\t\tif (empty($secretKeyDest)) {\n\t\t\t\t// NOTE: to save different stories for the same dest/filename, make sure key is empty\n\t\t\t\t$uuid = AppController::$userid ? AppController::$userid : String::uuid();\n\t\t\t\t$secretKeyDest = $this->__getSecretKey($uuid, $this->__getSeed($dest));\n\t\t\t}\n \tif ($secretKeyDest) {\t\n\t $content = $this->data['content'];\t\t// page content\n\t /*\n\t * read content from page\n\t */\n\t \t\tif (empty($content)) {\n\t \t\t\t$src = $this->data['src'];\t\t// source file, stored in /svc/pages\n\t \t\t\t$secretKeySrc = $this->__getSecretKey($uuid, $this->__getSeed($src));\n\t\t $File = Configure::read('path.svcroot').Configure::read('path.pageGalleryPrefix').DS.$src.'_'.$secretKeySrc.'.div';\n\t\t $content = @file_get_contents($File);\n\t \t\t}\n\t /*\n\t * append or write content to book\n\t */\n\t $File = Configure::read('path.svcroot').Configure::read('path.pageGalleryPrefix').DS.$dest.'_'.$secretKeyDest.'.div';\n\t // append page to book\n\t $mode = isset($this->data['reset']) ? 'w' : 'a';\n\t $Handle = fopen($File, $mode);\n\t fwrite($Handle, $content);\n\t fclose($Handle);\n\t // don't unlink\n\t $ret = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$ret = false;\n\t\t}\n\t\t$this->autoRender = false;\n\t\theader('Content-type: application/json');\n\t\theader('Pragma: no-cache');\n\t\theader('Cache-control: no-cache');\n\t\theader(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\"); \t\t\n\t\t$success = $ret ? true : false;\n\t\tif ($success) {\n\t\t\theader(\"HTTP/1.1 201 CREATED\");\n\t\t\t$message = \"Your Story was saved.\";\n\t\t\t$response = array(\n\t\t\t\t'key'=>$secretKeyDest, \n\t\t\t\t'link'=>\"/gallery/story/{$dest}_{$secretKeyDest}\",\n\t\t\t);\n\t\t} else {\n\t\t\t$message = \"There was an error saving your Story. Please try again.\";\n\t\t\t$response = array();\n\t\t}\n\t\techo json_encode(compact('success', 'message', 'response'));\n\t\treturn;\n }", "function wp_save_footnotes_meta($revision_id)\n {\n }", "function create_post()\n {\n //Create the post with information submitted\n if(isset($_POST['note-text']) && !($_POST['note-text'] == \"\"))\n {\n $query = $this->pdo->prepare('INSERT INTO note (title, description, created_at, updated_at) VALUES(:title,:description, NOW(), NOW())');\n $query->execute(array(\n ':title' => $_POST['note-title'],\n ':description' => $_POST['note-text']\n ));\n }\n }", "public static function save() {\n\t\t\t$page_title = $_POST['page_title'];\n\t\t\t$meta['dod_custom_css'] = $_POST['custom_css'];\n\t\t\t$meta['_wp_page_template'] = $_POST['page_template'];\n\t\t\treturn dd_update_page(get_option('dod_page_id'), $page_title, '', $meta);\n\t\t}", "function edit_notes()\n {\n $query = $this->pdo->prepare('UPDATE note SET description=:description, updated_at=NOW() WHERE id=:id');\n $query->execute(array( ':description' => $_POST['edit-note-text'] ,':id' => $_POST['edit-note-id']));\n \n }", "function cc_plugin($title, $excerpt, $url, $blog_name, $tb_url, $pic, $profile_link)\r\n{\r\n //Standard Trackback\r\n $title = urlencode(stripslashes($title));\r\n $excerpt = urlencode(stripslashes($excerpt));\r\n $url = urlencode($url);\r\n $blog_name = urlencode(stripslashes($blog_name));\r\n\r\n //Create a new comment using the trackback variables.\r\n}", "function __viewNotes()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //show text view\n $this->data['visible']['wi_my_note_view'] = 1;\n\n //check if team member has a note for this project\n $notes = $this->mynotes_model->checkNotes($this->project_id, $this->data['vars']['my_id']);\n\n //do it have a note for this project, if not create a blank one\n if ($notes === 0) {\n $this->mynotes_model->newNote($this->project_id, $this->data['vars']['my_id']);\n $this->data['debug'][] = $this->mynotes_model->debug_data;\n }\n\n //reload notes again\n //load team members first\n $this->data['reg_fields'][] = 'mynotes';\n $this->data['fields']['mynotes'] = $this->mynotes_model->getNotes($this->project_id, $this->data['vars']['my_id']);\n $this->data['debug'][] = $this->mynotes_model->debug_data;\n\n }", "function activation_action() { \n // add a sample.bib\n //@file_put_contents(plugin_dir_path(__FILE__).'/sample.bib', \n // \"@article{doe2000,title={An article},author={Jane Doe},journal={The Wordpress Journal},year=2000}\\n\".\n // \"@book{doo2001,title={An bok},author={Jane Doe},year=2001}\");\n \n //add_fake_post\n $post = array(\n 'post_content' => \"&#91;wp-publications bib=sample.bib all=1&#93; gives:\\n[wp-publications bib=sample.bib all=1]\", //The full text of the post.\n 'post_status' => 'publish',\n 'post_title' => 'wp-publications example', //The title of your post.\n ); \n $post_id = wp_insert_post( $post ); \n }", "function save($strip_html = true) {\n\n\t// set up some options\n\t\t\n\t\t\t$this->success = false;\n\t\t\t$this->POD->tolog(\"content->save()\");\t\t\t\n\n\t\t\tif (!$this->POD->isAuthenticated()) { \n\t\t\t\t$this->throwError(\"No current user! Can't save content!\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\tif (!$this->isEditable()) { \n\t\t\t\t$this->throwError(\"Access Denied\");\n\t\t\t\t$this->error_code = 401;\n\t\t\t\treturn null;\n\t\t\t}\t\t\t\n\n\n\t\t\tif ($strip_html) {\n\t\t\t\t$this->set('body',$this->POD->sanitizeInput($this->get('body')));\t\t\t\n\t\t\t}\t\n\t\t\t\n\t\t\t$this->set('body',stripslashes($this->get('body')));\n\t\t\t$this->set('headline',stripslashes(strip_tags($this->get('headline'))));\n\t\t\t$this->set('link',stripslashes(strip_tags($this->get('link'))));\n\n\t\t\tif (!$this->saved()) { \n\t\t\t\t$this->set('date','now()');\n\t\t\t\t$this->set('editDate','now()');\n\t\t\t\t$this->set('minutes','0');\n\t\t\t\t$this->set('changeDate','now()');\n\t\t\t\t$this->set('yes_votes','0');\n\t\t\t\t$this->set('no_votes','0');\n\t\t\t\t$this->set('hidden','0');\n\n\t\t\t} else {\n\t\t\t\t$this->set('editDate','now()');\n\t\t\t\t$this->set('changeDate','now()');\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\tif ($this->get('privacy')=='') {\n\t\t\t\t$this->set('privacy','public');\n\t\t\t}\n\t\t\t\n\t\t\t// do this down here instead of at the top to catch cases where the headline is blank after stripping html\n\t\t\tif ($this->get('headline')=='') {\n\t\t\t\t$this->success = false;\n\t\t\t\t$this->throwError(\"Missing required fields\");\n\t\t\t\t$this->error_code = 500;\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif (!$this->get('type')) { \n\t\t\t\t$this->set('type','document');\n\t\t\t}\n\n\t\t\tif (!$this->get('status')) { \n\t\t\t\t$this->set('status','new');\n\t\t\t}\n\n\t\t\tif ($this->get('createdBy') == '') {\n\t\t\t\t$this->set('createdBy',$this->POD->currentUser()->get('id'));\n\t\t\t}\n\n\t\t\tif ($this->get('userId') == '') {\n\t\t\t\t$this->set('userId',$this->get('createdBy'));\n\t\t\t}\n\n\t\t\tif (!$this->get('stub')) {\n\t\t\t\t$stub = $this->get('headline');\t\t\t\n\t\t\t\t$stub = preg_replace(\"/\\s+/\",\"-\",$stub);\n\t\t\t\t$stub = preg_replace(\"/[^a-zA-Z0-9\\-]/\",\"\",$stub);\n\t\t\t\t$stub = strtolower($stub);\n\t\t\t} else {\n\t\t\t\t$stub = $this->get('stub');\n\t\t\t}\n\t\t\t\n\t\t\t$newstub = $stub;\n\n\t\t\t// check and see if any content already use this stub.\n\t\t\t$stubcheck = $this->POD->getContent(array('stub'=>$stub));\n\t\t\t$counter = 2;\n\t\t\twhile ($stubcheck->success() && $stubcheck->get('id')!=$this->get('id')) {\n\t\t\t\n\t\t\t\t$newstub = $stub . \"_\" . $counter++;\n\t\t\t\t$stubcheck = $this->POD->getContent(array('stub'=>$newstub));\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$this->set('stub',$newstub);\n\n\t\t\tparent::save();\n\t\t\t\n\t\t\tif (!$this->success()) { \n\t\t\t\t$this->POD->cacheclear($this);\n\t\t\t\treturn null;\n\t\t\t}\t\t\t\t\t\n\t\t\t\n\t\t\t$this->stuffDoc();\t\n\t\t\t\n\t\t\t$this->POD->cachestore($this);\n\n\t\t\t$this->POD->tolog(\"content->save() ADD WATCH\");\t\t\t\n\t\t\t$this->POD->currentUser()->addWatch($this);\n\n\t\t\t$this->success= true;\n\t\t\t$this->POD->tolog(\"content->save(): Content saved!\");\n\t\t}", "function setNoteText(){\n $html = \"\";\n \n $this->aFields[\"note\"]->editable = true;\n $this->aFields[\"note\"]->value = $html;\n }", "function autoregister_install()\n {\n // read email template for new autoregister\n $content = file_get_contents( osc_plugins_path() . osc_plugin_folder(__FILE__).'autoregister_new_user_info' );\n $aContent = json_decode($content, true);\n $s_internal_name = 'autoregister_new_user_info';\n $aFields = array('s_internal_name' => $s_internal_name, 'b_indelible' => '1');\n $aFieldsDescription = array();\n\n foreach($aContent as $key => $value) {\n $aFieldsDescription[$key]['s_title'] = $value['title'];\n $aFieldsDescription[$key]['s_text'] = $value['description'];\n }\n // add page as email template\n $page = Page::newInstance()->findByInternalName($s_internal_name);\n if(!isset($page['pk_i_id'])) {\n $result = Page::newInstance()->insert($aFields, $aFieldsDescription) ;\n } else {\n osc_add_flash_error_message(_m(\"Oops! That internal name is already in use. We can't make the changes\", 'autoregister'), 'admin') ;\n }\n }", "function recentpostsindex_info()\r\n{\r\n global $lang;\r\n\r\n $lang->load(\"recentpostsindex\");\r\n \r\n $lang->recentpostsindex_Desc = '<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" style=\"float:right;\">' .\r\n '<input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\">' . \r\n '<input type=\"hidden\" name=\"hosted_button_id\" value=\"AZE6ZNZPBPVUL\">' .\r\n '<input type=\"image\" src=\"https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\">' .\r\n '<img alt=\"\" border=\"0\" src=\"https://www.paypalobjects.com/pl_PL/i/scr/pixel.gif\" width=\"1\" height=\"1\">' .\r\n '</form>' . $lang->recentpostsindex_Desc;\r\n\r\n return Array(\r\n 'name' => $lang->recentpostsindex_Name,\r\n 'description' => $lang->recentpostsindex_Desc,\r\n 'website' => $lang->recentpostsindex_Web,\r\n 'author' => $lang->recentpostsindex_Auth,\r\n 'authorsite' => $lang->recentpostsindex_AuthSite,\r\n 'version' => $lang->recentpostsindex_Ver,\r\n 'codename' => $lang->recentpostsindex_CodeName,\r\n 'compatibility' => $lang->recentpostsindex_Compat\r\n );\r\n}", "function wiki_edit_page($page_id, $title, $description, $notes, $hide_posts, $meta_keywords, $meta_description, $member = null, $edit_time = null, $add_time = null, $views = null, $null_is_literal = false)\n{\n if (is_null($edit_time)) {\n $edit_time = $null_is_literal ? null : time();\n }\n\n $pages = $GLOBALS['SITE_DB']->query_select('wiki_pages', array('*'), array('id' => $page_id), '', 1);\n if (!array_key_exists(0, $pages)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE', 'wiki_page'));\n }\n $page = $pages[0];\n $_description = $page['description'];\n $_title = $page['title'];\n\n $log_id = log_it('WIKI_EDIT_PAGE', strval($page_id), get_translated_text($_title));\n if (addon_installed('actionlog')) {\n require_code('revisions_engine_database');\n $revision_engine = new RevisionEngineDatabase();\n $revision_engine->add_revision(\n 'wiki_page',\n strval($page_id),\n strval($page_id),\n get_translated_text($_title),\n get_translated_text($_description),\n $page['submitter'],\n $page['add_date'],\n $log_id\n );\n }\n\n $update_map = array(\n 'hide_posts' => $hide_posts,\n 'notes' => $notes,\n );\n\n $update_map['edit_date'] = $edit_time;\n if (!is_null($add_time)) {\n $update_map['add_date'] = $add_time;\n }\n if (!is_null($views)) {\n $update_map['wiki_views'] = $views;\n }\n if (!is_null($member)) {\n $update_map['submitter'] = $member;\n } else {\n $member = $page['submitter'];\n }\n\n require_code('attachments2');\n require_code('attachments3');\n\n $update_map += lang_remap('title', $_title, $title);\n $update_map += update_lang_comcode_attachments('description', $_description, $description, 'wiki_page', strval($page_id), null, $member);\n\n $GLOBALS['SITE_DB']->query_update('wiki_pages', $update_map, array('id' => $page_id), '', 1);\n\n require_code('seo2');\n seo_meta_set_for_explicit('wiki_page', strval($page_id), $meta_keywords, $meta_description);\n\n if (post_param_integer('send_notification', null) !== 0) {\n dispatch_wiki_page_notification($page_id, 'EDIT');\n }\n\n if ((addon_installed('commandr')) && (!running_script('install')) && (!get_mass_import_mode())) {\n require_code('resource_fs');\n generate_resource_fs_moniker('wiki_page', strval($page_id));\n }\n\n require_code('sitemap_xml');\n notify_sitemap_node_edit('_SEARCH:wiki:browse:' . strval($page_id), has_category_access($GLOBALS['FORUM_DRIVER']->get_guest_id(), 'wiki', strval($page_id)));\n}", "function ajax_saveTemplate()\n{\n\n $cc = new CapabilityCheck('fetchTemplateContent');\n if (!$cc->checkCapability()) {\n return;\n }\n\n check_ajax_referer('CPWP');\n\n $templateName = sanitize_text_field($_POST['templateName']);\n //$templateContent = sanitize_text_field($_POST['templateContent']);\n $templateContent = $_POST['templateContent'];\n\n //$breaks = array(\"<br />\",\"<br>\",\"<br/>\", '\\n\\n');\n\n //$templateContent = str_ireplace($breaks, \"\\r\\n\", $templateContent);\n\n if ($templateName == 'New Server Created') {\n update_option(WPCP_NEW_SERVER, $templateContent, 'no');\n } elseif ($templateName == 'Server Cancelled') {\n update_option(WPCP_SERVER_CANCELLED, $templateContent, 'no');\n } elseif ($templateName == 'Server Suspended') {\n update_option(WPCP_SERVER_SUSPENDED, $templateContent, 'no');\n } elseif ($templateName == 'Server Terminated') {\n update_option(WPCP_SERVER_TERMINATED, $templateContent, 'no');\n }\n\n wp_send_json(array('status' => 1));\n}", "function view_upload_lecture_notes(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/upload_lectures_meterials';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Lecture Upload Meterials',\n\t\t\t'courselist' => $this->setting_model->Get_All('course'),\n\t\t\t'course_upload_notes' =>$this->setting_model->Get_All('course_meterials'),\n\t\t\t'course_meterial_upload_list' =>$this->setting_model->Get_All('course_meterial_upload'),\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t\n\t}", "protected function afterSave()\n\t{\n\t\tparent::afterSave();\n\t\tif(!$this->status == 1){\n\t\t$title = $this->howtoTitle($this->id);\n\t\t$tags = $this->tagLinks();\n\t\t$title = CHtml::link('Created '.$title , array('/howto/' . $this->id . '/' . $title ) );\n\t\t$shortText = substr($this->content,0,160);\n\t\t$content = $shortText.\"...<br/>Tags:\";\n\t\tforeach($tags as $tag){\n\t\t\t$content .=\" \".$tag.\",\";\n\t\t}\n\t\tAction::newAction($content,$title);\n\t\t}\n\t\t\n\t}", "function wiki_add_post($page_id, $message, $validated = 1, $member = null, $send_notification = true, $add_time = null, $views = 0, $edit_date = null)\n{\n if (is_null($member)) {\n $member = get_member();\n }\n if (is_null($add_time)) {\n $add_time = time();\n }\n\n require_lang('wiki');\n\n ignore_user_abort(true);\n\n require_code('comcode_check');\n check_comcode($message, null, false, null, true);\n\n if (!addon_installed('unvalidated')) {\n $validated = 1;\n }\n $map = array(\n 'validated' => $validated,\n 'member_id' => $member,\n 'date_and_time' => $add_time,\n 'page_id' => $page_id,\n 'wiki_views' => $views,\n 'edit_date' => $edit_date\n );\n if (multi_lang_content()) {\n $map['the_message'] = 0;\n } else {\n $map['the_message'] = '';\n $map['the_message__text_parsed'] = '';\n $map['the_message__source_user'] = get_member();\n }\n $post_id = $GLOBALS['SITE_DB']->query_insert('wiki_posts', $map, true);\n\n require_code('attachments2');\n $GLOBALS['SITE_DB']->query_update('wiki_posts', insert_lang_comcode_attachments('the_message', 2, $message, 'wiki_post', strval($post_id)), array('id' => $post_id), '', 1);\n\n // Log\n log_it('WIKI_MAKE_POST', strval($post_id), strval($page_id));\n\n // Update post count\n if ((addon_installed('points')) && (cms_mb_strlen($message) > 1024)) {\n require_code('points');\n $_count = point_info($member);\n $count = array_key_exists('points_gained_wiki', $_count) ? $_count['points_gained_wiki'] : 0;\n $GLOBALS['FORUM_DRIVER']->set_custom_field($member, 'points_gained_wiki', $count + 1);\n }\n\n // Stat\n update_stat('num_wiki_posts', 1);\n\n if ($send_notification) {\n if (post_param_integer('send_notification', null) !== 0) {\n dispatch_wiki_post_notification($post_id, 'ADD');\n }\n }\n\n if (get_option('show_post_validation') == '1') {\n decache('main_staff_checklist');\n }\n\n if ((addon_installed('commandr')) && (!running_script('install')) && (!get_mass_import_mode())) {\n require_code('resource_fs');\n generate_resource_fs_moniker('wiki_post', strval($post_id), null, null, true);\n }\n\n @ignore_user_abort(false);\n\n return $post_id;\n}", "static function add_notes(): void {\r\n\t\tself::add_acf_inner_field(self::divisions, self::notes, [\r\n\t\t\t'label' => 'Notes',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => 'Any notes pertinent to the division.',\r\n\t\t\t'required' => 0,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '40',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t]\r\n\t\t]);\r\n\t}", "function my_admin_page_contents() {\n\t\t?>\n\t\t\t<h1>\n\t\t\t\tPage d'aministration du plugin de création de formulaire\n\t\t\t\t\n\t\t\t</h1>\n\t\t<?php\n\t}", "function plugin_autoinstall_nexcontent($pi_name)\r\n{\r\n global $CONF_SE,$_CONF;\r\n @require ($_CONF['path'] . 'plugins/nexcontent/nexcontent.php');\r\n\r\n $pi_name = $CONF_SE['pi_name'];\r\n $pi_display_name = $CONF_SE['pi_display_name'];\r\n $pi_admin = $pi_display_name . ' Admin';\r\n\r\n $info = array(\r\n 'pi_name' => $pi_name,\r\n 'pi_display_name' => $pi_display_name,\r\n 'pi_version' => $CONF_SE['version'],\r\n 'pi_gl_version' => $CONF_SE['gl_version'],\r\n 'pi_homepage' => 'http://www.nextide.ca/'\r\n );\r\n\r\n $groups = array(\r\n $pi_admin => 'Has full access to ' . $pi_display_name . ' features'\r\n );\r\n\r\n $features = array(\r\n $pi_name . '.edit' => 'Plugin Admin',\r\n $pi_name . '.user' => 'Plugin User'\r\n );\r\n\r\n $mappings = array(\r\n $pi_name . '.edit' => array($pi_admin),\r\n $pi_name . '.user' => array($pi_admin),\r\n );\r\n\r\n $tables = array(\r\n 'nxcontent',\r\n 'nxcontent_pages',\r\n 'nxcontent_images'\r\n );\r\n\r\n $inst_parms = array(\r\n 'info' => $info,\r\n 'groups' => $groups,\r\n 'features' => $features,\r\n 'mappings' => $mappings,\r\n 'tables' => $tables\r\n );\r\n\r\n return $inst_parms;\r\n}", "function odt_editor_page_handler($page) {\n\n $odt_editor_pages_dir = elgg_get_plugins_path() . 'odt_editor/pages';\n\n $page_type = $page[0];\n switch ($page_type) {\n case 'saveas':\n set_input('guid', $page[1]);\n include \"$odt_editor_pages_dir/odt_editor/saveas.php\";\n break;\n case 'create':\n $container = get_entity($page[1]);\n\n if (!$container) {\n $container = get_loggedin_userid();\n }\n\n // show new document in WebODF editor page\n // 0 as indicator for new document\n set_input('guid', 0);\n set_input('container_guid', $page[1]);\n include \"$odt_editor_pages_dir/file/odt_editor.php\";\n $result = false;\n\n break;\n case 'gettemplate':\n include \"$odt_editor_pages_dir/odt_editor/gettemplate.php\";\n break;\n default:\n return false;\n }\n return true;\n}", "function contribute() {\n\tob_start();\n\trequire_once($_POST[\"rootpath\"]);\n\n\t$paragraph = \"<p>\".sanitize_text_field( $_POST[\"paragraph\"] ).\"</p>\";\n\t$paragraphIDTitle = wp_count_posts('post')->publish + 1;\t// paragraph IDs are gathered from post titles in order to have them humanly readable\n\t\n\t$chapter = $_POST[\"chapter\"];\n\t//$edition = $_POST[\"edition\"];\n\t$references = $_POST[\"references\"];\n\t\n\t// delete unused (legacy) posted references\n\tforeach($references as $i => $ref) {\n\n\t\tif($i >= substr_count($paragraph, \"[reference id=\")) {\n\t\t\tunset($references[$i]);\n\t\t}\n\t}\n\n\t$http_referer = $_POST[\"_wp_http_referer\"];\n\t$path = $_POST[\"rootpath\"];\n\t$nonce = $_POST[\"_wpnonce\"];\n\n\t//Load WordPress\n\trequire($path);\n\n\t//Verify the form fields\n\tif (! wp_verify_nonce($nonce) ) die('Security check');\n\t\n\t\tif( !isset($_POST[\"paragraph\"]) ) {\n\t\t\n\t\t\twp_redirect( bloginfo('url') . $http_referer );\t\n\t\t}\n\t\telse {\n\t\t\t\t\n\t\t\t// just in case to avoid duplicate titles (hope it works)\n\t\t\twhile( get_page_by_title($paragraphIDTitle, OBJECT, 'post') !== NULL ) {\n\t\n\t\t\t\t//\n\t\t\t\t$paragraphIDTitle++; //= wp_count_posts('post')+1;\n\t\t\t}\n\t\n\t\t\t// post Properties\n\t\t\t$new_post = array(\n\t\t\t\t'post_title'\t=>\t$paragraphIDTitle,\n\t\t\t\t'post_content' =>\t$paragraph,\n\t\t\t\t'post_category' =>\tarray($chapter),\t// Usable for custom taxonomies too\n\t\t\t\t//'tags_input'\t => array($edition),\n\t\t\t\t'post_status' \t=>\t'publish',\t\t\t // Choose: publish, preview, future, draft, etc.\n\t\t\t\t'post_type'\t\t=>\t'post',\t//'post',page' or use a custom post type if you want to\n\t\t\t\t'post_author'\t=>\t2 //Author ID\n\t\t\t);\n\t\n\t\t\t//save the new post\n\t\t\t$postID = wp_insert_post($new_post);\n\t\n\t\t\t//save reference info\n\t\t\tsave_references( $references, $postID );\n\t\n\t\n\t\t\tif( isset($postID) ) {\n\t\t\n\t\t\t\t// mark paragraph as collected\n\t\t\t\tupdateCollection( strval($paragraphIDTitle) );\n\t\t\t\twp_redirect(\"http://\" . $_SERVER[\"HTTP_HOST\"].$http_referer . \"#paragraph-\" . $paragraphIDTitle);\n\t\t\t}\n\t\t\telse {\n\t\t\t\techo \"ERROR SUBMITTING!\";\n\t\t\t}\n\t\t}\n}", "public function createAction(){\n \n $this->_form->customSubmitBtn = $this->xhr;\n $this->_form->build( $this->uri,\n $this->consumer_id,\n $this->user_id,\n $this->id);\n \n \n \n $this->result = Main_Forms_Handler::onPost($this->_form ,\n $this->post,\n $this->_model,\n \"createNote\",\n $this->params,\n $this->_helper,\n $this->indexAction . $this->consumer_id,\n \"Note created.\",\n $this->xhr); \n \n $this->_onSubmit();\n\n }", "function display_notes() {\n\t\t?>\n\t\t<style>\n\t #adminmenuwrap,\n\t #screen-meta,\n\t #screen-meta-links,\n\t #adminmenuback,\n\t #wpfooter,\n\t #wpadminbar{\n\t display: none !important;\n\t }\n\t #wpbody-content{\n\t \tpadding: 0;\n\t }\n\t html{\n\t padding-top: 0 !important;\n\t }\n\t #wpcontent{\n\t margin: 0 !important;\n\t }\n\t #wc-crm-page{\n\t margin: 15px !important;\n\t }\n </style>\n <input type=\"hidden\" id=\"customer_user\" name=\"customer_user\" value=\"<?php echo $this->user_id; ?>\">\n\t\t<div id=\"side-sortables\" class=\"meta-box-sortables\">\n\t\t\t\t<div class=\"postbox \" id=\"woocommerce-customer-notes\">\n\t\t\t\t\t\t<div class=\"inside\">\n\t\t\t\t\t\t<ul class=\"order_notes\">\n\t\t\t\t\t\t\t<?php $notes = $this->get_customer_notes(); ?>\n\t\t\t\t\t\t\t\t\t<?php if ( $notes ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach( $notes as $note ) {\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<li rel=\"<?php echo absint( $note->comment_ID ) ; ?>\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"note_content\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php echo wpautop( wptexturize( wp_kses_post( $note->comment_content ) ) ); ?>\n\t\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\t<p class=\"meta\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<abbr class=\"exact-date\" title=\"<?php echo $note->comment_date_gmt; ?> GMT\"><?php printf( __( 'added %s ago', 'wc_customer_relationship_manager' ), human_time_diff( strtotime( $note->comment_date_gmt ), current_time( 'timestamp', 1 ) ) ); ?></abbr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( $note->comment_author !== __( 'WooCommerce', 'wc_customer_relationship_manager' ) ) printf( ' ' . __( 'by %s', 'wc_customer_relationship_manager' ), $note->comment_author ); ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"#\" class=\"delete_customer_note\"><?php _e( 'Delete note', 'wc_customer_relationship_manager' ); ?></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</li>\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}\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '<li>' . __( 'There are no notes for this customer yet.', 'wc_customer_relationship_manager' ) . '</li>';\n\t\t\t\t\t\t\t\t\t\t\t\t} ?>\n\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t<div class=\"add_note\">\n\t\t\t\t\t\t\t\t\t\t\t<h4>Add note</h4>\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t<textarea rows=\"5\" cols=\"20\" class=\"input-text\" id=\"add_order_note\" name=\"order_note\" type=\"text\"></textarea>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t<a class=\"add_note_customer button\" href=\"#\">Add</a>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}", "function BeforeShowEdit(&$xt,&$templatefile,$values,&$pageObject)\n{\n\n\t\t$_SESSION['pid'] = $values['pid'];\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n;\t\t\n}", "function SavePost()\n\t{\n\t\n\t\t// wordpress global\n\t\tglobal $post;\n\t\t\n\t\t// this first check is, I feel, a hack: why should SavePost run on page load?\n\t\tif ( isset( $_POST['tlsp_noncename'] ) )\n\t\t{\n\t\t\n\t\t\t// run the following checks:\n\t\t\tif (\n\t\t\t\t// validate the nonce\n\t\t\t\t( wp_verify_nonce( $_POST['tlsp_noncename'], plugin_basename(__FILE__) ) )\n\t\t\t\t// make sure this is not an autosave\n\t\t\t\t&& ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) == false )\n\t\t\t\t// check user permissions\n\t\t\t\t&& ( current_user_can( 'edit_post', $post_id ) )\n\t\t\t\t// check that the element exists\n\t\t\t\t&& ( isset ( $_POST['tlsp_text'] ) )\n\t\t\t)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t// if there is data, update the meta field\n\t\t\t\tif ( $_POST['tlsp_text'] != '' )\n\t\t\t\t{\n\t\t\t\t\tupdate_post_meta( $post->ID, 'tlsp_text', $_POST['tlsp_text'] );\n\t\t\t\t}\n\t\t\t\t// otherwise delete the table row, for a cleaner database\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdelete_post_meta( $post->ID, 'tlsp_text' );\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t// if the checks fail, return an error\n\t\t\telse\n\t\t\t{\n\t\t\t\t// TODO: This error does not show up yet\n\t\t\t\techo '<div id=\"message\" class=\"error\">Error on saving meta data!</div>';\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t}", "public function generateControls(Page $page, User $user, $notes, $image_id)\n\t{\n\t\t$permission = $this->userPermission($user);\n\t\n\t\t$string = <<<JS\n\t\t\n<form>\n<input type=\"button\" value=\"New Note\" name=\"button1\" onClick=\"javascript:$.add_note_init_center($image_id, $permission);\">\n</form> \n\nJS;\n\t\treturn($string);\n\t}", "public static function action_note() {\n\t\t// Make sure that both plugins are active before actioning the note.\n\t\t$active_plugin_slugs = PluginsHelper::get_active_plugin_slugs();\n\t\t$jp_active = in_array( 'jetpack', $active_plugin_slugs, true );\n\t\t$wcs_active = in_array( 'woocommerce-services', $active_plugin_slugs, true );\n\n\t\tif ( ! $jp_active || ! $wcs_active ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Action any notes with a matching name.\n\t\t$data_store = \\WC_Data_Store::load( 'admin-note' );\n\t\t$note_ids = $data_store->get_notes_with_name( self::NOTE_NAME );\n\n\t\tforeach ( $note_ids as $note_id ) {\n\t\t\t$note = Notes::get_note( $note_id );\n\n\t\t\tif ( $note ) {\n\t\t\t\t$note->set_status( Note::E_WC_ADMIN_NOTE_ACTIONED );\n\t\t\t\t$note->save();\n\t\t\t}\n\t\t}\n\t}", "function wasslnow_tracking_active() {\n if( empty( get_option('wasslnow_tracking_active_page_id') ) ):\n // Create post object\n $my_post = array(\n 'post_title' => wp_strip_all_tags( 'Wasslnow track-order' ),\n 'post_content' => '[wasslnow-trackorder]',\n 'post_status' => 'publish',\n 'post_author' => 1,\n 'post_type' => 'page',\n );\n\n // Insert the post into the database\n $page_id = wp_insert_post( $my_post );\n update_option('wasslnow_tracking_active_page_id',$page_id);\n endif;\n}", "function add($note) {\r\n $CI = &get_instance();\r\n //check access rights (!)\r\n $userlogin = getUserLogin();\r\n $user = $CI->user_db->getByID($userlogin->userID());\r\n $publication = $CI->publication_db->getByID($note->pub_id);\r\n if ( ($publication == null) \r\n ||\r\n (!$userlogin->hasRights('note_edit'))\r\n || \r\n (!$CI->accesslevels_lib->canEditObject($publication))\r\n ) \r\n {\r\n\t appendErrorMessage(__('Add note').': '.__('insufficient rights').'.<br/>');\r\n\t return;\r\n } \r\n //add new note\r\n $CI->db->insert(\"notes\", array('text' => $note->text,\r\n 'pub_id' => $note->pub_id,\r\n 'user_id' => $userlogin->userId()));\r\n $new_id = $CI->db->insert_id();\r\n $note->note_id = $new_id;\r\n $CI->accesslevels_lib->initNoteAccessLevels($note); \r\n //set crossref ids\r\n $xref_ids = getCrossrefIDsForText($note->text);\r\n foreach ($xref_ids as $xref_id) {\r\n $CI->db->insert(\"notecrossrefid\", array('xref_id'=>$xref_id, 'note_id'=>$note->note_id));\r\n }\r\n \r\n return $new_id;\r\n }", "function create_newsletter_page() {\r\n require_once( $plugin_dir . \"email-newsletter-files/page-create-newsletter.php\" );\r\n }", "function update_notepad()\r\n\t{\r\n\t\tglobal $ibforums, $std;\r\n\r\n\t\t// Do we have an entry for this member?\r\n\r\n\t\tif ($_POST['act'] == \"\")\r\n\t\t{\r\n\t\t\t$std->Error(array('LEVEL' => 1, 'MSG' => 'complete_form'));\r\n\t\t}\r\n\t\t//+----------------------------------------\r\n\r\n\t\t$stmt = $ibforums->db->query(\r\n\t\t \"SELECT id\r\n\t\t\tFROM ibf_member_extra\r\n\t\t\tWHERE id='\" . $this->member['id'] . \"'\"\r\n );\r\n\r\n\t\tif ($stmt->rowCount())\r\n\t\t{\r\n\t\t\t$ibforums->db->exec(\r\n\t\t\t \"UPDATE ibf_member_extra\r\n\t\t\t\tSET\r\n\t\t\t\t\tnotes='\" . $ibforums->input['notes'] . \"',\r\n\t\t\t\t\tta_size='\" . $ibforums->input['ta_size'] . \"'\r\n\t\t\t\tWHERE id='\" . $this->member['id'] . \"'\"\r\n );\r\n\t\t} else\r\n\t\t{\r\n\t\t\t$ibforums->db->exec(\r\n\t\t\t \"INSERT INTO ibf_member_extra\r\n\t\t\t\t\t(id, notes, ta_size)\r\n\t\t\t\tVALUES\r\n\t\t\t\t\t('\" . $this->member['id'] . \"', '\" . $ibforums->input['notes'] . \"', '\" . $ibforums->input['ta_size'] . \"')\"\r\n );\r\n\t\t}\r\n\r\n\t\t$std->boink_it($this->base_url . \"act=UserCP&CODE=00\");\r\n\t\texit;\r\n\t}", "function add_note_link($module_key) {\r\n\r\n\treturn true;\r\n\r\n}", "function ajax_get_client_internal_notes() {\r\n\r\n if ( !isset( $_POST['id'] ) || !$_REQUEST['id'] ) {\r\n echo json_encode( array( 'id' => '', 'warning' => true ) );\r\n exit;\r\n }\r\n\r\n $id = explode( '_', $_POST['id'] );\r\n\r\n //check id and hash\r\n if ( isset( $id[0] ) && $id[0] && isset( $id[1] ) && md5( 'wpcclientinternalnote_' . $id[0] ) == $id[1] ) {\r\n $client = get_userdata( $id[0] );\r\n\r\n $internal_notes = get_user_meta( $id[0], 'wpc__internal_notes', true );\r\n if ( $internal_notes ) {\r\n echo json_encode( array( 'client_name' => $client->user_login, 'internal_notes' => $internal_notes ) );\r\n } else {\r\n echo json_encode( array( 'client_name' => $client->user_login, 'internal_notes' => '' ) );\r\n }\r\n exit;\r\n }\r\n\r\n echo json_encode( array( 'internal_notes' => '' ) );\r\n exit;\r\n }", "public function noteAction() {\n\tif($this->_getParam('id',false)) {\n\t$notes = new Findofnotereasons();\n\t$this->view->notes = $notes->getReasonDetails($this->_getParam('id'));\n\t} else {\n throw new Pas_Exception_Param($this->_missingParameter);\n\t}\n\t}", "function insert_update_text_image_slider_customize()\n\t{\n\t\t$page_id = $this->input->post('page-id');\n\t\t$this->Text_image_slider_model->insert_update_text_image_slider_customize_data($page_id);\n\t\tredirect('text_image_slider/text_image_slider_index/' . $page_id);\n\t}", "function update_post( $post, $plugin_name, $plugin_info ) {\n echo \"Updating post: \" . $post->ID;\n echo PHP_EOL;\n //echo \"New slug:\" . $plugin_info->\n $parts = explode( '/', $plugin_name );\n $slug = $parts[0];\n echo \"New slug: \" . $slug;\n echo PHP_EOL;\n echo \"New plugin name: \" . $plugin_name;\n echo PHP_EOL;\n echo \"Name: \" . $plugin_info['Name'];\n echo PHP_EOL;\n //echo \"Title: \" . $plugin_info['Title'];\n //echo PHP_EOL;\n //echo \"Desc: \" . $plugin_info['Description'];\n if ( $plugin_info['Name'] !== $plugin_info['Title']) { gob(); }\n\n\n //print_r( $plugin_info );\n\n if ( true ) {\n update_post_meta($post->ID, '_oikp_slug', $slug);\n update_post_meta($post->ID, '_oikp_name', $plugin_name);\n update_post_meta($post->ID, '_oikp_desc', $plugin_info['Name']);\n $plugin_uri = isset( $plugin_info['PluginURI']) ? $plugin_info['PluginURI'] : '';\n update_post_meta($post->ID, '_oikp_uri', $plugin_uri );\n }\n //$_POST['_oikp_slug'] = $this->component;\n //$_POST['_oikp_name'] = $this->get_plugin_file_name();\n // $_POST['_oikp_desc'] = $this->get_plugin_name();\n //$_POST['_oikp_uri'] = $this->get_plugin_uri();\n\n}", "protected function _Store_Note() {\n\t\tglobal $wpdb; \n // Submission table name (including wp prefix)\n $entry_notes_table = $this->Get_Notes_Table(); \n // Retrieve the storage data\n $store_note = $this->store_note;\n // If there are no store fields, return out\n if (!$store_note || !is_array($store_note)) { return array(); }\n // Check for an existing record\n $existing = $wpdb->get_row($wpdb->prepare(\"SELECT uuid FROM $entry_notes_table WHERE form_uuid = %s AND entry_uuid = %s AND uuid = %s\", $store_note['form_uuid'], $store_note['uuid'], $store_note['uuid']));\n // If a record was returned\n if ($existing) { die('existing');\n // Attempt to store the entry data\n $result = $wpdb->update($entry_notes_table, $store_note, array('uuid' => $existing->uuid));\n } // Otherwise attempt to insert a new record \n else { $result = $wpdb->insert($entry_notes_table, $store_note); }\n // If the insert failed\n if ($result === false) { die('Note value failed to insert'); }\n // Store the result id\n $this->store_note['id'] = $wpdb->insert_id; \n // Return the inserted id\n return $this->store_note;\n }", "function manage_word_notes($vwref)\n{ $refpos = VerseWordPosition::get_VerseWordPosition($vwref);\n $word = new VerseWord($refpos->get_verseword()); # Get the VerseWord.\n $notes = Note::get_AllInWord($word->get_id()); # Get all the notes for the VerseWord.\n\n $hcols = array( # Define hb.notes columns' headings and titles.\n 'morph' => 'Submitted morphology', \n 'member' => 'Member who submitted the morph',\n 'verification' => 'Whether note is an editor verification',\n 'noteDate' => 'When submitted',\n 'noteText' => 'TBD: textual notes about the selection'\n );\n \n $id = $word->get_id();\n $spelling = $word->get_word();\n $lemma = $word->get_lemma();\n $status = $word->get_status();\n echo \"<section class='admin'><h3 title='wordId = $id'>Notes for $vwref</h3>\";\n echo \"<center><h2>$spelling</h2><span title='lemma'>$lemma</span></center>\";\n echo \"<center><span title='status'>$status</span></center>\";\n?>\n <p><ol style=\"list-style-type:none;\">\n <li>Hover over a <i>column heading</i> to see a description of the column data.</li>\n </ol></p>\n<?php\n start_admin_table($hcols);\n\n list_word_notes($notes, $vwref);\n echo \"</table></section>\";\n}", "function notes_save_meta_box_data( $post_id ) {\n\n\t/*\n\t * We need to verify this came from our screen and with proper authorization,\n\t * because the save_post action can be triggered at other times.\n\t */\n\n\t// Check if our nonce is set.\n\tif ( ! isset( $_POST['notes_meta_box_nonce'] ) ) {\n\t\treturn;\n\t}\n\n\t// Verify that the nonce is valid.\n\tif ( ! wp_verify_nonce( $_POST['notes_meta_box_nonce'], 'notes_meta_box' ) ) {\n\t\treturn;\n\t}\n\n\t// If this is an autosave, our form has not been submitted, so we don't want to do anything.\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\treturn;\n\t}\n\n\t// Check the user's permissions.\n\tif ( isset( $_POST['post_type'] ) && 'page' == $_POST['post_type'] ) {\n\n\t\tif ( ! current_user_can( 'edit_page', $post_id ) ) {\n\t\t\treturn;\n\t\t}\n\n\t} else {\n\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t/* OK, it's safe for us to save the data now. */\n\t\n\t// Make sure that it is set.\n\tif ( ! isset( $_POST['notes_new_field'] ) ) {\n\t\treturn;\n\t}\n\n\t// Sanitize user input.\n\t$my_data = sanitize_text_field( $_POST['notes_new_field'] );\n\n\t// Update the meta field in the database.\n\tupdate_post_meta( $post_id, '_my_meta_value_key', $my_data );\n}", "function savewiretransfer($detail) {\r\n \r\n $published = $detail['published']['0'];\r\n \r\n //get text editor content\r\n $content = $_REQUEST['content'];\r\n $content = addslashes($content);\r\n \r\n $db = JFactory::getDBO();\r\n// \r\n $query = \" UPDATE `#__em_wiretransfer_settings` SET `details` = '$content'\r\n WHERE `id` = 1\";\r\n $db->setQuery($query);\r\n $db->query();\r\n $query = \" UPDATE `#__em_paymentmethod` SET `status` = '$published'\r\n WHERE `id` = 1\";\r\n $db->setQuery($query);\r\n $db->query();\r\n }", "function dokuwysiwyg_edit_meta(&$event)\n {\n global $ACT;\n\n // we only change the edit behaviour\n if (!in_array($ACT, array('recover', 'edit', 'preview'))){\n return;\n }\n\n global $lang;\n global $ID;\n \n $this->init();\n $event->data['script'][] = \n array( \n 'type' =>'text/javascript', \n 'charset' =>'utf-8', \n '_data' =>'',\n 'src' => $this->fck_location. '/fckeditor.js?rev='.self::getSCID()\n );\n\n $event->data['script'][] = \n array( \n 'type'=>'text/javascript', \n 'charset'=>'utf-8', \n '_data'=>'',\n 'src'=> $this->fck_location. '/../jquery-1.3.2.min.js'\n );\n\n $event->data['script'][] = \n array( \n 'type'=>'text/javascript', \n 'charset'=>'utf-8', \n '_data'=>'',\n 'src'=> $this->fck_location. '/../edit.js?rev='.self::getSCID()\n );\n\n $toolbar = 'Default';\n $snippets = @plugin_load('helper', 'snippets');\n if ($snippets && !plugin_isdisabled('snippets')) {\n $toolbar = 'WithSnippets';\n }\n\n $event->data['script'][] = \n // the $lang['plugin']['js'] is not used on purpose\n array( \n 'type'=>'text/javascript', \n 'charset'=>'utf-8', \n '_data'=>\"\n\n jQuery.noConflict();\n\n var dokuwysiwyg_lang = \n {\n btn_save:'{$lang['btn_save']}',\n btn_cancel:'{$lang['btn_cancel']}',\n btn_wikisyntax: 'Wikisyntax',\n summary:'{$lang['summary']}',\n label_discussion:'\".$this->getLang('discussion').\"',\n label_nocache:'\".$this->getLang('nocache').\"',\n label_notoc:'\".$this->getLang('notoc').\"'\n };\n var ID = '$ID';\n var dokuwysiwyg_link_protocols = '\".$this->getConf('link_protocols').\"';\n var dokuwysiwyg_dicussion_plugin_active = \".((@plugin_load('action','discussion') && !plugin_isdisabled('discussion'))?'true':'false').\";\n var separate_page_title = \". ($this->getConf('separate_page_title')?'true':'false') .\";\n var dokuwysiwyg_default_wysiwyg = \". ($this->getConf('default_wysiwyg')?'true':'false') .\";\n var dokuwysiwyg_toolbar = '$toolbar';\n var DOKU_REL = '\".DOKU_REL.\"';\n \"\n );\n return;\n }", "function Page() {\n \n // only administrators can edit it\n \n // fields\n \n $this->char_field( 'title' );\n \n $this->text_field( 'body' );\n \n $this->text_field( 'summary' );\n \n $this->text_field( 'contributor' );\n $this->text_field( 'rights' );\n $this->text_field( 'source' );\n \n $this->char_field( 'uri' );\n $this->char_field( 'url' );\n \n $this->file_field( 'attachment' );\n \n $this->int_field( 'parent_id' );\n $this->int_field( 'profile_id' );\n $this->int_field( 'recipient_id' );\n \n $this->bool_field( 'local' );\n \n $this->time_field( 'created' );\n $this->time_field( 'modified' );\n \n $this->int_field( 'entry_id' );\n \n $this->auto_field( 'id' );\n \n // relationships\n \n // each record in posts HAS ONE record in entries\n \n $this->has_one( 'entry' );\n\n //$this->has_many( 'comments' );\n\n //$this->has_many( 'reviews' );\n \n $this->set_limit(10);\n \n // permissions\n \n $this->let_read( 'all:everyone' );\n \n $this->let_access( 'all:administrators' );\n \n $this->use_templates_from( 'posts' );\n \n }", "function clonemaker_add_meta_box(){\r\n add_meta_box(\r\n 'clonemaker',\r\n 'Clone a Page',\r\n 'add_post_list',\r\n 'page',\r\n 'side'\r\n );\r\n\r\n\r\n}", "public function add_note()\n {\n\n $cols = \"`desc`\";\n\n $value =\n \" '\" . $this->obj->all_data->notes->get_desc() . \"' \";\n\n\n $insert = $this->obj->insert(\"notes\", $cols, $value);\n return $insert;\n }", "function modify_note($module_key,$link_key) {\r\n\r\n\tglobal $CONN, $CONFIG;\r\n\t$body = $_POST['body'];\r\n\t$sql = \"UPDATE {$CONFIG['DB_PREFIX']}notes SET note='$body' WHERE module_key='$module_key'\";\t\r\n\tif ($CONN->Execute($sql) === false) {\r\n\t\r\n\t\t$message = 'There was an error modifying your note: '.$CONN->ErrorMsg().' <br />';\r\n\t\treturn $message;\r\n\t\t\r\n\t} else {\t \r\n\t\r\n\t\t\treturn true; \r\n\t}\r\n\r\n}", "function edit_page()\n\t{\n\t\tglobal $errors, $cache, $security, $basic_gui;\n\t\t\n\t\t// basic error check\n\t\tif ( !isset( $_POST[ 'submit_page' ] ) )\n\t\t{\n\t\t\t$errors->report_error( $this->lang[ 'Wrong_form' ], CRITICAL_ERROR );\n\t\t}\n\t\t\n\t\t// get data\n\t\t$title = ( isset( $_POST[ 'title' ] ) ) ? strval( $_POST[ 'title' ] ) : '';\n\t\t$lang = ( isset( $_POST[ 'language' ] ) ) ? strval( $_POST[ 'language' ] ) : '';\n\t\t$text = str_replace( '&nbsp;', ' ', $basic_gui->gennuline( ( isset( $_POST[ 'editor1' ] ) ) ? strval( $_POST[ 'editor1' ] ) : '' ) );\n\t\t$auth = ( isset( $_POST[ 'auth' ] ) ) ? intval( $_POST[ 'auth' ] ) : GUEST;\n\t\t$remove = ( isset( $_POST[ 'remove' ] ) && $_POST[ 'remove' ] == 'on' ) ? TRUE : FALSE;\n\t\t\n// \t\t$text = str_replace( \"\\n\", '<br />', $text );\n\t\t\n\t\tif ( empty( $title ) || empty( $text ) )\n\t\t{ // need these\n\t\t\t$errors->report_error( $this->lang[ 'No_data' ], GENERAL_ERROR );\n\t\t}\n\t\t\n\t\t// save to the array\n\t\tif ( !is_array( $this->pages_array[ $lang ] ) )\n\t\t{ // make it an array, just to be sure\n\t\t\t$this->pages_array[ $lang ] = array();\n\t\t}\n\t\tif ( !$remove )\n\t\t{\n\t\t\t$pag = array( 'content' => $text, 'auth' => $auth );\n\t\t\t$this->pages_array[ $lang ][ $title ] = $pag;\n\t\t}else\n\t\t{\n\t\t\tunset( $this->pages_array[ $lang ][ $title ] );\n\t\t}\n\t\t\n\t\t// now write it\n\t\t$this->save_pages();\n\t\t\n\t\t$errors->report_error( $this->lang[ 'Edited' ], MESSAGE );\n\t}", "public function lectureNotes() {\n\t\t$pageTitle = 'Lecture Notes';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/ntsub-lecture-notes.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "public function onSaveSuccess($type, $id) {\nglobal $_LW;\nif (!isset($_LW->ENV->editors[$_LW->page])) {\n\t// if not saving from the editor, this is coming from the ->update() API and these steps can be skipped\n\treturn false;\n}\nif ($type=='events' && ($_LW->page=='events_edit' || $_LW->page=='events_sub_edit')) { // if saving an event from the editor\n\t$_LW->setCustomFields($type, $id, ['sample_textarea'=>@$_LW->_POST['sample_textarea']], []); // store the value entered for sample_textarea, allowing the sample_textarea field full visibility (on details pages, in widget results, and /live/* requests such as /live/json)\n\t/*\n\tNote:\n \tTo optionally hide the field (i.e. store it in the database but not expose it to the public on the frontend web site or API requests, add \"sample_textarea\" to the empty array above, registering it as a hidden field).\n\tNon-hidden fields may be added to a details template via <xphp var=\"details_custom_sample_textarea\"/> or to a widget format arg via {custom_sample_textarea}.\n\t*/\n\t$_LW->setCustomFields($type, $id, ['sample_text'=>@$_LW->_POST['sample_text']], []); // store the value\n\t$_LW->setCustomFields($type, $id, ['sample_select'=>@$_LW->_POST['sample_select']], []); // store the value\n\t$_LW->setCustomFields($type, $id, ['sample_checkbox'=>@$_LW->_POST['sample_checkbox']], []); // store the value\n\t$_LW->setCustomFields($type, $id, ['sample_radio'=>@$_LW->_POST['sample_radio']], []); // store the value\n};\n}", "public function run()\n {\n \n\n \\DB::table('pages')->delete();\n \n \\DB::table('pages')->insert(array (\n 0 => \n array (\n 'id' => 2,\n 'title' => 'Privacy Policy',\n 'slug' => 'privacy-policy',\n 'contents' => '<p><strong>Acceptance the Use of HireANerd Technology Pvt Ltd Terms and Conditions</strong></p>\n\n<p>By availing any service from HireANerd Technology Pvt Ltd, you&rsquo;re acknowledging the terms and conditions provided by us. Any of your access is subject to follow these terms and conditions strictly. You will not avail Intlum for any purpose which is illegal or forbidden by these terms and conditions. If you&rsquo;re availing services from Intlum Technology, that denotes the agreement with the disclaimers, terms, and conditions provided in this page. If you&rsquo;re unlikely to this terms and conditions and do not want to accept, you need to instantly stop using our service.</p>\n\n<p><strong>Credit card details</strong></p>\n\n<p>You are requested not to enter any of your Credit Card details on any form of HireANerd Technology Pvt Ltd. Because we will never ask you for Credit Card details. If you find any form, documentation or payment that requires your Credit Card details, contact Intlum before you continue.</p>\n\n<p><strong>Advice</strong></p>\n\n<p>The contents of HireANerd Technology Pvt Ltd website do not establish opinion and should not be entirely relied upon in making or refusing any decision that you make. We write as per the current standard. But you can make your decisions.</p>\n\n<p><strong>Change of Use</strong></p>\n\n<p>HireANerd Technology Pvt Ltd reserves the right to:</p>\n\n<p>Modify or Eliminate anything from its website at any point of time without any notice. And by accepting these terms and condition you&rsquo;re confirming that Intlum Technology will neither be liable for any changes done in its site, nor it needs to inform about any modification to its website. Modify the terms and conditions at any time without any prior notice. And the continuing use of your website after the modification will convey your acceptance of the changes made.</p>\n\n<p><strong>Links to Third Party Websites</strong></p>\n\n<p>HireANerd Technology Pvt Ltd Website may contain links to external websites that are coordinated and preserved by others. Any link to other websites is not an advocacy of such websites and you accept and approve that we are not accountable for the content or accessibility of any such sites.</p>\n\n<p><strong>Copyright</strong></p>\n\n<p>Copyright, trademarks and all the further intellectual property permissions in the Website and its content (including the text, design, graphics and all source codes and software linked to the Website) are possessed by or registered to HireANerd Technology Pvt Ltd or else handled by HireANerd Technology Pvt Ltd as legalized by law.<br />\nWhile accessing the HireANerd Technology Pvt Ltd website, you agree that you will access the content exclusively for your private, non-commercial practice. None of the content may be transferred, copied, duplicated, broadcasted, saved, traded or distributed without the aforementioned written agreement of the copyright owner. This keeps out the downloading, replication and/or printing of pages of the Website for private, non-commercial usage only.</p>\n\n<p><strong>Disclaimers and Limitation of Liability</strong></p>\n\n<p>The Website is delivered on AS IS and AS AVAILABLE basis without any depiction or advocacy made and deprived of assurance of any kind whether articulated or suggested, counting but not limited to the indicated warranties of suitable quality, condition for a specific reason, non-violation, compatibility, safety, and precision.&nbsp;</p>\n\n<p>As allowable by regulation, HireANerd Technology Pvt Ltd will not be accountable for any unintended or subsequent damage or harm whatever (including but not limited to loss of prospect, business, information, revenues) arising out of or regarding the Website practice.<br />\nHireANerd Technology Pvt Ltd doesn&rsquo;t assure that the functionality of the Website will be continuous or free of errors, that flaws will be modified after the post-project support period or that the Website or the server that avails it is virus-free or free of other damaging or vicious elements.<br />\nNot anything in these Terms and Conditions will be interpreted in order to discard or limit the accountability of HireANerd Technology Pvt Ltd for death or individual damage as a result of the carelessness of HireANerd Technology Pvt Ltd or that of its staffs or managers.</p>\n\n<p><strong>Indemnity</strong></p>\n\n<p>You agree to ensure, and hold HireANerd Technology Pvt Ltd and its personnel and managers safe from and against all obligations, legal charges, compensations, debits, charges and other expenditures concerning any allegation or action brought against HireANerd Technology Pvt Ltd arising out of any violation by you of these Terms and Conditions or other obligations arising out of your use of Intlum Website.</p>\n\n<p><strong>Compensation</strong></p>\n\n<p>If any of these Terms and Conditions is verified by any court of competent jurisdiction to be unacceptable, unlawful or unenforceable for any cause, then the Term or Condition will certainly be cut off and the outstanding Terms and Conditions will continue and stay in full force and result and remain to be enforceable and compulsory.</p>\n\n<p>Governing Law</p>\n\n<p>These Terms and Conditions written on HireANerd Technology Pvt Ltd will be administered by and interpreted in line with the law of USA and you hereby submit to the complete authority of the USA courts.</p>',\n 'is_active' => 1,\n 'created_at' => '2019-08-22 16:07:52',\n 'updated_at' => '2019-08-22 16:25:16',\n ),\n 1 => \n array (\n 'id' => 3,\n 'title' => 'Terms & Conditions',\n 'slug' => 'terms-conditions',\n 'contents' => '<p><strong>Acceptance the Use of HireANerd Technology Pvt Ltd Terms and Conditions</strong></p>\n\n<p>By availing any service from HireANerd Technology Pvt Ltd, you&rsquo;re acknowledging the terms and conditions provided by us. Any of your access is subject to follow these terms and conditions strictly. You will not avail Intlum for any purpose which is illegal or forbidden by these terms and conditions. If you&rsquo;re availing services from Intlum Technology, that denotes the agreement with the disclaimers, terms, and conditions provided in this page. If you&rsquo;re unlikely to this terms and conditions and do not want to accept, you need to instantly stop using our service.</p>\n\n<p>Credit card details</p>\n\n<p>You are requested not to enter any of your Credit Card details on any form of HireANerd Technology Pvt Ltd. Because we will never ask you for Credit Card details. If you find any form, documentation or payment that requires your Credit Card details, contact Intlum before you continue.</p>\n\n<p>Advice</p>\n\n<p><strong>The contents of HireANerd Technology Pvt Ltd website do not establish opinion and should not be entirely relied upon in making or refusing any decision that you make. We write as per the current standard. But you can make your decisions.</strong></p>\n\n<p>Change of Use</p>\n\n<p>HireANerd Technology Pvt Ltd reserves the right to:</p>\n\n<p>Modify or Eliminate anything from its website at any point of time without any notice. And by accepting these terms and condition you&rsquo;re confirming that Intlum Technology will neither be liable for any changes done in its site, nor it needs to inform about any modification to its website. Modify the terms and conditions at any time without any prior notice. And the continuing use of your website after the modification will convey your acceptance of the changes made.</p>\n\n<p>Links to Third Party Websites</p>\n\n<p>HireANerd Technology Pvt Ltd Website may contain links to external websites that are coordinated and preserved by others. Any link to other websites is not an advocacy of such websites and you accept and approve that we are not accountable for the content or accessibility of any such sites.</p>\n\n<p>Copyright</p>\n\n<p>Copyright, trademarks and all the further intellectual property permissions in the Website and its content (including the text, design, graphics and all source codes and software linked to the Website) are possessed by or registered to HireANerd Technology Pvt Ltd or else handled by HireANerd Technology Pvt Ltd as legalized by law.<br />\nWhile accessing the HireANerd Technology Pvt Ltd website, you agree that you will access the content exclusively for your private, non-commercial practice. None of the content may be transferred, copied, duplicated, broadcasted, saved, traded or distributed without the aforementioned written agreement of the copyright owner. This keeps out the downloading, replication and/or printing of pages of the Website for private, non-commercial usage only.</p>\n\n<p>Disclaimers and Limitation of Liability</p>\n\n<p>The Website is delivered on AS IS and AS AVAILABLE basis without any depiction or advocacy made and deprived of assurance of any kind whether articulated or suggested, counting but not limited to the indicated warranties of suitable quality, condition for a specific reason, non-violation, compatibility, safety, and precision.&nbsp;</p>\n\n<p>As allowable by regulation, HireANerd Technology Pvt Ltd will not be accountable for any unintended or subsequent damage or harm whatever (including but not limited to loss of prospect, business, information, revenues) arising out of or regarding the Website practice.<br />\nHireANerd Technology Pvt Ltd doesn&rsquo;t assure that the functionality of the Website will be continuous or free of errors, that flaws will be modified after the post-project support period or that the Website or the server that avails it is virus-free or free of other damaging or vicious elements.<br />\nNot anything in these Terms and Conditions will be interpreted in order to discard or limit the accountability of HireANerd Technology Pvt Ltd for death or individual damage as a result of the carelessness of HireANerd Technology Pvt Ltd or that of its staffs or managers.</p>\n\n<p>Indemnity</p>\n\n<p>You agree to ensure, and hold HireANerd Technology Pvt Ltd and its personnel and managers safe from and against all obligations, legal charges, compensations, debits, charges and other expenditures concerning any allegation or action brought against HireANerd Technology Pvt Ltd arising out of any violation by you of these Terms and Conditions or other obligations arising out of your use of Intlum Website.</p>\n\n<p>Compensation</p>\n\n<p>If any of these Terms and Conditions is verified by any court of competent jurisdiction to be unacceptable, unlawful or unenforceable for any cause, then the Term or Condition will certainly be cut off and the outstanding Terms and Conditions will continue and stay in full force and result and remain to be enforceable and compulsory.</p>\n\n<p>Governing Law</p>\n\n<p>These Terms and Conditions written on HireANerd Technology Pvt Ltd will be administered by and interpreted in line with the law of USA and you hereby submit to the complete authority of the USA courts.</p>',\n 'is_active' => 1,\n 'created_at' => '2019-08-22 16:22:45',\n 'updated_at' => '2019-08-22 16:23:22',\n ),\n ));\n \n \n }", "public function ajaxProcessUpdateCustomerNote()\n {\n }", "public function save() {\n\t\t$url = $this->items[ $this->id ]['url'];\n\t\t$handle = $this->items[ $this->id ]['name'];\n\t\t$deps = isset( $this->items[ $this->id ]['deps'] ) ? $this->items[ $this->id ]['deps'] : array();\n\t\t$ver = isset( $this->items[ $this->id ]['ver'] ) ? $this->items[ $this->id ]['ver'] : null;\n\t\t$ver = $ver && 'auto' === $ver ? \\Wpfw\\Asset::get_modified_time( $url ) : $ver;\n\t\t$in_footer = isset( $this->items[ $this->id ]['in_footer'] ) ? $this->items[ $this->id ]['in_footer'] : true; // put default to footer for non-blocking request.\n\t\t$localize = isset( $this->items[ $this->id ]['localize'] ) ? $this->items[ $this->id ]['localize'] : false;\n\n\t\twp_register_script( $handle, $url, $deps, $ver, $in_footer );\n\n\t\tif ( $localize ) {\n\t\t\twp_localize_script(\n\t\t\t\t$this->items[ $this->id ]['name'],\n\t\t\t\t$this->items[ $this->id ]['localize']['name'],\n\t\t\t\t$this->items[ $this->id ]['localize']['value']\n\t\t\t);\n\t\t}\n\t}", "function edit_form($page, $postdata, $digest = FALSE, $b_template = TRUE, $cmd='')\n{\n\t//global $script, $vars, $rows, $cols, $hr, $function_freeze;\n\tglobal $script, $rows, $cols, $hr, $function_freeze;\n\tglobal $_btn_preview, $_btn_repreview, $_btn_update, $_btn_cancel, $_msg_help;\n\tglobal $whatsnew, $_btn_template, $_btn_load, $load_template_func;\n\tglobal $notimeupdate;\n\tglobal $_btn_addtop;\n\tglobal $gEnvManager;\n\t\n\t// テンプレートタイプに合わせて出力を変更\n\t$templateType = $gEnvManager->getCurrentTemplateType();\n\t\t\n\t// Newly generate $digest or not\n\tif ($digest === FALSE) $digest = md5(get_source($page, true));\n\n\t$refer = $template = '';\n\n \t// Add plugin\n\t$addtag = $add_top = '';\n\tif ($cmd == 'add'){\n\t\t$addtag = '<input type=\"hidden\" name=\"add\" value=\"true\" />';\n\t\t$add_top = (WikiParam::getVar('add_top') != '') ? ' checked=\"checked\"' : '';\n\t\t\n\t\tif ($templateType == M3_TEMPLATE_BOOTSTRAP_30){\t\t// Bootstrap型テンプレートの場合\n\t\t\t$add_top = '<div class=\"checkbox-inline\"><input type=\"checkbox\" name=\"add_top\" id=\"_edit_form_add_top\" value=\"true\"' . $add_top . ' />' . \"\\n\" .\n\t\t\t\t\t'<label for=\"_edit_form_add_top\">' . $_btn_addtop . '</label></div>';\n\t\t} else {\n\t\t\t$add_top = '<input type=\"checkbox\" name=\"add_top\" id=\"_edit_form_add_top\" value=\"true\"' . $add_top . ' />' . \"\\n\" .\n\t\t\t\t\t'<label for=\"_edit_form_add_top\">' . $_btn_addtop . '</label>';\n\t\t}\n\t}\n\n\tif($load_template_func && $b_template) {\n\t\t$pages = array();\n\t\tforeach(get_existpages() as $_page) {\n\t\t\tif ($_page == $whatsnew || check_non_list($_page))\n\t\t\t\tcontinue;\n\t\t\t$s_page = htmlspecialchars($_page);\n\t\t\t$pages[$_page] = ' <option value=\"' . $s_page . '\">' .\n\t\t\t\t$s_page . '</option>';\n\t\t}\n\t\tksort($pages);\n\t\t$s_pages = join(\"\\n\", $pages);\n\t\t\n\t\tif ($templateType == M3_TEMPLATE_BOOTSTRAP_30){\t\t// Bootstrap型テンプレートの場合\n\t\t\t$template = <<<EOD\n <select class=\"form-control\" name=\"template_page\">\n <option value=\"\">-- $_btn_template --</option>\n$s_pages\n </select>\n <input type=\"submit\" name=\"template\" class=\"button btn\" value=\"$_btn_load\" accesskey=\"r\" />\nEOD;\n\t\t} else {\n\t\t\t$template = <<<EOD\n <select name=\"template_page\">\n <option value=\"\">-- $_btn_template --</option>\n$s_pages\n </select>\n <input type=\"submit\" name=\"template\" class=\"button\" value=\"$_btn_load\" accesskey=\"r\" />\n <br />\nEOD;\n\t\t}\n\n\t\t/*if (isset($vars['refer']) && $vars['refer'] != '')\n\t\t\t$refer = '[[' . strip_bracket($vars['refer']) . ']]' . \"\\n\\n\";*/\n\t\t$referValue = WikiParam::getVar('refer');\n\t\tif ($referValue != '') $refer = '[[' . strip_bracket($referValue) . ']]' . \"\\n\\n\";\n\t}\n\n\t$r_page = rawurlencode($page);\n\t$s_page = htmlspecialchars($page);\n\t$s_digest = htmlspecialchars($digest);\n\t$s_postdata = htmlspecialchars($refer . $postdata);\n\t/*$s_original = isset($vars['original']) ? htmlspecialchars($vars['original']) : $s_postdata;\n\t$b_preview = isset($vars['preview']); // TRUE when preview*/\n\t$s_original = (WikiParam::getVar('original') != '') ? htmlspecialchars(WikiParam::getVar('original')) : $s_postdata;\n\t$b_preview = (WikiParam::getVar('preview') != ''); // TRUE when preview\n\t$btn_preview = $b_preview ? $_btn_repreview : $_btn_preview;\n\n\t// Checkbox 'do not change timestamp'\n\t$add_notimestamp = '';\n\tif ($notimeupdate != 0) {\n\t\tglobal $_btn_notchangetimestamp;\n\n\t\t$checked_time = (WikiParam::getVar('notimestamp') != '') ? ' checked=\"checked\"' : '';\n\t\t\n\t\tif ($templateType == M3_TEMPLATE_BOOTSTRAP_30){\t\t// Bootstrap型テンプレートの場合\n\t\t\t// Only for administrator\n\t\t\tif ($notimeupdate == 2) {\n\t\t\t\t$add_notimestamp = '<input type=\"password\" class=\"form-control\" name=\"pass\" size=\"12\" />';\n\t\t\t}\n\t\t\t$add_notimestamp = '<div class=\"checkbox-inline\"><input type=\"checkbox\" name=\"notimestamp\" id=\"_edit_form_notimestamp\" value=\"true\"' . $checked_time . ' />' .\n\t\t\t\t\t\t\t\t'<label for=\"_edit_form_notimestamp\">' . $_btn_notchangetimestamp . '</label></div>' . $add_notimestamp . '&nbsp;';\n\t\t} else {\n\t\t\t// Only for administrator\n\t\t\tif ($notimeupdate == 2) {\n\t\t\t\t$add_notimestamp = ' ' .\n\t\t\t\t\t'<input type=\"password\" name=\"pass\" size=\"12\" />' . \"\\n\";\n\t\t\t}\n\t\t\t$add_notimestamp = '<input type=\"checkbox\" name=\"notimestamp\" ' .\n\t\t\t\t'id=\"_edit_form_notimestamp\" value=\"true\"' . $checked_time . ' />' . \"\\n\" .\n\t\t\t\t' ' . '<label for=\"_edit_form_notimestamp\"><span class=\"small\">' .\n\t\t\t\t$_btn_notchangetimestamp . '</span></label>' . \"\\n\" .\n\t\t\t\t$add_notimestamp .\n\t\t\t\t'&nbsp;';\n\t\t}\n\t}\n\n\t$postScript = $script . WikiParam::convQuery(\"?\");\n\t\n\tif ($templateType == M3_TEMPLATE_BOOTSTRAP_30){\t\t// Bootstrap型テンプレートの場合\n\t\t$cols = EDIT_COLS_BOOTSTRAP;\n\t\t$body = <<<EOD\n<div class=\"edit_form\">\n <form action=\"$postScript\" method=\"post\" class=\"form form-inline\" role=\"form\">\n$template\n $addtag\n <input type=\"hidden\" name=\"wcmd\" value=\"edit\" />\n <input type=\"hidden\" name=\"page\" value=\"$s_page\" />\n <input type=\"hidden\" name=\"digest\" value=\"$s_digest\" />\n <div><textarea class=\"wiki_edit form-control\" name=\"msg\" rows=\"$rows\" cols=\"$cols\">$s_postdata</textarea></div>\n <input type=\"submit\" name=\"preview\" class=\"button btn\" value=\"$btn_preview\" accesskey=\"p\" />\n <input type=\"submit\" name=\"write\" class=\"button btn\" value=\"$_btn_update\" accesskey=\"s\" />\n $add_top\n $add_notimestamp\n <textarea name=\"original\" style=\"display:none\">$s_original</textarea>\n </form>\n <form action=\"$postScript\" method=\"post\" class=\"form form-inline\" role=\"form\">\n <input type=\"hidden\" name=\"wcmd\" value=\"edit\" />\n <input type=\"hidden\" name=\"page\" value=\"$s_page\" />\n <input type=\"submit\" name=\"cancel\" class=\"button btn\" value=\"$_btn_cancel\" accesskey=\"c\" />\n </form>\n</div>\nEOD;\n\t} else {\n\t\t$body = <<<EOD\n<div class=\"edit_form\">\n <form action=\"$postScript\" method=\"post\" style=\"margin-bottom:0px;\" class=\"form\">\n$template\n $addtag\n <input type=\"hidden\" name=\"wcmd\" value=\"edit\" />\n <input type=\"hidden\" name=\"page\" value=\"$s_page\" />\n <input type=\"hidden\" name=\"digest\" value=\"$s_digest\" />\n <textarea name=\"msg\" class=\"wiki_edit\" rows=\"$rows\" cols=\"$cols\">$s_postdata</textarea>\n <br />\n <div style=\"float:left;\">\n <input type=\"submit\" name=\"preview\" class=\"button\" value=\"$btn_preview\" accesskey=\"p\" />\n <input type=\"submit\" name=\"write\" class=\"button\" value=\"$_btn_update\" accesskey=\"s\" />\n $add_top\n $add_notimestamp\n </div>\n <textarea name=\"original\" rows=\"1\" cols=\"1\" style=\"display:none\">$s_original</textarea>\n </form>\n <form action=\"$postScript\" method=\"post\" style=\"margin-top:0px;\" class=\"form\">\n <input type=\"hidden\" name=\"wcmd\" value=\"edit\" />\n <input type=\"hidden\" name=\"page\" value=\"$s_page\" />\n <input type=\"submit\" name=\"cancel\" class=\"button\" value=\"$_btn_cancel\" accesskey=\"c\" />\n </form>\n</div>\nEOD;\n\t}\n\n\t//if (isset($vars['help'])) {\n\tif (WikiParam::getVar('help') != ''){\n\t\t$body .= $hr . catrule();\n\t} else {\n\t\t// modified for Magic3 by naoki on 2008/10/6\n\t\t/*$body .= '<ul><li><a href=\"' .\n\t\t\t$script . '?cmd=edit&amp;help=true&amp;page=' . $r_page .\n\t\t\t'\">' . $_msg_help . '</a></li></ul>';*/\n\t\t$body .= '<ul><li><a href=\"' .\n\t\t\t$script . WikiParam::convQuery(\"?cmd=edit&amp;help=true&amp;page=$r_page\") .\n\t\t\t'\">' . $_msg_help . '</a></li></ul>';\n\t}\n\n\treturn $body;\n}", "public function main()\n {\n $lang = $this->getLanguageService();\n // Access check...\n // The page will show only if there is a valid page and if this page may be viewed by the user\n $access = is_array($this->pageinfo) ? 1 : 0;\n // Content\n $content = '';\n if ($this->id && $access) {\n // Initialize permission settings:\n $this->CALC_PERMS = $this->getBackendUser()->calcPerms($this->pageinfo);\n $this->EDIT_CONTENT = $this->contentIsNotLockedForEditors();\n\n $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($this->pageinfo);\n\n // override the default jumpToUrl\n $this->moduleTemplate->addJavaScriptCode('jumpToUrl', '\n function jumpToUrl(URL,formEl) {\n if (document.editform && TBE_EDITOR.isFormChanged) { // Check if the function exists... (works in all browsers?)\n if (!TBE_EDITOR.isFormChanged()) {\n window.location.href = URL;\n } else if (formEl) {\n if (formEl.type==\"checkbox\") formEl.checked = formEl.checked ? 0 : 1;\n }\n } else {\n window.location.href = URL;\n }\n }\n ');\n $this->moduleTemplate->addJavaScriptCode('mainJsFunctions', '\n if (top.fsMod) {\n top.fsMod.recentIds[\"web\"] = ' . (int)$this->id . ';\n top.fsMod.navFrameHighlightedID[\"web\"] = \"pages' . (int)$this->id . '_\"+top.fsMod.currentBank; ' . (int)$this->id . ';\n }\n ' . ($this->popView ? BackendUtility::viewOnClick($this->id, '', BackendUtility::BEgetRootLine($this->id)) : '') . '\n function deleteRecord(table,id,url) { //\n window.location.href = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_db') . '&cmd[')\n . ' + table + \"][\" + id + \"][delete]=1&redirect=\" + encodeURIComponent(url) + \"&prErr=1&uPT=1\";\n return false;\n }\n ');\n\n // Find backend layout / columns\n $backendLayout = GeneralUtility::callUserFunction(BackendLayoutView::class . '->getSelectedBackendLayout', $this->id, $this);\n if (!empty($backendLayout['__colPosList'])) {\n $this->colPosList = implode(',', $backendLayout['__colPosList']);\n }\n // Removing duplicates, if any\n $this->colPosList = array_unique(GeneralUtility::intExplode(',', $this->colPosList));\n // Accessible columns\n if (isset($this->modSharedTSconfig['properties']['colPos_list']) && trim($this->modSharedTSconfig['properties']['colPos_list']) !== '') {\n $this->activeColPosList = array_unique(GeneralUtility::intExplode(',', trim($this->modSharedTSconfig['properties']['colPos_list'])));\n // Match with the list which is present in the colPosList for the current page\n if (!empty($this->colPosList) && !empty($this->activeColPosList)) {\n $this->activeColPosList = array_unique(array_intersect(\n $this->activeColPosList,\n $this->colPosList\n ));\n }\n } else {\n $this->activeColPosList = $this->colPosList;\n }\n $this->activeColPosList = implode(',', $this->activeColPosList);\n $this->colPosList = implode(',', $this->colPosList);\n\n $content .= $this->getHeaderFlashMessagesForCurrentPid();\n\n // Render the primary module content:\n if ($this->MOD_SETTINGS['function'] == 1 || $this->MOD_SETTINGS['function'] == 2) {\n $content .= '<form action=\"' . htmlspecialchars(BackendUtility::getModuleUrl($this->moduleName, ['id' => $this->id, 'imagemode' => $this->imagemode])) . '\" id=\"PageLayoutController\" method=\"post\">';\n // Page title\n $content .= '<h1 class=\"t3js-title-inlineedit\">' . htmlspecialchars($this->getLocalizedPageTitle()) . '</h1>';\n // All other listings\n $content .= $this->renderContent();\n }\n $content .= '</form>';\n $content .= $this->searchContent;\n // Setting up the buttons for the docheader\n $this->makeButtons();\n // @internal: This is an internal hook for compatibility7 only, this hook will be removed without further notice\n if ($this->MOD_SETTINGS['function'] != 1 && $this->MOD_SETTINGS['function'] != 2) {\n $renderActionHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['renderActionHook'];\n if (is_array($renderActionHook)) {\n foreach ($renderActionHook as $hook) {\n $params = [\n 'deleteButton' => $this->deleteButton,\n ''\n ];\n $content .= GeneralUtility::callUserFunction($hook, $params, $this);\n }\n }\n }\n // Create LanguageMenu\n $this->makeLanguageMenu();\n } else {\n $this->moduleTemplate->addJavaScriptCode(\n 'mainJsFunctions',\n 'if (top.fsMod) top.fsMod.recentIds[\"web\"] = ' . (int)$this->id . ';'\n );\n $content .= '<h1>' . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) . '</h1>';\n $view = GeneralUtility::makeInstance(StandaloneView::class);\n $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/InfoBox.html'));\n $view->assignMultiple([\n 'title' => $lang->getLL('clickAPage_header'),\n 'message' => $lang->getLL('clickAPage_content'),\n 'state' => InfoboxViewHelper::STATE_INFO\n ]);\n $content .= $view->render();\n }\n // Set content\n $this->moduleTemplate->setContent($content);\n }", "function wp_add_privacy_policy_content($plugin_name, $policy_text)\n {\n }", "function projectpentagon_save_postdata($post_id) {\n // If it is our form has not been submitted, so we dont want to do anything\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) \n return;\n\n // verify this came from the our screen and with proper authorization,\n // because save_post can be triggered at other times\n\n if ( !wp_verify_nonce( $_POST['myplugin_noncename'], plugin_basename( __FILE__ ) ) )\n return;\n\n // Check permissions\n\n if ( 'page' == $_POST['post_type'] ) \n {\n if ( !current_user_can( 'edit_page', $post_id ) )\n return;\n }\n else\n {\n if ( !current_user_can( 'edit_post', $post_id ) )\n return;\n }\n\n\t//update the tasting notes\n \t$outside_newvalue = $_POST['tasting-notes'];\n\tupdate_post_meta($post_id, 'tasting-notes', $outside_newvalue);\n\n // Do something with $mydata \n // probably using add_post_meta(), update_post_meta(), or \n // a custom table (see Further Reading section below)\n for($hh=1;$hh<6;$hh++)\n\n \t{\n \t//do an update for each of the potential 5 fields....\n\n \t$get_field_name\t\t\t\t\t=\t\"myplugin_new_field\" . $hh .\"\";\t\n \t$create_variable_name\t\t\t=\t\"pentagon-field-\". $hh .\"\";\t\n\t$create_name_of_field_to_update =\t\"mydata\" . $hh .\"\";\n\t$newvalue = $_POST[$get_field_name];\n\t//echo \"$newvalue is returning ---\". \t$newvalue\t.\"<br />\";//DEBUG\n\tupdate_post_meta($post_id, $create_variable_name, $newvalue);\t\n\n\t//echo \"get field name is returning --- \". $get_field_name\t.\"<br />\";//DEBUG\n\t//echo \"create variable name name is returning --- \". \t$create_variable_name\t\t.\"<br />\";//DEBUG\n\t//echo \"$create_name_of_field_to_update is returning --- \". \t$create_name_of_field_to_update\t.\"<br />\";//DEBUG\n\t}\n\n\n\n //echo \"$mydata is mydata....\";//debug\n\n}", "public function createContentAndCopyLivePage() {}", "function SaveItems() \n {\n global $Core;\n \n $name = $Core->GetVar($_POST, 'name', NULL);\n if (isset($_POST['content']) && !empty($_POST['content']))\n {\n $text = $_POST['content'];\n }\n \n $text = stripslashes($text);\n \n if (!empty($name) && !empty($text))\n {\n $name = $this->AddFileExtension($name, 'txt');\n $file = SB_SITE_DATA_DIR . \"ads/\" . $name;\n $Core->ExitEvent($Core->WriteFile($file, $text, 1), $this->redirect);\n }\n else\n {\n $Core->ExitEvent(0, $this->redirect);\n }\n }", "function mmdyk_page() {\n\t\n\t// Page wrapper start\n\techo '<div class=\"wrap\">';\n\n\t// Title\n\tscreen_icon();\n\techo '<h2>MM Did You Know?</h2>';\n\n\tglobal $wpdb;\n\t$table_name = $wpdb->prefix . 'mmdyk_quote';\n\t$hidden_field_name = 'mm_dyk_submit';\n\t\n\t// See if the user has posted us some information\n\t// If they did, this hidden field will be set to 'Y'\n\tif(isset($_POST[ $hidden_field_name ]) && $_POST[ $hidden_field_name ] == 'Y' ) {\n\t\t$mydata = $_POST['mmdyk_txtarea'];\n\t\t$wpdb->query(\"DELETE FROM $table_name WHERE post_id = 0\");\n \n\t// Do something with $mydata \n \n\t\tif($mmdyk_list = strip_tags(stripslashes($mydata))) {\n\t\t\t$mmdyk_array = explode(\"\\n\", $mmdyk_list);\n\t\t\tsort($mmdyk_array);\n\n\t\t\tforeach($mmdyk_array as $mmdyk_current) {\n\t\t\t\t$mmdyk_current = trim($mmdyk_current);\n\t\t\t\tif(!empty($mmdyk_current)) {\n\t\t\t\t\t$mmdyk_str = explode(\" http://\", $mmdyk_current);\n\t\t\t\t\tif (strlen($mmdyk_str[1]) > 0) $mmdyk_str[1] = \"http://\".$mmdyk_str[1];\n\t\t\t\t\t$wpdb->insert( $table_name, array( 'quotes' => $mmdyk_str[0], 'post_id' => $post_id, 'link' => $mmdyk_str[1] ));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// Options\n?>\n\t<p>Only one quote per line (no HTML code). To add a link put it at the end of line and start it with http://</p>\n\t<form name=\"mmdyk_form\" method=\"post\" action=\"<?php echo $_SERVER['REQUEST_URI']; ?>\">\n\t\t<input type=\"hidden\" name=\"<?php echo $hidden_field_name; ?>\" value=\"Y\">\n\n\t\t<textarea name=\"mmdyk_txtarea\" rows=\"30\" cols=\"120\" wrap=\"off\" style=\"overflow: auto;\">\n<?php \t\t\t$mmdyk_rec = $wpdb->get_results(\"SELECT * FROM $table_name WHERE post_id = 0\");\n\t\t\tforeach($mmdyk_rec as $mmdyk_act) {\n\t\t\t\techo $mmdyk_act->quotes . \" \" . $mmdyk_act->link . \"\\r\\n\";\n\t\t\t}\n?>\n\t\t</textarea>\n\t\n\t\t<p class=\"submit\">\n\t\t\t<input type=\"submit\" class=\"button-primary\" value=\"<?php _e('Save Changes') ?>\" />\n\t\t</p>\n\t</form>\n<?php }", "function Simple_Release_Notes() {\n add_action( 'init', array( $this, 'register_custom_post_type' ) );\n\n // Add the custom taxonomies\n add_action( 'init', array( $this, 'register_custom_taxonomy' ), 1 );\n\n // Set up the new permalink for this structure\n add_action( 'init', array( $this, 'register_permalinks' ), 1 );\n\n // Handle our custom permalinks\n add_filter( 'post_type_link', array( $this, 'process_custom_permalink' ), 10, 3 );\n\n // Filter our custom type off the home page\n add_action( 'pre_get_posts', array( $this, 'customize_query_for_custom_type' ) );\n\n // On the posts page, add a Category column\n add_filter( 'manage_posts_columns', array( $this, 'add_taxonomy_column' ), 10, 1 );\n add_action( 'manage_posts_custom_column', array( $this, 'manage_taxonomy_column' ), 10, 2 );\n }", "function plugin_tb_save($url, $tb_id)\n{\n\tglobal $vars, $trackback;\n\tstatic $fields = array( /* UTIME, */ 'url', 'title', 'excerpt', 'blog_name');\n\n\t$die = '';\n\tif (! $trackback) $die .= 'TrackBack feature disabled. ';\n\tif ($url == '') $die .= 'URL parameter is not set. ';\n\tif ($tb_id == '') $die .= 'TrackBack Ping ID is not set. ';\n\tif ($die != '') return array(PLUGIN_TB_ERROR, $die);\n\n\tif (! file_exists(TRACKBACK_DIR)) return array(PLUGIN_TB_ERROR, 'No such directory: TRACKBACK_DIR');\n\tif (! is_writable(TRACKBACK_DIR)) return array(PLUGIN_TB_ERROR, 'Permission denied: TRACKBACK_DIR');\n\n\t$page = tb_id2page($tb_id);\n\tif ($page === FALSE) return array(PLUGIN_TB_ERROR, 'TrackBack ID is invalid.');\n\n\t// URL validation (maybe worse of processing time limit)\n\t$result = http_request($url, 'HEAD');\n\tif ($result['rc'] !== 200) return array(PLUGIN_TB_ERROR, 'URL is fictitious.');\n\n\t// Update TrackBack Ping data\n\t$filename = tb_get_filename($page);\n\t$data = tb_get($filename);\n\n\t$items = array(UTIME);\n\tforeach ($fields as $key) {\n\t\t$value = isset($vars[$key]) ? $vars[$key] : '';\n\t\tif (preg_match('/[,\"' . \"\\n\\r\" . ']/', $value))\n\t\t\t$value = '\"' . str_replace('\"', '\"\"', $value) . '\"';\n\t\t$items[$key] = $value;\n\t}\n\t$data[rawurldecode($items['url'])] = $items;\n\n\t$fp = fopen($filename, 'w');\n\tset_file_buffer($fp, 0);\n\tflock($fp, LOCK_EX);\n\trewind($fp);\n\tforeach ($data as $line) {\n\t\t$line = preg_replace('/[\\r\\n]/s', '', $line); // One line, one ping\n\t\tfwrite($fp, join(',', $line) . \"\\n\");\n\t}\n\tflock($fp, LOCK_UN);\n\tfclose($fp);\n\n\treturn array(PLUGIN_TB_NOERROR, '');\n}", "function updatePage(){\r\n\t$pageData=base64_decode($_POST['data']);\r\n\t// Get the page we need to edit\r\n\t$html=getPage();\r\n\t// Iterate HTML, look for the editable region and make sure it's count matches the one being sent. \r\n\t$eid=0; // Assign logical number to each found class tag\r\n\tforeach($html->find('.clienteditor') as $e){ // TODO: change this to variable defined topic for edit regions\r\n\t \tif($eid==$_GET['id']){\r\n\t \t\t$e->innertext=$pageData;\r\n\t \t}\r\n\t\t$eid++;\r\n\t}\r\n\t// Post Back the updated HTML object.\r\n\t$result=postData($html);\r\n\techo \"{'status':'$result'}\";\r\n}", "public function indexTypo3PageContent() {}", "function pa_save_testidata( $post_id ) {\r\r\n\t\r\r\n\t// verify if this is an auto save routine. \r\r\n\t// If it is our form has not been submitted, so we dont want to do anything\r\r\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) \r\r\n\t\treturn;\r\r\n\t\r\r\n\t// verify this came from the our screen and with proper authorization,\r\r\n\t// because save_post can be triggered at other times\r\r\n\t\r\r\n\tif ( isset($_POST['pa_noncename']) && !wp_verify_nonce( $_POST['pa_noncename'], plugin_basename( __FILE__ ) ) )\r\r\n\t\treturn;\r\r\n\r\r\n \r\r\n\t// Check permissions\r\r\n\tif ( !current_user_can( 'edit_page', $post_id ) )\r\r\n\t\treturn;\r\r\n\t\r\r\n\t// OK, we're authenticated: we need to find and save the data\r\r\n\t\r\r\n\t$testimonialoptions = array(\r\r\n\t'testisidebar',\r\r\n\t'testisidebarright',\r\r\n\t'testisidebarleft',\r\r\n\t'testipost',\r\r\n\t'testicompany',\r\r\n\t'testiurl',\r\r\n\t'testiimageonoff');\r\r\n\t\r\r\n\tforeach ($testimonialoptions as $testimonialoption) {\t\r\r\n\tif (isset($_POST[$testimonialoption])) update_post_meta($post_id, $testimonialoption, $_POST[$testimonialoption]);\r\r\n\t}\r\r\n}" ]
[ "0.6546427", "0.63748735", "0.6362832", "0.63580805", "0.63543826", "0.6194748", "0.61930937", "0.619011", "0.6169558", "0.61306274", "0.59950274", "0.59931594", "0.5979956", "0.595651", "0.5950447", "0.5937393", "0.5921388", "0.5902664", "0.58746684", "0.58700025", "0.58604056", "0.5851742", "0.58417535", "0.5840934", "0.5839202", "0.5807899", "0.5804883", "0.5778294", "0.5766463", "0.5763349", "0.57265174", "0.57257414", "0.57105803", "0.57002634", "0.56830204", "0.56801826", "0.56787217", "0.56746733", "0.5659968", "0.5653865", "0.5653497", "0.56344044", "0.56295246", "0.56207615", "0.5605969", "0.55949837", "0.5593466", "0.5583803", "0.5583785", "0.5582933", "0.5556789", "0.5549038", "0.5540547", "0.553021", "0.55254906", "0.54987544", "0.54913366", "0.5487615", "0.54817504", "0.547544", "0.5472708", "0.54606473", "0.5455344", "0.54470086", "0.5441963", "0.5439383", "0.54382145", "0.5434695", "0.5433601", "0.54282", "0.5425831", "0.54233056", "0.5417794", "0.5413079", "0.54128885", "0.54120976", "0.5410683", "0.54039836", "0.53995574", "0.53982097", "0.53852636", "0.5383816", "0.53801006", "0.5367881", "0.5364476", "0.5362107", "0.53585", "0.53569174", "0.53558457", "0.5348009", "0.5342846", "0.53366554", "0.53363633", "0.53362226", "0.5335651", "0.53312457", "0.53253984", "0.5321976", "0.5313198", "0.5313093", "0.53129774" ]
0.0
-1
Registers Course Notes as custom post type
function nt_register_course_note_create_type() { $post_labels = array( 'name' => 'Course Notes', 'singular_name' => 'Course Notes', 'add_new' => 'Add New', 'add_new_item' => 'Add New Note', 'edit' => 'Edit', 'edit_item' => 'Edit Course Note', 'new_item' => 'New Course Note', 'view' => 'View Course Note', 'view_item' => 'View Course Note', 'search_term' => 'Search Notes', 'parent' => 'Parent Course Note', 'not_found' => 'No Notes Found', 'not_found_in_trash' => 'No Notes in Trash' ); register_post_type( 'coursenote', array( 'labels' => $post_labels, 'public' => true, 'has_archive' => true, 'supports' => array( 'title', 'editor', 'thumbnail','page-attributes' ), 'taxonomies' => array( 'post_tag', 'category' ), 'exclude_from_search' => false, 'capability_type' => 'post', 'rewrite' => array( 'slug' => 'Course Notes' ), ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function courses_custom_post_type (){\n\n $labels = array(\n 'name' => 'Courses',\n 'singular_name' => 'Course',\n 'add_new' => 'Add course',\n 'all_items' => 'All courses',\n 'add_new_item' => 'Add course',\n 'edit_item' => 'Edit course',\n 'new_item' => 'New course',\n 'view_item' => 'View course',\n 'search_item' => 'Search course',\n 'non_found' => 'No courses found',\n 'not_found_in_trash' => 'No courses found in trash',\n 'parent_item_colon' => 'Parent course'\n );\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'has_archive' => true,\n 'publicly_queryable' => true,\n 'query_var' => true,\n 'rewrite' => true,\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'supports' => array(\n 'title',\n 'editor',\n 'excerpt',\n 'thumbnail',\n 'revisions',\n 'post-formats',\n 'custom-fields'\n ),\n 'menu_position' => 10,\n 'exclude_from_search' => false\n );\n register_post_type('courses',$args); \n}", "function create_cmecourse() {\n\n\tregister_post_type( 'cmecourse',\n\t// CPT Options\n\t\tarray(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __( 'CME Courses' ),\n\t\t\t\t'singular_name' => __( 'CME Course' ),\n\t\t\t'supports' => array('title,editor,thumbnail,comments,uvacme_id,uvacme_credit,uvacme_date,uvacme_time,uvacme_endtime,uvacme_status,uvacme_webpublish,uvacme_sponsorship,uvacme_progurl,uvacme_url,uvacme_facility,uvacme_city,uvasomcme_state,uvasomcme_thumb,uvasomcme_thumblink'),\n\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'has_archive' => true,\n\t\t\t'rewrite' => array('slug' => 'cmecourse'),\n\t\t)\n\t);\n}", "function db099_lifterlms_add_post_types($post_types) {\r\n\tif (in_array('course', get_post_types())) {\r\n\t\t$post_types[] = 'course';\r\n\t} \r\n\treturn $post_types;\r\n}", "function tt_register_cpt($single, $plural = '') {\n if (empty($plural)) {\n $plural = $single.'s';\n }\n register_post_type(\n strtolower($single),\n array(\n 'label' => $plural,\n 'labels' => array(\n 'add_new_item' => \"Add New $single\",\n 'edit_item' => \"Edit $single\",\n 'new_item' => \"New $single\",\n 'view_item' => \"View $single\",\n 'search_items' => \"Search $plural\",\n 'not_found' => \"No $plural found\",\n 'not_found_in_trash' => \"No $plural found in Trash\",\n ),\n 'public' => true,\n 'has_archive' => true,\n 'supports' => array(\n 'title',\n 'editor',\n 'thumbnail',\n 'custom-fields',\n 'excerpt',\n ),\n 'taxonomies' => array('category'),\n )\n );\n}", "function Simple_Release_Notes() {\n add_action( 'init', array( $this, 'register_custom_post_type' ) );\n\n // Add the custom taxonomies\n add_action( 'init', array( $this, 'register_custom_taxonomy' ), 1 );\n\n // Set up the new permalink for this structure\n add_action( 'init', array( $this, 'register_permalinks' ), 1 );\n\n // Handle our custom permalinks\n add_filter( 'post_type_link', array( $this, 'process_custom_permalink' ), 10, 3 );\n\n // Filter our custom type off the home page\n add_action( 'pre_get_posts', array( $this, 'customize_query_for_custom_type' ) );\n\n // On the posts page, add a Category column\n add_filter( 'manage_posts_columns', array( $this, 'add_taxonomy_column' ), 10, 1 );\n add_action( 'manage_posts_custom_column', array( $this, 'manage_taxonomy_column' ), 10, 2 );\n }", "public function add_custom_post_types() {\n //\n }", "function news_custom_post() {\n $args = array(\n 'public' => true,\n 'label' => 'News',\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\n 'show_ui' => true,\n 'publicly_queryable' => true,\n 'taxonomies' => array('category', 'post_tag'),\n 'rewrite' => array( 'slug' => 'news' )\n\t\n );\n register_post_type('news', $args);\n}", "public function register_qmgt_custom_post() {\r\n\t\trequire_once( QMGT_ROOT . '/qmgt-custom-post-type.php');\r\n\t}", "public function faculty_course_custom_posttypes() {\n\t\t$labels = array(\n\t\t\t'name' => _x( 'Courses', 'Courses post type', 'academic' ),\n\t\t\t'singular_name' => _x( 'Course', 'Course', 'academic' ),\n\t\t\t'menu_name' => _x( 'Courses', 'admin menu', 'academic' ),\n\t\t\t'name_admin_bar' => _x( 'Course', 'add new on admin bar', 'academic' ),\n\t\t\t'add_new' => _x( 'Add New', 'Course', 'academic' ),\n\t\t\t'add_new_item' => __( 'Add New Course', 'academic' ),\n\t\t\t'new_item' => __( 'New Course', 'academic' ),\n\t\t\t'edit_item' => __( 'Edit Course', 'academic' ),\n\t\t\t'view_item' => __( 'View Course', 'academic' ),\n\t\t\t'all_items' => __( 'All Courses', 'academic' ),\n\t\t\t'search_items' => __( 'Search Course', 'academic' ),\n\t\t\t'parent_item_colon' => __( 'Parent Course:', 'academic' ),\n\t\t\t'not_found' => __( 'No Courses found.', 'academic' ),\n\t\t\t'not_found_in_trash' => __( 'No Courses found in Trash.', 'academic' )\n\t\t);\n\n\t\t$args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'description' => __( 'Adds Course post type.', 'academic' ),\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'query_var' => true,\n\t\t\t'rewrite' => array( 'slug' => _x( 'faculty_courses', 'courses', 'academic' ) ),\n\t\t\t'capability_type' => 'post',\n\t\t\t'has_archive' => true,\n\t\t\t'hierarchical' => true,\n\t\t\t'menu_position' => 6,\n\t\t\t'menu_icon' \t => 'dashicons-welcome-learn-more',\n\t\t\t'supports' => array( 'title', 'thumbnail', 'revisions')\n\t\t);\n\n\t\tregister_post_type( 'course', $args );\n\t}", "function qode_lms_add_course_to_post_types_payment( $post_types ) {\n\t\tif ( qode_lms_qode_woocommerce_integration_installed() ) {\n\t\t\t$post_types[] = 'course';\n\t\t}\n\t\t\n\t\treturn $post_types;\n\t}", "public function register_post_type() {\n\t $args = array(\n\t\t\t'public' => true,\n\t\t\t'label' => 'Questions'\n\t\t);\n\t register_post_type( 'questions', $args );\n\t}", "function create_post_type() {\r\n\r\n\tregister_post_type( 'Editorials',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t'name' => __( 'Editorials' ),\r\n\t\t\t\t'singular_name' => __( 'Editorial' )\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'editorials'),\r\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),\r\n \t'show_ui' => true,\r\n\t\t)\r\n\t);\r\n\tregister_post_type( 'Local news',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t\r\n\t\t\t\t'name' => __( 'Local news' ),\r\n\t\t\t\t'singular_name' => __( 'Local new' )\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'local news'),\r\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),\r\n \t'show_ui' => true,\r\n\t\t)\r\n\t);\r\n}", "function create_posttype() {\n \n register_post_type( 'headlines',\n // CPT Options\n array(\n 'labels' => array(\n 'name' => __( 'Headlines' ),\n 'singular_name' => __( 'Headline' )\n\t\t\t),\n\t\t\t'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields'),\n 'public' => true,\n\t\t\t'has_archive' => true,\n 'menu_icon' => 'dashicons-text-page',\n 'rewrite' => array('slug' => 'headlines'),\n 'show_in_rest' => true,\n )\n );\n}", "function add_custom_post_type() \n {\n // add custom type evenementen\n $labels = array(\n 'name' => _x('Quotes', 'post type general name', $this->localization_domain),\n 'singular_name' => _x('Quote', 'post type singular name', $this->localization_domain),\n 'add_new' => _x('Add Quote', 'event', $this->localization_domain),\n 'add_new_item' => __('Add New Quote', $this->localization_domain),\n 'edit_item' => __('Edit Quote', $this->localization_domain),\n 'new_item' => __('New Quote', $this->localization_domain),\n 'view_item' => __('View Quote', $this->localization_domain),\n 'search_items' => __('Search Quotes', $this->localization_domain),\n 'not_found' => __('No Quotes found', $this->localization_domain),\n 'not_found_in_trash' => __('No Quotes found in Trash', $this->localization_domain), \n 'parent_item_colon' => ''\n );\n $type_args = array(\n 'labels' => $labels,\n 'description' => __('bbQuotations offers a simple quotes custom post type. Useful for pull quotes or just random quotes on your site.',\n $this->localization_domain),\n 'public' => false,\n 'publicly_queryable' => false,\n 'show_ui' => true, \n 'query_var' => true,\n 'rewrite' => array('slug' => $this->options['bbquotations-slug']),\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'menu_position' => 5,\n 'supports' => array('title','editor','author')\n ); \n register_post_type( $this->custom_post_type_name, $type_args);\n }", "public function register_post_type(){\n\t\tif(!class_exists('CPT')) return;\n\t\n\t\t$this->post_type = new CPT(\n\t\t\tarray(\n\t\t\t 'post_type_name' => 'slide',\n\t\t\t 'singular' => 'Slide',\n\t\t\t 'plural' => 'Slides',\n\t\t\t 'slug' => 'slide'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'has_archive' \t\t\t=> \ttrue,\n\t\t\t\t'menu_position' \t\t=> \t8,\n\t\t\t\t'menu_icon' \t\t\t=> \t'dashicons-layout',\n\t\t\t\t'supports' \t\t\t\t=> \tarray('title', 'excerpt', 'content','thumbnail', 'post-formats', 'custom-fields')\n\t\t\t)\n\t\t);\n\t\t\n\t\t$labels = array('menu_name'=>'Types');\n\t\t$this->post_type->register_taxonomy('type',array(\n\t\t\t'hierarchical' => true,\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'show_tagcloud' => true,\n\t\t),$labels);\n\t}", "public function cws_register_cpt() {\n\n\t\tforeach ( $this->cpts as $key => $value ) {\n\n\t\t\tregister_post_type( $key, $value );\n\n\t\t}\n\n\t}", "function create_news_custom_post() {\n register_post_type( 'news',\n array(\n 'labels' => array(\n 'name' => __( 'News' ),\n 'singular_name' => __( 'News Item' ),\n ),\n 'public' => true,\n 'has_archive' => true,\n 'supports' => array(\n 'title',\n 'editor',\n 'thumbnail'\n )\n ));\n}", "protected function addPostType()\n {\n WordPress::registerType('lbwp-nl', 'Newsletter', 'Newsletter', array(\n 'show_in_menu' => 'newsletter',\n 'publicly_queryable' => false,\n 'exclude_from_search' => true,\n 'supports' => array('title')\n ), 'n');\n }", "public function registerCustomPostTypes() {\n\n\n }", "function nt_course_note_entry_field() {\nglobal $post;\n\n//ID's\n$current_user = get_current_user_id();\n$current_lesson_id = $post->ID;\n$current_post_type = get_post_type();\n\n//Checks if note exists and changes title and body variables accordingly\n$args = array(\n\t'post_type' => 'coursenote',\n\t'post_status' => array('draft'),\n\t'meta_query' => array(\n\t\t//'relation' => 'AND',\n\t\tarray(\n\t\t\t'key' => 'nt-note-current-lessson-id',\n\t\t\t'value' => $current_lesson_id,\n\t\t\t'compare' => '=',\n\t\t)\n\t),\n\t 'author' => $current_user\n);\n\n$the_query = new WP_Query( $args );\n\nif ($the_query->have_posts()){\n while ( $the_query->have_posts() ) : $the_query->the_post();\n\n $title = get_the_title();\n $body = get_the_content();\n\n endwhile;\n wp_reset_postdata();\n} else {\n\n\t$title = 'Note Title';\n\t$body = 'Enter Lesson Notes here';\n}\n\n\n\n?>\n\n <div id=\"nt_note_cont\" class=\"note-container\">\n <div class=\"note-header\">\n <div class=\"note-header-title\">\n <?php _e('Notes'); ?>\n\t\t\t\t<div id=\"apf-response\"></div>\n </div>\n <div class=\"note-header-actions\">\n\n </div>\n </div>\n <div class=\"note-body\">\n <form id=\"nt-course-note\" action=\"\" method=\"post\">\n\t\t\t\t\t<?php wp_nonce_field( basename(__FILE__), 'nt-course-note-nonce') ?>\n\t\t\t\t\t<input type=\"text\" name=\"nt-note-title\" id=\"nt-note-title\" value=\"<?php echo $title; ?>\" placeholder=\"\" >\n\t\t\t\t\t<input type=\"hidden\" name=\"nt-note-user-id\" id=\"nt-note-user-id\" value=\"<?php echo $current_user; ?>\">\n\t\t\t\t\t<input type=\"hidden\" name=\"nt-note-current-lesson-id\" id=\"nt-note-current-lessson-id\" value=\"<?php echo $current_lesson_id; ?>\">\n\t\t\t\t\t<input type=\"hidden\" name=\"nt-note-current-post-type\" id=\"nt-note-current-post-type\" value=\"<?php echo $current_post_type; ?>\">\n\t\t\t\t\t<textarea rows=\"8\" name=\"nt-note-body\" id=\"nt-note-body\" class=\"\" placeholder=\"\"/><?php echo $body; ?></textarea>\n\t\t\t\t\t<input type=\"text\" id=\"xyz\" name=\"<?php echo apply_filters( 'honeypot_name', 'date-submitted') ?>\" value=\"\" style=\"display:none\">\n <input type=\"submit\" id=\"nt-note-submit\" value=\"<?php _e('Save Notes'); ?>\"/>\n </form>\n\n </div>\n\n </div>\n <?php\n\n}", "function gndt_register_cpt_publishing() {\n register_post_type('gndt_research',\n array(\n 'labels' => array(\n 'name' => __('Research', 'textdomain'),\n 'singular_name' => __('Research', 'textdomain'),\n ),\n 'public' => true,\n 'has_archive' => true,\n\t\t \t\t'show_in_rest' => true,\n 'supports' => ['editor'], /* allow gutenberg editor for this post type */\n 'capability_type' => 'gndt_researchposttype',\n\t\t\t \t'capabilities' => array(\n\t\t\t\t\t 'publish_posts' => 'gndt_publish_researchposttypes',\n\t\t\t\t\t 'edit_posts' => 'gndt_edit_researchposttypes',\n\t\t\t\t\t 'edit_others_posts' => 'gndt_edit_others_researchposttypes',\n\t\t\t\t\t 'read_private_posts' => 'gndt_read_private_researchposttypes',\n\t\t\t\t\t 'edit_post' => 'gndt_edit_researchposttype',\n\t\t\t\t\t 'delete_post' => 'gndt_delete_researchposttype',\n\t\t\t\t\t 'read_post' => 'gndt_read_researchposttype',\n\t\t\t\t ),\n )\n );\n\n\tadd_post_type_support( 'gndt_research', 'author' ); //add author support to custom post type \n}", "function add_post_types_and_taxonomies()\n{\n\n\t/* Common Labels */\n\t$labels = array(\n\t\t'add_new' => __( 'Add New', 'gladtidings' ),\n\t\t'not_found' => __( 'Not found', 'gladtidings' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'gladtidings' ),\n\t);\n\n\t/* Common Arguments */\n\t$args = array(\n\t\t'supports' => array( 'title' ),\n\t\t'public' => false,\n\t\t'show_ui' => true, //defaults to 'public'\n\t\t'show_in_menu' => true, //defaults to 'show_ui'\n\t\t'show_in_admin_bar' => true, // defaults to 'show_in_menu'\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'publicly_queryable' => true,\n\t\t'rewrite' => false,\n\t);\n\n\t/* Course */\n\t$course_labels = $labels + array(\n\t\t'name' => _x( 'Courses', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Course', 'Post Type Singular Name', 'gladtidings' ),\n\t\t'all_items' => __( 'All Courses', 'gladtidings' ),\n\t\t'add_new_item' => __( 'Add New Course', 'gladtidings' ),\n\t\t'new_item' => __( 'New Course', 'gladtidings' ),\n\t\t'edit_item' => __( 'Edit Course', 'gladtidings' ),\n\t\t'update_item' => __( 'Update Course', 'gladtidings' ),\n\t\t'view_item' => __( 'View Course', 'gladtidings' ),\n\t\t'search_items' => __( 'Search Courses', 'gladtidings' ),\n\t\t'items_list' => __( 'Course list', 'gladtidings' ),\n\t\t'items_list_navigation' => __( 'Course list navigation', 'gladtidings' ),\n\t\t'filter_items_list' => __( 'Filter course list', 'gladtidings' ),\n\t);\n\t$course_args = $args + array(\n\t\t'label' => __( 'Course', 'gladtidings' ),\n\t\t'description' => __( 'Courses consisting of separate Units with Videos and Quizzes', 'gladtidings' ),\n\t\t'labels' => $course_labels,\n\t\t'supports' => array( 'title', 'editor', 'excerpt', 'page-attributes' ),\n\t\t// 'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-welcome-learn-more',\n\t);\n\tregister_post_type( 'course', $course_args );\n\n\t/* Lesson */\n\t$lesson_labels = $labels + array(\n\t\t'name' => _x( 'Lessons', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Lesson', 'Post Type Singular Name', 'gladtidings' ),\n\t\t'all_items' => __( 'All Lessons', 'gladtidings' ),\n\t\t'add_new_item' => __( 'Add Lesson', 'gladtidings' ),\n\t\t'new_item' => __( 'New Lesson', 'gladtidings' ),\n\t\t'edit_item' => __( 'Edit Lesson', 'gladtidings' ),\n\t\t'update_item' => __( 'Update Lesson', 'gladtidings' ),\n\t\t'view_item' => __( 'View Lesson', 'gladtidings' ),\n\t\t'search_items' => __( 'Search Lesson', 'gladtidings' ),\n\t\t'items_list' => __( 'Lessons list', 'gladtidings' ),\n\t\t'items_list_navigation' => __( 'Lessons list navigation', 'gladtidings' ),\n\t\t'filter_items_list' => __( 'Filter Lessons list', 'gladtidings' ),\n\t);\n\t$lesson_args = $args + array(\n\t\t'label' => __( 'Lesson', 'gladtidings' ),\n\t\t'description' => __( 'Individual Videos Lessons', 'gladtidings' ),\n\t\t'labels' => $lesson_labels,\n\t\t// 'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-video-alt2',\n\t);\n\tregister_post_type( 'lesson', $lesson_args );\n\n\t/* Quizzes */\n\t$quizz_labels = $labels + array(\n\t\t'name' => _x( 'Quizzes', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Quizz', 'Post Type Singular Name', 'gladtidings' ),\n\t\t'all_items' => __( 'All Quizzes', 'gladtidings' ),\n\t\t'add_new_item' => __( 'Add Quizz', 'gladtidings' ),\n\t\t'new_item' => __( 'New Quizz', 'gladtidings' ),\n\t\t'edit_item' => __( 'Edit Quizz', 'gladtidings' ),\n\t\t'update_item' => __( 'Update Quizz', 'gladtidings' ),\n\t\t'view_item' => __( 'View Quizz', 'gladtidings' ),\n\t\t'search_items' => __( 'Search Quizz', 'gladtidings' ),\n\t\t'items_list' => __( 'Quizzes list', 'gladtidings' ),\n\t\t'items_list_navigation' => __( 'Quizzes list navigation', 'gladtidings' ),\n\t\t'filter_items_list' => __( 'Filter Quizzes list', 'gladtidings' ),\n\t);\n\t$quizz_args = $args + array(\n\t\t'label' => __( 'Quizz', 'gladtidings' ),\n\t\t'description' => __( 'Individual Quizzes', 'gladtidings' ),\n\t\t'labels' => $quizz_labels,\n\t\t// 'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-welcome-write-blog',\n\t);\n\tregister_post_type( 'quizz', $quizz_args );\n\n\t/* Exams */\n\t$exam_labels = $labels + array(\n\t\t'name' => _x( 'Exams', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Exam', 'Post Type Singular Name', 'gladtidings' ),\n\t\t'all_items' => __( 'All Exams', 'gladtidings' ),\n\t\t'add_new_item' => __( 'Add Exam', 'gladtidings' ),\n\t\t'new_item' => __( 'New Exam', 'gladtidings' ),\n\t\t'edit_item' => __( 'Edit Exam', 'gladtidings' ),\n\t\t'update_item' => __( 'Update Exam', 'gladtidings' ),\n\t\t'view_item' => __( 'View Exam', 'gladtidings' ),\n\t\t'search_items' => __( 'Search Exam', 'gladtidings' ),\n\t\t'items_list' => __( 'Exams list', 'gladtidings' ),\n\t\t'items_list_navigation' => __( 'Exams list navigation', 'gladtidings' ),\n\t\t'filter_items_list' => __( 'Filter Exams list', 'gladtidings' ),\n\t);\n\t$exam_args = $args + array(\n\t\t'label' => __( 'Exam', 'gladtidings' ),\n\t\t'description' => __( 'Individual Exams', 'gladtidings' ),\n\t\t'labels' => $exam_labels,\n\t\t// 'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-welcome-write-blog',\n\t);\n\tregister_post_type( 'exam', $exam_args );\n\n\n\n\t/**\n\t * Register Virtual Custom Post Types\n\t * These are just for internal reference, they have no admin ui and are created in gt_relationships\n\t */\n\n\t/* Common Arguments */\n\t$args = array(\n\t\t'supports' => array( 'title' ),\n\t\t'public' => false,\n\t\t'show_ui' => false,\n\t\t'can_export' => false,\n\t\t'has_archive' => false,\n\t\t'publicly_queryable' => true,\n\t\t'rewrite' => false,\n\t);\n\n\t/* Units */\n\t$unit_labels = array(\n\t\t'name' => _x( 'Units', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Unit', 'Post Type Singular Name', 'gladtidings' ),\n\t);\n\t$unit_args = $args + array(\n\t\t'label' => __( 'Unit', 'gladtidings' ),\n\t\t'description' => __( 'Units consisting of Videos and Quizzes', 'gladtidings' ),\n\t\t'labels' => $unit_labels,\n\t);\n\tregister_post_type( 'unit', $unit_args );\n\n\n\t/* Headline */\n\t$headline_labels = array(\n\t\t'name' => _x( 'Headlines', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Headline', 'Post Type Singular Name', 'gladtidings' ),\n\t);\n\t$headline_args = $args + array(\n\t\t'label' => __( 'Headline', 'gladtidings' ),\n\t\t'description' => __( 'Individual Headlines', 'gladtidings' ),\n\t\t'labels' => $headline_labels,\n\t);\n\tregister_post_type( 'headline', $headline_args );\n\n\n\t/**\n\t * Add custom post status for unit\n\t * - 'success' - the unit is sucessfully finished (user specific)\n\t * - 'active' - the unit was started, but is not finished (user specific)\n\t * - 'publish' - the unit is open, but not yet started (wp builtin)\n\t * - 'locked' - the unit is visible, but not accessible\n\t * - 'coming' - the unit is anounced for a future date, but visible (other than builtin 'future')\n\t * - 'draft' - the unit is not visible (wp builtin)\n\t */\n\tregister_post_status( 'locked', array( 'public' => true, 'label' => __( 'Locked', 'gladtidings' ) ) );\n\tregister_post_status( 'coming', array( 'public' => true, 'label' => __( 'Coming soon', 'gladtidings' ) ) );\n\n\n\t/**\n\t * Create a variable in $wpdb for the wp_gt_relationships table\n\t */\n\tglobal $wpdb;\n\t$wpdb->gt_relationships = $wpdb->prefix . \"gt_relationships\";\n\n\n}", "function tower_custom_post_types() {\n foreach (TOWER_CUSTOM_POSTS as $key => $custom_type) {\n register_post_type($key, $custom_type['config']);\n }\n}", "function add_custom_post_type() {\n\tregister_post_type( 'learning_resource',\n array(\n 'labels' => array(\n 'name' => __( 'Learning Resources' ),\n 'singular_name' => __( 'Learning Resource' )\n ),\n 'public' => true,\n 'has_archive' => true,\n )\n );\n}", "function cfwprapi_register_cpt_todos() {\n\n register_post_type( 'todo', array(\n 'labels' => array(\n 'name' => _x( 'Todos', 'Post Type General Name', 'cfwprapi' ),\n 'singular_name' => _x( 'Todo', 'Post Type Singular Name', 'cfwprapi' ),\n 'menu_name' => __( 'Todos', 'cfwprapi' ),\n 'name_admin_bar' => __( 'Todo', 'cfwprapi' ),\n 'parent_item_colon' => __( 'Parent Todos:', 'cfwprapi' ),\n 'all_items' => __( 'All Todos', 'cfwprapi' ),\n 'add_new_item' => __( 'Add New Todo', 'cfwprapi' ),\n 'add_new' => __( 'Add New', 'cfwprapi' ),\n 'new_item' => __( 'New Todo', 'cfwprapi' ),\n 'edit_item' => __( 'Edit Todo', 'cfwprapi' ),\n 'update_item' => __( 'Update Todo', 'cfwprapi' ),\n 'view_item' => __( 'View Todo', 'cfwprapi' ),\n 'search_items' => __( 'Search Todos', 'cfwprapi' ),\n 'not_found' => __( 'Not found', 'cfwprapi' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'cfwprapi' ),\n ),\n 'supports' => array(\n 'title',\n 'editor',\n ),\n 'hierarchical' => true,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-media-text',\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'has_archive' => 'todo',\n 'rewrite' => array(\n 'with_front' => false,\n 'slug' => 'Todos',\n ),\n 'show_in_rest' => true,\n ) );\n}", "function thirdtheme_custom_post_type()\n {\n $args = array(\n 'labels' => array('name' =>__(' my custom post'),\n 'singular name' =>__('my custom post')),\n 'public' => true,\n 'show_in_menu' => true,\n 'has_archive' => true,\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail'));\n register_post_type('custompost',$args);\n \n }", "function register_post_types(){\n }", "function cadastrando_post_type_clientes() {\n\n $nomeSingular = 'Cliente';\n $nomePlural = 'Clientes';\n $descricao = 'Clientes da minha empresa';\n\n $labels = array(\n 'name' => $nomePlural,\n 'name_singular' => $nomeSingular,\n 'add_new_item' => 'Adicionar novo ' . $nomeSingular,\n 'edit_item' => 'Editar ' . $nomeSingular\n );\n\n $supports = array(\n 'title',\n 'editor',\n 'thumbnail'\n );\n\n $args = array(\n 'labels' => $labels,\n 'description' => $descricao,\n 'public' => true,\n 'menu_icon' => 'dashicons-id-alt',\n 'supports' => $supports\n );\n\n register_post_type( 'cliente', $args);\n}", "function register_post_types(){\n\t\t\trequire('lib/custom-types.php');\n\t\t}", "function register_post_types(){\n }", "function add_post_meta_box( ) {\n\t\t\tadd_meta_box('Course-Information', __( 'Course Information', $this->plugin_domain), array($this, 'setup_meta_english'), 'public-courses', 'normal', 'high');\n\t\t\tadd_meta_box('Arabic-Translations', __( 'Arabic Translations', $this->plugin_domain), array($this, 'setup_meta_translation'), 'public-courses', 'normal', 'high');\n\t\t\tadd_meta_box('Course-Dates', __( 'Course Dates', $this->plugin_domain), array($this, 'setup_meta_dates'), 'public-courses', 'normal', 'high');\n\t\t}", "function yee_post_type_testimonial_init(){\n\t$labels =array(\n\t\t'name'=>'Testimonials',\n\t\t'sigular_name'=>'Testimonial',\n\t\t'add_new'=>__('Add New Testimonial','Storefront-Child'),\n\t\t'add_new_item'=>__('Add New Testimonial','Storefront-Child'),\n\t\t'edit_item'=>__('Edit Testimonial','Storefront-Child'),\n\t\t'new_item'=>__('New Testimonial','Storefront-Child'),\n\t\t'view_item'=>__('View Testimonial','Storefront-Child'),\n\t\t'view_items'=>__('View Testimonials','Storefront-Child'),\n\t\t'all_items'=>__('All Testimonials','Storefront-Child'),\n\t\t'search_items'=>__('Search Testimonials','Storefront-Child')\n\t);\n\t$args =array(\n\t\t'labels'=>$labels,\n\t\t'public'=>true,\n\t\t'menu_position'=>5,\n\t\t'menu_icon'=>'dashicons-visibility',\n\t\t'hierarchical'=>false,\n\t\t'has_archive'=>true,\n\t\t'supports'=>array('title','editor','thumbnail','excerpt'),\n\t\t'rewrite'=>array('slug'=>'testimonial')\n\t\t\n\t);\n\tregister_post_type('yee_testimonial',$args);\n}", "function register_post_types(){\n\t\trequire('lib/custom-types.php');\n\t}", "private function registerCPT()\n {\n if (!isset($this->config['cpt'])) {\n return;\n }\n\n foreach ($this->config['cpt'] as $cpt) {\n $staff = new PostType($cpt['name']);\n }\n }", "public function create_post_types() {\n }", "function testimonials_register_post_type() {\n\n $labels = [\n 'name' => __('Testimonials'),\n 'singular_name' => __('Testimonial'),\n 'add_new' => __('Add new', 'Testimonials'),\n 'add_new_item' => __('Add new Testimonial'),\n 'edit_item' => __('Edit Testimonial'),\n 'new_item' => __('New Testimonial'),\n 'view_item' => __('View Testimonial'),\n 'search_item' => __('Search Testimonials'),\n 'not_found' => __('No Testimonial found'),\n 'not_found_in_trash' => __('No Testimonial found in trash'),\n 'parent_item_colon' => ''\n ];\n\n register_post_type(TESTIMONIAL_TYPE, [\n 'labels' => $labels,\n 'public' => true,\n 'exclude_from_search' => true,\n 'has_archive' => true,\n 'hierarchical' => false,\n 'supports' => ['title', 'editor', 'custom-fields']\n ]);\n\n register_taxonomy_for_object_type(CRAFT_TAX_NAME, TESTIMONIAL_TYPE);\n}", "function testimonials() {\n register_post_type( 'testimonials',\n array(\n 'labels' => array(\n 'name' => 'Testimonials',\n 'singular_name' => 'Testimonial',\n 'add_new' => 'Add New',\n 'add_new_item' => 'Add New Testimonial',\n 'edit' => 'Edit',\n 'edit_item' => 'Edit Testimonial',\n 'new_item' => 'New Testimonial',\n 'view' => 'View',\n 'view_item' => 'View Testimonial',\n 'search_items' => 'Search Testimonials',\n 'not_found' => 'No Testimonials found',\n 'not_found_in_trash' => 'No Testimonials found in Trash',\n ),\n 'exclude_from_search' => true,\n 'public' => true,\n 'menu_position' => 30,\n 'supports' => array( 'title', 'editor'),\n 'has_archive' => false\n )\n );\n}", "function cptui_register_my_cpts_how_it_works() {\n\n\t$labels = array(\n\t\t\"name\" => __( \"How It Works\", \"esoftkulo\" ),\n\t\t\"singular_name\" => __( \"How it Work\", \"esoftkulo\" ),\n\t);\n\n\t$args = array(\n\t\t\"label\" => __( \"How It Works\", \"esoftkulo\" ),\n\t\t\"labels\" => $labels,\n\t\t\"description\" => \"\",\n\t\t\"public\" => true,\n\t\t\"publicly_queryable\" => true,\n\t\t\"show_ui\" => true,\n\t\t\"delete_with_user\" => false,\n\t\t\"show_in_rest\" => true,\n\t\t\"rest_base\" => \"\",\n\t\t\"rest_controller_class\" => \"WP_REST_Posts_Controller\",\n\t\t\"has_archive\" => false,\n\t\t\"show_in_menu\" => true,\n\t\t\"show_in_nav_menus\" => true,\n\t\t\"exclude_from_search\" => false,\n\t\t\"capability_type\" => \"post\",\n\t\t\"map_meta_cap\" => true,\n\t\t\"hierarchical\" => false,\n\t\t\"rewrite\" => array( \"slug\" => \"how_it_works\", \"with_front\" => true ),\n\t\t\"query_var\" => true,\n\t\t\"supports\" => array( \"title\", \"editor\", \"thumbnail\" ),\n\t);\n\n\tregister_post_type( \"how_it_works\", $args );\n}", "function cm_add_meta_box_course() {\n\n\t$screens = array( 'course' );\n\n\n$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ;\n // check for a template type\n \n \n\tforeach ( $screens as $screen ) {\n\n\t\n add_meta_box(\n\t\t\t'myplugin_sectionid',\n\t\t\t__( 'Course Information', 'lps_wp' ),\n\t\t\t'cm_meta_box_course_callback',\n\t\t\t$screen\n\t\t);\n \n\t\t\n\t}\n}", "public function register() {\r\n add_action('post_updated', array($this, 'save_meta'), null, 2 );\r\n\r\n $original_config = $this->get_config();\r\n // push it through a filter so a theme can change the terminology\r\n $filtered_config = apply_filters('ah-wp-dl-res-config',$original_config);\r\n register_post_type(self::POST_TYPE, $filtered_config);\r\n\r\n register_taxonomy(self::POST_TYPE . '_cat',\r\n array(self::POST_TYPE),\r\n array('hierarchical' => true,\r\n 'labels' => array(\r\n 'name' => __( 'Categories' ),\r\n 'singular_name' => __( 'Category' ),\r\n 'search_items' => __( 'Search Categories' ),\r\n 'all_items' => __( 'All Categories' ),\r\n 'parent_item' => __( 'Parent Category' ),\r\n 'parent_item_colon' => __( 'Parent Category:' ),\r\n 'edit_item' => __( 'Edit Category' ),\r\n 'update_item' => __( 'Update Category' ),\r\n 'add_new_item' => __( 'Add New Category' ),\r\n 'new_item_name' => __( 'New Category Name')\r\n ),\r\n 'show_ui' => true,\r\n 'query_var' => true,\r\n 'rewrite' => array( 'slug' => 'documents/categories' ),\r\n )\r\n );\r\n }", "public function register_custom_post() {\n foreach ( $this->posts as $key => $value ) {\n register_post_type( $key, $value );\n }\n }", "public function register_post_types() {\n\n\t}", "function register_casetudy()\n\t\n\t{\n\n\t\n\t\t\t$args = array(\n\t\t\t\t'public' => true,\n\t\t\t\t'label' => __( 'Case Studies', 'textdomain' ),\n\t\t\t\t'supports' => array( 'title', 'editor' ),\n\t\t\t 'taxonomies' => array( 'category', 'post_tag' ),\n\t\t\t\t'show_in_graphql' => true,\n\t\t\t\t'graphql_name' => 'CaseStudy',\n\t\t\t\t'graphql_single_name' => 'CaseStudy',\n\t\t\t\t'graphql_plural_name' => 'CaseStudies',\n\t\t\t\t'graphql_singular_type' => 'CaseStudy',\n\t\t\t\t'graphql_plural_type' => 'CaseStudies','exclude_from_search' => false,\n\t\t\t\t\t\t'publicly_queryable' => true,\n\t\t\t\t\t\t'capability_type' => 'page',\n\t\t\t\t\t\t 'show_in_rest' => true\n\t\t\t);\n\t\t\n\t\t\tregister_post_type( 'casestudy', $args );\n\t\t\n\t\t\n\t\t\n\n\t}", "static function add_notes(): void {\r\n\t\tself::add_acf_inner_field(self::divisions, self::notes, [\r\n\t\t\t'label' => 'Notes',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => 'Any notes pertinent to the division.',\r\n\t\t\t'required' => 0,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '40',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t]\r\n\t\t]);\r\n\t}", "function clicks_register_my_cpt_testimonial() {\n\n\t// Post Type: Testimonials.\n\n\t$labels = array(\n\t\t\"name\" => __( \"Testimonials\", \"custom-post-type\" ),\n\t\t\"singular_name\" => __( \"Testimonial\", \"custom-post-type\" ),\n\t);\n\n\t$args = array(\n\t\t\"label\" => __( \"Testimonials\", \"custom-post-type-ui\" ),\n\t\t\"labels\" => $labels,\n\t\t\"description\" => \"\",\n\t\t\"public\" => true,\n\t\t\"publicly_queryable\" => true,\n\t\t\"show_ui\" => true,\n\t\t\"delete_with_user\" => false,\n\t\t\"show_in_rest\" => false,\n\t\t\"rest_base\" => \"\",\n\t\t\"rest_controller_class\" => \"WP_REST_Posts_Controller\",\n\t\t\"has_archive\" => false,\n\t\t\"show_in_menu\" => true,\n\t\t\"show_in_nav_menus\" => true,\n\t\t\"exclude_from_search\" => false,\n\t\t\"capability_type\" => \"post\",\n\t\t\"map_meta_cap\" => true,\n\t\t\"hierarchical\" => false,\n\t\t\"rewrite\" => array( \"slug\" => \"testimonial\", \"with_front\" => true ),\n\t\t\"query_var\" => true,\n\t\t\"menu_position\" => 21,\n\t\t\"supports\" => array( \"title\", \"revisions\", \"author\", \"page-attributes\" ),\n\t\t\"taxonomies\" => array( \"category\" ),\n\t);\n\n\tregister_post_type( \"testimonial\", $args );\n}", "public static function register_post_type()\n {\n\n \t register_post_type( 'books',\n\t\t array(\n\t\t 'labels' => array(\n\t\t 'name' => __( 'Books' ),\n\t\t 'singular_name' => __( 'Books' )\n\t\t ),\n\t\t 'public' => true,\n\t\t 'has_archive' => false,\n\t\t )\n\t\t );\n\n }", "public static function createPostType() {\n $plural = 'Travel Cards';\n $singular = 'Travel Card';\n $p_lower = strtolower($plural);\n $s_lower = strtolower($singular);\n\n $labels = [\n 'name' => $plural,\n 'singular_name' => $singular,\n 'add_new_item' => \"New $singular\",\n 'edit_item' => \"Edit $singular\",\n 'view_item' => \"View $singular\",\n 'view_items' => \"View $plural\",\n 'search_items' => \"Search $plural\",\n 'not_found' => \"No $p_lower found\",\n 'not_found_in_trash' => \"No $p_lower found in trash\",\n 'parent_item_colon' => \"Parent $singular\",\n 'all_items' => \"All $plural\",\n 'archives' => \"$singular Archives\",\n 'attributes' => \"$singular Attributes\",\n 'insert_into_item' => \"Insert into $s_lower\",\n 'uploaded_to_this_item' => \"Uploaded to this $s_lower\",\n ];\n\n $supports = ['title', 'editor', 'thumbnail', 'excerpt'];\n\n register_post_type( 'travelcard',\n array(\n 'rewrite' => ['slug' => 'travelcard'],\n 'taxonomies' => array('card_category', 'card_tag'),\n 'register_meta_box_cb' => [self::class, 'addMetaBox'],\n 'labels' => $labels,\n 'public' => true,\n 'has_archive' => false,\n 'menu_icon' => 'dashicons-id',\n 'supports' => $supports,\n 'capability_type' => array('travelcard', 'travelcards'),\n 'map_meta_cap' => false,\n 'exclude_from_search' => true,\n )\n );\n }", "public function register_location_content_type(){\n\t\t //Labels for post type\n\t\t $labels = array(\n 'name' => 'Add Portfolio',\n 'singular_name' => 'Portfolio',\n 'menu_name' => 'Add Portfolio',\n 'name_admin_bar' => 'Add Portfolio',\n 'add_new' => 'Add New', \n 'add_new_item' => 'Add New Portfolio Item',\n 'new_item' => 'New Portfolio Item', \n 'edit_item' => 'Edit Portfolio Item',\n 'view_item' => 'View Portfolio Item',\n 'all_items' => 'All Portfolio Items',\n 'search_items' => 'Search Portfolio Items',\n 'parent_item_colon' => 'Parent Portfolio Item: ', \n 'not_found' => 'No Portfolio Items found.', \n 'not_found_in_trash' => 'No Portfolio Items found in Trash.',\n );\n //arguments for post type\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable'=> true,\n 'show_ui' => true,\n 'show_in_nav' => true,\n 'query_var' => true,\n 'hierarchical' => false,\n 'supports' => array('title','thumbnail','editor'),\n 'has_archive' => true,\n 'menu_position' => 20,\n 'show_in_admin_bar' => true,\n 'menu_icon' => 'dashicons-location-alt',\n 'rewrite'\t\t\t=> array('slug' => 'locations', 'with_front' => 'true')\n );\n //register post type\n register_post_type('wp_locations', $args);\n\t}", "function wp_arch_cpts() {\n /**\n * Registers a new post type\n * @uses $wp_post_types Inserts new post type object into the list\n *\n * @param string Post type key, must not exceed 20 characters\n * @param array|string See optional args description above.\n * @return object|WP_Error the registered post type object, or an error object\n */\n register_post_type( 'wp_arch_testimonial',\n array(\n 'labels' => array(\n 'name' => _x('Testimonials', 'post type general name'),\n 'singular_name' => _x('Testimonial', 'post type singular name'),\n 'add_new' => _x('Add New', 'testimonial'),\n 'add_new_item' => __('Add New Testimonial'),\n 'edit_item' => __('Edit Testimonial'),\n 'new_item' => __('New Testimonial'),\n 'view_item' => __('View Testimonial'),\n 'search_items' => __('Search Testimonial'),\n 'not_found' => __('No testimonials found'),\n 'not_found_in_trash' => __('No testimonials found in Trash'),\n 'parent_item_colon' => ''\n ),\n 'public' => true,\n 'description' => 'Our Testimonials',\n 'exclude_from_search' => true,\n 'has_archive' => true,\n 'rewrite' => array('slug' => 'testimonials'),\n 'hierarchical' => true,\n 'supports' => array(\n 'title',\n 'editor'\n ),\n )\n );\n}", "function wpcp_custom_post_type()\n{\n register_post_type('wpcp_server',\n array(\n 'labels' => array(\n 'name' => __('Servers', 'textdomain'),\n 'singular_name' => __('Server', 'textdomain'),\n ),\n 'public' => true,\n 'has_archive' => false,\n 'delete_with_user' => false,\n \"supports\" => array(\"customer\", \"author\"),\n 'menu_icon' => 'dashicons-cloud'\n )\n );\n}", "function mfn_news_post_type()\n{\n mfn_register_types();\n}", "public static function register_post_types() {}", "public function flo_reg_custom_post_type(){\n\t\t// call the methods that are registering the post types\n\t\t$this->flo_reg_forms_post_type();\n\t\t$this->flo_reg_entrie_post_type();\n\n\t\t$this->flo_register_form_entries_taxonomy();\n\t}", "function my_custom_post_registry() {\n\t$registry_labels = array(\n\t\t'name' => 'Registrations',\n\t\t'singular_name' => 'Cozmeena Shawl Registration',\n\t\t'add_new' => 'Add New',\n\t\t'all_items' => 'All Registrations',\n\t\t'add_new_item' => 'Add New Registration',\n\t\t'edit_item' => 'Edit Registration',\n\t\t'new_item' => 'New Registration',\n\t\t'view_item' => 'View Registration',\n\t\t'search_items' => 'Search Registrations',\n\t\t'not_found' => 'No Registrations found',\n\t\t'not_found_in_trash' => 'No Registrations found in trash',\n\t\t'parent_item_colon' => '',\n\t\t'menu_name' => 'Cozmeena Shawl Registrations'\n\t);\n\t$registry_args = array(\n\t\t'labels' => $registry_labels,\n\t\t'description' => \"The International Cozmeena Registry is the official record of Cozmeena Shawls\",\n\t\t'public' => true,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => '',\n\t\t'supports' => array('title','author', 'editor','thumbnail'),\n\t\t'capability_type' => 'coz_registry', // need to assign capabilities via plugin\n\t\t'map_meta_cap' => true,\n\t\t'has_archive' => true,\n\t); \n\tregister_post_type('coz_registry',$registry_args);\n}", "public function testimonial_cpt ()\n\t{\n\t\t$labels = array(\n\t\t\t'name' => 'Testimonials',\n\t\t\t'singular_name' => 'Testimonial'\n\t\t);\n\t\t$args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'public' => true,\n\t\t\t'has_archive' => false,\n\t\t\t'menu_icon' => 'dashicons-testimonial',\n\t\t\t'exclude_from_search' => true,\n\t\t\t'publicly_queryable' => false,\n\t\t\t'supports' => array( 'title', 'editor' ),\n 'show_in_rest' => true\n\t\t);\n\t\tregister_post_type ( 'testimonial', $args );\n\t}", "function custom_post_type_careers() {\n\t$labels = array(\n\t\t'name' => _x( 'Careers', 'Post Type General Name', 'leasepilot' ),\n\t\t'singular_name' => _x( 'Job', 'Post Type Singular Name', 'leasepilot' ),\n\t\t'menu_name' => __( 'Jobs', 'leasepilot' ),\n\t\t'name_admin_bar' => __( 'Post Type', 'leasepilot' ),\n\t\t'archives' => __( 'Jobs Archives', 'leasepilot' ),\n\t\t'attributes' => __( 'Job Attributes', 'leasepilot' ),\n\t\t'parent_item_colon' => __( 'Parent Job:', 'leasepilot' ),\n\t\t'all_items' => __( 'All Jobs', 'leasepilot' ),\n\t\t'add_new_item' => __( 'Add New Job', 'leasepilot' ),\n\t\t'add_new' => __( 'Add New', 'leasepilot' ),\n\t\t'new_item' => __( 'New Job', 'leasepilot' ),\n\t\t'edit_item' => __( 'Edit Job', 'leasepilot' ),\n\t\t'update_item' => __( 'Update Job', 'leasepilot' ),\n\t\t'view_item' => __( 'View Job', 'leasepilot' ),\n\t\t'view_items' => __( 'View Jobs', 'leasepilot' ),\n\t\t'search_items' => __( 'Search Jobs', 'leasepilot' ),\n\t\t'not_found' => __( 'Not found', 'leasepilot' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'leasepilot' ),\n\t\t'featured_image' => __( 'Featured Image', 'leasepilot' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'leasepilot' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'leasepilot' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'leasepilot' ),\n\t\t'insert_into_item' => __( 'Insert into job', 'leasepilot' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this job', 'leasepilot' ),\n\t\t'items_list' => __( 'Jobs list', 'leasepilot' ),\n\t\t'items_list_navigation' => __( 'Jobs list navigation', 'leasepilot' ),\n\t\t'filter_items_list' => __( 'Filter Jobs list', 'leasepilot' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'Job', 'leasepilot' ),\n\t\t'description' => __( 'Job Description', 'leasepilot' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'thumbnail', 'editor', 'excerpt' ),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-businessman',\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'page',\n\t\t'rewrite' => array( 'with_front' => false ), // This needs to be false so that custom Permalinks settings won't effect this permalink.\n\t);\n\tregister_post_type( 'careers', $args );\n}", "function create_CPTs ()\n\t{\n\n\n $singular = 'Quote';\n $plural = 'Quotes';\n\n //Topics\n $labels = array(\n 'name' => $plural,\n 'singular_name' => $singular,\n 'menu_name' => $plural,\n 'name_admin_bar' => $plural,\n 'add_new' => 'Add New '.$singular,\n 'add_new_item' => 'Add New '.$singular,\n 'new_item' => 'New '.$singular,\n 'edit_item' => 'Edit '.$singular,\n 'view_item' => 'View '.$plural,\n 'all_items' => 'All '.$plural,\n 'search_items' => 'Search '.$plural,\n 'parent_item_colon' => '',\n 'not_found' => 'No '.$plural.' found.',\n 'not_found_in_trash' => 'No '.$plural.' found in Trash.'\n );\n\n $args = array(\n 'menu_icon' => 'dashicons-media-spreadsheet',\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n 'show_in_nav_menus'\t => true,\n 'show_in_menu' => false,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'clients' ),\n 'capability_type' => 'page',\n 'has_archive' => false,\n 'hierarchical' => false,\n 'supports' => array( 'title', 'revisions', 'editor', 'thumbnail' )\n\n );\n\n\n register_post_type( 'lh_quotes', $args );\n\t}", "public function register_content_type() {\n\t\t$labels = array(\n\t\t\t'name' => 'Honor Rolls',\n\t\t\t'singular_name' => 'Honor Roll',\n\t\t\t'add_new' => 'Add New',\n\t\t\t'add_new_item' => 'Add New Honor Roll',\n\t\t\t'edit_item' => 'Edit Honor Roll',\n\t\t\t'new_item' => 'New Honor Roll',\n\t\t\t'all_items' => 'All Honor Rolls',\n\t\t\t'view_item' => 'View Honor Rolls',\n\t\t\t'search_items' => 'Search Honor Rolls',\n\t\t\t'not_found' => 'No Honor Rolls found',\n\t\t\t'not_found_in_trash' => 'No Honor Rolls found in Trash',\n\t\t\t'menu_name' => 'Honor Rolls',\n\t\t);\n\n\t\t$args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'public' => false,\n\t\t\t'publicly_queryable' => false,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'query_var' => true,\n\t\t\t'rewrite' => false,\n\t\t\t'has_archive' => false,\n\t\t\t'hierarchical' => false,\n\t\t\t'supports' => array( 'title' ),\n\t\t);\n\t\tregister_post_type( $this::$content_type_slug, $args );\n\t}", "function process_course_note() {\n\tif ( ! empty( $_POST[ 'submission' ] ) ) {\n\t\twp_send_json_error( 'Honeypot Check Failed' );\n\t}\n\tif ( ! check_ajax_referer( 'nt-course-note-nonce', 'security' ) ) {\n\t\twp_send_json_error( 'Security Check failed' );\n\t}\n\t$course_title = nt_generate_course_title($_POST[ 'data' ][ 'currentPostType' ] ,$_POST[ 'data' ][ 'currentLessonId' ]);\n\t$notes_data = array(\n\t\t'post_title' => $course_title.' - '.\n\t\t\t/*sanitize_text_field( $_POST[ 'data' ][ 'userId' ] ),\n\t\t\tsanitize_text_field( $_POST[ 'data' ][ 'currentLessonId' ] ),*/\n\n\t\t\tsanitize_text_field( $_POST[ 'data' ][ 'title' ] ),\n\t\t'post_status' => 'draft',\n\t\t'post_type' => 'coursenote',\n\t\t'post_content' => wp_kses_post( $_POST[ 'data' ][ 'body' ] )\n\t);\n\n\n\n//If note id already exists update exisiting note else insert new note\n$note_Id_update = get_post_id_by_meta_key_and_value('nt-note-current-lessson-id', $_POST[ 'data' ][ 'currentLessonId' ]);\n$post_author = get_post_field( 'post_author', $note_Id_update );\n\n\tif($note_Id_update && ($post_author == $_POST[ 'data' ][ 'userId' ])){\n\n\t\t$post_id = wp_update_post( array(\n\t\t\t'ID' => $note_Id_update,\n\t\t\t'post_content' => wp_kses_post( $_POST[ 'data' ][ 'body' ] )\n\t\t), true );\n\n\t\twp_send_json_success( $post_id );\n\t} else {\n\t\t$post_id = wp_insert_post( $notes_data, true );\n\t\tif ( $post_id ) {\n\n\t\t\tupdate_post_meta( $post_id, 'nt-note-user-id', $_POST[ 'data' ][ 'userId' ] );\n\t\t\tupdate_post_meta( $post_id, 'nt-note-current-lessson-id', $_POST[ 'data' ][ 'currentLessonId' ] );\n\n\t\t}\n\t\twp_send_json_success( $post_id );\n\t}\n\n}", "function news_story_init() {\n register_post_type('news', array(\n 'labels' => array(\n 'name' => __('News Stories', 'water-bear-games'),\n 'singular_name' => __('News Story', 'water-bear-games')\n ),\n 'menu_icon' => 'dashicons-id-alt',\n 'public' => true,\n 'has_archive' => true,\n 'show_ui' => true,\n 'supports' => array(\n 'title',\n 'editor',\n 'thumbnail'\n )\n ));\n}", "function register_post_types()\n {\n }", "public function register_transcript_cpt() {\n\t\t$labels = array(\n\t\t\t'name' => __( 'Transcripts', 'wubtitle' ),\n\t\t\t'singular_name' => __( 'Transcript', 'wubtitle' ),\n\t\t\t'menu_name' => __( 'Transcripts', 'wubtitle' ),\n\t\t\t'all_items' => __( 'All transcripts', 'wubtitle' ),\n\t\t\t'add_new' => __( 'Add new', 'wubtitle' ),\n\t\t\t'add_new_item' => __( 'Add new transcript', 'wubtitle' ),\n\t\t\t'edit_item' => __( 'Edit transcript', 'wubtitle' ),\n\t\t\t'new_item' => __( 'New transcript', 'wubtitle' ),\n\t\t\t'view_item' => __( 'View transcript', 'wubtitle' ),\n\t\t\t'view_items' => __( 'View transcripts', 'wubtitle' ),\n\t\t\t'search_items' => __( 'Search transcripts', 'wubtitle' ),\n\t\t\t'not_found' => __( 'No Transcripts found', 'wubtitle' ),\n\t\t\t'not_found_in_trash' => __( 'No Transcripts found in trash', 'wubtitle' ),\n\t\t\t'parent' => __( 'Parent transcript:', 'wubtitle' ),\n\t\t\t'archives' => __( 'Transcript archives', 'wubtitle' ),\n\t\t\t'insert_into_item' => __( 'Insert into Transcript', 'wubtitle' ),\n\t\t\t'uploaded_to_this_item' => __( 'Upload to this Transcript', 'wubtitle' ),\n\t\t\t'filter_items_list' => __( 'Filter Transcripts list', 'wubtitle' ),\n\t\t\t'items_list_navigation' => __( 'Transcripts list navigation', 'wubtitle' ),\n\t\t\t'items_list' => __( 'Transcripts list', 'wubtitle' ),\n\t\t\t'attributes' => __( 'Transcripts attributes', 'wubtitle' ),\n\t\t\t'name_admin_bar' => __( 'Transcript', 'wubtitle' ),\n\t\t\t'item_published' => __( 'Transcript published', 'wubtitle' ),\n\t\t\t'item_published_privately' => __( 'Transcript published privately.', 'wubtitle' ),\n\t\t\t'item_reverted_to_draft' => __( 'Transcript reverted to draft.', 'wubtitle' ),\n\t\t\t'item_scheduled' => __( 'Transcript scheduled', 'wubtitle' ),\n\t\t\t'item_updated' => __( 'Transcript updated.', 'wubtitle' ),\n\t\t\t'parent_item_colon' => __( 'Parent transcript:', 'wubtitle' ),\n\t\t);\n\n\t\t$args = array(\n\t\t\t'label' => __( 'Transcripts', 'wubtitle' ),\n\t\t\t'labels' => $labels,\n\t\t\t'description' => __( 'Video Transcripts', 'wubtitle' ),\n\t\t\t'show_in_rest' => true,\n\t\t\t'map_meta_cap' => true,\n\t\t\t'hierarchical' => false,\n\t\t\t'supports' => array( 'title', 'editor', 'revisions' ),\n\t\t);\n\n\t\tif ( WP_DEBUG ) {\n\t\t\t$args['show_ui'] = true;\n\t\t\t$args['menu_position'] = 83;\n\t\t\t$args['menu_icon'] = 'dashicons-format-chat';\n\t\t}\n\n\t\tregister_post_type( 'transcript', $args );\n\t}", "public function register_post_type() {\n\t\tadd_action( 'init', array( $this, 'post_registration_callback' ), 0, 0 );\n\t}", "public function register_post_type()\n {\n $labels = [\n 'name' => _x('Chiro Quizzes', 'post type general name', $this->token),\n 'singular_name' => _x('Chiro Quiz', 'post type singular name', $this->token),\n 'add_new' => _x('Add New', $this->token, $this->token),\n 'add_new_item' => sprintf(__('Add New %s', $this->token), __('Chiro Quiz', $this->token)),\n 'edit_item' => sprintf(__('Edit %s', $this->token), __('Chiro Quiz', $this->token)),\n 'new_item' => sprintf(__('New %s', $this->token), __('Chiro Quiz', $this->token)),\n 'all_items' => sprintf(__('All %s', $this->token), __('Chiro Quizzes', $this->token)),\n 'view_item' => sprintf(__('View %s', $this->token), __('Chiro Quiz', $this->token)),\n 'search_items' => sprintf(__('Search %a', $this->token), __('Chiro Quizzes', $this->token)),\n 'not_found' => sprintf(__('No %s Found', $this->token), __('Chiro Quizzes', $this->token)),\n 'not_found_in_trash' => sprintf(__('No %s Found In Trash', $this->token), __('Chiro Quizzes', $this->token)),\n 'parent_item_colon' => '',\n 'menu_name' => __('Chiro Quizzes', $this->token)\n ];\n\n $slug = __('chiro-quiz', 'pf_chiro_quiz');\n $custom_slug = get_option('pf_chiro_quiz_slug');\n if ($custom_slug && strlen($custom_slug) > 0 && $custom_slug != '') {\n $slug = $custom_slug;\n }\n\n $args = [\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'exclude_from_search' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'query_var' => true,\n 'rewrite' => ['slug' => $slug],\n 'capability_type' => 'post',\n 'has_archive' => false,\n 'hierarchical' => false,\n 'supports' => ['title'],\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-admin-quiz'\n ];\n\n register_post_type($this->token, $args);\n }", "function project_post_type(){\n $projects = array(\n 'labels' => array(\n 'name' => 'Projects',\n 'singular_name' => 'Project',\n ),\n 'public' => true,\n 'has_archive' => true,\n 'supports' => array('title', 'editor', 'thumbnail', 'excerpt', 'custom-fields'),\n );\n\n register_post_type('projects', $projects);\n}", "public function register_custom_post_type() {\n $labels = array (\n 'name' => __('Custom', self::$plugin_obj->class_name ),\n 'singular_name' => __('item', self::$plugin_obj->class_name ),\n 'add_new' => __('new item', self::$plugin_obj->class_name ),\n 'add_new_item' => __('new item', self::$plugin_obj->class_name ),\n 'new_item' => __('new item', self::$plugin_obj->class_name ),\n 'edit' => __('edit item', self::$plugin_obj->class_name ),\n 'edit_item' => __('edit item', self::$plugin_obj->class_name ),\n 'view' => __('view item', self::$plugin_obj->class_name ),\n 'view_item' => __('view item', self::$plugin_obj->class_name ),\n 'search_items' => __('search item', self::$plugin_obj->class_name ),\n 'not_found' => __('no item found', self::$plugin_obj->class_name ),\n 'not_found_in_trash' => __('no item in trash', self::$plugin_obj->class_name ),\n 'parent' => __('parent item', self::$plugin_obj->class_name )\n );\n\n $args = array(\n 'labels' => $labels,\n 'public' => TRUE,\n 'publicly_queryable' => TRUE,\n 'show_ui' => TRUE,\n 'show_in_menu' => TRUE,\n 'query_var' => TRUE,\n 'capability_type' => 'page',\n 'has_archive' => TRUE,\n 'hierarchical' => TRUE,\n 'exclude_from_search' => FALSE,\n 'menu_position' => 100 ,\n 'supports' => array('title','editor','excerpt','custom-fields','revisions','thumbnail','page-attributes'),\n 'taxonomies' => array('category','post_tag')\n );\n\n register_post_type('custom', $args);\n }", "function cw_post_type_news() {\n $supports = array(\n 'title', // post title\n 'editor', // post content\n 'author', // post author\n 'thumbnail', // featured images\n 'excerpt', // post excerpt\n 'custom-fields', // custom fields\n 'comments', // post comments\n 'revisions', // post revisions\n 'post-formats', // post formats\n );\n $labels = array(\n 'name' => _x('news', 'plural'),\n 'singular_name' => _x('news', 'singular'),\n 'menu_name' => _x('news', 'admin menu'),\n 'name_admin_bar' => _x('news', 'admin bar'),\n 'add_new' => _x('Add New', 'add new'),\n 'add_new_item' => __('Add New news'),\n 'new_item' => __('New news'),\n 'edit_item' => __('Edit news'),\n 'view_item' => __('View news'),\n 'all_items' => __('All news'),\n 'search_items' => __('Search news'),\n 'not_found' => __('No news found.'),\n );\n $args = array(\n 'supports' => $supports,\n 'labels' => $labels,\n 'public' => true,\n 'query_var' => true,\n 'rewrite' => array('slug' => 'news'),\n 'has_archive' => true,\n 'hierarchical' => false,\n );\n register_post_type('news', $args);\n }", "function create_posttype() \n {\n register_post_type( 'mist_employee',\n array(\n 'labels' => array(\n 'name' => __( 'Employees' ),\n 'singular_name' => __( 'Employee' )\n ),\n \n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array('slug' => 'employees'),\n 'supports' => array('title','editor','thumbnail','excerpt'),\n 'menu_icon' => 'dashicons-businessman'\n )\n );\n register_post_type( 'mist_message',\n array(\n 'labels' => array(\n 'name' => __( 'Person Messages' ),\n 'singular_name' => __( 'Message' ),\n ),\n \n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array('slug' => 'message'),\n 'supports' => array('title','editor','thumbnail','excerpt'),\n 'menu_icon' => 'dashicons-testimonial'\n )\n );\n add_post_type_support('mist_message', 'excerpt');\n \n }", "function bf_register_custom_post_type() {\r\n /* Añado las etiquetas que aparecerán en el escritorio de WordPress */\r\n\t$labels = array(\r\n\t\t'name' => _x( 'Ponentes', 'post type general name', 'text-domain' ),\r\n\t\t'singular_name' => _x( 'Ponente', 'post type singular name', 'text-domain' ),\r\n\t\t'menu_name' => _x( 'Ponentes', 'admin menu', 'text-domain' ),\r\n\t\t'add_new' => _x( 'Añadir nuevo', 'ponente', 'text-domain' ),\r\n\t\t'add_new_item' => __( 'Añadir nuevo ponente', 'text-domain' ),\r\n\t\t'new_item' => __( 'Nuevo Ponente', 'text-domain' ),\r\n\t\t'edit_item' => __( 'Editar Ponente', 'text-domain' ),\r\n\t\t'view_item' => __( 'Ver ponente', 'text-domain' ),\r\n\t\t'all_items' => __( 'Todos los ponentes', 'text-domain' ),\r\n\t\t'search_items' => __( 'Buscar ponentes', 'text-domain' ),\r\n\t\t'not_found' => __( 'No hay ponentes.', 'text-domain' ),\r\n\t\t'not_found_in_trash' => __( 'No hay ponentes en la papelera.', 'text-domain' )\r\n\t);\r\n\r\n /* Configuro el comportamiento y funcionalidades del nuevo custom post type */\r\n\t$args = array(\r\n\t\t'labels' => $labels,\r\n\t\t'description' => __( 'Descripción.', 'text-domain' ),\r\n\t\t'public' => true,\r\n\t\t'publicly_queryable' => true,\r\n\t\t'show_ui' => true,\r\n\t\t'show_in_menu' => true,\r\n\t\t'show_in_nav_menus' => true,\r\n\t\t'query_var' => true,\r\n\t\t'rewrite' => array( 'slug' => 'ponente' ),\r\n\t\t'capability_type' => 'post',\r\n\t\t'hierarchical' => false,\r\n\t\t'menu_position' => null,\r\n 'menu_icon' => 'dashicons-businessman',\r\n\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\r\n\t\t'show_in_rest'\t \t => true,\r\n\t\t'public' \t\t\t => true,\r\n\t\t'has_archive' \t\t => true,\r\n\t\t'taxonomies' => array('category','categoria-conferencias')\r\n\t);\r\n\r\n\tregister_post_type('ponentes', $args );\r\n}", "function carbon_register_post_types(){\n\n // carbon_register_post_type(array(\n // 'singular' => 'Type', // required\n // 'plural' => 'Types', // required\n // 'type' => 'type', // required\n // 'slug' => 'types/type',\n // 'menu_icon' => 'dashicons-admin-post',\n // 'has_archive' => true,\n // 'exclude_from_search' => true,\n // ));\n }", "function stock_toolkit_custom_post()\n\t{\n\tregister_post_type('slide', array(\n\t\t'labels' => array(\n\t\t\t'name' => __('Slides') ,\n\t\t\t'singular_name' => __('Slide')\n\t\t) ,\n\t\t'supports' => array(\n\t\t\t'title',\n\t\t\t'editor',\n\t\t\t'custom-fields',\n\t\t\t'thumbnail',\n\t\t\t'page-attributes'\n\t\t) ,\n\t\t'public' => false,\n\t\t'show_ui' => true\n\t));\n\t}", "function register_post_field($args) {\r\n\t\t$this->postmeta[ $args['post_type'] ][ $args['section'] ][ $args['id'] ] = $args;\r\n\t}", "function create_children_custom_post() {\n register_post_type( 'children',\n array(\n 'labels' => array(\n 'name' => __( 'Children' ),\n 'singular_name' => __( 'Child' ),\n ),\n 'public' => true,\n 'has_archive' => true,\n 'supports' => array(\n 'title',\n 'editor',\n 'thumbnail',\n )\n ));\n}", "function register_post_types() {\n\t}", "function register_post_types() {\n\t}", "function registerPostTypes()\n{\n register_post_type('destination', [\n 'public' => true,\n 'label' => 'Destinations',\n 'supports' => ['title', 'editor', 'thumbnail']\n ]);\n register_post_type('review', [\n 'public' => true,\n 'label' => 'Reviews',\n 'supports' => ['title', 'editor']\n ]);\n}", "function clicks_register_my_cpt_process() {\n\n // Post Type: Process.\n\n $labels = array(\n \"name\" => __( \"Process\", \"custom-post-type\" ),\n \"singular_name\" => __( \"Process\", \"custom-post-type\" ),\n );\n\n $args = array(\n \"label\" => __( \"Process\", \"custom-post-type\" ),\n \"labels\" => $labels,\n \"description\" => \"\",\n \"public\" => true,\n \"publicly_queryable\" => true,\n \"show_ui\" => true,\n \"delete_with_user\" => false,\n \"show_in_rest\" => false,\n \"rest_base\" => \"\",\n \"rest_controller_class\" => \"WP_REST_Posts_Controller\",\n \"has_archive\" => false,\n \"show_in_menu\" => true,\n \"show_in_nav_menus\" => true,\n \"exclude_from_search\" => false,\n \"capability_type\" => \"post\",\n \"map_meta_cap\" => true,\n \"hierarchical\" => false,\n \"rewrite\" => array( \"slug\" => \"process\", \"with_front\" => true ),\n \"query_var\" => true,\n \"menu_position\" => 21,\n \"supports\" => array( \"title\", \"editor\", \"thumbnail\" ),\n \"taxonomies\" => array( \"category\" ),\n );\n\n register_post_type( \"process\", $args );\n}", "function training_section(){\r\n\t$singular='Training Show';\r\n\t$plural='Training Shows';\r\n\r\n\t$labels=array(\r\n 'name'=>$plural,\r\n 'singular_name'=>$singular,\r\n 'add_name'=>'Add New',\r\n 'add_new_item'=>'Add New' . $singular,\r\n 'edit'=>'Edit',\r\n 'edit_item' =>'Edit' . $singular,\r\n 'new_item' =>'New' . $singular,\r\n 'view'=>'View' . $singular,\r\n 'view_item'=>'View' . $singular,\r\n 'search_item'=>'Search' . $plural,\r\n 'parent'=>'Parent' . $singular,\r\n 'not_found'=>'No' . $plural .'found',\r\n 'not_found_in_trash'=>'No' . $plural .'in Trash'\r\n\t\t);\r\n\t$args =array(\r\n 'labels' =>$labels,\r\n 'public' =>true,\r\n 'menu_position'=>10,\r\n 'has_archive'=>true,\r\n 'capability_type'=>'post',\r\n 'map_meta_cap'=>true,\r\n 'supports'=>array(\r\n 'title',\r\n 'editor',\r\n 'custom-fields',\r\n 'thumbnail'\r\n \t)\r\n\t\t);\r\n\tregister_post_type('training_show',$args);\r\n}", "public static function register_post_type() {\n\t\tregister_post_type( 'drsa_ad', self::arguments() );\n\t}", "function austeve_create_creations_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'Creations', 'Post Type General Name', 'austeve-canvas' ),\n\t\t'singular_name' => _x( 'Creation', 'Post Type Singular Name', 'austeve-canvas' ),\n\t\t'menu_name' => __( 'Creations', 'austeve-canvas' ),\n\t\t'name_admin_bar' => __( 'Creation', 'austeve-canvas' ),\n\t\t'archives' => __( 'Creation Archives', 'austeve-canvas' ),\n\t\t'attributes' => __( 'Creation Attributes', 'austeve-canvas' ),\n\t\t'parent_item_colon' => __( 'Parent Creation:', 'austeve-canvas' ),\n\t\t'all_items' => __( 'All Creations', 'austeve-canvas' ),\n\t\t'add_new_item' => __( 'Add New Creation', 'austeve-canvas' ),\n\t\t'add_new' => __( 'Add Creation', 'austeve-canvas' ),\n\t\t'new_item' => __( 'New Creation', 'austeve-canvas' ),\n\t\t'edit_item' => __( 'Edit Creation', 'austeve-canvas' ),\n\t\t'update_item' => __( 'Update Creation', 'austeve-canvas' ),\n\t\t'view_item' => __( 'View Creation', 'austeve-canvas' ),\n\t\t'view_items' => __( 'View Creations', 'austeve-canvas' ),\n\t\t'search_items' => __( 'Search Creation', 'austeve-canvas' ),\n\t\t'not_found' => __( 'Not found', 'austeve-canvas' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'austeve-canvas' ),\n\t\t'featured_image' => __( 'Featured Image', 'austeve-canvas' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'austeve-canvas' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'austeve-canvas' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'austeve-canvas' ),\n\t\t'insert_into_item' => __( 'Insert into Creation', 'austeve-canvas' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this item', 'austeve-canvas' ),\n\t\t'items_list' => __( 'Creations list', 'austeve-canvas' ),\n\t\t'items_list_navigation' => __( 'Creations list navigation', 'austeve-canvas' ),\n\t\t'filter_items_list' => __( 'Filter items list', 'austeve-canvas' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'Creation', 'austeve-canvas' ),\n\t\t'description' => __( 'Creations for '.get_bloginfo( 'name' ).' events', 'austeve-canvas' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'author', 'thumbnail', 'revisions', ),\n\t\t'taxonomies' => array( 'creation_tags' ),\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' => 10,\n\t\t'menu_icon' => 'dashicons-admin-customizer',\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' => 'creations',\n\t\t'rewrite' \t=> array( 'slug' => 'creations' ),\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => array( 'creation' , 'creations' ),\n 'map_meta_cap' => true,\n\t);\n\tregister_post_type( 'austeve-creations', $args );\n\n\t// Add new taxonomy, make it hierarchical (like categories)\n\t$categoryLabels = array(\n\t\t'name' => _x( 'Categories', 'taxonomy general name', 'austeve-canvas' ),\n\t\t'singular_name' => _x( 'Category', 'taxonomy singular name', 'austeve-canvas' ),\n\t\t'search_items' => __( 'Search Categories', 'austeve-canvas' ),\n\t\t'all_items' => __( 'All Categories', 'austeve-canvas' ),\n\t\t'parent_item' => __( 'Parent Category', 'austeve-canvas' ),\n\t\t'parent_item_colon' => __( 'Parent Category:', 'austeve-canvas' ),\n\t\t'edit_item' => __( 'Edit Category', 'austeve-canvas' ),\n\t\t'update_item' => __( 'Update Category', 'austeve-canvas' ),\n\t\t'add_new_item' => __( 'Add New Category', 'austeve-canvas' ),\n\t\t'new_item_name' => __( 'New Category Name', 'austeve-canvas' ),\n\t\t'menu_name' => __( 'Categories', 'austeve-canvas' ),\n\t);\n\n\t$categoryArgs = array(\n\t\t'hierarchical' => true,\n\t\t'label' => __( 'austeve_creation_categories', 'austeve-canvas' ),\n\t\t'labels' => $categoryLabels,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'creation-categories' ),\n\t\t'capabilities'\t\t=> array(\n\t\t\t\t\t\t\t 'manage_terms' => 'edit_users',\n\t\t\t\t\t\t\t 'edit_terms' => 'edit_users',\n\t\t\t\t\t\t\t 'delete_terms' => 'edit_users',\n\t\t\t\t\t\t\t 'assign_terms' => 'edit_creations'\n\t\t\t\t\t\t\t )\n\t);\n\n\tregister_taxonomy( 'austeve_creation_categories', array( 'austeve-creations' ), $categoryArgs );\n\n\t$taxonomyLabels = array(\n\t\t'name' => _x( 'Tags', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Tag', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Search Tags' ),\n\t\t'all_items' => __( 'All Tags' ),\n\t\t'parent_item' => __( 'Parent Tag' ),\n\t\t'parent_item_colon' => __( 'Parent Tag:' ),\n\t\t'edit_item' => __( 'Edit Tag' ),\n\t\t'update_item' => __( 'Update Tag' ),\n\t\t'add_new_item' => __( 'Add New Tag' ),\n\t\t'new_item_name' => __( 'New Tag Name' ),\n\t\t'menu_name' => __( 'Tags' ),\n\t);\n\n\t$taxonomyArgs = array(\n\n\t\t'label' => __( 'austeve_creation_tags', 'austeve-canvas' ),\n\t\t'labels' => $taxonomyLabels,\n\t\t'show_admin_column'\t=> false,\n\t\t'hierarchical' \t\t=> false,\n\t\t'show_ui'\t\t\t=> true,\n\t\t'rewrite' => array( 'slug' => 'creation-tags' ),\n\t\t'capabilities'\t\t=> array(\n\t\t\t\t\t\t\t 'manage_terms' => 'edit_users',\n\t\t\t\t\t\t\t 'edit_terms' => 'edit_users',\n\t\t\t\t\t\t\t 'delete_terms' => 'edit_users',\n\t\t\t\t\t\t\t 'assign_terms' => 'edit_creations'\n\t\t\t\t\t\t\t )\n\t\t);\n\n\tregister_taxonomy( 'austeve_creation_tags', 'austeve-creations', $taxonomyArgs );\n\n}", "public function register_post_type()\n\t{\n\n\t\tregister_post_type( 'partner', array(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => _x( 'Partners', 'post type general name', 'custom-post-type-partners' ),\n\t\t\t\t'singular_name' => _x( 'Partner', 'post type singular name', 'custom-post-type-partners' ),\n\t\t\t\t'add_new' => _x( 'Add New', 'Partner', 'custom-post-type-partners' ),\n\t\t\t\t'add_new_item' => __( 'Add New Partner', 'custom-post-type-partners' ),\n\t\t\t\t'edit_item' => __( 'Edit Partner', 'custom-post-type-partners' ),\n\t\t\t\t'new_item' => __( 'New Partner', 'custom-post-type-partners' ),\n\t\t\t\t'all_items' => __( 'All Partners', 'custom-post-type-partners' ),\n\t\t\t\t'view_item' => __( 'View Partner', 'custom-post-type-partners' ),\n\t\t\t\t'search_items' => __( 'Search Partners', 'custom-post-type-partners' ),\n\t\t\t\t'not_found' => __( 'No Partners found', 'custom-post-type-partners' ),\n\t\t\t\t'not_found_in_trash' => __( 'No Partners found in Trash', 'custom-post-type-partners' ),\n\t\t\t\t'parent_item_colon' => '',\n\t\t\t\t'menu_name' => __( 'Partners', 'custom-post-type-partners' )\n\t\t\t),\n\t\t\t'public' => TRUE,\n\t\t\t'publicly_queryable' => TRUE,\n\t\t\t'show_ui' => TRUE,\n\t\t\t'show_in_menu' => TRUE,\n\t\t\t'query_var' => TRUE,\n\t\t\t'rewrite' => TRUE,\n\t\t\t'capability_type' => 'post',\n\t\t\t'has_archive' => FALSE,\n\t\t\t'hierarchical' => FALSE,\n\t\t\t'menu_position' => NULL,\n\t\t\t'menu_icon' => 'dashicons-admin-links',\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes' )\n\t\t) );\n\n\t}", "public function createPostTypes()\n {\n }", "public function registerCustomPostType()\n {\n if (!post_type_exists($this->slug)) {\n register_post_type($this->slug, $this->arguments);\n }\n }", "function create_volunteer_custom_post() {\n register_post_type( 'volunteers',\n array(\n 'labels' => array(\n 'name' => __( 'Board Members' ),\n 'singular_name' => __( 'Board Member' ),\n ),\n 'public' => true,\n 'has_archive' => true,\n 'supports' => array(\n 'title',\n 'editor',\n 'thumbnail',\n 'custom-fields'\n )\n ));\n}", "function register_cpt_Testimonial() {\n\n $labels = array(\n 'name' => _x( 'Testimonials', 'Testimonial' ),\n 'singular_name' => _x( 'Testimonial', 'Testimonial' ),\n 'add_new' => _x( 'Add New', 'Testimonial' ),\n 'add_new_item' => _x( 'Add New Testimonial', 'Testimonial' ),\n 'edit_item' => _x( 'Edit Testimonial', 'Testimonial' ),\n 'new_item' => _x( 'New Testimonial', 'Testimonial' ),\n 'view_item' => _x( 'View Testimonial', 'Testimonial' ),\n 'search_items' => _x( 'Search Testimonials', 'Testimonial' ),\n 'not_found' => _x( 'No Testimonials found', 'Testimonial' ),\n 'not_found_in_trash' => _x( 'No Testimonials found in Trash', 'Testimonial' ),\n 'parent_item_colon' => _x( 'Parent Testimonial:', 'Testimonial' ),\n 'menu_name' => _x( 'Testimonials', 'Testimonial' ),\n );\n\n $args = array(\n 'labels' => $labels,\n 'hierarchical' => true,\n 'description' => 'Customer Testimonials',\n 'supports' => array( 'title'),\n 'public' => false,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-editor-quote',\n 'show_in_nav_menus' => true,\n 'publicly_queryable' => false,\n 'exclude_from_search' => true,\n 'has_archive' => false,\n 'query_var' => true,\n 'can_export' => true,\n 'rewrite' => true,\n 'capability_type' => 'post'\n );\n\n register_post_type( 'Testimonial', $args );\n}", "function cm_add_meta_box_schedule_course() {\n\n\t$screens = array( 'scheduled_course' );\n\n\n$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ;\n // check for a template type\n \n \n\tforeach ( $screens as $screen ) {\n\n\t\n add_meta_box(\n\t\t\t'myplugin_sectionid',\n\t\t\t__( 'Course Settings', 'myplugin_textdomain' ),\n\t\t\t'cm_meta_box_schedule_course_callback',\n\t\t\t$screen\n\t\t);\n \n\t\t\n\t}\n}", "function gf_testimonials_cpt() {\n\nregister_post_type( 'testimonials',\n array(\n 'labels' => array(\n 'name' => __( 'Testimonials' ),\n 'singular_name' => __( 'Testimonial' ),\t\t\n\t\t'add_new' => _x( 'Add New', 'Testimonial' ),\n\t\t'add_new_item' => __( 'Add New Testimonial' ),\n\t\t'edit_item' => __( 'Edit Testimonial' ),\n\t\t'new_item' => __( 'New Testimonial' ),\n\t\t'view_item' => __( 'View Testimonials' ),\n\t\t'search_items' => __( 'Search Testimonials' ),\n\t\t'not_found' => __( 'No Testimonials found' ),\n\t\t'not_found_in_trash' => __( 'Testimonials found in Trash' ),\n\t\t'parent_item_colon' => ''\n\t\t\n ),\n 'public' => true,\n\t 'supports' => array('title', 'editor', 'thumbnail'),\n\t 'menu_icon' => GF_TESTIMONIALS_PLUGIN_URL .'assets/images/icon-testimonials.png',\n\t 'query_var' => true,\n\t 'rewrite' => array( 'slug' => 'testimonials' ),\n )\n );\n}", "private function initCustomPostType(){\n //Instantiate our custom post type object\n $this->cptWPDS = new PostType($this->wpdsPostType);\n \n //Set our custom post type properties\n $this->cptWPDS->setSingularName($this->wpdsPostTypeName);\n $this->cptWPDS->setPluralName($this->wpdsPostTypeNamePlural);\n $this->cptWPDS->setMenuName($this->wpdsPostTypeNamePlural);\n $this->cptWPDS->setLabels('Add New', 'Add New '.$this->wpdsPostTypeName, 'Edit '.$this->wpdsPostTypeName, 'New '.$this->wpdsPostTypeName, 'All '.$this->wpdsPostTypeNamePlural, 'View '.$this->wpdsPostTypeNamePlural, 'Search '.$this->wpdsPostTypeNamePlural, 'No '.strtolower($this->wpdsPostTypeNamePlural).' found', 'No '.strtolower($this->wpdsPostTypeNamePlural).' found in the trash');\n $this->cptWPDS->setMenuIcon('dashicons-welcome-write-blog');\n $this->cptWPDS->setSlug($this->wpdsPostType);\n $this->cptWPDS->setDescription('Writings from the universe');\n $this->cptWPDS->setShowInMenu(true);\n $this->cptWPDS->setPublic(true);\n $this->cptWPDS->setTaxonomies([$this->wpdsPostType]);\n $this->cptWPDS->removeSupports(['title']);\n \n //Register custom post type\n $this->cptWPDS->register();\n }", "function fcc_stow_special_event_init()\r\n{\r\n $labels = array( \"name\" => \"Special Events\",\r\n \"singular_name\" => \"Special Event\",\r\n \"add_new_item\" => \"Add New Special Event\",\r\n \"new_item\" => \"New Special Event\",\r\n \"edit_item\" => \"Edit Special Event\",\r\n \"view_item\" => \"View Special Event\",\r\n \"all_items\" => \"All Special Events\",\r\n \"search_items\" => \"Search Special Events\",\r\n \"not_found\" => \"No Special Events found\",\r\n \"not_found_in_trash\" => \"No Special Events found in trash\" );\r\n\r\n $args = array( \"labels\" => $labels,\r\n \"public\" => true,\r\n \"rewrite\" => array( \"slug\" => \"special-event\" ),\r\n \"supports\" => array( \"title\" ));\r\n\r\n register_post_type( \"fcc-stow-special-event\", $args );\r\n\r\n add_filter( \"the_content\", \"fcc_stow_special_event_post_apply_metadata\" );\r\n}", "function create_posttype_periodontics() {\n\n\tregister_post_type( 'periodontics',\n\t\t\t\t\t array(\n\t\t\t\t\t\t 'labels' => array(\n\t\t\t\t\t\t\t 'name' => __( 'Periodontics' ),\n\t\t\t\t\t\t\t 'singular_name' => __( 'periodontics' )\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t 'public' => true,\n\t\t\t\t\t\t 'has_archive' => false,\n\t\t\t\t\t\t 'rewrite' => array('slug' => 'periodontics'),\n\t\t\t\t\t\t 'show_in_rest' => true,\n\t\t\t\t\t\t 'supports'=> array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ),\n\t\t\t\t\t )\n\t\t\t\t\t );\n}", "function compendium_register_type($slug, $name, $pname, $dicon) {\n $pt_slug = $slug;\n $tax_slug = $slug . '-category';\n\n register_post_type($pt_slug, array(\n 'labels' => array(\n 'name' => $pname,\n 'singular_name' => $name,\n 'add_new' => 'Add New',\n 'add_new_item' => 'Add New '.$name,\n 'edit_item' => 'Edit '.$name,\n 'new_item' => 'New '.$name,\n 'view_item' => 'View '.$name,\n 'search_items' => 'Search '.$pname,\n 'not_found' => 'No '.$pname.' found',\n 'not_found_in_trash' => 'No '.$pname.' found in trash',\n ),\n 'public' => true,\n 'menu_position' => 35,\n 'supports' => array('title','editor','thumbnail','excerpt'),\n 'menu_icon' => $dicon,\n 'rewrite' => array(\n 'slug' => 'resource-center/' . $pt_slug,\n 'with_front' => true\n ),\n ));\n\n register_taxonomy($tax_slug, $pt_slug, array(\n 'labels' => array(\n 'name' => 'Categories',\n 'singular_name' => 'Category',\n ),\n 'hierarchical' => true,\n ));\n}", "function custom_post_Contentp() {\r\n\tregister_post_type( 'contentp',\r\n\t\tarray('labels' => array(\r\n\t\t\t'name' => __('Teacher Education Presentations', 'emc'),\r\n\t\t\t'singular_name' => __('Teacher Education Presentation', 'emc'),\r\n\t\t\t'all_items' => __('All Teacher Education Presentations', 'emc'),\r\n\t\t\t'add_new' => __('Add New', 'emc'),\r\n\t\t\t'add_new_item' => __('Add New Teacher Education Presentation', 'emc'),\r\n\t\t\t'edit' => __( 'Edit', 'emc' ),\r\n\t\t\t'edit_item' => __('Edit Teacher Education Presentation', 'emc'),\r\n\t\t\t'new_item' => __('New Teacher Education Presentation', 'emc'),\r\n\t\t\t'view_item' => __('View Teacher Education Presentation', 'emc'),\r\n\t\t\t'search_items' => __('Search Teacher Education Presentations', 'emc'),\r\n\t\t\t'not_found' => __('Nothing found in the Database.', 'emc'),\r\n\t\t\t'not_found_in_trash' => __('Nothing found in Trash', 'emc'),\r\n\t\t\t'parent_item_colon' => ''\r\n\t\t\t),\r\n\t\t\t'description' => __( 'This is the example Teacher Education Presentation', 'emc' ),\r\n\t\t\t'public' => true,\r\n\t\t\t'publicly_queryable' => true,\r\n\t\t\t'exclude_from_search' => false,\r\n\t\t\t'show_ui' => true,\r\n\t\t\t'query_var' => true,\r\n\t\t\t'menu_position' => 5,\r\n\t\t\t'menu_icon' => get_stylesheet_directory_uri() . '/img/emc.png',\r\n\t\t\t'rewrite'\t=> array( 'slug' => 'teacher-education-presentations', 'with_front' => false ),\r\n\t\t\t'has_archive' => 'teacher-education-presentations',\r\n\t\t\t'capability_type' => 'post',\r\n\t\t\t'hierarchical' => true,\r\n\t\t\t'supports' => array( 'title', 'category', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'sticky')\r\n\t \t)\r\n\t);\r\n\t//register_taxonomy_for_object_type('category', 'reasearch');\r\n\t//register_taxonomy_for_object_type('post_tag', 'reasearch');\r\n}", "function tyreconnect_testimonials_post_type() {\n $args = [\n 'name' => 'testimonials',\n 'label' => 'testimonials',\n 'singular_name' => 'Testimonials',\n 'show_in_rest' => true,\n 'menu_icon' => 'dashicons-chart-pie',\n 'show_in_menu ' => true,\n 'public' => true,\n 'hierarchical' => false,\n 'menu_position' => 50,\n 'supports' => array('title', 'editor', 'thumbnail'),\n 'show_ui' => true\n\n ];\n register_post_type('testimonials', $args );\n}", "private function register_cluster_fields() {\n\n $types = [];\n foreach ( Types::get_cluster_post_types() as $post_type ) {\n if ( ! post_type_supports( $post_type, 'editor' ) ) {\n $types[] = $post_type;\n }\n }\n\n $description = new \\Fieldmanager_RichTextArea( false, [\n 'name' => 'description',\n 'required' => false,\n ] );\n $description->add_meta_box( esc_html__( 'Description', 'pedestal' ), $types, 'normal', 'default' );\n\n }", "function cptui_register_my_cpts_we_did() {\n\n\t$labels = array(\n\t\t\"name\" => __( \"What We Did\", \"esoftkulo\" ),\n\t\t\"singular_name\" => __( \"We Did Item\", \"esoftkulo\" ),\n\t);\n\n\t$args = array(\n\t\t\"label\" => __( \"What We Did\", \"esoftkulo\" ),\n\t\t\"labels\" => $labels,\n\t\t\"description\" => \"\",\n\t\t\"public\" => true,\n\t\t\"publicly_queryable\" => true,\n\t\t\"show_ui\" => true,\n\t\t\"delete_with_user\" => false,\n\t\t\"show_in_rest\" => true,\n\t\t\"rest_base\" => \"\",\n\t\t\"rest_controller_class\" => \"WP_REST_Posts_Controller\",\n\t\t\"has_archive\" => false,\n\t\t\"show_in_menu\" => true,\n\t\t\"show_in_nav_menus\" => true,\n\t\t\"exclude_from_search\" => false,\n\t\t\"capability_type\" => \"post\",\n\t\t\"map_meta_cap\" => true,\n\t\t\"hierarchical\" => false,\n\t\t\"rewrite\" => array( \"slug\" => \"we_did\", \"with_front\" => true ),\n\t\t\"query_var\" => true,\n\t\t\"supports\" => array( \"title\", \"editor\", \"thumbnail\" ),\n\t);\n\n\tregister_post_type( \"we_did\", $args );\n}", "function custom_post_Conference() {\r\n\tregister_post_type( 'conference',\r\n\t\tarray('labels' => array(\r\n\t\t\t'name' => __('Conferences', 'emc'),\r\n\t\t\t'singular_name' => __('Conference', 'emc'),\r\n\t\t\t'all_items' => __('All Conferences', 'emc'),\r\n\t\t\t'add_new' => __('Add New', 'emc'),\r\n\t\t\t'add_new_item' => __('Add New Conference', 'emc'),\r\n\t\t\t'edit' => __( 'Edit', 'emc' ),\r\n\t\t\t'edit_item' => __('Edit Conference', 'emc'),\r\n\t\t\t'new_item' => __('New Conference', 'emc'),\r\n\t\t\t'view_item' => __('View Conference', 'emc'),\r\n\t\t\t'search_items' => __('Search Conferences', 'emc'),\r\n\t\t\t'not_found' => __('Nothing found in the Database.', 'emc'),\r\n\t\t\t'not_found_in_trash' => __('Nothing found in Trash', 'emc'),\r\n\t\t\t'parent_item_colon' => ''\r\n\t\t\t),\r\n\t\t\t'description' => __( 'This is the example Conference', 'emc' ),\r\n\t\t\t'public' => true,\r\n\t\t\t'publicly_queryable' => true,\r\n\t\t\t'exclude_from_search' => false,\r\n\t\t\t'show_ui' => true,\r\n\t\t\t'query_var' => true,\r\n\t\t\t'menu_position' => 5,\r\n\t\t\t'menu_icon' => get_stylesheet_directory_uri() . '/img/emc.png',\r\n\t\t\t'rewrite'\t=> array( 'slug' => 'conferences', 'with_front' => false ),\r\n\t\t\t'has_archive' => 'conferences',\r\n\t\t\t'capability_type' => 'post',\r\n\t\t\t'hierarchical' => true,\r\n\t\t\t'supports' => array( 'title', 'category', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'sticky')\r\n\t \t)\r\n\t);\r\n\t//register_taxonomy_for_object_type('category', 'reasearch');\r\n\t//register_taxonomy_for_object_type('post_tag', 'reasearch');\r\n}", "function create_post_type() {\n\n // register external_post as a Custom Post Type\n register_post_type( 'external_post', \n array( \n 'labels' => array( \n 'name' => __('External Posts'), \n 'singular_name' => __('External Post') \n ),\n 'public' => true,\n 'menu_position' => 5,\n 'supports' => array('title', 'excerpt'),\n 'rewrite' => array('slug' => 'external','with_front' => false) \n ) \n ); \n\n // connect external_post to category taxonomy\n register_taxonomy_for_object_type('category', 'external_post');\n register_taxonomy_for_object_type('post_tag', 'external_post');\n\n\n // register wp_tool as a Custom Post Type\n register_post_type('wp_tool',\n array( \n 'labels' => array( \n 'name' => __('WordPress Tools'), \n 'singular_name' => __('WordPress Tool') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'author', 'editor', 'excerpt', 'thumbnail', 'post-formats', 'revisions', 'meta_info'),\n 'rewrite' => array('slug' => 'tool','with_front' => false) \n ) \n );\n\n // connect wp_tool to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'wp_tool');\n register_taxonomy_for_object_type('category', 'wp_tool');\n\n\n // reregister default post so we can set a custom slug\n register_post_type('post', array(\n 'labels' => array(\n 'name_admin_bar' => _x('Post', 'add new on admin bar' ),\n ),\n 'public' => true,\n '_builtin' => false, \n '_edit_link' => 'post.php?post=%d', \n 'capability_type' => 'post',\n 'map_meta_cap' => true,\n 'show_in_menu' => false,\n 'hierarchical' => false,\n 'rewrite' => array('slug' => 'article'),\n 'query_var' => false,\n 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats', 'column_info'),\n )); \n\n // register external_tool as a Custom Post Type\n register_post_type('external_tool',\n array(\n 'labels' => array( \n 'name' => __('External Tools'), \n 'singular_name' => __('External Tool') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'author', 'excerpt', 'thumbnail', 'revisions', 'meta_info'),\n 'rewrite' => array('slug' => 'special','with_front' => false) \n ) \n ); \n\n // connect external_tool to category taxonomy\n register_taxonomy_for_object_type('category', 'external_tool');\n register_taxonomy_for_object_type('meta_info', 'external_tool');\n\n\n // register city_journal as a Custom Post Type\n register_post_type('city_journal',\n array(\n 'labels' => array( \n 'name' => __('CityJournal Entry'),\n 'singular_name' => __('CityJournal Entry')\n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'editor', 'author', 'excerpt', 'thumbnail', 'revisions', 'meta_info', 'comments'),\n 'rewrite' => array('slug' => 'cityjournal','with_front' => false) \n ) \n ); \n\n // connect city_journal to category taxonomy\n register_taxonomy_for_object_type('category', 'city_journal');\n register_taxonomy_for_object_type('meta_info', 'city_journal'); \n\n\n // register people_project as a Custom Post Type\n register_post_type('people_project',\n array(\n 'labels' => array( \n 'name' => __('People & Projects'),\n 'singular_name' => __('People & Project')\n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'excerpt', 'thumbnail', 'meta_info'),\n ) \n ); \n\n // connect people_project to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'people_project'); \n\n\n register_post_type('discussion',\n array( \n 'labels' => array( \n 'name' => __('Discussions'), \n 'singular_name' => __('Discussion') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'post-formats', 'revisions', 'meta_info', 'comments'),\n 'rewrite' => array('slug' => 'discussion','with_front' => false) \n ) \n );\n\n // connect discussion to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'discussion');\n register_taxonomy_for_object_type('category', 'discussion');\n\n}", "function portfolio_post_type(){\n $args=array(\n 'labels'=>array(\n 'name'=>'Portfolios',\n 'singular_name'=>'Portfolio'\n ),\n 'public'=>true,\n 'has_archive'=>true,\n 'menu_icon'=>'dashicons-admin-site-alt3',\n 'supports'=>array('title','editor','thumbnail','custom-fields'),\n\n );\n register_post_type('portfolio',$args);\n}", "public function register_post_type(){\r\n //Capitilize the words and make it plural\r\n $name = ucwords( str_replace( '_', ' ', $this->post_type_name ) );\r\n $plural = $name . 's';\r\n $menupos = $this->post_type_pos;\r\n\r\n // We set the default labels based on the post type name and plural. We overwrite them with the given labels.\r\n $labels = array_merge(\r\n\r\n // Default\r\n array(\r\n 'name' => _x( $plural, 'post type general name' ),\r\n 'singular_name' => _x( $name, 'post type singular name' ),\r\n 'add_new' => _x( 'Add New', strtolower( $name ) ),\r\n 'add_new_item' => __( 'Add New ' . $name ),\r\n 'edit_item' => __( 'Edit ' . $name ),\r\n 'new_item' => __( 'New ' . $name ),\r\n 'all_items' => __( 'All ' . $plural ),\r\n 'view_item' => __( 'View ' . $name ),\r\n 'search_items' => __( 'Search ' . $plural ),\r\n 'not_found' => __( 'No ' . strtolower( $plural ) . ' found'),\r\n 'not_found_in_trash' => __( 'No ' . strtolower( $plural ) . ' found in Trash'),\r\n 'parent_item_colon' => '',\r\n 'menu_name' => $plural\r\n ),\r\n\r\n // Given labels\r\n $this->post_type_labels\r\n\r\n );\r\n\r\n // Same principle as the labels. We set some defaults and overwrite them with the given arguments.\r\n $args = array_merge(\r\n\r\n // Default\r\n array(\r\n 'capability_type' => 'post',\r\n 'hierarchical' => false,\r\n 'label' => $plural,\r\n 'labels' => $labels,\r\n 'menu_position' => $menupos,\r\n 'public' => true,\r\n 'publicly_queryable' => true,\r\n 'query_var' => true,\r\n 'rewrite' => array('slug' => $plural),\r\n 'show_in_nav_menus' => true,\r\n 'show_ui' => true,\r\n 'supports' => array( 'title', 'editor'),\r\n '_builtin' => false,\r\n ),\r\n\r\n // Given args\r\n $this->post_type_args\r\n\r\n );\r\n\r\n // Register the post type\r\n register_post_type( $this->post_type_name, $args );\r\n }", "private function register_article_cpt() {\n\t\n\n\t\tif (MKB_Options::option( 'cpt_slug_switch' )) {\n\t\t\t$args[\"rewrite\"] = array(\n\t\t\t\t\"slug\" => MKB_Options::option( 'article_slug' ),\n\t\t\t\t\"with_front\" => MKB_Options::option( 'cpt_slug_front_switch' )\n\t\t\t);\n\t\t}\n\n\t\tregister_post_type( MKB_Options::option( 'article_cpt' ), $args );\n\t}" ]
[ "0.6953161", "0.67703384", "0.6549829", "0.6466879", "0.6453754", "0.6426882", "0.64204943", "0.6400464", "0.6392772", "0.6388003", "0.63603806", "0.6349964", "0.63493836", "0.63026845", "0.6274581", "0.62579477", "0.6244729", "0.62369424", "0.62205845", "0.6216684", "0.6209176", "0.62036556", "0.61834407", "0.61752033", "0.6168831", "0.6157798", "0.61571807", "0.61554927", "0.6151371", "0.6145525", "0.61455125", "0.61406595", "0.6134279", "0.6130743", "0.61256176", "0.61235183", "0.6119641", "0.6113999", "0.6103379", "0.6101751", "0.6089257", "0.6085016", "0.60845184", "0.608445", "0.6070939", "0.6065926", "0.60559434", "0.60550356", "0.60499156", "0.60431653", "0.6031128", "0.60259736", "0.6023599", "0.6012259", "0.6005842", "0.6004571", "0.5980478", "0.5978062", "0.59727293", "0.5971302", "0.5970768", "0.59592515", "0.59557396", "0.5955031", "0.594095", "0.5939384", "0.593795", "0.5937052", "0.5934531", "0.59295136", "0.5917986", "0.59123003", "0.591086", "0.5910771", "0.5910771", "0.5896097", "0.58954984", "0.5891788", "0.5885013", "0.5863229", "0.58614475", "0.58550555", "0.5854035", "0.58472615", "0.58405596", "0.5836581", "0.5833309", "0.5831187", "0.5828817", "0.5809391", "0.5808651", "0.58066535", "0.58022875", "0.5799933", "0.5799139", "0.57945997", "0.5791735", "0.5791089", "0.57890475", "0.57816255" ]
0.8126819
0
Adds Course Note taxonomies
function nt_regsiter_taxonomy() { $labels = array( 'name' => 'Course Note Categories', 'singular_name' => 'Course Note Category', 'search_items' => 'Search Course Notes Categories', 'all_items' => 'All Course Note Categories', 'edit_item' => 'Edit Course Note Category', 'update_item' => 'Update Course Note Category', 'add_new_item' => 'Add New Course Note Category', 'new_item_name' => 'New Course Note Category', 'menu_name' => 'Course Note Categories' ); // register taxonomy register_taxonomy( 'coursenotecat', 'coursenote', array( 'hierarchical' => true, 'labels' => $labels, 'query_var' => true, 'show_admin_column' => true ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nt_register_course_note_create_type() {\n\t$post_labels = array(\n\t\t'name' \t\t\t => 'Course Notes',\n\t\t'singular_name' \t=> 'Course Notes',\n\t\t'add_new' \t\t => 'Add New',\n\t\t'add_new_item' \t=> 'Add New Note',\n\t\t'edit'\t\t => 'Edit',\n\t\t'edit_item'\t => 'Edit Course Note',\n\t\t'new_item'\t => 'New Course Note',\n\t\t'view' \t\t\t => 'View Course Note',\n\t\t'view_item' \t\t=> 'View Course Note',\n\t\t'search_term' \t=> 'Search Notes',\n\t\t'parent' \t\t => 'Parent Course Note',\n\t\t'not_found' \t\t=> 'No Notes Found',\n\t\t'not_found_in_trash' \t=> 'No Notes in Trash'\n\t);\n\n\tregister_post_type( 'coursenote', array(\n\t\t'labels' => $post_labels,\n\t\t'public' => true,\n\t\t'has_archive' => true,\n\t\t'supports' => array( 'title', 'editor', 'thumbnail','page-attributes' ),\n\t\t'taxonomies' => array( 'post_tag', 'category' ),\n\t\t'exclude_from_search' => false,\n\t\t'capability_type' => 'post',\n\t\t'rewrite' => array( 'slug' => 'Course Notes' ),\n\t)\n\t );\n\n}", "function custom_taxonomies_for_courses() {\n\n // add new taxonomy - type\n $labels = array(\n 'name' => 'Type',\n 'singular_name' => 'Type',\n 'search_items' => 'Search',\n 'all_items' => 'All',\n 'parent_item' => 'Parent',\n 'parent_item_colon' => 'Parent type:',\n 'edit_item' => 'Edit',\n 'update_item' => 'Update',\n 'add_new_item' => 'Add new',\n 'new_item_name' => 'New Type Field',\n 'menu_name' => 'Type'\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array('slug' => 'type')\n );\n\n register_taxonomy('type', array('courses'), $args);\n\n}", "public function addTaxonomies() {\n foreach (self::getPostTypes() as $post_type) {\n register_rest_field($post_type, 'taxonomies', [\n 'get_callback' => function ($post) use ($post_type) {\n return self::getTermSchema($post_type, $post);\n },\n ]);\n }\n }", "function create_taxonomies() \n{\n register_taxonomy(\n 'location',\n 'projects',\n array(\n 'labels' => array(\n 'name' => 'Location',\n 'add_new_item' => 'Add New Location',\n 'new_item_name' => \"New Location\"\n ),\n 'show_ui' => true,\n 'show_tagcloud' => false,\n 'hierarchical' => true\n )\n );\n \n register_taxonomy(\n 'category',\n 'projects',\n array(\n 'labels' => array(\n 'name' => 'Category',\n 'add_new_item' => 'Add New Category',\n 'new_item_name' => \"New Category\"\n ),\n 'show_ui' => true,\n 'show_tagcloud' => false,\n 'hierarchical' => true\n )\n );\n}", "function add_post_types_and_taxonomies()\n{\n\n\t/* Common Labels */\n\t$labels = array(\n\t\t'add_new' => __( 'Add New', 'gladtidings' ),\n\t\t'not_found' => __( 'Not found', 'gladtidings' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'gladtidings' ),\n\t);\n\n\t/* Common Arguments */\n\t$args = array(\n\t\t'supports' => array( 'title' ),\n\t\t'public' => false,\n\t\t'show_ui' => true, //defaults to 'public'\n\t\t'show_in_menu' => true, //defaults to 'show_ui'\n\t\t'show_in_admin_bar' => true, // defaults to 'show_in_menu'\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'publicly_queryable' => true,\n\t\t'rewrite' => false,\n\t);\n\n\t/* Course */\n\t$course_labels = $labels + array(\n\t\t'name' => _x( 'Courses', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Course', 'Post Type Singular Name', 'gladtidings' ),\n\t\t'all_items' => __( 'All Courses', 'gladtidings' ),\n\t\t'add_new_item' => __( 'Add New Course', 'gladtidings' ),\n\t\t'new_item' => __( 'New Course', 'gladtidings' ),\n\t\t'edit_item' => __( 'Edit Course', 'gladtidings' ),\n\t\t'update_item' => __( 'Update Course', 'gladtidings' ),\n\t\t'view_item' => __( 'View Course', 'gladtidings' ),\n\t\t'search_items' => __( 'Search Courses', 'gladtidings' ),\n\t\t'items_list' => __( 'Course list', 'gladtidings' ),\n\t\t'items_list_navigation' => __( 'Course list navigation', 'gladtidings' ),\n\t\t'filter_items_list' => __( 'Filter course list', 'gladtidings' ),\n\t);\n\t$course_args = $args + array(\n\t\t'label' => __( 'Course', 'gladtidings' ),\n\t\t'description' => __( 'Courses consisting of separate Units with Videos and Quizzes', 'gladtidings' ),\n\t\t'labels' => $course_labels,\n\t\t'supports' => array( 'title', 'editor', 'excerpt', 'page-attributes' ),\n\t\t// 'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-welcome-learn-more',\n\t);\n\tregister_post_type( 'course', $course_args );\n\n\t/* Lesson */\n\t$lesson_labels = $labels + array(\n\t\t'name' => _x( 'Lessons', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Lesson', 'Post Type Singular Name', 'gladtidings' ),\n\t\t'all_items' => __( 'All Lessons', 'gladtidings' ),\n\t\t'add_new_item' => __( 'Add Lesson', 'gladtidings' ),\n\t\t'new_item' => __( 'New Lesson', 'gladtidings' ),\n\t\t'edit_item' => __( 'Edit Lesson', 'gladtidings' ),\n\t\t'update_item' => __( 'Update Lesson', 'gladtidings' ),\n\t\t'view_item' => __( 'View Lesson', 'gladtidings' ),\n\t\t'search_items' => __( 'Search Lesson', 'gladtidings' ),\n\t\t'items_list' => __( 'Lessons list', 'gladtidings' ),\n\t\t'items_list_navigation' => __( 'Lessons list navigation', 'gladtidings' ),\n\t\t'filter_items_list' => __( 'Filter Lessons list', 'gladtidings' ),\n\t);\n\t$lesson_args = $args + array(\n\t\t'label' => __( 'Lesson', 'gladtidings' ),\n\t\t'description' => __( 'Individual Videos Lessons', 'gladtidings' ),\n\t\t'labels' => $lesson_labels,\n\t\t// 'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-video-alt2',\n\t);\n\tregister_post_type( 'lesson', $lesson_args );\n\n\t/* Quizzes */\n\t$quizz_labels = $labels + array(\n\t\t'name' => _x( 'Quizzes', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Quizz', 'Post Type Singular Name', 'gladtidings' ),\n\t\t'all_items' => __( 'All Quizzes', 'gladtidings' ),\n\t\t'add_new_item' => __( 'Add Quizz', 'gladtidings' ),\n\t\t'new_item' => __( 'New Quizz', 'gladtidings' ),\n\t\t'edit_item' => __( 'Edit Quizz', 'gladtidings' ),\n\t\t'update_item' => __( 'Update Quizz', 'gladtidings' ),\n\t\t'view_item' => __( 'View Quizz', 'gladtidings' ),\n\t\t'search_items' => __( 'Search Quizz', 'gladtidings' ),\n\t\t'items_list' => __( 'Quizzes list', 'gladtidings' ),\n\t\t'items_list_navigation' => __( 'Quizzes list navigation', 'gladtidings' ),\n\t\t'filter_items_list' => __( 'Filter Quizzes list', 'gladtidings' ),\n\t);\n\t$quizz_args = $args + array(\n\t\t'label' => __( 'Quizz', 'gladtidings' ),\n\t\t'description' => __( 'Individual Quizzes', 'gladtidings' ),\n\t\t'labels' => $quizz_labels,\n\t\t// 'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-welcome-write-blog',\n\t);\n\tregister_post_type( 'quizz', $quizz_args );\n\n\t/* Exams */\n\t$exam_labels = $labels + array(\n\t\t'name' => _x( 'Exams', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Exam', 'Post Type Singular Name', 'gladtidings' ),\n\t\t'all_items' => __( 'All Exams', 'gladtidings' ),\n\t\t'add_new_item' => __( 'Add Exam', 'gladtidings' ),\n\t\t'new_item' => __( 'New Exam', 'gladtidings' ),\n\t\t'edit_item' => __( 'Edit Exam', 'gladtidings' ),\n\t\t'update_item' => __( 'Update Exam', 'gladtidings' ),\n\t\t'view_item' => __( 'View Exam', 'gladtidings' ),\n\t\t'search_items' => __( 'Search Exam', 'gladtidings' ),\n\t\t'items_list' => __( 'Exams list', 'gladtidings' ),\n\t\t'items_list_navigation' => __( 'Exams list navigation', 'gladtidings' ),\n\t\t'filter_items_list' => __( 'Filter Exams list', 'gladtidings' ),\n\t);\n\t$exam_args = $args + array(\n\t\t'label' => __( 'Exam', 'gladtidings' ),\n\t\t'description' => __( 'Individual Exams', 'gladtidings' ),\n\t\t'labels' => $exam_labels,\n\t\t// 'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-welcome-write-blog',\n\t);\n\tregister_post_type( 'exam', $exam_args );\n\n\n\n\t/**\n\t * Register Virtual Custom Post Types\n\t * These are just for internal reference, they have no admin ui and are created in gt_relationships\n\t */\n\n\t/* Common Arguments */\n\t$args = array(\n\t\t'supports' => array( 'title' ),\n\t\t'public' => false,\n\t\t'show_ui' => false,\n\t\t'can_export' => false,\n\t\t'has_archive' => false,\n\t\t'publicly_queryable' => true,\n\t\t'rewrite' => false,\n\t);\n\n\t/* Units */\n\t$unit_labels = array(\n\t\t'name' => _x( 'Units', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Unit', 'Post Type Singular Name', 'gladtidings' ),\n\t);\n\t$unit_args = $args + array(\n\t\t'label' => __( 'Unit', 'gladtidings' ),\n\t\t'description' => __( 'Units consisting of Videos and Quizzes', 'gladtidings' ),\n\t\t'labels' => $unit_labels,\n\t);\n\tregister_post_type( 'unit', $unit_args );\n\n\n\t/* Headline */\n\t$headline_labels = array(\n\t\t'name' => _x( 'Headlines', 'Post Type General Name', 'gladtidings' ),\n\t\t'singular_name' => _x( 'Headline', 'Post Type Singular Name', 'gladtidings' ),\n\t);\n\t$headline_args = $args + array(\n\t\t'label' => __( 'Headline', 'gladtidings' ),\n\t\t'description' => __( 'Individual Headlines', 'gladtidings' ),\n\t\t'labels' => $headline_labels,\n\t);\n\tregister_post_type( 'headline', $headline_args );\n\n\n\t/**\n\t * Add custom post status for unit\n\t * - 'success' - the unit is sucessfully finished (user specific)\n\t * - 'active' - the unit was started, but is not finished (user specific)\n\t * - 'publish' - the unit is open, but not yet started (wp builtin)\n\t * - 'locked' - the unit is visible, but not accessible\n\t * - 'coming' - the unit is anounced for a future date, but visible (other than builtin 'future')\n\t * - 'draft' - the unit is not visible (wp builtin)\n\t */\n\tregister_post_status( 'locked', array( 'public' => true, 'label' => __( 'Locked', 'gladtidings' ) ) );\n\tregister_post_status( 'coming', array( 'public' => true, 'label' => __( 'Coming soon', 'gladtidings' ) ) );\n\n\n\t/**\n\t * Create a variable in $wpdb for the wp_gt_relationships table\n\t */\n\tglobal $wpdb;\n\t$wpdb->gt_relationships = $wpdb->prefix . \"gt_relationships\";\n\n\n}", "function create_taxonomies() {\n\t// taxonomy_init(\n\t// \t$settings = array(\n\t// \t\t'slug' \t=> 'sample',\t\t\t// Required\n\t// \t\t'singular' \t=> 'Sample',\t\t\t// Required\n\t// \t\t'plural' \t=> 'Samples',\t\t\t// Required\n\t// \t\t'post_types'\t=> 'your_CPT',\t\t\t// Required\n\t// \t)\n\t// );\n}", "function add_custom_taxonomies() {\n // Add new taxonomy\n $types = array('post','page','attachment','nav_menu_item', 'learning_resource');\n register_taxonomy('asn_index', $types, array(\n 'hierarchical' => true,\n 'labels' => array(\n 'name' => _x( 'ASN Index', 'taxonomy general name' ),\n 'singular_name' => _x( 'Competency', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Competencies' ),\n 'all_items' => __( 'All Competencies' ),\n 'parent_item' => __( 'Parent Competency' ),\n 'parent_item_colon' => __( 'Parent Competency:' ),\n 'edit_item' => __( 'Edit Competency' ),\n 'update_item' => __( 'Update Competency' ),\n 'add_new_item' => __( 'Add New Competency' ),\n 'new_item_name' => __( 'New Competency Name' ),\n 'menu_name' => __( 'Competency Index' ),\n ),\n //Slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'competency_index', \n 'with_front' => false,\n 'hierarchical' => true \n ),\n ));\n add_custom_post_type();\n create_new_topic_index();\n add_metadata_taxonomies();\n}", "public function create_taxonomies() {\n \n }", "protected function addTaxonomyConfigs()\n {\n // TODO: add taxonomy configs\n }", "function wpm_add_taxonomies() {\n\t// Taxonomie Lieux\n\n\t$labels_lieux = array(\n\t\t'name' => _x( 'Lieux', 'taxonomy general name'),\n\t\t'singular_name' => _x( 'Lieu', 'taxonomy singular name'),\n\t\t'search_items' => __( 'Rechercher un lieu'),\n\t\t'popular_items' => __( 'Lieux populaires'),\n\t\t'all_items' => __( 'Tous les lieux'),\n\t\t'edit_item' => __( 'Editer un lieu'),\n\t\t'update_item' => __( 'Mettre à jour un lieu'),\n\t\t'add_new_item' => __( 'Ajouter un nouveau lieu'),\n\t\t'new_item_name' => __( 'Nom du nouveau lieu'),\n\t\t'separate_items_with_commas' => __( 'Séparer les lieux avec une virgule'),\n\t\t'add_or_remove_items' => __( 'Ajouter ou supprimer un lieu'),\n\t\t'choose_from_most_used' => __( 'Choisir parmi les plus utilisés'),\n\t\t'not_found' => __( 'Pas de lieu trouvé'),\n\t\t'menu_name' => __( 'Lieux'),\n\t);\n\n\t$args_lieux = array(\n\t\t'hierarchical' => false,\n\t\t'labels' => $labels_lieux,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'update_count_callback' => '_update_post_term_count',\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'lieux' ),\n\t);\n\n\tregister_taxonomy( 'lieux', 'actus', $args_lieux );\n}", "function axiom_create_testimonial_taxonomies() \n{ \n //labels for Testimonial Category:\n $testi_category_labels = array(\n 'name' => _x( 'Testimonial Category' , \"Staff's Departmans general name\" , 'default' ),\n 'singular_name' => _x( \"Testimonial Category' , 'Staff's Departmans singular name\", 'default' ),\n 'search_items' => __( 'Search in Testimonial Categories' , 'default'),\n 'all_items' => __( 'All Testimonial Categories' , 'default'),\n 'most_used_items' => null,\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Testimonial Category' , 'default'), \n 'update_item' => __( 'Update Testimonial Category' , 'default'),\n 'add_new_item' => __( 'Add new Category' , 'default'),\n 'new_item_name' => __( 'New Testimonial Category' , 'default'),\n 'menu_name' => __( 'Categories' , 'default'),\n );\n \n register_taxonomy('testimonial-category', array('testimonial'), array(\n 'hierarchical' => true,\n 'labels' => $testi_category_labels,\n 'singular_name' => 'testimonial-category',\n 'show_ui' => true,\n 'query_var' => true,\n 'rewrite' => array('slug' => 'testimonial-category' )\n ));\n}", "private function registerTax() {\n $labels = array(\n 'name' => esc_html__('Masonry Gallery Categories', 'eltdf-core'),\n 'singular_name' => esc_html__('Masonry Gallery Category', 'eltdf-core'),\n 'search_items' => esc_html__('Search Masonry Gallery Categories', 'eltdf-core'),\n 'all_items' => esc_html__('All Masonry Gallery Categories', 'eltdf-core'),\n 'parent_item' => esc_html__('Parent Masonry Gallery Category', 'eltdf-core'),\n 'parent_item_colon' => esc_html__('Parent Masonry Gallery Category:', 'eltdf-core'),\n 'edit_item' => esc_html__('Edit Masonry Gallery Category', 'eltdf-core'),\n 'update_item' => esc_html__('Update Masonry Gallery Category', 'eltdf-core'),\n 'add_new_item' => esc_html__('Add New Masonry Gallery Category', 'eltdf-core'),\n 'new_item_name' => esc_html__('New Masonry Gallery Category Name', 'eltdf-core'),\n 'menu_name' => esc_html__('Masonry Gallery Categories', 'eltdf-core'),\n );\n\n register_taxonomy($this->taxBase, array($this->base), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'query_var' => true,\n 'show_admin_column' => true,\n 'rewrite' => array( 'slug' => 'masonry-gallery-category' ),\n ));\n }", "function setupTaxonomy()\n\t{\n\t\t$labels = array(\n\t\t\t\t'name' => 'Skills',\n\t\t\t\t'add_new_item' => 'Add New Skill',\n\t\t\t\t'new_item_name' => \"New Skill\"\n\t\t);\n\t\t\n\t\t$args = array(\n\t\t\t'hierarchical' => false,\n\t\t\t'labels' \t=> $labels,\n\t\t\t'show_ui' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'update_count_callback' => '_update_post_term_count',\n\t\t\t'query_var' => true,\n\t\t\t//'rewrite' => array( 'slug' => 'writer' ),\n\t\t\t'show_tagcloud' \t\t=> true\n\t\t);\n\n\t\tregister_taxonomy( 'skills', 'iru_positions', $args );\n\t\tregister_taxonomy_for_object_type( 'skills', 'iru_positions' );\n\t}", "function register_custom_taxonomies() {\n $labels = array(\n 'name' => _x( 'Categories', 'taxonomy general name' ),\n 'singular_name' => _x( 'Category', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Categories' ),\n 'all_items' => __( 'All Categories' ),\n 'parent_item' => __( 'Parent Category' ),\n 'parent_item_colon' => __( 'Parent Category:' ),\n 'edit_item' => __( 'Edit Category' ), \n 'update_item' => __( 'Update Category' ),\n 'add_new_item' => __( 'Add New Category' ),\n 'new_item_name' => __( 'New Category' ),\n 'menu_name' => __( 'Categories' ),\n );\n\n $args = array(\n 'labels' => $labels,\n 'hierarchical' => true,\n 'rewrite' => array (\n 'hierarchical' => true\n )\n );\n\n register_taxonomy( 'featured_tax', 'lwa_feature', $args );\n register_taxonomy( 'news_tax', 'lwa_news', $args );\n\n $carousel_labels = array(\n 'name' => _x( 'Settings', 'taxonomy general name' ),\n 'singular_name' => _x( 'Settings', 'taxonomy singular name' ),\n 'menu_name' => __( 'Choose post settings' ),\n );\n\n $carousel_args = array(\n 'labels' => $carousel_labels,\n 'hierarchical' => true\n );\n register_taxonomy( 'carousel', 'lwa_carousel', $carousel_args );\n}", "function briavers_register_tips_and_tricks_taxonomies(){\n $labels = array(\n 'name' => 'Types',\n 'singular_name' => 'Type',\n 'search_items' => 'Search type',\n 'all_items' => 'All types',\n 'edit_item' => 'Edit type',\n 'update_item' => 'Update type',\n 'add_new_item' => 'Add New type',\n 'new_item_name' => ' New type name',\n 'menu_name' => 'Types',\n 'not_found' => __('Types not found', 'briavers'),\n 'not_found_in_trash' => __('Type not found in trash', 'briavers'),\n );\n $args = array(\n 'hierarchical' => false,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'type'),\n 'show_in_rest' => true,\n 'rest_base' => 'type',\n\n );\n\n register_taxonomy('type', array('tips_and_tools'), $args);\n}", "function add_custom_taxonomies() {\n register_taxonomy('mechanic', 'post', array(\n // Hierarchical taxonomy (like categories)\n 'hierarchical' => true,\n 'show_admin_column' => true,\n 'show_in_rest' => true,\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Mechanics', 'taxonomy general name' ),\n 'singular_name' => _x( 'Mechanic', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Mechanics' ),\n 'all_items' => __( 'All Mechanics' ),\n 'parent_item' => __( 'Parent Mechanic' ),\n 'parent_item_colon' => __( 'Parent Mechanic:' ),\n 'edit_item' => __( 'Edit Mechanic' ),\n 'update_item' => __( 'Update Mechanic' ),\n 'add_new_item' => __( 'Add New Mechanic' ),\n 'new_item_name' => __( 'New Mechanic Name' ),\n 'menu_name' => __( 'Mechanics' ),\n ),\n // Control the slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'mechanics', // This controls the base slug that will display before each term\n 'with_front' => false, // Don't display the category base before \"/locations/\"\n 'hierarchical' => true // This will allow URL's like \"/locations/boston/cambridge/\"\n ),\n ));\n \n // Add new \"Locations\" taxonomy to Posts\n register_taxonomy('family', 'post', array(\n // Hierarchical taxonomy (like categories)\n 'hierarchical' => true,\n 'show_admin_column' => true,\n 'show_in_rest' => true,\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Families', 'taxonomy general name' ),\n 'singular_name' => _x( 'Family', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Families' ),\n 'all_items' => __( 'All Families' ),\n 'parent_item' => __( 'Parent Family' ),\n 'parent_item_colon' => __( 'Parent Family:' ),\n 'edit_item' => __( 'Edit Family' ),\n 'update_item' => __( 'Update Family' ),\n 'add_new_item' => __( 'Add New Family' ),\n 'new_item_name' => __( 'New Family Name' ),\n 'menu_name' => __( 'Families' ),\n ),\n // Control the slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'family', // This controls the base slug that will display before each term\n 'with_front' => false, // Don't display the category base before \"/locations/\"\n 'hierarchical' => true // This will allow URL's like \"/locations/boston/cambridge/\"\n ),\n ));\n \n // Add new \"Locations\" taxonomy to Posts\n register_taxonomy('publisher', 'post', array(\n // Hierarchical taxonomy (like categories)\n 'hierarchical' => true,\n 'show_admin_column' => true,\n 'show_in_rest' => true,\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Publishers', 'taxonomy general name' ),\n 'singular_name' => _x( 'Publisher', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Publishers' ),\n 'all_items' => __( 'All Publishers' ),\n 'parent_item' => __( 'Parent Publisher' ),\n 'parent_item_colon' => __( 'Parent Publisher:' ),\n 'edit_item' => __( 'Edit Publisher' ),\n 'update_item' => __( 'Update Publisher' ),\n 'add_new_item' => __( 'Add New Publisher' ),\n 'new_item_name' => __( 'New Publisher Name' ),\n 'menu_name' => __( 'Publishers' ),\n ),\n // Control the slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'publisher', // This controls the base slug that will display before each term\n 'with_front' => false, // Don't display the category base before \"/locations/\"\n 'hierarchical' => true // This will allow URL's like \"/locations/boston/cambridge/\"\n ),\n ));\n \n register_taxonomy('artists', 'post', array(\n // Hierarchical taxonomy (like categories)\n 'hierarchical' => true,\n 'show_admin_column' => true,\n 'show_in_rest' => true,\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Artists', 'taxonomy general name' ),\n 'singular_name' => _x( 'Artist', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Artists' ),\n 'all_items' => __( 'All Artists' ),\n 'parent_item' => __( 'Parent Artist' ),\n 'parent_item_colon' => __( 'Parent Artist:' ),\n 'edit_item' => __( 'Edit Artist' ),\n 'update_item' => __( 'Update Artist' ),\n 'add_new_item' => __( 'Add New Artist' ),\n 'new_item_name' => __( 'New Artist Name' ),\n 'menu_name' => __( 'Artists' ),\n ),\n // Control the slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'artists', // This controls the base slug that will display before each term\n 'with_front' => false, // Don't display the category base before \"/locations/\"\n 'hierarchical' => true // This will allow URL's like \"/locations/boston/cambridge/\"\n ),\n ));\n \n register_taxonomy('designers', 'post', array(\n // Hierarchical taxonomy (like categories)\n 'hierarchical' => true,\n 'show_admin_column' => true,\n 'show_in_rest' => true,\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Designers', 'taxonomy general name' ),\n 'singular_name' => _x( 'Designer', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Designers' ),\n 'all_items' => __( 'All Designers' ),\n 'parent_item' => __( 'Parent Designer' ),\n 'parent_item_colon' => __( 'Parent Designer:' ),\n 'edit_item' => __( 'Edit Designer' ),\n 'update_item' => __( 'Update Designer' ),\n 'add_new_item' => __( 'Add New Designer' ),\n 'new_item_name' => __( 'New Designer Name' ),\n 'menu_name' => __( 'Designers' ),\n ),\n // Control the slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'designers', // This controls the base slug that will display before each term\n 'with_front' => false, // Don't display the category base before \"/locations/\"\n 'hierarchical' => true // This will allow URL's like \"/locations/boston/cambridge/\"\n ),\n ));\n\n\n register_taxonomy('awards', 'post', array(\n // Hierarchical taxonomy (like categories)\n 'hierarchical' => true,\n 'show_admin_column' => true,\n 'show_in_rest' => true,\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Awards', 'taxonomy general name' ),\n 'singular_name' => _x( 'Award', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Awards' ),\n 'all_items' => __( 'All Awards' ),\n 'parent_item' => __( 'Parent Award' ),\n 'parent_item_colon' => __( 'Parent Award:' ),\n 'edit_item' => __( 'Edit Award' ),\n 'update_item' => __( 'Update Award' ),\n 'add_new_item' => __( 'Add New Award' ),\n 'new_item_name' => __( 'New Award Name' ),\n 'menu_name' => __( 'Awards' ),\n ),\n // Control the slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'awards', // This controls the base slug that will display before each term\n 'with_front' => false, // Don't display the category base before \"/locations/\"\n 'hierarchical' => true // This will allow URL's like \"/locations/boston/cambridge/\"\n ),\n ));\n }", "function create_my_taxonomies()\n{\n register_taxonomy('utilities', 'post', array('hierarchical' => true, 'label' => 'Utilities'));\n}", "function register_taxonomies(){\n }", "function add_metadata_taxonomies() {\n\t/*\n\tEducational use: http://schema.org/educationalUse e.g. http://purl.org/dcx/lrmi-vocabs/edUse/instruction\nEducational audience: http://schema.org/EducationalAudience e.g. http://purl.org/dcx/lrmi-vocabs/educationalAudienceRole/student\nInteractivity type: http://schema.org/interactivityType e.g. http://purl.org/dcx/lrmi-vocabs/interactivityType/expositive (active, expositive, or mixed)\nProficiency level: http://schema.org/proficiencyLevel (Beginner, Expert)\n\t*/\n\tadd_educational_use();\n\tadd_educational_audience();\n\tadd_interactivity_type();\n\tadd_proficiency_level();\n}", "function create_testimonial_taxonomies() {\n // Add new taxonomy, make it hierarchical (like categories)\n\n // Staff Categories\n $labels = array(\n 'name' => _x( 'Testimonial Categories', 'taxonomy general name' ),\n 'singular_name' => _x( 'Testimonial Category', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Testimonial Categories' ),\n 'all_items' => __( 'All Categories' ),\n 'parent_item' => __( 'Parent Testimonial Categories' ),\n 'parent_item_colon' => __( 'Parent Testimonial Categories' ),\n 'edit_item' => __( 'Edit Testimonial Category' ),\n 'update_item' => __( 'Update Testimonial Category' ),\n 'add_new_item' => __( 'Add New Testimonial Category' ),\n 'new_item_name' => __( 'New Testimonial Category' ),\n 'menu_name' => __( 'Categories' ),\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'testimonial_category' ),\n );\n\n register_taxonomy( 'testimonial_category', array( 'testimonials' , 'page' ), $args );\n}", "function additional_taxonomies() {\r\n\tregister_taxonomy(\r\n\t\t'gradelevel',\r\n\t\t'post',\r\n\t\tarray(\r\n 'hierarchical' => true,\r\n\t\t\t'label' => __( 'Grade Level' ),\r\n\t\t\t'sort' => true,\r\n\t\t\t'args' => array( 'orderby' => 'term_order' ),\r\n\t\t\t'rewrite' => array( 'slug' => 'gradelevel' )\r\n\t\t)\r\n\t);\r\n \r\n register_taxonomy(\r\n\t\t'logotype',\r\n\t\t'logo',\r\n\t\tarray(\r\n 'hierarchical' => true,\r\n\t\t\t'label' => __( 'Logo Types' ),\r\n\t\t\t'sort' => true,\r\n\t\t\t'args' => array( 'orderby' => 'term_order' ),\r\n\t\t\t'rewrite' => array( 'slug' => 'logotype' )\r\n\t\t)\r\n\t);\r\n}", "function register_taxonomies(){\n }", "function cooma_create_location_taxo() {\n $labels = array(\n 'name' => 'Locations',\n 'singular_name' => 'Location',\n 'search_items' => 'Search Locations',\n 'popular_items' => 'Popular Locations',\n 'all_items' => 'All Locations',\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => 'Edit Location',\n 'update_item' => 'Update Location',\n 'add_new_item' => 'Add New Location',\n 'new_item_name' => 'New Location Name',\n 'separate_items_with_commas' => 'Separate locations with commas',\n 'add_or_remove_items' => 'Add or remove locations',\n 'choose_from_most_used' => 'Choose from the most used locations',\n 'not_found' => 'No locations found.',\n 'menu_name' => 'Locations'\n );\n\n register_taxonomy(\n 'event-location',\n ['event', 'event-recurring', 'accommodation', 'coffee_food_wine', 'groups_associations', 'attractions'],\n array(\n 'labels' => $labels,\n 'hierarchical' => true,\n 'query_var' => true\n )\n );\n}", "function my_register_taxonomies() {\r\n\t}", "function register_taxonomies() {\n\t}", "function register_taxonomies() {\n\t}", "function register_taxonomies() {\n\t}", "public function register_taxonomies()\n {\n }", "function bw_create_taxonomies() {\n//first do the translations part for GUI\n \n $labels = array(\n 'name' => _x( 'Years', 'taxonomy general name' ),\n 'singular_name' => _x( 'Year', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Years' ),\n 'all_items' => __( 'All Years' ),\n 'parent_item' => __( 'Parent Year' ),\n 'parent_item_colon' => __( 'Parent Year:' ),\n 'edit_item' => __( 'Edit Year' ), \n 'update_item' => __( 'Update Year' ),\n 'add_new_item' => __( 'Add New Year' ),\n 'new_item_name' => __( 'New Year Name' ),\n 'menu_name' => __( 'Years' ),\n ); \n \n// Now register the taxonomy\n \n register_taxonomy('years',array('post'), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'topic' ),\n ));\n \n}", "function humcore_create_taxonomies() {\n\t// Add new taxonomy, make it hierarchical (like categories).\n\t$labels = array(\n\t\t'name' => _x( 'Subjects', 'taxonomy general name', 'humcore_domain' ),\n\t\t'singular_name' => _x( 'Subject', 'taxonomy singular name', 'humcore_domain' ),\n\t\t'search_items' => __( 'Search Subjects', 'humcore_domain' ),\n\t\t'all_items' => __( 'All Subjects', 'humcore_domain' ),\n\t\t'parent_item' => __( 'Parent Subject', 'humcore_domain' ),\n\t\t'parent_item_colon' => __( 'Parent Subject:', 'humcore_domain' ),\n\t\t'edit_item' => __( 'Edit Subject', 'humcore_domain' ),\n\t\t'update_item' => __( 'Update Subject', 'humcore_domain' ),\n\t\t'add_new_item' => __( 'Add New Subject', 'humcore_domain' ),\n\t\t'new_item_name' => __( 'New Subject Name', 'humcore_domain' ),\n\t\t'menu_name' => __( 'Subjects', 'humcore_domain' ),\n\t);\n\n\t$args = array(\n\t\t'public' => false,\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => false,\n\t\t'query_var' => false,\n\t\t'rewrite' => false,\n\t);\n\n\tregister_taxonomy( 'humcore_deposit_subject', array( 'humcore_deposit' ), $args );\n\tregister_taxonomy_for_object_type( 'humcore_deposit_subject', 'humcore_deposit' );\n\n\t// Add new taxonomy, NOT hierarchical (like tags).\n\t$labels = array(\n\t\t'name' => _x( 'Tags', 'taxonomy general name', 'humcore_domain' ),\n\t\t'singular_name' => _x( 'Tag', 'taxonomy singular name', 'humcore_domain' ),\n\t\t'search_items' => __( 'Search Tags', 'humcore_domain' ),\n\t\t'popular_items' => __( 'Popular Tags', 'humcore_domain' ),\n\t\t'all_items' => __( 'All Tags', 'humcore_domain' ),\n\t\t'parent_item' => null,\n\t\t'parent_item_colon' => null,\n\t\t'edit_item' => __( 'Edit Tag', 'humcore_domain' ),\n\t\t'update_item' => __( 'Update Tag', 'humcore_domain' ),\n\t\t'add_new_item' => __( 'Add New Tag', 'humcore_domain' ),\n\t\t'new_item_name' => __( 'New Tag Name', 'humcore_domain' ),\n\t\t'separate_items_with_commas' => __( 'Separate tags with commas', 'humcore_domain' ),\n\t\t'add_or_remove_items' => __( 'Add or remove tags', 'humcore_domain' ),\n\t\t'choose_from_most_used' => __( 'Choose from the most used tags', 'humcore_domain' ),\n\t\t'not_found' => __( 'No tags found.', 'humcore_domain' ),\n\t\t'menu_name' => __( 'Tags', 'humcore_domain' ),\n\t);\n\n\t$args = array(\n\t\t'public' => false,\n\t\t'hierarchical' => false,\n\t\t'labels' => $labels,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => false,\n\t\t'update_count_callback' => '_update_post_term_count',\n\t\t'query_var' => false,\n\t\t'rewrite' => false,\n\t);\n\n\tregister_taxonomy( 'humcore_deposit_tag', array( 'humcore_deposit' ), $args );\n\tregister_taxonomy_for_object_type( 'humcore_deposit_tag', 'humcore_deposit' );\n\n}", "function create_ha_taxonomies() {\n\n $labels = array(\n 'name' => _x( 'Habilidad artistica', 'taxonomy general name' ),\n 'singular_name' => _x( 'Habilidad artistica', 'taxonomy singular name' ),\n 'search_items' => __( 'Buscar Habilidad' ),\n 'all_items' => __( 'Habilidades artisticas' ),\n 'parent_item' => __( 'Parent Genre' ),\n 'parent_item_colon' => __( 'Parent Genre:' ),\n 'edit_item' => __( 'Editar habilidad' ), \n 'update_item' => __( 'Actualizar habilidad' ),\n 'add_new_item' => __( 'Nueva habilidad artistica' ),\n 'new_item_name' => __( 'Nueva habilidad artistica' ),\n 'menu_name' => __( 'Habilidades artisticas' ),\n ); \t\n\n register_taxonomy('habilidad-artistica',array('ofertas'), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'habilidad-artistica' ),\n ));\n\n}", "function create_topics_hierarchical_taxonomy() {\n \n// Add new taxonomy, make it hierarchical like categories\n//first do the translations part for GUI\n \n $labels = array(\n 'name' => _x( 'Sectores', 'taxonomy general name' ),\n 'singular_name' => _x( 'Sector', 'taxonomy singular name' ),\n 'search_items' => __( 'Buscar Sectores' ),\n 'all_items' => __( 'Todos los Sectores' ),\n 'parent_item' => __( 'Sector Padre' ),\n 'parent_item_colon' => __( 'Sector Padre:' ),\n 'edit_item' => __( 'Editar Sector' ), \n 'update_item' => __( 'Actualizar Sector' ),\n 'add_new_item' => __( 'Añadir Nuevo Sector' ),\n 'new_item_name' => __( 'Nuevo Sector' ),\n 'menu_name' => __( 'Sectores' ),\n ); \n \n// Now register the taxonomy\n \n register_taxonomy('sectores', array('logos, proyecto, diapositiva'), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'sectores' ),\n ));\n \n}", "function add_custom_taxonomies() {\n register_taxonomy('meta_info', 'post', array(\n // Hierarchical taxonomy (like categories)\n 'hierarchical' => true,\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x('Meta Information', 'taxonomy general name'),\n 'singular_name' => _x('Meta Information', 'taxonomy singular name'),\n 'search_items' => __('Search Meta Information'),\n 'all_items' => __('All Meta Information'),\n 'edit_item' => __('Edit Meta Information'),\n 'update_item' => __('Update Meta Information'),\n 'add_new_item' => __('Add New Meta Information'),\n 'new_item_name' => __('New Meta Information Name'),\n 'menu_name' => __('Meta Information'),\n ),\n // Control the slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'meta', // This controls the base slug that will display before each term\n 'with_front' => false, // Don't display the category base before \"/locations/\"\n 'hierarchical' => true // This will allow URL's like \"/locations/boston/cambridge/\"\n ),\n ));\n\n register_taxonomy('column_info', 'post', array(\n // Hierarchical taxonomy (like categories)\n 'hierarchical' => true,\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x('Column Information', 'taxonomy general name'),\n 'singular_name' => _x('Column Information', 'taxonomy singular name'),\n 'search_items' => __('Search Column Information'),\n 'all_items' => __('All Column Information'),\n 'edit_item' => __('Edit Column Information'),\n 'update_item' => __('Update Column Information'),\n 'add_new_item' => __('Add New Column Information'),\n 'new_item_name' => __('New Column Information Name'),\n 'menu_name' => __('Column Information'),\n ),\n // Control the slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'commentary', // This controls the base slug that will display before each term\n 'with_front' => false, // Don't display the category base before \"/locations/\"\n 'hierarchical' => true // This will allow URL's like \"/locations/boston/cambridge/\"\n ),\n ));\n\n}", "function tax_cmecourse() {\n// Coordinator\n\t$labels = array(\n\t\t'name' => _x( 'Coordinators', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Coordinator', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Search Coordinators' ),\n\t\t'all_items' => __( 'All Coordinators' )\n\t);\n\n\t$args = array(\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels,\n\t\t'show_ui' => false,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'coordinator' ),\n\t);\n\nregister_taxonomy( 'coordinators', array( 'cmecourse' ), $args );\n//Course Directors\n$labels = array(\n\t\t'name' => _x( 'Course Directors', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Course Director', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Search Course Directors' ),\n\t\t'all_items' => __( 'All Course Directors' )\n\t);\n\n\t$args = array(\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels,\n\t\t'show_ui' => false,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'course-director' ),\n\t);\nregister_taxonomy( 'course-director', array( 'cmecourse' ), $args );\n//Departments\n$labels = array(\n\t\t'name' => _x( 'Department', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Departments', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Search Departments' ),\n\t\t'all_items' => __( 'All Departments' )\n\t);\n\n\t$args = array(\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'department' ),\n\t);\n\nregister_taxonomy( 'department', array( 'cmecourse' ), $args );\n//Divisions\n$labels = array(\n\t\t'name' => _x( 'Division', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Divisions', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Search Divisions' ),\n\t\t'all_items' => __( 'All Divisions' )\n\t);\n\n\t$args = array(\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels,\n\t\t'show_ui' => false,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'division' ),\n\t);\n\nregister_taxonomy( 'division', array( 'cmecourse' ), $args );\n//Course Types -- Editable in WordPress\n$labels = array(\n\t\t'name' => _x( 'Course Type', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Course Types', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Search Course Types' ),\n\t\t'all_items' => __( 'All Course Types' )\n\t);\n\n\t$args = array(\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'course-type' ),\n\t);\n\nregister_taxonomy( 'course-type', array( 'cmecourse' ), $args );\n\n}", "function sedoo_docmanager_taxonomies()\n {\n \n $labels_type = array(\n 'name' => 'Types de document',\n 'singular_name' => 'Type',\n 'all_items' => 'Toutes les types de document',\n 'edit_item' => 'Éditer le type de document',\n 'view_item' => 'Voir le type de document',\n 'update_item' => 'Mettre à jour le type de document',\n 'add_new_item' => 'Ajouter un type de document',\n 'new_item_name' => 'Nouveau type de document',\n 'search_items' => 'Rechercher parmi les types de document',\n 'popular_items' => 'Types de document les plus utilisées',\n );\n \n $args_type = array (\n 'label' => 'Type de document',\n 'labels' => $labels_type,\n 'hierarchical' => true,\n // 'show_admin_column' => false,\n // 'show_in_nav_menus' => false,\n // 'show_tagcloud' => false,\n 'show_ui' => true,\n 'show_in_rest' => true\n );\n\n register_taxonomy('sedoo-type-document', array('sedoo-document'), $args_type);\n\n register_taxonomy_for_object_type( 'sedoo-type-document', 'document' );\n }", "public static function createTaxonomies() {\n // Add new taxonomy, make it hierarchical (like categories)\n $labels = array(\n 'name' => _x( 'Card Categories', 'taxonomy general name', 'textdomain' ),\n 'singular_name' => _x( 'Card Category', 'taxonomy singular name', 'textdomain' ),\n 'search_items' => __( 'Search Card Categories', 'textdomain' ),\n 'all_items' => __( 'All Card Categories', 'textdomain' ),\n 'parent_item' => __( 'Parent Card Category', 'textdomain' ),\n 'parent_item_colon' => __( 'Parent Card Category:', 'textdomain' ),\n 'edit_item' => __( 'Edit Card Category', 'textdomain' ),\n 'update_item' => __( 'Update Card Category', 'textdomain' ),\n 'add_new_item' => __( 'Add New Card Category', 'textdomain' ),\n 'new_item_name' => __( 'New Card Category Name', 'textdomain' ),\n 'menu_name' => __( 'Card Category', 'textdomain' ),\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'card_category' ),\n 'capabilities' => array(\n 'manage_terms' => 'edit_travelcards',\n 'edit_terms' => 'edit_travelcards',\n 'delete_terms' => 'edit_travelcards',\n 'assign_terms' => 'edit_travelcards'\n )\n );\n\n register_taxonomy( 'card_category', array( 'travelcard' ), $args );\n\n // Add 'card tags' taxonomy\n $labels = array(\n 'name' => _x( 'Card Tags', 'taxonomy general name', 'textdomain' ),\n 'singular_name' => _x( 'Card Tag', 'taxonomy singular name', 'textdomain' ),\n 'search_items' => __( 'Search Card Tags', 'textdomain' ),\n 'popular_items' => __( 'Popular Card Tags', 'textdomain' ),\n 'all_items' => __( 'All Card Tags', 'textdomain' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Card Tag', 'textdomain' ),\n 'update_item' => __( 'Update Card Tag', 'textdomain' ),\n 'add_new_item' => __( 'Add New Card Tag', 'textdomain' ),\n 'new_item_name' => __( 'New Card Tag Name', 'textdomain' ),\n 'separate_items_with_commas' => __( 'Separate card tags with commas', 'textdomain' ),\n 'add_or_remove_items' => __( 'Add or remove card tags', 'textdomain' ),\n 'choose_from_most_used' => __( 'Choose from the most used card tags', 'textdomain' ),\n 'not_found' => __( 'No card tags found.', 'textdomain' ),\n 'menu_name' => __( 'Card Tags', 'textdomain' ),\n );\n\n $args = array(\n 'hierarchical' => false,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'card_tag' ),\n 'capabilities' => array(\n 'manage_terms' => 'edit_travelcards',\n 'edit_terms' => 'edit_travelcards',\n 'delete_terms' => 'edit_travelcards',\n 'assign_terms' => 'edit_travelcards'\n )\n );\n\n register_taxonomy( 'card_tag', 'travelcard', $args );\n }", "function custom_taxonomies() {\n }", "public function register_taxonomies() {\n\n\t}", "public function setTaxonomies() {\n // ## TAXONOMIES ##\n $args = array(\n // ## Fields ##\n array(\n 'taxonomy' => self::TAX_FIELDS,\n 'object_type' => array(self::POST_TYPE_BADGES),\n 'args' => array(\n 'labels' => array(\n 'name' => _x('Fields of education', 'taxonomy general name'),\n 'singular_name' => _x('Field of education', 'taxonomy singular name'),\n 'search_items' => __('Search Fields of education'),\n 'all_items' => __('All Fields of education'),\n 'parent_item' => __('Parent Field'),\n 'parent_item_colon' => __('Parent Field:'),\n 'edit_item' => __('Edit Field'),\n 'update_item' => __('Update Field'),\n 'add_new_item' => __('Add New Field'),\n 'new_item_name' => __('New Field Name'),\n 'menu_name' => __('Field of Education'),\n ),\n 'rewrite' => array('slug' => self::TAX_FIELDS),\n 'hierarchical' => true,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true\n )\n ),\n // ## Levels ##\n array(\n 'taxonomy' => self::TAX_LEVELS,\n 'object_type' => self::POST_TYPE_BADGES,\n 'args' => array(\n 'labels' => array(\n 'name' => _x('Levels', 'taxonomy general name'),\n 'singular_name' => _x('Levels', 'taxonomy singular name'),\n 'search_items' => __('Search Levels'),\n 'all_items' => __('All Levels'),\n 'parent_item' => __('Parent Level'),\n 'parent_item_colon' => __('Parent Level:'),\n 'edit_item' => __('Edit Level'),\n 'update_item' => __('Update Level'),\n 'add_new_item' => __('Add New Level'),\n 'new_item_name' => __('New Level Name'),\n 'menu_name' => __('Level of Education'),\n ),\n 'rewrite' => array('slug' => self::TAX_LEVELS),\n 'hierarchical' => false,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true\n )\n ),\n );\n\n $this->settings->loadTaxonomies($args);\n }", "function ww_taxonomies_addon($addons){\n $addons['Taxonomies'] = new WW_Taxonomies();\n return $addons;\n}", "function add_wp_taxonomy_to_recipe() {\n\t// Replace post_type with actual CPT slug.\n\tregister_taxonomy_for_object_type( 'category', 'recipe' );\n\tregister_taxonomy_for_object_type( 'post_tag', 'recipe' );\n}", "function create_ht_taxonomies() {\n\n $labels = array(\n 'name' => _x( 'Habilidad tecnica', 'taxonomy general name' ),\n 'singular_name' => _x( 'Habilidad tecnica', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Genres' ),\n 'all_items' => __( 'Habilidades tecnicas' ),\n 'parent_item' => __( 'Parent Genre' ),\n 'parent_item_colon' => __( 'Parent Genre:' ),\n 'edit_item' => __( 'Editar habilidad' ), \n 'update_item' => __( 'Actualizar habilidad' ),\n 'add_new_item' => __( 'Nueva habilidad tecnica' ),\n 'new_item_name' => __( 'Nueva habilidad tecnica' ),\n 'menu_name' => __( 'Habilidades tecnicas' ),\n ); \t\n\n register_taxonomy('habilidad-tecnica',array('ofertas'), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'habilidad-tecnica' ),\n ));\n\n}", "function ccac_2020_new_init() {\n register_taxonomy_for_object_type( 'category', 'attachment' );\n register_taxonomy_for_object_type( 'post_tag', 'attachment' );\n\n /*\n * Register custom post types. You can also move this code to a plugin.\n */\n /* Pinegrow generated Custom Post Types Begin */\n\n /* Pinegrow generated Custom Post Types End */\n \n /*\n * Register custom taxonomies. You can also move this code to a plugin.\n */\n /* Pinegrow generated Taxonomies Begin */\n\n /* Pinegrow generated Taxonomies End */\n\n}", "function create_portfolio_taxonomies () {\r\n $labels = [\r\n 'name' => _x('Tecnologías', 'taxonomy general name'),\r\n 'singular_name' => _x('Tecnología', 'taxonomy singular name'),\r\n 'search_items' => __('Busca Tecnologías'),\r\n 'popular_items' => __('Tecnologías más usadas'),\r\n 'all_items' => __('Todas las tecnologías'),\r\n 'parent_item' => null,\r\n 'parent_item_colon' => null,\r\n 'edit_item' => __('Editar tecnología'),\r\n 'update_item' => __('Actualizar tecnología'),\r\n 'add_new_item' => __('Añade una nueva tecnología'),\r\n 'new_item_name' => __('Nombre de nueva tecnología'),\r\n 'separate_items_with_commas' => __('Tecnologías. Separadas por comas.'),\r\n 'add_or_remove_items' => __('Añadir o quitar tecnologías'),\r\n 'choose_from_most_used' => __('Elige de las tecnologías más usadas.'),\r\n 'not_found' => __('No se han encontrado tecnologías.'),\r\n 'menu_name' => __('Tecnologías'),\r\n ];\r\n $args = [\r\n 'hierarchical' => FALSE,\r\n 'labels' => $labels,\r\n 'show_ui' => TRUE,\r\n 'show_admin_column' => TRUE,\r\n 'update_count_callback' => '_update_post_term_count',\r\n 'query_var' => TRUE,\r\n 'rewrite' => array( 'slug' => 'tecnologia' ),\r\n ];\r\n \r\n register_taxonomy( 'tecnologia', 'trabajo', $args );\r\n}", "function ms_add_custom_taxonomies() {\n // Add new \"Placement Tag\" taxonomy to Articles\n register_taxonomy('placement_tag', 'article', array(\n 'hierarchical' => false,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'placement-tags' ),\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Placement Tags', 'taxonomy general name' ),\n 'singular_name' => _x( 'Placement Tag', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Placement Tags' ),\n 'popular_items' => __( 'Popular Placement Tags' ),\n 'all_items' => __( 'All Placement Tags' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Placement Tag' ),\n 'update_item' => __( 'Update Placement Tag' ),\n 'add_new_item' => __( 'Add New Placement Tag' ),\n 'new_item_name' => __( 'New Origin Tag Name' ),\n 'add_or_remove_items' => __( 'Add or remove placement tags' ),\n 'separate_items_with_commas' => __( 'Separate placement tags with commas' ),\n 'choose_from_most_used' => __( 'Choose from the most used placement tags' ),\n 'not_found' => __( 'No placement tags found.' ),\n 'menu_name' => __( 'Placement Tags' ),\n ),\n ));\n\n // Add new \"Location Tag\" taxonomy to Articles\n register_taxonomy('location_tag', 'article', array(\n 'hierarchical' => false,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'location-tags' ),\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Location Tags', 'taxonomy general name' ),\n 'singular_name' => _x( 'Location Tag', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Location Tags' ),\n 'popular_items' => __( 'Popular Location Tags' ),\n 'all_items' => __( 'All Location Tags' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Location Tag' ),\n 'update_item' => __( 'Update Location Tag' ),\n 'add_new_item' => __( 'Add New Location Tag' ),\n 'new_item_name' => __( 'New Location Tag Name' ),\n 'add_or_remove_items' => __( 'Add or remove location tags' ),\n 'separate_items_with_commas' => __( 'Separate location tags with commas' ),\n 'choose_from_most_used' => __( 'Choose from the most used location tags' ),\n 'not_found' => __( 'No location tags found.' ),\n 'menu_name' => __( 'Location Tags' ),\n ),\n ));\n\n // Add new \"Lifestyle Tag\" taxonomy to Articles\n register_taxonomy('lifestyle_tag', 'article', array(\n 'hierarchical' => false,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'lifestyle-tag' ),\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Lifestyle Tags', 'taxonomy general name' ),\n 'singular_name' => _x( 'Lifestyle Tag', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Lifestyle Tags' ),\n 'popular_items' => __( 'Popular Lifestyle Tags' ),\n 'all_items' => __( 'All Lifestyle Tags' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Lifestyle Tag' ),\n 'update_item' => __( 'Update Lifestyle Tag' ),\n 'add_new_item' => __( 'Add New Lifestyle Tag' ),\n 'new_item_name' => __( 'New Lifestyle Name' ),\n 'add_or_remove_items' => __( 'Add or remove lifestyle tags' ),\n 'separate_items_with_commas' => __( 'Separate lifestyle tags with commas' ),\n 'choose_from_most_used' => __( 'Choose from the most used lifestyle tags' ),\n 'not_found' => __( 'No lifestyle tags found.' ),\n 'menu_name' => __( 'Lifestyle Tags' ),\n ),\n ));\n\n // Add new \"Featured Tag\" taxonomy to Articles\n register_taxonomy('featured_tag', 'article', array(\n 'hierarchical' => false,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'featured-tag' ),\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Featured Tags', 'taxonomy general name' ),\n 'singular_name' => _x( 'Featured Tag', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Featured Tags' ),\n 'popular_items' => __( 'Popular Featured Tags' ),\n 'all_items' => __( 'All Featured Tags' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Featured Tag' ),\n 'update_item' => __( 'Update Featured Tag' ),\n 'add_new_item' => __( 'Add New Featured Tag' ),\n 'new_item_name' => __( 'New Featured Tag Name' ),\n 'add_or_remove_items' => __( 'Add or remove featured tags' ),\n 'separate_items_with_commas' => __( 'Separate featured tags with commas' ),\n 'choose_from_most_used' => __( 'Choose from the most used featured tags' ),\n 'not_found' => __( 'No locations found.' ),\n 'menu_name' => __( 'Featured Tags' ),\n ),\n ));\n // Add new \"Origin Tag\" taxonomy to Articles\n register_taxonomy('origin_tag', 'article', array(\n 'hierarchical' => false,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'origin-tags' ),\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Origin Tags', 'taxonomy general name' ),\n 'singular_name' => _x( 'Origin Tag', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Origin Tags' ),\n 'popular_items' => __( 'Popular Origin Tags' ),\n 'all_items' => __( 'All Origin Tags' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Origin Tag' ),\n 'update_item' => __( 'Update Origin Tag' ),\n 'add_new_item' => __( 'Add New Origin Tag' ),\n 'new_item_name' => __( 'New Origin Tag Name' ),\n 'add_or_remove_items' => __( 'Add or remove origin tags' ),\n 'separate_items_with_commas' => __( 'Separate origin tags with commas' ),\n 'choose_from_most_used' => __( 'Choose from the most used origin tags' ),\n 'not_found' => __( 'No origin tags found.' ),\n 'menu_name' => __( 'Origin Tags' ),\n ),\n ));\n}", "function ahr_add_tax_meta_box() {\r\n \r\n $taxonomies = get_taxonomies();\r\n $slugs = array();\r\n \r\n // Add only taxonomies that have pages attached to them\r\n foreach ( $taxonomies as $tax ) {\r\n if ( 'nav_menu' !== $tax && 'post_format' !== $tax && 'link_category' !== $tax && 'wpforms_log_type' !== $tax ) {\r\n array_push( $slugs, $tax );\r\n }\r\n }\r\n \r\n foreach ( $slugs as $slug ) {\r\n add_action( \"{$slug}_edit_form_fields\", 'ahr_tax_edit_form' );\r\n add_action( \"edited_{$slug}\", 'ahr_tax_edited_form' );\r\n \r\n add_action( \"{$slug}_add_form_fields\", 'ahr_tax_add_form' );\r\n add_action( \"create_{$slug}\", 'ahr_tax_edited_form' );\r\n }\r\n \r\n}", "function create_author_taxonomies() {\n\n\n\t$labels = array(\n\t\t'name' => _x( 'Autore', 'taxonomy general name', 'italiattivo' ),\n\n\t);\n\n\n\t$args = array(\n\t\t'hierarchical' => false,\n\t\t'labels' => $labels,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\n\t);\n\n\tregister_taxonomy( 'autore', array('frasi', 'quadri', 'esercizi'), $args );\n\n}", "function add_interactivity_type() {\n\t$types = array('post','page','attachment','nav_menu_item', 'learning_resource');\n register_taxonomy('asn_interactivity_type', $types, array(\n 'hierarchical' => false,\n 'labels' => array(\n 'name' => _x( 'Interactivity Type', 'taxonomy general name' ),\n 'singular_name' => _x( 'Interactivity Type', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Interactivity Types' ),\n 'all_items' => __( 'All Interactivity Types' ),\n 'parent_item' => __( 'Parent Interactivity Type' ),\n 'parent_item_colon' => __( 'Parent Interactivity Type:' ),\n 'edit_item' => __( 'Edit Interactivity Type' ),\n 'update_item' => __( 'Update Interactivity Type' ),\n 'add_new_item' => __( 'Add New Interactivity Type' ),\n 'new_item_name' => __( 'New Interactivity Type Name' ),\n 'menu_name' => __( 'Interactivity Type' ),\n ),\n //Slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'interactivity_type', \n 'with_front' => false,\n 'hierarchical' => false \n ),\n ));\n}", "function mnk_taxonomies_prodotti() {\n\n\t$labels = array(\n\t\t'name'\t\t\t\t\t=> _x( 'Cat Prodotti', 'Taxonomy plural name', 'plugin-cpt' ),\n\t\t'singular_name'\t\t\t=> _x( 'Prodotto', 'Taxonomy singular name', 'plugin-cpt' ),\n\t\t'search_items'\t\t\t=> __( 'Cerca Prodotto', 'plugin-cpt' ),\n\t\t'popular_items'\t\t\t=> __( 'Prodotto più usata', 'plugin-cpt' ),\n\t\t'all_items'\t\t\t\t=> __( 'Tutte le categorie', 'plugin-cpt' ),\n\t\t'parent_item'\t\t\t=> __( 'Prodotto', 'plugin-cpt' ),\n\t\t'parent_item_colon'\t\t=> __( 'Prodotto', 'plugin-cpt' ),\n\t\t'edit_item'\t\t\t\t=> __( 'Modifica Prodotto', 'plugin-cpt' ),\n\t\t'update_item'\t\t\t=> __( 'Aggiorna Prodotto', 'plugin-cpt' ),\n\t\t'add_new_item'\t\t\t=> __( 'Aggiungi Nuova Prodotto', 'plugin-cpt' ),\n\t\t'new_item_name'\t\t\t=> __( 'Nuova Prodotto', 'plugin-cpt' ),\n\t\t'add_or_remove_items'\t=> __( 'Aggiungi o Rimuovi Prodotto', 'plugin-cpt' ),\n\t\t'choose_from_most_used'\t=> __( 'Scegli tra le Categorie più usate', 'plugin-cpt' ),\n\t\t'menu_name'\t\t\t\t=> __( 'Cat Prodotti', 'plugin-cpt' ),\n\t);\n\n\t$args = array(\n\t\t'labels' => $labels,\n\t\t'public' => true,\n\t\t'show_admin_column' => true,\n\t\t'hierarchical' => true,\n\t\t'query_var' => true,\n\t);\n\n\tregister_taxonomy( 'cat_prodotti', array( 'realizzazioni' ), $args );\n}", "function create_taxonomies() {\r\n\t\t$labels = array(\r\n\t\t\t'name' => 'Ad Categories',\r\n\t\t\t'singular_name' => 'Ad Category',\r\n\t\t\t'search_items' => 'Search Ad Categories',\r\n\t\t\t'all_items' => 'All Ad Categories',\r\n\t\t\t'parent_item' => 'Parent Ad Category',\r\n\t\t\t'parent_item_colon' => 'Parent Ad Category:',\r\n\t\t\t'edit_item' => 'Edit Ad Category',\r\n\t\t\t'update_item' => 'Update Ad Category',\r\n\t\t\t'add_new_item' => 'Add New Ad Category',\r\n\t\t\t'new_item_name' => 'New Ad Category Name',\r\n\t\t\t'menu_name' => 'Ad Categories',\r\n\t\t\t);\r\n\r\n\t\t$args = array(\r\n\t\t\t'hierarchical' => true,\r\n\t\t\t'labels' => $labels,\r\n\t\t\t'show_ui' => true,\r\n\t\t\t'show_admin_column' => true,\r\n\t\t\t'query_var' => true,\r\n\t\t\t'rewrite' => false,\r\n\t\t\t);\r\n\r\n\t\tregister_taxonomy('mar_adverts_cats',array('mar_adverts'),$args);\r\n\r\n\t\t// Add new taxonomy, make it non-hierarchical (like tags)\r\n\t\t$labels = array(\r\n\t\t\t'name' => 'Ad Tags',\r\n\t\t\t'singular_name' => 'Ad Tag',\r\n\t\t\t'search_items' => 'Search Ad Tags',\r\n\t\t\t'all_items' => 'All Ad Tags',\r\n\t\t\t'parent_item' => 'Parent Ad Tag',\r\n\t\t\t'parent_item_colon' => 'Parent Ad Tag:',\r\n\t\t\t'edit_item' => 'Edit Ad Tag',\r\n\t\t\t'update_item' => 'Update Ad Tag',\r\n\t\t\t'add_new_item' => 'Add New Ad Tag',\r\n\t\t\t'new_item_name' => 'New Ad Tag Name',\r\n\t\t\t'menu_name' => 'Ad Tags',\r\n\t\t\t);\r\n\r\n\t\t$args = array(\r\n\t\t\t'hierarchical' => false,\r\n\t\t\t'labels' => $labels,\r\n\t\t\t'show_ui' => true,\r\n\t\t\t'show_admin_column' => true,\r\n\t\t\t'query_var' => true,\r\n\t\t\t'rewrite' => false,\r\n\t\t\t);\r\n\r\n\t\tregister_taxonomy('mar_adverts_tags',array('mar_adverts'),$args);\r\n\t}", "function add_educational_audience() {\n\t$types = array('post','page','attachment','nav_menu_item', 'learning_resource');\n register_taxonomy('asn_educational_audience', $types, array(\n 'hierarchical' => false,\n 'labels' => array(\n 'name' => _x( 'Educational Audience', 'taxonomy general name' ),\n 'singular_name' => _x( 'Educational Audience', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Educational Audiences' ),\n 'all_items' => __( 'All Educational Audiences' ),\n 'parent_item' => __( 'Parent Educational Audience' ),\n 'parent_item_colon' => __( 'Parent Educational Audience:' ),\n 'edit_item' => __( 'Edit Educational Audience' ),\n 'update_item' => __( 'Update Educational Audience' ),\n 'add_new_item' => __( 'Add New Educational Audience' ),\n 'new_item_name' => __( 'New Educational Audience Name' ),\n 'menu_name' => __( 'Educational Audience' ),\n ),\n //Slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'educational_audience', \n 'with_front' => false,\n 'hierarchical' => false \n ),\n ));\n}", "function news_add_taxonomy_categories() {\n global $typenow;\n\n // An array of all the taxonomyies you want to display. Use the taxonomy name or slug\n $taxonomies = array( 'news_category' );\n\n // must set this to the post type you want the filter(s) displayed on\n if ( $typenow == 'news' ) {\n\n foreach ( $taxonomies as $tax_slug ) {\n $current_tax_slug = isset( $_GET[$tax_slug] ) ? $_GET[$tax_slug] : false;\n $tax_obj = get_taxonomy( $tax_slug );\n $tax_name = $tax_obj->labels->name;\n $terms = get_terms($tax_slug);\n if ( count( $terms ) > 0) {\n echo \"<select name='$tax_slug' id='$tax_slug' class='postform'>\";\n echo \"<option value=''>$tax_name</option>\";\n foreach ( $terms as $term ) {\n echo '<option value=' . $term->slug, $current_tax_slug == $term->slug ? ' selected=\"selected\"' : '','>' . $term->name .' (' . $term->count .')</option>';\n }\n echo \"</select>\";\n }\n }\n }\n}", "function create_taxonomies($tax,$val) {\n \n\n // register_taxonomy( 'genre', $taxonomies, $args );\n\n // Add new taxonomy, NOT hierarchical (like tags)\n $labels = array(\n 'name' => _x( $tax, 'taxonomy general name', 'textdomain' ),\n 'singular_name' => _x( $tax, 'taxonomy singular name', 'textdomain' ),\n 'search_items' => __( 'Search '.$tax, 'textdomain' ),\n 'popular_items' => __( 'Popular '.$tax, 'textdomain' ),\n 'all_items' => __( 'All '.$tax, 'textdomain' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit '.$tax, 'textdomain' ),\n 'update_item' => __( 'Update '.$tax, 'textdomain' ),\n 'add_new_item' => __( 'Add New '.$tax, 'textdomain' ),\n 'new_item_name' => __( 'New '.$tax.' Name', 'textdomain' ),\n 'separate_items_with_commas' => __( 'Separate '.$tax.' with commas', 'textdomain' ),\n 'add_or_remove_items' => __( 'Add or remove '.$tax, 'textdomain' ),\n 'choose_from_most_used' => __( 'Choose from the most used '.$tax, 'textdomain' ),\n 'not_found' => __( 'No '.$tax.' found', 'textdomain' ),\n 'menu_name' => __( $tax, 'textdomain' ),\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => $tax ),\n );\n\n register_taxonomy( $tax, $val, $args );\n}", "function testimonials_register_post_type() {\n\n $labels = [\n 'name' => __('Testimonials'),\n 'singular_name' => __('Testimonial'),\n 'add_new' => __('Add new', 'Testimonials'),\n 'add_new_item' => __('Add new Testimonial'),\n 'edit_item' => __('Edit Testimonial'),\n 'new_item' => __('New Testimonial'),\n 'view_item' => __('View Testimonial'),\n 'search_item' => __('Search Testimonials'),\n 'not_found' => __('No Testimonial found'),\n 'not_found_in_trash' => __('No Testimonial found in trash'),\n 'parent_item_colon' => ''\n ];\n\n register_post_type(TESTIMONIAL_TYPE, [\n 'labels' => $labels,\n 'public' => true,\n 'exclude_from_search' => true,\n 'has_archive' => true,\n 'hierarchical' => false,\n 'supports' => ['title', 'editor', 'custom-fields']\n ]);\n\n register_taxonomy_for_object_type(CRAFT_TAX_NAME, TESTIMONIAL_TYPE);\n}", "public function register_taxonomies() {\n require_once('includes/taxonomies.php');\n }", "function create_new_topic_index() {\n\t// Add new taxonomy\n $types = array('post','page','attachment','nav_menu_item', 'learning_resource');\n register_taxonomy('asn_topic_index', $types, array(\n 'hierarchical' => true,\n 'labels' => array(\n 'name' => _x( 'ASN Topic Index', 'taxonomy general name' ),\n 'singular_name' => _x( 'Topic', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Topics' ),\n 'all_items' => __( 'All Topics' ),\n 'parent_item' => __( 'Parent Topic' ),\n 'parent_item_colon' => __( 'Parent Topic:' ),\n 'edit_item' => __( 'Edit Topic' ),\n 'update_item' => __( 'Update Topic' ),\n 'add_new_item' => __( 'Add New Topic' ),\n 'new_item_name' => __( 'New Topic Name' ),\n 'menu_name' => __( 'Topic Index' ),\n ),\n //Slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'topic_index', \n 'with_front' => false,\n 'hierarchical' => true \n ),\n ));\n}", "public function register_taxonomies() {\n\n\t\t$options = $this->options;\n\t\t$this->remove_mb = array();\n\n\t\tforeach ( $options as $option ) {\n\n\t\t\tif ( 'taxonomy' == $option['args']['field_type'] ) {\n\n\t\t\t\t$name = ! empty( $option['args']['label'] ) ? sanitize_text_field( $option['args']['label'] ) : ucwords( str_replace( array( '_', '-' ), ' ', $option['name'] ) );\n\t\t\t\t$plural = ! empty( $option['args']['label_plural'] ) ? sanitize_text_field( $option['args']['label_plural'] ) : $name . 's';\n\t\t\t\t$column = true === $option['args']['taxo_std'] ? true : false;\n\t\t\t\t$hierarchical = $option['args']['taxo_hierarchical'];\n\n\t\t\t\t$labels = array(\n\t\t\t\t\t'name' => $plural,\n\t\t\t\t\t'singular_name' => $name,\n\t\t\t\t\t'search_items' => sprintf( __( 'Search %s', TEXTDOMAIN ), $plural ),\n\t\t\t\t\t'all_items' => sprintf( __( 'All %s', TEXTDOMAIN ), $plural ),\n\t\t\t\t\t'parent_item' => sprintf( __( 'Parent %s', TEXTDOMAIN ), $name ),\n\t\t\t\t\t'parent_item_colon' => sprintf( _x( 'Parent %s:', 'Parent term in a taxonomy where %s is dynamically replaced by the taxonomy (eg. \"book\")', TEXTDOMAIN ), $name ),\n\t\t\t\t\t'edit_item' => sprintf( __( 'Edit %s', TEXTDOMAIN ), $name ),\n\t\t\t\t\t'update_item' => sprintf( __( 'Update %s', TEXTDOMAIN ), $name ),\n\t\t\t\t\t'add_new_item' => sprintf( __( 'Add New %s', TEXTDOMAIN ), $name ),\n\t\t\t\t\t'new_item_name' => sprintf( _x( 'New %s Name', 'A new taxonomy term name where %s is dynamically replaced by the taxonomy (eg. \"book\")', TEXTDOMAIN ), $name ),\n\t\t\t\t\t'menu_name' => $plural,\n\t\t\t\t);\n\n\t\t\t\t$args = array(\n\t\t\t\t\t'hierarchical' => $hierarchical,\n\t\t\t\t\t'labels' => $labels,\n\t\t\t\t\t'show_ui' => true,\n\t\t\t\t\t'show_admin_column' => $column,\n\t\t\t\t\t'query_var' => true,\n\t\t\t\t\t'rewrite' => array( 'slug' => $option['name'] ),\n\t\t\t\t\t'capabilities' => array(\n\t\t\t\t\t\t'manage_terms' => 'create_ticket',\n\t\t\t\t\t\t'edit_terms' => 'settings_tickets',\n\t\t\t\t\t\t'delete_terms' => 'settings_tickets',\n\t\t\t\t\t\t'assign_terms' => 'create_ticket'\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\tif ( false !== $option['args']['update_count_callback'] && function_exists( $option['args']['update_count_callback'] ) ) {\n\t\t\t\t\t$args['update_count_callback'] = $option['args']['update_count_callback'];\n\t\t\t\t}\n\n\t\t\t\tregister_taxonomy( $option['name'], array( 'ticket' ), $args );\n\n\t\t\t\tif ( false === $option['args']['taxo_std'] ) {\n\t\t\t\t\tarray_push( $this->remove_mb, $option['name'] );\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t/* Remove metaboxes that won't be used */\n\t\tif ( ! empty( $this->remove_mb ) ) {\n\t\t\tadd_action( 'admin_menu', array( $this, 'remove_taxonomy_metabox' ) );\n\t\t}\n\n\t}", "function wpdocs_create_book_taxonomies() {\n // Add new taxonomy, make it hierarchical (like categories)\n $labels = array(\n 'name' => _x( 'Genres', 'taxonomy general name', 'textdomain' ),\n 'singular_name' => _x( 'Genre', 'taxonomy singular name', 'textdomain' ),\n 'search_items' => __( 'Search Genres', 'textdomain' ),\n 'all_items' => __( 'All Genres', 'textdomain' ),\n 'parent_item' => __( 'Parent Genre', 'textdomain' ),\n 'parent_item_colon' => __( 'Parent Genre:', 'textdomain' ),\n 'edit_item' => __( 'Edit Genre', 'textdomain' ),\n 'update_item' => __( 'Update Genre', 'textdomain' ),\n 'add_new_item' => __( 'Add New Genre', 'textdomain' ),\n 'new_item_name' => __( 'New Genre Name', 'textdomain' ),\n 'menu_name' => __( 'Genre', 'textdomain' ),\n );\n \n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'genre' ),\n );\n \n register_taxonomy( 'genre', array( 'book' ), $args );\n \n unset( $args );\n unset( $labels );\n \n // Add new taxonomy, NOT hierarchical (like tags)\n $labels = array(\n 'name' => _x( 'Writers', 'taxonomy general name', 'textdomain' ),\n 'singular_name' => _x( 'Writer', 'taxonomy singular name', 'textdomain' ),\n 'search_items' => __( 'Search Writers', 'textdomain' ),\n 'popular_items' => __( 'Popular Writers', 'textdomain' ),\n 'all_items' => __( 'All Writers', 'textdomain' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Writer', 'textdomain' ),\n 'update_item' => __( 'Update Writer', 'textdomain' ),\n 'add_new_item' => __( 'Add New Writer', 'textdomain' ),\n 'new_item_name' => __( 'New Writer Name', 'textdomain' ),\n 'separate_items_with_commas' => __( 'Separate writers with commas', 'textdomain' ),\n 'add_or_remove_items' => __( 'Add or remove writers', 'textdomain' ),\n 'choose_from_most_used' => __( 'Choose from the most used writers', 'textdomain' ),\n 'not_found' => __( 'No writers found.', 'textdomain' ),\n 'menu_name' => __( 'Writers', 'textdomain' ),\n );\n \n $args = array(\n 'hierarchical' => false,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'writer' ),\n );\n \n register_taxonomy( 'writer', 'book', $args );\n}", "function create_my_taxonomies() {\n\t$labels_producto_productor = array(\n\t\t'name' => _x( 'Productores', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Productor', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Buscar productores' ),\n\t\t'all_items' => __( 'Todos los productores' ),\n\t\t'parent_item' => __( 'Productor Padre' ),\n\t\t'parent_item_colon' => __( 'Productor Padre:' ),\n\t\t'edit_item' => __( 'Editar productor' ),\n\t\t'update_item' => __( 'Actualizar productor' ),\n\t\t'add_new_item' => __( 'Agregar Nuevo productor' ),\n\t\t'new_item_name' => __( 'Nombre de Nuevo productor' ),\n\t\t'menu_name' => __( 'Productores' )\n\t);\n\n\t$args_producto_productor = array(\n\t\t'public' \t\t\t=> true,\n\t\t'hierarchical' => false,\n\t\t'labels' => $labels_producto_productor,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'capabilities'\t\t=> array(\n\t\t\t'manage_terms' => 'manage_productor',\n\t\t\t'edit_terms' => 'edit_productor',\n\t\t\t'delete_terms' => 'delete_productor',\n\t\t\t'assign_terms' => 'assign_productor'\n\t\t)\n\t);\n\n\t$labels_producto_marca = array(\n\t\t'name' => _x( 'Marcas', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Marca', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Buscar Marcas' ),\n\t\t'all_items' => __( 'Todos las Marcas' ),\n\t\t'parent_item' => __( 'Marca Padre' ),\n\t\t'parent_item_colon' => __( 'Marca Padre:' ),\n\t\t'edit_item' => __( 'Editar Marca' ),\n\t\t'update_item' => __( 'Actualizar Marca' ),\n\t\t'add_new_item' => __( 'Agregar Nueva Marca' ),\n\t\t'new_item_name' => __( 'Nombre de Nueva Marca' ),\n\t\t'menu_name' => __( 'Marcas' )\n\t);\n\n\t$args_producto_marca = array(\n\t\t'public' \t\t\t=> true,\n\t\t'hierarchical' => false,\n\t\t'labels' => $labels_producto_marca,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'capabilities'\t\t=> array(\n\t\t\t'manage_terms' => 'manage_marca',\n\t\t\t'edit_terms' => 'edit_marca',\n\t\t\t'delete_terms' => 'delete_marca',\n\t\t\t'assign_terms' => 'assign_marca'\n\t\t)\n\t);\n\n\t$labels_producto_lugar = array(\n\t\t'name' => _x( 'Lugares', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Lugar', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Buscar Lugares' ),\n\t\t'all_items' => __( 'Todos los Lugares' ),\n\t\t'parent_item' => __( 'Lugar Padre' ),\n\t\t'parent_item_colon' => __( 'Lugar Padre:' ),\n\t\t'edit_item' => __( 'Editar Lugar' ),\n\t\t'update_item' => __( 'Actualizar Lugar' ),\n\t\t'add_new_item' => __( 'Agregar Nuevo Lugar' ),\n\t\t'new_item_name' => __( 'Nombre de Nuevo Lugar' ),\n\t\t'menu_name' => __( 'Lugares' )\n\t);\n\n\t$args_producto_lugar = array(\n\t\t'public' \t\t\t=> true,\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels_producto_lugar,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'capabilities'\t\t=> array(\n\t\t\t'manage_terms' => 'manage_lugar',\n\t\t\t'edit_terms' => 'edit_lugar',\n\t\t\t'delete_terms' => 'delete_lugar',\n\t\t\t'assign_terms' => 'assign_lugar'\n\t\t)\n\t);\n\n\t$labels_producto_clasificacion = array(\n\t\t'name' => _x( 'Clasificaciones', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Clasificación', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Buscar Clasificaciones' ),\n\t\t'all_items' => __( 'Todos las Clasificaciones' ),\n\t\t'parent_item' => __( 'Clasificación Padre' ),\n\t\t'parent_item_colon' => __( 'Clasificación Padre:' ),\n\t\t'edit_item' => __( 'Editar Clasificación' ),\n\t\t'update_item' => __( 'Actualizar Clasificación' ),\n\t\t'add_new_item' => __( 'Agregar Nueva Clasificación' ),\n\t\t'new_item_name' => __( 'Nombre de Nueva Clasificación' ),\n\t\t'menu_name' => __( 'Clasificaciones' )\n\t);\n\n\t$args_producto_clasificacion = array(\n\t\t'public' \t\t\t=> true,\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels_producto_clasificacion,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'capabilities'\t\t=> array(\n\t\t\t'manage_terms' => 'manage_clasificacion',\n\t\t\t'edit_terms' => 'edit_clasificacion',\n\t\t\t'delete_terms' => 'delete_clasificacion',\n\t\t\t'assign_terms' => 'assign_clasificacion'\n\t\t)\n\t);\n\n\t$labels_banner_posicion = array(\n\t\t'name' => _x( 'Posiciones', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Posición', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Buscar Posiciones' ),\n\t\t'all_items' => __( 'Todas las Posiciones' ),\n\t\t'parent_item' => __( 'Posición Padre' ),\n\t\t'parent_item_colon' => __( 'Posición Padre:' ),\n\t\t'edit_item' => __( 'Editar posición' ),\n\t\t'update_item' => __( 'Actualizar posición' ),\n\t\t'add_new_item' => __( 'Agregar Nueva posición' ),\n\t\t'new_item_name' => __( 'Nombre de Nueva posición' ),\n\t\t'menu_name' => __( 'Posiciones' )\n\t);\n\n\t$args_banner_posicion = array(\n\t\t'public' \t\t\t=> true,\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels_banner_posicion,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'capabilities'\t\t=> array(\n\t\t\t'manage_terms' => 'manage_posicion',\n\t\t\t'edit_terms' => 'edit_posicion',\n\t\t\t'delete_terms' => 'delete_posicion',\n\t\t\t'assign_terms' => 'assign_posicion'\n\t\t)\n\t);\n\n\t$labels_documentos_tipos = array(\n\t\t'name' => _x( 'Tipos', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Tipo', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Buscar Tipos' ),\n\t\t'all_items' => __( 'Todos los Tipos' ),\n\t\t'parent_item' => __( 'Tipo Padre' ),\n\t\t'parent_item_colon' => __( 'Tipo Padre:' ),\n\t\t'edit_item' => __( 'Editar Tipo' ),\n\t\t'update_item' => __( 'Actualizar Tipo' ),\n\t\t'add_new_item' => __( 'Agregar Nuevo Tipo' ),\n\t\t'new_item_name' => __( 'Nombre de Nuevo Tipo' ),\n\t\t'menu_name' => __( 'Tipos' )\n\t);\n\n\t$args_documentos_tipos = array(\n\t\t'public' \t\t\t=> true,\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels_documentos_tipos,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'capabilities'\t\t=> array(\n\t\t\t'manage_terms' => 'manage_tipo',\n\t\t\t'edit_terms' => 'edit_tipo',\n\t\t\t'delete_terms' => 'delete_tipo',\n\t\t\t'assign_terms' => 'assign_tipo'\n\t\t)\n\t);\n\n\t$labels_convocatorias_categorias = array(\n\t\t'name' => _x( 'Categorías', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Categoría', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Buscar Categorías' ),\n\t\t'all_items' => __( 'Todas las Categorías' ),\n\t\t'parent_item' => __( 'Categoría Padre' ),\n\t\t'parent_item_colon' => __( 'Categoría Padre:' ),\n\t\t'edit_item' => __( 'Editar Categoría' ),\n\t\t'update_item' => __( 'Actualizar Categoría' ),\n\t\t'add_new_item' => __( 'Agregar Nueva Categoría' ),\n\t\t'new_item_name' => __( 'Nombre de Nueva Categoría' ),\n\t\t'menu_name' => __( 'Categorías' )\n\t);\n\n\t$args_convocatorias_categorias = array(\n\t\t'public' \t\t\t=> true,\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels_convocatorias_categorias,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'capabilities'\t\t=> array(\n\t\t\t'manage_terms' => 'manage_cat-convocatorias',\n\t\t\t'edit_terms' => 'edit_cat-convocatorias',\n\t\t\t'delete_terms' => 'delete_cat-convocatorias',\n\t\t\t'assign_terms' => 'assign_cat-convocatorias'\n\t\t)\n\t);\n\n\t$labels_convocatorias_estados = array(\n\t\t'name' => _x( 'Estados', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Estado', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Buscar Estados' ),\n\t\t'all_items' => __( 'Todas los Estados' ),\n\t\t'parent_item' => __( 'Estado Padre' ),\n\t\t'parent_item_colon' => __( 'Estado Padre:' ),\n\t\t'edit_item' => __( 'Editar Estado' ),\n\t\t'update_item' => __( 'Actualizar Estado' ),\n\t\t'add_new_item' => __( 'Agregar Nuevo Estado' ),\n\t\t'new_item_name' => __( 'Nombre de Nuevo Estado' ),\n\t\t'menu_name' => __( 'Estados' )\n\t);\n\n\t$args_convocatorias_estados = array(\n\t\t'public' \t\t\t=> true,\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels_convocatorias_estados,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'capabilities'\t\t=> array(\n\t\t\t'manage_terms' => 'manage_est-convocatorias',\n\t\t\t'edit_terms' => 'edit_est-convocatorias',\n\t\t\t'delete_terms' => 'delete_est-convocatorias',\n\t\t\t'assign_terms' => 'assign_est-convocatorias'\n\t\t)\n\t);\n\n\t$labels_servicios_condiciones = array(\n\t\t'name' => _x( 'Condiciones', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Condición', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Buscar Condiciones' ),\n\t\t'all_items' => __( 'Todas las Condiciones' ),\n\t\t'parent_item' => __( 'Condición Padre' ),\n\t\t'parent_item_colon' => __( 'Condición Padre:' ),\n\t\t'edit_item' => __( 'Editar Condición' ),\n\t\t'update_item' => __( 'Actualizar Condición' ),\n\t\t'add_new_item' => __( 'Agregar Nueva Condición' ),\n\t\t'new_item_name' => __( 'Nombre de Nueva Condición' ),\n\t\t'menu_name' => __( 'Condiciones' )\n\t);\n\n\t$args_servicios_condiciones = array(\n\t\t'public' \t\t\t=> true,\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels_servicios_condiciones,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'capabilities'\t\t=> array(\n\t\t\t'manage_terms' => 'manage_condiciones',\n\t\t\t'edit_terms' => 'edit_condiciones',\n\t\t\t'delete_terms' => 'delete_condiciones',\n\t\t\t'assign_terms' => 'assign_condiciones'\n\t\t)\n\t);\n\n\t$labels_directorios_grupos = array(\n\t\t'name' => _x( 'Grupos', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Grupo', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Buscar Grupos' ),\n\t\t'all_items' => __( 'Todos los Grupos' ),\n\t\t'parent_item' => __( 'Grupo Padre' ),\n\t\t'parent_item_colon' => __( 'Grupo Padre:' ),\n\t\t'edit_item' => __( 'Editar Grupo' ),\n\t\t'update_item' => __( 'Actualizar Grupo' ),\n\t\t'add_new_item' => __( 'Agregar Nuevo Grupo' ),\n\t\t'new_item_name' => __( 'Nombre de Nuevo Grupo' ),\n\t\t'menu_name' => __( 'Grupos' )\n\t);\n\n\t$args_directorios_grupos = array(\n\t\t'public' \t\t\t=> true,\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels_directorios_grupos,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'capabilities'\t\t=> array(\n\t\t\t'manage_terms' => 'manage_grupos',\n\t\t\t'edit_terms' => 'edit_grupos',\n\t\t\t'delete_terms' => 'delete_grupos',\n\t\t\t'assign_terms' => 'assign_grupos'\n\t\t)\n\t);\n\n\tregister_taxonomy( 'productor', 'producto', $args_producto_productor );\n\tregister_taxonomy( 'marca', 'producto', $args_producto_marca );\n\tregister_taxonomy( 'lugar', 'producto', $args_producto_lugar );\n\tregister_taxonomy( 'clasificacion', 'producto', $args_producto_clasificacion );\n\tregister_taxonomy( 'posiciones', 'banners', $args_banner_posicion );\n\tregister_taxonomy( 'tipos', 'documentos', $args_documentos_tipos );\n\tregister_taxonomy( 'cat-convocatorias', 'convocatorias', $args_convocatorias_categorias );\n\tregister_taxonomy( 'est-convocatorias', 'convocatorias', $args_convocatorias_estados );\n\tregister_taxonomy( 'condiciones', 'servicios', $args_convocatorias_estados );\n\tregister_taxonomy( 'grupos', 'directorios', $args_directorios_grupos );\n}", "function add_educational_use() {\n\t// Add new taxonomy\n $types = array('post','page','attachment','nav_menu_item', 'learning_resource');\n register_taxonomy('asn_educational_use', $types, array(\n 'hierarchical' => false,\n 'labels' => array(\n 'name' => _x( 'Educational Use', 'taxonomy general name' ),\n 'singular_name' => _x( 'Educational Use', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Educational Uses' ),\n 'all_items' => __( 'All Educational Uses' ),\n 'parent_item' => __( 'Parent Educational Use' ),\n 'parent_item_colon' => __( 'Parent Educational Use:' ),\n 'edit_item' => __( 'Edit Educational Use' ),\n 'update_item' => __( 'Update Educational Use' ),\n 'add_new_item' => __( 'Add New Educational Use' ),\n 'new_item_name' => __( 'New Educational Use Name' ),\n 'menu_name' => __( 'Educational Use' ),\n ),\n //Slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'educational_use', \n 'with_front' => false,\n 'hierarchical' => false \n ),\n ));\t\n}", "public function addTaxonomies() {\n\n echo \"\\nAdding taxonomies to post {$this->wp_post_id}...\\n\";\n\n if( is_array($this->taxonomy_info) ){\n foreach( $this->taxonomy_info as $taxonomy_name => $terms ){\n $term_ids = implode( \" \", $this->getRandomTerms($terms) );\n $set_terms_cmd = \"wp post term set {$this->wp_post_id} {$taxonomy_name} {$term_ids} --by=id\";\n $output = shell_exec( $set_terms_cmd );\n }\n }\n\n return true;\n }", "function five_register_my_taxonomies()\n{\n //five_register_taxonomy('custom-taxonomy', 'Custom Taxonomy', 'Custom Taxonomies', ['custom-post-type']);\n}", "public function add_custom_taxonomies() {\n\t\t// Add new \"Departments\" taxonomy to Posts\n\t\tregister_taxonomy(\n\t\t\t'department',\n\t\t\t'lrhoa_voting',\n\t\t\t[\n\t\t\t\t// Hierarchical taxonomy (like categories)\n\t\t\t\t'hierarchical' => false,\n\t\t\t\t// This array of options controls the labels displayed in the WordPress Admin UI\n\t\t\t\t'labels' => [\n\t\t\t\t\t'name' => _x( 'Departments', 'taxonomy general name' ),\n\t\t\t\t\t'singular_name' => _x( 'Department', 'taxonomy singular name' ),\n\t\t\t\t\t'search_items' => __( 'Search Departments' ),\n\t\t\t\t\t'all_items' => __( 'All Departments' ),\n\t\t\t\t\t'parent_item' => __( 'Parent Department' ),\n\t\t\t\t\t'parent_item_colon' => __( 'Parent Department:' ),\n\t\t\t\t\t'edit_item' => __( 'Edit Department' ),\n\t\t\t\t\t'update_item' => __( 'Update Department' ),\n\t\t\t\t\t'add_new_item' => __( 'Add New Department' ),\n\t\t\t\t\t'new_item_name' => __( 'New Department Name' ),\n\t\t\t\t\t'menu_name' => __( 'Departments' ),\n\t\t\t\t],\n\t\t\t\t'query_var' => 'department',\n\t\t\t\t// Control the slugs used for this taxonomy\n\t\t\t\t'rewrite' => [\n\t\t\t\t\t'slug' => 'department', // This controls the base slug that will display before each term\n\t\t\t\t\t'with_front' => false, // Don't display the category base before \"/locations/\"\n\t\t\t\t\t'hierarchical' => true, // This will allow URL's like \"/locations/boston/cambridge/\"\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t}", "function create_ticket_tax() {\n $labels = array(\n 'name' => _x( 'Genres', 'taxonomy general name', 'textdomain' ),\n 'singular_name' => _x( 'Genre', 'taxonomy singular name', 'textdomain' ),\n 'search_items' => __( 'Search Genres', 'textdomain' ),\n 'all_items' => __( 'All Genres', 'textdomain' ),\n 'parent_item' => __( 'Parent Genre', 'textdomain' ),\n 'parent_item_colon' => __( 'Parent Genre:', 'textdomain' ),\n 'edit_item' => __( 'Edit Genre', 'textdomain' ),\n 'update_item' => __( 'Update Genre', 'textdomain' ),\n 'add_new_item' => __( 'Add New Genre', 'textdomain' ),\n 'new_item_name' => __( 'New Genre Name', 'textdomain' ),\n 'menu_name' => __( 'Genre', 'textdomain' ),\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'genre', 'with_front' => false ),\n 'description' => 'Genre for shows and cast. Parent categories are Sports, Theater, Concerts or Other.',\n );\n\n //register_taxonomy( 'genre', array( 'show', 'cast' ), $args );\n register_taxonomy( 'genre', array( 'show' ), $args );\n\n register_taxonomy_for_object_type( 'genre', 'show' );\n //register_taxonomy_for_object_type( 'genre', 'cast' );\n\n}", "function custom_taxonomy_news()\n {\n // Add new taxonomy, make it hierarchical (like categories)\n $labels =array(\n 'name' => _x( 'news type', 'thirdtheme' ),\n 'singular_name' => _x( 'news type', 'thirdtheme' ),\n 'search_items' => __( 'Search news', 'thirdtheme' ),\n 'all_items' => __( 'All news', 'thirdtheme' ),\n 'parent_item' => __( 'Parent news', 'thirdtheme' ),\n 'edit_item' => __( 'Edit news type', 'thirdtheme' ),\n 'update_item' => __( 'Update news type', 'thirdtheme' ),\n 'add_new_item' => __( 'Add New news type', 'thirdtheme' ),\n 'new_item_name' => __( 'New news type Name', 'thirdtheme' ),\n 'not_found' => __( 'no news category found.', 'thirdtheme' ),\n 'menu_name' => __( 'news type', 'thirdtheme' ));\n \n $args =array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'category'));\n\n register_taxonomy('newstype','custompost',$args);\n\n // Add new taxonomy, NOT hierarchical (like tags)\n $labels =array(\n 'name' => _x( 'news tag', 'thirdtheme' ),\n 'singular_name' => _x( 'news tag', 'thirdtheme' ),\n 'search_items' => __( 'Search tag', 'thirdtheme' ),\n 'all_items' => __( 'All tag', 'thirdtheme' ),\n 'edit_item' => __( 'Edit news tag', 'thirdtheme' ),\n 'update_item' => __( 'Update news tag', 'thirdtheme' ),\n 'add_new_item' => __( 'Add New news tag', 'thirdtheme' ),\n 'new_item_name' => __( 'New news tag Name', 'thirdtheme' ),\n 'not_found' => __( 'no news tag found', 'thirdtheme' ),\n 'menu_name' => __( 'news tag', 'thirdtheme' ));\n\n $args =array(\n 'hierarchical' => false,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'tag'));\n\n register_taxonomy('newstag','custompost',$args);\n }", "function store_custom_taxonomy() {\n // Adding taxonomy hierarchical\n $labels = array(\n 'name' => 'Store_Categories',\n 'singular_name' => 'Store_Category',\n 'search_items' => 'Search Store_Categories',\n 'all_items' => 'All Store_Categories',\n 'parent_item' => 'Parent Store_Category',\n 'parent_item_colon' => 'Parent Store_Category:',\n 'edit_item' => 'Edit Category',\n 'update_item' => 'Update Category',\n 'add_new_item' => 'Add New Category',\n 'new_item_name' => 'New Category',\n 'menu_name' => 'Category'\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array('slug' => 'store_category')\n );\n\n register_taxonomy('store_category', array('stores'), $args);\n}", "public function add_taxonomy_fields() {\n\t\t$template_file = $this->media->plugin->template_path . 'taxonomy-transformation-fields.php';\n\t\tif ( file_exists( $template_file ) ) {\n\t\t\tinclude $template_file; // phpcs:ignore\n\t\t}\n\t}", "function action_rest_insert_quotes( $post, $request, $true ) {\n $params = $request->get_json_params();\n if(array_key_exists(\"terms\", $params)) {\n foreach($params[\"terms\"] as $taxonomy => $terms) {\n wp_set_post_terms($post->ID, $terms, $taxonomy);\n }\n }\n}", "private function initCustomTaxonomy(){\n //Instantiate our custom taxonomy object\n $this->taxAstrology = new Taxonomy($this->wpdsTaxonomyName, $this->wpdsPostType);\n \n //Set our taxonomy's properties\n $this->taxAstrology->setSingularName($this->wpdsTaxonomyName);\n $this->taxAstrology->setPluralName($this->wpdsTaxonomyName);\n $this->taxAstrology->setMenuName($this->wpdsTaxonomyName);\n $this->taxAstrology->setLabels('Search '.$this->wpdsPostTypeNamePlural, 'Popular '.$this->wpdsPostTypeNamePlural, 'All '.$this->wpdsPostTypeNamePlural, 'Edit '.$this->wpdsPostTypeName, 'Update '.$this->wpdsPostTypeName, 'Add New '.$this->wpdsPostTypeName, 'New '.$this->wpdsPostTypeName.' Name');\n $this->taxAstrology->setDescription($this->wpdsPostTypeNamePlural);\n $this->taxAstrology->setShowInMenu(true);\n $this->taxAstrology->setPublic(true);\n $this->taxAstrology->setHierarchical(false);\n \n //Finally, we register our new taxonomy\n $this->taxAstrology->register();\n }", "function create_dpto_taxonomies() {\n\n $labels = array(\n 'name' => _x( 'Departamento', 'taxonomy general name' ),\n 'singular_name' => _x( 'Departamento', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Genres' ),\n 'all_items' => __( 'Departamentos' ),\n 'parent_item' => __( 'Parent Genre' ),\n 'parent_item_colon' => __( 'Parent Genre:' ),\n 'edit_item' => __( 'Editar departamento' ), \n 'update_item' => __( 'Actualizar departamento' ),\n 'add_new_item' => __( 'Nuevo departamento' ),\n 'new_item_name' => __( 'Nuevo departamento' ),\n 'menu_name' => __( 'Departamentos' ),\n ); \t\n\n register_taxonomy('departamento',array('ofertas'), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'departamento' ),\n ));\n\n}", "private function register_taxonomies()\n {\n $this->register_service($this->get_taxonomy_services(), 'taxonomies');\n }", "function wp_arch_cpts() {\n /**\n * Registers a new post type\n * @uses $wp_post_types Inserts new post type object into the list\n *\n * @param string Post type key, must not exceed 20 characters\n * @param array|string See optional args description above.\n * @return object|WP_Error the registered post type object, or an error object\n */\n register_post_type( 'wp_arch_testimonial',\n array(\n 'labels' => array(\n 'name' => _x('Testimonials', 'post type general name'),\n 'singular_name' => _x('Testimonial', 'post type singular name'),\n 'add_new' => _x('Add New', 'testimonial'),\n 'add_new_item' => __('Add New Testimonial'),\n 'edit_item' => __('Edit Testimonial'),\n 'new_item' => __('New Testimonial'),\n 'view_item' => __('View Testimonial'),\n 'search_items' => __('Search Testimonial'),\n 'not_found' => __('No testimonials found'),\n 'not_found_in_trash' => __('No testimonials found in Trash'),\n 'parent_item_colon' => ''\n ),\n 'public' => true,\n 'description' => 'Our Testimonials',\n 'exclude_from_search' => true,\n 'has_archive' => true,\n 'rewrite' => array('slug' => 'testimonials'),\n 'hierarchical' => true,\n 'supports' => array(\n 'title',\n 'editor'\n ),\n )\n );\n}", "function fs_create_portfolio_taxonomies()\n{\n $labels = array(\n 'name' => __('Portfolio Category', 'fs-portfolio'),\n 'singular_name' => __('Portfolio Category', 'fs-portfolio'),\n 'search_items' => __('Search Portfolio Categories', 'fs-portfolio'),\n 'all_items' => __('All Portfolio Categories', 'fs-portfolio'),\n 'parent_item' => __('Parent Portfolio Category', 'fs-portfolio'),\n 'parent_item_colon' => __('Parent Portfolio Category:', 'fs-portfolio'),\n 'edit_item' => __('Edit Portfolio Category', 'fs-portfolio'),\n 'update_item' => __('Update Portfolio Category', 'fs-portfolio'),\n 'add_new_item' => __('Add New Portfolio Category', 'fs-portfolio'),\n 'new_item_name' => __('New Portfolio Category Name', 'fs-portfolio'),\n 'menu_name' => __('Portfolio Category', 'fs-portfolio')\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array('slug' => 'portfolio-category'),\n 'show_in_rest' => true,\n 'rest_base' => 'portfolio_category',\n 'rest_controller_class' => 'WP_REST_Terms_Controller',\n );\n\n\n\n register_taxonomy( 'portfolio-category', array( 'portfolio' ), $args );\n\n // Add new taxonomy, NOT hierarchical (like tags)\n $labelst = array(\n 'name' => __( 'Porftolio Tags', 'fs-portfolio' ),\n 'singular_name' => __( 'Tag', 'fs-portfolio' ),\n 'search_items' => __( 'Search Tags', 'fs-portfolio' ),\n 'popular_items' => __( 'Popular Tags', 'fs-portfolio' ),\n 'all_items' => __( 'All Tags', 'fs-portfolio' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Tag', 'fs-portfolio' ),\n 'update_item' => __( 'Update Tag', 'fs-portfolio' ),\n 'add_new_item' => __( 'Add New Tag', 'fs-portfolio' ),\n 'new_item_name' => __( 'New Tag Name', 'fs-portfolio' ),\n 'separate_items_with_commas' => __( 'Separate tags with commas', 'fs-portfolio' ),\n 'add_or_remove_items' => __( 'Add or remove tags', 'fs-portfolio' ),\n 'choose_from_most_used' => __( 'Choose from the most used tags', 'fs-portfolio' ),\n 'not_found' => __( 'No tags found.', 'fs-portfolio' ),\n 'menu_name' => __( 'Portfolio Tags', 'fs-portfolio' )\n );\n\n $argst = array(\n 'hierarchical' => false,\n 'labels' => $labelst,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'portfolio-tags' ),\n 'show_in_rest' => true,\n 'rest_base' => 'porfolio_tags',\n 'rest_controller_class' => 'WP_REST_Terms_Controller',\n );\n\n register_taxonomy( 'portfolio-tags', 'portfolio', $argst );\n}", "function build_taxonomies() {\n// custom tax\n register_taxonomy( 'from', array('menu'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'From',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'menu-from' ),\n\t\t\t'_builtin' => true\n ) );\n \n register_taxonomy( 'cpt-tag',array('menu','recipe','sources-resources','tips-quips','style-points'), \n array( \n 'hierarchical' => false, // true = acts like categories false = acts like tags\n 'label' => 'Tags',\n 'query_var' => true,\n 'show_admin_column' => true,\n 'public' => true,\n 'rewrite' => true,\n '_builtin' => true\n ) );\n register_taxonomy( 'from-5', array('recipe'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'From',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'recipe-from' ),\n\t\t\t'_builtin' => true\n ) );\n \n register_taxonomy( 'from-2', array('sources-resources'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'From',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'sources-resources-from' ),\n\t\t\t'_builtin' => true\n ) );\n \n register_taxonomy( 'from-3', array('tips-quips'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'From',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'tips-quips-from' ),\n\t\t\t'_builtin' => true\n ) );\n \n register_taxonomy( 'from-4', array('style-points'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'From',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'style-points-from' ),\n\t\t\t'_builtin' => true\n ) );\n register_taxonomy( 'sub', array('menu'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'Sub',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'menu-sub' ),\n\t\t\t'_builtin' => true\n\t\t) );\n register_taxonomy( 'sub-5', array('recipe'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'Sub',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'recipe-sub' ),\n\t\t\t'_builtin' => true\n\t\t) );\n register_taxonomy( 'sub-2', array('sources-resources'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'Sub',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'sources-resources-sub' ),\n\t\t\t'_builtin' => true\n\t\t) );\n register_taxonomy( 'sub-3', array('tips-quips'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'Sub',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'tips-quips-sub' ),\n\t\t\t'_builtin' => true\n\t\t) );\n register_taxonomy( 'sub-4', array('style-points'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'Sub',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'style-points-sub' ),\n\t\t\t'_builtin' => true\n\t\t) );\n}", "private function register_taxonomies()\n {\n $all_types = get_post_types(array(\n '_builtin' => false,\n 'public' => true,\n 'exclude_from_search' => false\n ), 'names');\n\n // Add post and page back in after removing them with _builtin: false\n $all_types['post'] = 'post';\n $all_types['page'] = 'page';\n\n // Exclude acf\n unset($all_types['acf']);\n\n // Add new taxonomy, make it hierarchical (like categories)\n $labels = array(\n 'name' => _x('States', 'taxonomy general name'),\n 'singular_name' => _x('State', 'taxonomy singular name'),\n 'search_items' => __('Search States'),\n 'all_items' => __('All States'),\n 'parent_item' => __('Parent State'),\n 'parent_item_colon' => __('Parent State:'),\n 'edit_item' => __('Edit State'),\n 'update_item' => __('Update State'),\n 'add_new_item' => __('Add New State'),\n 'new_item_name' => __('New State Name'),\n 'menu_name' => __('State'),\n );\n\n register_taxonomy('custom_geo_us_state', $all_types, array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'query_var' => true,\n 'rewrite' => array('slug' => 'state'),\n )\n );\n\n // Add new taxonomy, make it hierarchical (like categories)\n $labels = array(\n 'name' => _x('Countries', 'taxonomy general name'),\n 'singular_name' => _x('Country', 'taxonomy singular name'),\n 'search_items' => __('Search Countries'),\n 'all_items' => __('All Countries'),\n 'parent_item' => __('Parent Country'),\n 'parent_item_colon' => __('Parent Country:'),\n 'edit_item' => __('Edit Country'),\n 'update_item' => __('Update Country'),\n 'add_new_item' => __('Add New Country'),\n 'new_item_name' => __('New Country Name'),\n 'menu_name' => __('Country'),\n );\n\n register_taxonomy('custom_geo_country', $all_types, array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'query_var' => true,\n 'rewrite' => array('slug' => 'country'),\n )\n );\n }", "function Simple_Release_Notes() {\n add_action( 'init', array( $this, 'register_custom_post_type' ) );\n\n // Add the custom taxonomies\n add_action( 'init', array( $this, 'register_custom_taxonomy' ), 1 );\n\n // Set up the new permalink for this structure\n add_action( 'init', array( $this, 'register_permalinks' ), 1 );\n\n // Handle our custom permalinks\n add_filter( 'post_type_link', array( $this, 'process_custom_permalink' ), 10, 3 );\n\n // Filter our custom type off the home page\n add_action( 'pre_get_posts', array( $this, 'customize_query_for_custom_type' ) );\n\n // On the posts page, add a Category column\n add_filter( 'manage_posts_columns', array( $this, 'add_taxonomy_column' ), 10, 1 );\n add_action( 'manage_posts_custom_column', array( $this, 'manage_taxonomy_column' ), 10, 2 );\n }", "function years_custom_taxonomies() {\n\t$labels = array(\n\t\t'name' => 'Год',\n\t\t'singular_name' => 'Год',\n\t\t'search_items' => 'Поиск по годам',\n\t\t'all_items' => 'Все года',\n\t\t'parent_item' => 'Родительское поле',\n\t\t'parent_item_colon' => 'Родительское поле:',\n\t\t'edit_item' => 'Редактирование',\n\t\t'update_item' => 'Обновить',\n\t\t'add_new_item' => 'Добавить новое рабочее поле',\n\t\t'new_item_name' => 'Имя нового поля',\n\t\t'menu_name' => 'Год'\n\t);\n\n\t$args = array(\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'years' )\n\t);\n\n\tregister_taxonomy('years', array('film'), $args);\n\n}", "function create_posttype() {\n \n register_post_type( 'headlines',\n // CPT Options\n array(\n 'labels' => array(\n 'name' => __( 'Headlines' ),\n 'singular_name' => __( 'Headline' )\n\t\t\t),\n\t\t\t'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields'),\n 'public' => true,\n\t\t\t'has_archive' => true,\n 'menu_icon' => 'dashicons-text-page',\n 'rewrite' => array('slug' => 'headlines'),\n 'show_in_rest' => true,\n )\n );\n}", "function register_part_of_speech_taxonomy () {\n\n $labels = array(\n 'name' => _x( 'Part of Speech', 'taxonomy general name' ),\n 'singular_name' => _x( 'Part of Speech', 'taxonomy singular name' ),\n 'search_items' => __( 'Parts of Speech' ),\n 'all_items' => __( 'All Parts of Speech' ),\n 'parent_item' => __( 'Parent Part of Speech' ),\n 'parent_item_colon' => __( 'Parent Part of Speech:' ),\n 'edit_item' => __( 'Edit Part of Speech' ),\n 'update_item' => __( 'Update Part of Speech' ),\n 'add_new_item' => __( 'Add New Part of Speech' ),\n 'new_item_name' => __( 'New Part of Speech Name' ),\n 'menu_name' => __( \"Parts of Speech\"),\n );\n\n register_taxonomy(\n 'sil_parts_of_speech',\n 'post',\n array(\n 'hierarchical' => false,\n 'labels' => $labels,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => true,\n 'public' => true,\n 'show_ui' => true\n )\n ) ;\n}", "function add_taxonomies_to_pages() {\n register_taxonomy_for_object_type('post_tag', 'page');\n register_taxonomy_for_object_type('category', 'page');\n}", "function courses_custom_post_type (){\n\n $labels = array(\n 'name' => 'Courses',\n 'singular_name' => 'Course',\n 'add_new' => 'Add course',\n 'all_items' => 'All courses',\n 'add_new_item' => 'Add course',\n 'edit_item' => 'Edit course',\n 'new_item' => 'New course',\n 'view_item' => 'View course',\n 'search_item' => 'Search course',\n 'non_found' => 'No courses found',\n 'not_found_in_trash' => 'No courses found in trash',\n 'parent_item_colon' => 'Parent course'\n );\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'has_archive' => true,\n 'publicly_queryable' => true,\n 'query_var' => true,\n 'rewrite' => true,\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'supports' => array(\n 'title',\n 'editor',\n 'excerpt',\n 'thumbnail',\n 'revisions',\n 'post-formats',\n 'custom-fields'\n ),\n 'menu_position' => 10,\n 'exclude_from_search' => false\n );\n register_post_type('courses',$args); \n}", "function kulam_acf_register_custom_taxonomies() {\n\n\t/**\n\t * Variables\n\t */\n\t$custom_tax\t= kulam_acf_get_global_option( 'acf-option_custom_taxonomies_generator' );\n\n\tif ( ! $custom_tax )\n\t\treturn;\n\n\tforeach ( $custom_tax as $tax ) {\n\n\t\t/**\n\t\t * Variables\n\t\t */\n\t\t$name\t\t= $tax[ 'name' ];\n\t\t$singular\t= $tax[ 'singular_name' ];\n\n\t\tif ( ! $name || ! $singular )\n\t\t\tcontinue;\n\n\t\t$labels = kulam_get_custom_taxonomy_labels( $name, $singular );\n\n\t\tif ( ! $labels )\n\t\t\tcontinue;\n\n\t\t$args = array(\n\t\t\t'labels'\t\t\t\t=> $labels,\n\t\t\t'public'\t\t\t\t=> true,\n\t\t\t'hierarchical'\t\t\t=> true,\n\t\t\t'show_in_rest'\t\t\t=> true,\n\t\t\t'show_admin_column'\t\t=> true,\n\t\t);\n\n\t\tregister_taxonomy( urldecode( sanitize_title( urldecode( 'post_tax_' . $singular ) ) ), 'post', $args );\n\n\t}\n\n}", "function create_post_type() {\n \n $lwa_feature_post_type = array(\n 'labels' => array(\n 'name' => __( 'Featured posts' ),\n 'singular_name' => __( 'Featured' ),\n ),\n 'description' => __( 'Featured articles are defined within this type' ),\n 'hierarchical' => true, \n 'show_ui' => true,\n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array('slug' => 'featured/%featured_tax%', 'with_front' => false),\n 'menu_position' => 5,\n 'supports' => array('title', 'editor', 'thumbnail', 'author', 'revisions' ),\n 'taxonomies' => array( 'featured_tax', 'subtitle', 'carousel' )\n );\n\n $lwa_news_post_type = array(\n 'labels' => array(\n 'name' => __( 'News posts' ),\n 'singular_name' => __( 'News' ),\n ),\n 'description' => __( 'News articles are defined within this type' ),\n 'hierarchical' => true,\n 'show_ui' => true,\n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array('slug' => 'news/%news_tax%', 'with_front' => false),\n 'menu_position' => 5,\n 'supports' => array('title', 'editor', 'thumbnail', 'author', 'revisions' ),\n 'taxonomies' => array( 'news_tax', 'subtitle', 'carousel' )\n );\n\n $lwa_shop_post_type = array(\n 'labels' => array(\n 'name' => __( 'Shop posts' ),\n 'singular_name' => __( 'Shop' ),\n ),\n 'description' => __( 'Shop articles are defined within this type' ),\n 'hierarchical' => true,\n 'show_ui' => true,\n 'public' => true,\n 'has_archive' => true,\n // 'rewrite' => array('slug' => 'news/%news_tax%', 'with_front' => false),\n 'menu_position' => 5,\n 'supports' => array('title', 'editor', 'thumbnail', 'author', 'revisions' ),\n 'taxonomies' => array( 'subtitle', 'carousel' )\n );\n\n register_post_type( 'lwa_feature', $lwa_feature_post_type );\n register_post_type( 'lwa_news', $lwa_news_post_type );\n register_post_type( 'lwa_shop', $lwa_shop_post_type );\n}", "function mti_create_artistcategory_tax() {\n\n\t\t$labels = array(\n\t\t\t'name' => _x( 'Artist Categories', 'taxonomy general name', 'artist-category' ),\n\t\t\t'singular_name' => _x( 'Artist Category', 'taxonomy singular name', 'artist-category' ),\n\t\t\t'search_items' => __( 'Search Artist Categories', 'artist-category' ),\n\t\t\t'all_items' => __( 'All Artist Categories', 'artist-category' ),\n\t\t\t'parent_item' => __( 'Parent Artist Category', 'artist-category' ),\n\t\t\t'parent_item_colon' => __( 'Parent Artist Category:', 'artist-category' ),\n\t\t\t'edit_item' => __( 'Edit Artist Category', 'artist-category' ),\n\t\t\t'update_item' => __( 'Update Artist Category', 'artist-category' ),\n\t\t\t'add_new_item' => __( 'Add New Artist Category', 'artist-category' ),\n\t\t\t'new_item_name' => __( 'New Artist Category Name', 'artist-category' ),\n\t\t\t'menu_name' => __( 'Artist Category', 'artist-category' ),\n\t\t);\n\t\t$args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'description' => __( '', 'artist-category' ),\n\t\t\t'hierarchical' => true,\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'show_in_rest' => false,\n\t\t\t'show_tagcloud' => true,\n\t\t\t'show_in_quick_edit' => true,\n\t\t\t'show_admin_column' => true,\n\t\t);\n\t\tregister_taxonomy( 'artistcategory', array('artistprofile', ), $args );\n\n\t\t/**\n\t\t * Register Taxonomy for City\n\t\t */\n\t\t$labels = array(\n\t\t\t'name' => _x( 'Cities', 'taxonomy general name', 'artist-city' ),\n\t\t\t'singular_name' => _x( 'City', 'taxonomy singular name', 'artist-city' ),\n\t\t\t'search_items' => __( 'Search Cities', 'artist-city' ),\n\t\t\t'all_items' => __( 'All Cities', 'artist-city' ),\n\t\t\t'parent_item' => __( 'Parent City', 'artist-city' ),\n\t\t\t'parent_item_colon' => __( 'Parent City:', 'artist-city' ),\n\t\t\t'edit_item' => __( 'Edit City', 'artist-city' ),\n\t\t\t'update_item' => __( 'Update City', 'artist-city' ),\n\t\t\t'add_new_item' => __( 'Add New City', 'artist-city' ),\n\t\t\t'new_item_name' => __( 'New City Name', 'artist-city' ),\n\t\t\t'menu_name' => __( 'City', 'artist-city' ),\n\t\t);\n\t\t$args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'description' => __( '', 'artist-city' ),\n\t\t\t'hierarchical' => false,\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'show_in_rest' => false,\n\t\t\t'show_tagcloud' => true,\n\t\t\t'show_in_quick_edit' => true,\n\t\t\t'show_admin_column' => true,\n\t\t);\n\t\tregister_taxonomy( 'city', array('artistprofile', ), $args );\n\n\t}", "function register_block_core_post_terms()\n {\n }", "function add_rew_apartment()\n{\n\t$lables = array(\n\t\t\t'name' => 'Apartments',\n\t\t\t'singular_name'=>'Apartment',\n\t\t\t'rewrite' => array( 'slug' => 'apartment' ),\n\t\t\t'all_items'=> 'All Apartments',\n\t\t\t'add_new'=>'Add New Apartment',\n\t\t\t'add_new_item'=>' Add New Apartment',\n \n\n\t\t );\n\n\t$tax = array(\n\n\t\t\t\t\t'category',\n\n\t\t\t\t\t\n\t\t);\n\t$args = array(\n\t\t'labels'=> $lables,\n\t\t'public'=>true,\n\t\t'show_in_menu'=>true,\n\t\t//'show_in_admin_bar'=>true,\n\t//\t'show_in_nav_menus'=>true,\n\t\t'description'=>'Enter your Description',\n\t\t'menu_position'=>10,\n\t\t'menu_icon'=>'dashicons-format-quote',\n\t\t'taxonomies'=>$tax,\n\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\n\t\t 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n 'query_var' => true,\n 'show_in_rest' => true,\n 'rest_base' => 'apartments',\n 'rest_controller_class' => 'WP_REST_Posts_Controller',\n\n\t\t);\t\n\tregister_post_type('Apartment', $args);\n\t//add_action('init' , 'codex_custom_init');\n\t\n}", "function create_tag_taxonomies()\n{\n // Add new taxonomy, NOT hierarchical (like tags)\n $labels = array(\n 'name' => _x( 'Tags', 'taxonomy general name' ),\n 'singular_name' => _x( 'Tag', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Tags' ),\n 'popular_items' => __( 'Popular Tags' ),\n 'all_items' => __( 'All Tags' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Tag' ),\n 'update_item' => __( 'Update Tag' ),\n 'add_new_item' => __( 'Add New Tag' ),\n 'new_item_name' => __( 'New Tag Name' ),\n 'separate_items_with_commas' => __( 'Separate tags with commas' ),\n 'add_or_remove_items' => __( 'Add or remove tags' ),\n 'choose_from_most_used' => __( 'Choose from the most used tags' ),\n 'menu_name' => __( 'Tags' ),\n );\n\n register_taxonomy('tag','edicoesAnteriores',array(\n 'hierarchical' => false,\n 'labels' => $labels,\n 'show_ui' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'tag' ),\n ));\n}", "function create_academy_taxonomy() {\n\t\t$labels = array(\n\t\t\t'name' => _x( 'Tipos', 'taxonomy general name', 'textdomain' ),\n\t\t\t'singular_name' => _x( 'Tipo', 'taxonomy singular name', 'textdomain' ),\n\t\t\t'search_items' => __( 'Buscar Tipos', 'textdomain' ),\n\t\t\t'all_items' => __( 'Todos los Tipos', 'textdomain' ),\n\t\t\t'parent_item' => __( 'Tipo Padre', 'textdomain' ),\n\t\t\t'parent_item_colon' => __( 'Parent Genre:', 'textdomain' ),\n\t\t\t'edit_item' => __( 'Editar Tipo', 'textdomain' ),\n\t\t\t'update_item' => __( 'Actualizar Tipo', 'textdomain' ),\n\t\t\t'add_new_item' => __( 'Nuevo Tipo', 'textdomain' ),\n\t\t\t'new_item_name' => __( 'Nuevo Nombre de Tipo', 'textdomain' ),\n\t\t\t'menu_name' => __( 'Tipo', 'textdomain' ),\n\t\t);\n\n\t\t$args = array(\n\t\t\t'hierarchical' => true,\n\t\t\t'labels' => $labels,\n\t\t\t'show_ui' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'query_var' => true,\n\t\t\t'rewrite' => array( 'slug' => 'academy-type' ),\n\t\t);\n\n\t\tregister_taxonomy( 'academy-type', array( 'academy' ), $args );\n\n\t}", "function gcd_tax_add_new_meta_field() {\r\n ?>\r\n <div class=\"form-field\">\r\n <label for=\"term_meta[featured]\"><?php _e( 'Featured ?', '' ); ?></label>\r\n <input type=\"text\" name=\"term_meta[featured]\" id=\"term_meta[featured]\" value=\"\">\r\n <p class=\"description\"><?php _e( 'Type 1 if you want to list category as featured','' ); ?></p>\r\n </div>\r\n\r\n <div class=\"form-field\">\r\n <label for=\"term_meta[subtitle]\"><?php _e( 'Subtitle', '' ); ?></label>\r\n <input type=\"text\" name=\"term_meta[subtitle]\" id=\"term_meta[subtitle]\" value=\"\">\r\n <p class=\"description\"><?php _e( 'Subtitle for your group','' ); ?></p>\r\n <div>\r\n<?php\r\n}", "function cptui_register_my_taxes_voyages_types() {\n\n\t/**\n\t * Taxonomy: Types.\n\t */\n\n\t$labels = [\n\t\t\"name\" => __( \"Types\", \"custom-post-type-ui\" ),\n\t\t\"singular_name\" => __( \"Type\", \"custom-post-type-ui\" ),\n\t];\n\n\t\n\t$args = [\n\t\t\"label\" => __( \"Types\", \"custom-post-type-ui\" ),\n\t\t\"labels\" => $labels,\n\t\t\"public\" => true,\n\t\t\"publicly_queryable\" => true,\n\t\t\"hierarchical\" => false,\n\t\t\"show_ui\" => true,\n\t\t\"show_in_menu\" => true,\n\t\t\"show_in_nav_menus\" => true,\n\t\t\"query_var\" => true,\n\t\t\"rewrite\" => [ 'slug' => 'voyages_types', 'with_front' => true, ],\n\t\t\"show_admin_column\" => false,\n\t\t\"show_in_rest\" => true,\n\t\t\"rest_base\" => \"voyages_types\",\n\t\t\"rest_controller_class\" => \"WP_REST_Terms_Controller\",\n\t\t\"show_in_quick_edit\" => false,\n\t\t\"show_in_graphql\" => false,\n\t];\n\tregister_taxonomy( \"voyages_types\", [ \"voyages\" ], $args );\n}", "public function add_tax_rewrite_rules() {\n\t\tif(get_option('no_taxonomy_structure')) {\n\t\t\treturn false;\n\t\t}\n\n\n\t\tglobal $wp_rewrite;\n\t\t$taxonomies = get_taxonomies(array( '_builtin' => false));\n\t\t$taxonomies['category'] = 'category';\n\n\t\tif(empty($taxonomies)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ($taxonomies as $taxonomy) :\n\t\t\t$taxonomyObject = get_taxonomy($taxonomy);\n\t\t\t$post_types = $taxonomyObject->object_type;\n\n\t\t\tforeach ($post_types as $post_type):\n\t\t\t\t$post_type_obj = get_post_type_object($post_type);\n\t\t\t\t$slug = $post_type_obj->rewrite['slug'];\n\t\t\t\tif(!$slug) {\n\t\t\t\t\t$slug = $post_type;\n\t\t\t\t}\n\n\t\t\t\tif(is_string($post_type_obj->has_archive)) {\n\t\t\t\t\t$slug = $post_type_obj->has_archive;\n\t\t\t\t};\n\n\t\t\t\tif ( $taxonomy == 'category' ){\n\t\t\t\t\t$taxonomypat = ($cb = get_option('category_base')) ? $cb : $taxonomy;\n\t\t\t\t\t$tax = 'category_name';\n\t\t\t\t} else {\n\t\t\t\t\t// Edit by [Xiphe]\n\t\t\t\t\tif (isset($taxonomyObject->rewrite['slug'])) {\n\t\t\t\t\t\t$taxonomypat = $taxonomyObject->rewrite['slug'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$taxonomypat = $taxonomy;\n\t\t\t\t\t}\n\t\t\t\t\t// [Xiphe] stop\n\n\t\t\t\t\t$tax = $taxonomy;\n\t\t\t\t}\n\n\n\t\t\t\t//add taxonomy slug\n\t\t\t\tadd_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/page/?([0-9]{1,})/?$', 'index.php?'.$tax.'=$matches[1]&paged=$matches[2]', 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?'.$tax.'=$matches[1]&feed=$matches[2]', 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/(feed|rdf|rss|rss2|atom)/?$', 'index.php?'.$tax.'=$matches[1]&feed=$matches[2]', 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/?$', 'index.php?'.$tax.'=$matches[1]', 'top' ); // modified by [steve] [*** bug fixing]\n\n\t\t\t\t// below rules were added by [steve]\n\t\t\t\tadd_rewrite_rule( $taxonomypat.'/(.+?)/date/([0-9]{4})/([0-9]{1,2})/?$', 'index.php?'.$tax.'=$matches[1]&year=$matches[2]&monthnum=$matches[3]&post_type='.$post_type, 'top' );\n\t\t\t\tadd_rewrite_rule( $taxonomypat.'/(.+?)/date/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$', 'index.php?'.$tax.'=$matches[1]&year=$matches[2]&monthnum=$matches[3]&paged=$matches[4]&post_type='.$post_type, 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/date/([0-9]{4})/([0-9]{1,2})/?$', 'index.php?'.$tax.'=$matches[1]&year=$matches[2]&monthnum=$matches[3]&post_type='.$post_type, 'top' );\n\t\t\t\tadd_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/date/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$', 'index.php?'.$tax.'=$matches[1]&year=$matches[2]&monthnum=$matches[3]&paged=$matches[4]&post_type='.$post_type, 'top' );\n\n\t\t\tendforeach;\n\t\tendforeach;\n\t}", "function yee_post_type_testimonial_init(){\n\t$labels =array(\n\t\t'name'=>'Testimonials',\n\t\t'sigular_name'=>'Testimonial',\n\t\t'add_new'=>__('Add New Testimonial','Storefront-Child'),\n\t\t'add_new_item'=>__('Add New Testimonial','Storefront-Child'),\n\t\t'edit_item'=>__('Edit Testimonial','Storefront-Child'),\n\t\t'new_item'=>__('New Testimonial','Storefront-Child'),\n\t\t'view_item'=>__('View Testimonial','Storefront-Child'),\n\t\t'view_items'=>__('View Testimonials','Storefront-Child'),\n\t\t'all_items'=>__('All Testimonials','Storefront-Child'),\n\t\t'search_items'=>__('Search Testimonials','Storefront-Child')\n\t);\n\t$args =array(\n\t\t'labels'=>$labels,\n\t\t'public'=>true,\n\t\t'menu_position'=>5,\n\t\t'menu_icon'=>'dashicons-visibility',\n\t\t'hierarchical'=>false,\n\t\t'has_archive'=>true,\n\t\t'supports'=>array('title','editor','thumbnail','excerpt'),\n\t\t'rewrite'=>array('slug'=>'testimonial')\n\t\t\n\t);\n\tregister_post_type('yee_testimonial',$args);\n}", "function rwb_create_custom_taxonomies() \n{\n // Add new taxonomy, make it hierarchical (like categories)\n $labels = array(\n 'name' => _x( 'Event Types', 'taxonomy general name' ),\n 'singular_name' => _x( 'Event Type', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Event Types' ),\n 'all_items' => __( 'All Event Types' ),\n 'parent_item' => __( 'Parent Event Type' ),\n 'parent_item_colon' => __( 'Parent Event Type:' ),\n 'edit_item' => __( 'Edit Event Type' ), \n 'update_item' => __( 'Update Event Type' ),\n 'add_new_item' => __( 'Add New Event Type' ),\n 'new_item_name' => __( 'New Event Type Name' ),\n 'menu_name' => __( 'Event Types' ),\n ); \t\n\n register_taxonomy('event_types',array('events'), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'query_var' => true,\n 'rewrite' => array('slug' => 'event-type','with_front' => false),\n ));\n \n // Add another below this comment if you like\n \n}", "public function add_taxonomy( $name, $hierarchy, $args = array(), $labels = array() ){\r\n if( ! empty( $name ) ){\r\n // We need to know the post type name, so the new taxonomy can be attached to it.\r\n $post_type_name = $this->post_type_name;\r\n\r\n // Taxonomy properties\r\n $taxonomy_name = strtolower( str_replace( ' ', '_', $name ) );\r\n $taxonomy_labels = $labels;\r\n $taxonomy_args = $args;\r\n\r\n if( ! taxonomy_exists( $taxonomy_name ) ){\r\n //Capitilize the words and make it plural\r\n $name = ucwords( str_replace( '_', ' ', $name ) );\r\n $plural = $name . 's';\r\n\r\n // Default labels, overwrite them with the given labels.\r\n $labels = array_merge(\r\n\r\n // Default\r\n array(\r\n 'name' => _x( $plural, 'taxonomy general name' ),\r\n 'singular_name' => _x( $name, 'taxonomy singular name' ),\r\n 'search_items' => __( 'Search ' . $plural ),\r\n 'all_items' => __( 'All ' . $plural ),\r\n 'parent_item' => __( 'Parent ' . $name ),\r\n 'parent_item_colon' => __( 'Parent ' . $name . ':' ),\r\n 'edit_item' => __( 'Edit ' . $name ),\r\n 'update_item' => __( 'Update ' . $name ),\r\n 'add_new_item' => __( 'Add New ' . $name ),\r\n 'new_item_name' => __( 'New ' . $name . ' Name' ),\r\n 'menu_name' => __( $plural ),\r\n ),\r\n\r\n // Given labels\r\n $taxonomy_labels\r\n\r\n );\r\n\r\n // Default arguments, overwritten with the given arguments\r\n $args = array_merge(\r\n\r\n // Default\r\n array(\r\n 'hierarchical' => $hierarchy,\r\n 'label' => $plural,\r\n 'labels' => $labels,\r\n 'public' => true,\r\n 'show_ui' => true,\r\n 'show_in_nav_menus' => true,\r\n '_builtin' => false,\r\n ),\r\n\r\n // Given\r\n $taxonomy_args\r\n\r\n );\r\n\r\n // Add the taxonomy to the post type\r\n add_action( 'init',\r\n function() use( $taxonomy_name, $post_type_name, $args ){\r\n register_taxonomy( $taxonomy_name, $post_type_name, $args );\r\n }\r\n );\r\n }\r\n else{\r\n add_action( 'init',\r\n function() use( $taxonomy_name, $post_type_name ){\r\n register_taxonomy_for_object_type( $taxonomy_name, $post_type_name );\r\n }\r\n );\r\n }\r\n }\r\n }", "function create_marque_taxonomies() {\n // Add new taxonomy, make it hierarchical (like categories)\n $labels = array(\n 'name' => _x( 'Marques', 'taxonomy general name' ),\n 'singular_name' => _x( 'Marque', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Marques' ),\n 'all_items' => __( 'All Marques' ),\n 'parent_item' => __( 'Parent Marque' ),\n 'parent_item_colon' => __( 'Parent Marque:' ),\n 'edit_item' => __( 'Edit Marque' ),\n 'update_item' => __( 'Update Marque' ),\n 'add_new_item' => __( 'Add New Marque' ),\n 'new_item_name' => __( 'New Marque Name' ),\n 'menu_name' => __( 'Marque' ),\n );\n \n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'marque' ),\n );\n \n register_taxonomy( 'marque', array( 'product' ), $args );\n}", "function create_CPTs ()\n\t{\n\n\n $singular = 'Quote';\n $plural = 'Quotes';\n\n //Topics\n $labels = array(\n 'name' => $plural,\n 'singular_name' => $singular,\n 'menu_name' => $plural,\n 'name_admin_bar' => $plural,\n 'add_new' => 'Add New '.$singular,\n 'add_new_item' => 'Add New '.$singular,\n 'new_item' => 'New '.$singular,\n 'edit_item' => 'Edit '.$singular,\n 'view_item' => 'View '.$plural,\n 'all_items' => 'All '.$plural,\n 'search_items' => 'Search '.$plural,\n 'parent_item_colon' => '',\n 'not_found' => 'No '.$plural.' found.',\n 'not_found_in_trash' => 'No '.$plural.' found in Trash.'\n );\n\n $args = array(\n 'menu_icon' => 'dashicons-media-spreadsheet',\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n 'show_in_nav_menus'\t => true,\n 'show_in_menu' => false,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'clients' ),\n 'capability_type' => 'page',\n 'has_archive' => false,\n 'hierarchical' => false,\n 'supports' => array( 'title', 'revisions', 'editor', 'thumbnail' )\n\n );\n\n\n register_post_type( 'lh_quotes', $args );\n\t}", "function compendium_register_type($slug, $name, $pname, $dicon) {\n $pt_slug = $slug;\n $tax_slug = $slug . '-category';\n\n register_post_type($pt_slug, array(\n 'labels' => array(\n 'name' => $pname,\n 'singular_name' => $name,\n 'add_new' => 'Add New',\n 'add_new_item' => 'Add New '.$name,\n 'edit_item' => 'Edit '.$name,\n 'new_item' => 'New '.$name,\n 'view_item' => 'View '.$name,\n 'search_items' => 'Search '.$pname,\n 'not_found' => 'No '.$pname.' found',\n 'not_found_in_trash' => 'No '.$pname.' found in trash',\n ),\n 'public' => true,\n 'menu_position' => 35,\n 'supports' => array('title','editor','thumbnail','excerpt'),\n 'menu_icon' => $dicon,\n 'rewrite' => array(\n 'slug' => 'resource-center/' . $pt_slug,\n 'with_front' => true\n ),\n ));\n\n register_taxonomy($tax_slug, $pt_slug, array(\n 'labels' => array(\n 'name' => 'Categories',\n 'singular_name' => 'Category',\n ),\n 'hierarchical' => true,\n ));\n}", "public function create_portfolio_taxonomies()\n {\n $labels = array(\n 'name' => _x( 'portfolio_category', 'taxonomy general name' ),\n 'singular_name' => _x( 'portfolio_category', 'taxonomy singular name' ),\n 'search_items' => __( 'Search portfolio_categories' ),\n 'popular_items' => __( 'Popular portfolio_categories' ),\n 'all_items' => __( 'All portfolio_categories' ),\n 'parent_item' => __( 'Parent portfolio_category' ),\n 'parent_item_colon' => __( 'Parent portfolio_category:' ),\n 'edit_item' => __( 'Edit portfolio_category' ),\n 'update_item' => __( 'Update portfolio_category' ),\n 'add_new_item' => __( 'Add New portfolio_category' ),\n 'new_item_name' => __( 'New portfolio_category Name' ),\n );\n register_taxonomy('portfolio_categories',array('portfolio'), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'portfolio_categories' ),\n ));\n }", "function country_custom_taxonomies() {\n\t$labels = array(\n\t\t'name' => 'Страны',\n\t\t'singular_name' => 'Страна',\n\t\t'search_items' => 'Поиск Стран',\n\t\t'all_items' => 'Все Страны',\n\t\t'parent_item' => 'Родительское поле',\n\t\t'parent_item_colon' => 'Родительское поле:',\n\t\t'edit_item' => 'Редактирование Страны',\n\t\t'update_item' => 'Обновить Страны',\n\t\t'add_new_item' => 'Добавить новое рабочее поле',\n\t\t'new_item_name' => 'Имя нового поля',\n\t\t'menu_name' => 'Страны'\n\t);\n\n\t$args = array(\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'country' )\n\t);\n\n\tregister_taxonomy('country', array('film'), $args);\n\n}", "public function register_taxonomy(){\n $labels = $this->jb_generate_tax_label('work category');\n $args = array(\n 'labels' => $labels,\n 'public' => true,\n 'show_in_nav_menus' => true,\n 'show_admin_column' => true,\n 'hierarchical' => true,\n 'show_tagcloud' => true,\n 'show_ui' => true,\n 'query_var' => true,\n 'rewrite' => array(\n 'slug' => jb_get_option('work_category_slug', 'work_category') ,\n 'hierarchical' => jb_get_option('work_category_hierarchical', false)\n ) ,\n 'capabilities' => array(\n 'manage_terms',\n 'edit_terms',\n 'delete_terms',\n 'assign_terms'\n )\n );\n register_taxonomy('work_category', array('jb_work') , $args);\n }" ]
[ "0.6718812", "0.6598343", "0.65285033", "0.64682776", "0.64632624", "0.64328915", "0.6418902", "0.6416722", "0.6398339", "0.6386658", "0.63728386", "0.6352394", "0.63428694", "0.63150233", "0.6286803", "0.62698144", "0.6267546", "0.62572664", "0.62428963", "0.6229403", "0.62234676", "0.6217226", "0.6215476", "0.6182018", "0.6177923", "0.6177923", "0.6177923", "0.61676383", "0.616331", "0.6157938", "0.6142011", "0.6138122", "0.6126017", "0.6122624", "0.61183625", "0.6105546", "0.6098975", "0.609117", "0.60842925", "0.60751", "0.6044172", "0.60408574", "0.6040162", "0.6030705", "0.60120016", "0.600669", "0.6001922", "0.6001514", "0.59999305", "0.59786344", "0.5978269", "0.59599996", "0.59572303", "0.59283346", "0.5919212", "0.59044886", "0.5903363", "0.58971155", "0.5897087", "0.58923393", "0.58887124", "0.58881605", "0.5867012", "0.5860136", "0.5836107", "0.5826757", "0.5825235", "0.58121175", "0.5809231", "0.57929635", "0.57875735", "0.57855004", "0.5777556", "0.57637227", "0.57538354", "0.57493234", "0.57324994", "0.57198006", "0.5717633", "0.5716907", "0.570811", "0.5701336", "0.56919235", "0.56886494", "0.5684799", "0.56839174", "0.56802976", "0.5678489", "0.56745887", "0.5671475", "0.56601065", "0.5651272", "0.56487566", "0.56473285", "0.5640845", "0.5638578", "0.5637794", "0.56303626", "0.5629476", "0.5622992" ]
0.69820523
0
Retreives Post Id from Meta Key
function get_post_id_by_meta_key_and_value($key, $value) { global $wpdb; $meta = $wpdb->get_results("SELECT * FROM `".$wpdb->postmeta."` WHERE meta_key='".$wpdb->escape($key)."' AND meta_value='".$wpdb->escape($value)."'"); if (is_array($meta) && !empty($meta) && isset($meta[0])) { $meta = $meta[0]; } if (is_object($meta)) { return $meta->post_id; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getKeyField() {\n return \"PostID\"; \n }", "public function get_id() {\n\t\treturn $this->_post->ID;\n\t}", "public function getPostId()\n {\n return $this->postId;\n }", "public function getPostId()\n {\n return $this->postId;\n }", "public function getPostId() {\n\t\treturn ($this->postId);\n\t}", "public function getPostId()\n {\n return $this->postId;\n }", "public function getPostId()\n {\n return $this->post_id;\n }", "public function getID(){\r\n\t\t\treturn $this->id_post;\r\n\t\t}", "public function getPostId() {\n\n\t\treturn $this->postId;\n\t}", "public function getPostId()\n {\n return $this->postId;\n }", "public function getPostId() {\n\t\treturn $this->post_id;\n\t}", "public function id() { return $this->post->ID; }", "public static function meta_id_field() { return 'id'; }", "public function find_oembed_post_id($cache_key)\n {\n }", "public function guid() { return $this->post->guid; }", "function meta($key) {\n return get_post_meta($post->ID, $key, true);\n}", "protected function getCurrentPageIdFromGetPostData() {}", "public function getPostID(): string\n {\n return $this->_postID;\n }", "public function getPostID(){\n return $this->POST_ID;\n }", "public function getPost_id()\n {\n return $this->post_id;\n }", "public function getIdPost()\n {\n return $this->idPost;\n }", "public function getPostID()\n {\n return $this->postID;\n }", "public static function id()\n {\n // can't use facades to access properties unfortunately!\n return query()->post->ID ?? null;\n }", "function get_post_meta($post_id, $key = '', $single = \\false)\n {\n }", "function cjpopups_post_by_metakey($meta_key, $meta_value){\n\tglobal $wpdb;\n\t$query = $wpdb->get_row(\"SELECT * FROM $wpdb->postmeta WHERE meta_key = '{$meta_key}' and meta_value = '{$meta_value}'\");\n\treturn (!empty($query)) ? $query->post_id : false;\n}", "public function getIdPost()\n {\n return $this->id_post;\n }", "public function getPostId(): Uuid {\n\t\treturn ($this->postId);\n\t}", "public function get_post_ID() {\n\t\treturn $this->post_id;\n\t}", "abstract public function get_meta_key();", "function get_post_ID() {\n\t\treturn $this->get_data( 'comment_post_ID' );\n\t}", "function sc_get_post_meta( $id, $key ){\n\treturn (object)get_post_meta( $id, $key, true );\n}", "function get_meta_value_by_post_id( $post_id = false, $meta_key = '' ) {\n \n if( ! absint( $post_id ) || empty( $meta_key ) ) {\n return false;\n }\n \n $user_id = _s_get_session_user_id();\n \n $args = array(\n 'p' => $post_id, // ID of a page, post, or custom type\n 'post_type' => 'any',\n 'meta_query' => array(\n array(\n 'key' => $meta_key,\n 'value' => $user_id,\n ),\n ),\n );\n \n $query = new WP_Query( $args );\n \n return $query->found_posts;\n}", "public function authorId() { return $this->post->post_author; }", "function get_post_meta_by_id($mid)\n {\n }", "static function get_post_by_id($post){\n\t\treturn self::$db->where('token_id',$post)->get('blog')->results();\n\t}", "public function getIdPost(): int\n {\n return $this->id_post;\n }", "function dsq_identifier_for_post($post) {\n\tif('post' == get_post_type($post)) {\n\t\t$guid_parts = parse_url($post->guid);\n\t\tif(isset($guid_parts['query'])) {\n\t\t\tparse_str($guid_parts['query'], $guid_parts_query);\n\t\t\tif(isset($guid_parts_query['p']) && $guid_parts_query['p'] != $post->ID) {\n\t\t\t\t//all this for that...\n\t\t\t\treturn $guid_parts_query['p'] . ' ' . $post->guid;\n\t\t\t}\n\t\t}\n\t}\n\treturn $post->ID . ' ' . $post->guid;\n}", "static function getCustomizedPostsIdFromPostType($post_type){\n $publishedPostId = array();\n $parameter = self::generatePostsParameter($post_type);\n $posts_array = get_posts($parameter);\n\n for ($i=0; $i < count($posts_array) ; $i++) {\n array_push($publishedPostId,$posts_array[$i]->ID);\n }\n\n return $publishedPostId;\n }", "public function get_post_id() {\n\t\tglobal $post;\n\n\t\tif ( isset( $post ) && is_object( $post ) ) {\n\t\t\treturn $post->ID;\n\t\t}\n\n\t\tif ( ! empty( $_GET['post'] ) ) {\n\t\t\treturn absint( $_GET['post'] );\n\t\t}\n\n\t\tif ( ! empty( $_POST['ID'] ) ) {\n\t\t\treturn absint( $_POST['ID'] );\n\t\t}\n\n\t\tif ( ! empty( $_POST['post_ID'] ) ) {\n\t\t\treturn absint( $_POST['post_ID'] );\n\t\t}\n\n\t\treturn 0;\n\t}", "function pms_get_post_meta( $post_id, $key = '', $single = false ) {\r\n\r\n if( empty( $key ) ) {\r\n $post_meta = get_post_meta( $post_id );\r\n\r\n foreach( $post_meta as $key => $value ) {\r\n $post_meta[$key] = $value[0];\r\n }\r\n\r\n return $post_meta;\r\n }\r\n\r\n return get_post_meta( $post_id, $key, $single );\r\n\r\n }", "public function getVotePostId(): int {\n\t\treturn ($this->votePostId);\n\t}", "public function id()\n\t{\n\t\treturn $this->get($this->meta()->primary_key);\n\t}", "public function getBlogKey();", "function url_to_postid($url)\n {\n }", "function get_post_thumbnail_id( $post = null ) {\n\t$post = get_post( $post );\n\tif ( ! $post ) {\n\t\treturn '';\n\t}\n\treturn get_post_meta( $post->ID, '_thumbnail_id', true );\n}", "public static function get_post_meta($post,$key){\n\t\t$post_id = false;\n\n\t\tif(!is_numeric($post)){\n\t\t\tif(isset($post->id)){\n\t\t\t\t$post_id = $post->id;\n\t\t\t}else{\n\t\t\t\t$post_id = $post->ID;\n\t\t\t}\n\t\t}else{\n\t\t\t$post_id = $post;\n\t\t}\n\n\t\tif(!$post_id) return [];\n\n\t\tstatic $cache = [];\n\n\t\tif(isset($cache[$post_id][$key])) return $cache[$post_id][$key];\n\n\t\t$meta = get_post_meta($post_id,$key,true);\n\n\t\tif($meta){\n\t\t\t$cache[$post_id][$key] = $meta;\n\t\t}\n\n\t\treturn $meta;\n\t}", "public function getMaconomyId(): string\n {\n return (string)$this->data['instancekeyField'];\n }", "protected function get_movie_id() {\n\n\t\tglobal $wpdb;\n\n\t\tif ( is_null( $this->attributes['title'] ) ) {\n\t\t\treturn $this->attributes['id'];\n\t\t}\n\n\t\t$like = $wpdb->esc_like( $this->attributes['title'] );\n\t\t$like = '%' . $like . '%';\n\n\t\t$post_id = $wpdb->get_var(\n\t\t\t$wpdb->prepare(\n\t\t\t\t\"SELECT ID FROM {$wpdb->posts} WHERE post_title LIKE %s\",\n\t\t\t\t$like\n\t\t\t)\n\t\t);\n\n\t\t$this->attributes['id'] = $post_id;\n\n\t\treturn $post_id;\n\t}", "function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}", "function get_specific_postmeta_data($postmetaDatabaseName, $userEmail) {\r\n global $wpdb;\r\n $postmetaDatabaseNameMetaVal = $postmetaDatabaseName . \".meta_value\";\r\n $postIdSearch = \"SELECT * FROM $postmetaDatabaseName where $postmetaDatabaseNameMetaVal = '$userEmail' LIMIT 1\";\r\n $postIdSearchObj = $wpdb->get_row($postIdSearch, OBJECT);\r\n $postedID = $postIdSearchObj->post_id;\r\n return $postedID;\r\n}", "protected function getCustomPostID(): ?int\n {\n if (\\is_singular($this->getCustomPostType())) {\n return App::getState(['routing', 'queried-object-id']);\n }\n return null;\n }", "function wpv_post_meta($post_id, $meta='', $single=false) {\n\t$real_id = wpv_get_the_ID();\n\n\tif ($real_id && $post_id != $real_id)\n\t\t$post_id = $real_id;\n\n\treturn get_post_meta( $post_id, $meta, $single );\n}", "function get_acf_post_id() {\n\tif ( function_exists( 'acf_maybe_get_POST' ) ) {\n\t\treturn intval( acf_maybe_get_POST( 'post_id' ) );\n\t} else {\n\t\tglobal $post;\n\t\treturn $post->ID;\n\t}\n}", "function get_the_guid($post = 0)\n {\n }", "public function getHypePostId() {\n\t\treturn $this->hypePostId;\n\t}", "function acf_get_post_id_info($post_id = 0)\n{\n}", "public static function get_meta( string $key, $post_id = false ) {\n\t\t$user_id = get_current_user_id();\n\t\t$cache = wpcom_vip_cache_get( \"request_${user_id}\", self::CACHE_GROUP );\n\n\t\tif ( isset( $cache['meta'][ $key ] ) ) {\n\t\t\t$value = $cache['meta'][ $key ];\n\t\t} elseif ( $post_id ) {\n\t\t\t$value = get_post_meta( $post_id, $key, true );\n\t\t}\n\n\t\treturn $value;\n\t}", "public function getID() {\n return array_key_exists($this->_key_field, $this->_data) ? $this->_data[$this->_key_field] : null;\n }", "private function getNewID()\n\t{\n\t\t$ids = array_keys($this->metadata['posts']);\n\t\t$lastId = (count($ids) > 0) ? max($ids) : 0;\n\n\t\treturn $lastId + 1;\n\t}", "function get_single_post_data($post_id, $key = 'post_content'){\n\t$post_data = get_post($post_id,ARRAY_A);\n\tif($post_data && is_array($post_data) && isset($post_data[$key])){\n\t\treturn $post_data[$key];\n\t}else{\n\t\treturn false;\n\t}\n}", "function get_single_post_data($post_id, $key = 'post_content'){\n\t$post_data = get_post($post_id,ARRAY_A);\n\tif($post_data && is_array($post_data) && isset($post_data[$key])){\n\t\treturn $post_data[$key];\n\t}else{\n\t\treturn false;\n\t}\n}", "public static function saveAndGetId($post)\n {\n $model = new static;\n if ($model->load($post) && $model->save()) {\n return $model->id;\n }\n return null;\n }", "public function getSinglePostData($key) { \n $sql = $this->getDetailedSelect() . $this->innerJoin(). \" WHERE \" .$this->getKeyField() .\" = :id GROUP BY \". $this->getKeyField() . \" ORDER BY PostTime DESC\" ;\n $statement = DatabaseHelper::runQuery($this->connection, $sql, Array(':id' => $key));\n return $statement->fetch();\n }", "function get_field($key, $page_id = 0) { /// get_field é para somente pegar o valor do que quero\n $id = $page_id !== 0 ? $page_id : get_the_ID();\n return get_post_meta($id, $key, true);\n }", "function get_the_ID()\n {\n }", "function getMetadataId($reviewObjectTypeId, $key) {\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT metadata_id FROM review_object_metadata WHERE review_object_type_id = ? AND metadata_key = ? ORDER BY seq',\n\t\t\tarray((int) $reviewObjectTypeId, $key)\n\t\t);\n\t\t$returner = isset($result->fields[0]) ? $result->fields[0] : false;\n\t\t$result->Close();\n\t\treturn $returner;\n\t}", "public static function get_from_post( $post_id, $key, $single = false ) {\r\n\t\treturn get_post_meta( $post_id, '_'.LP_PLUGIN_NAME.'_'. $key, $single );\r\n\t}", "function get_site_meta($site_id, $key = '', $single = \\false)\n {\n }", "function dtm_get_post_id( $post_type, $post_id ) {\n\t//$accepted_post_type = array( 'article', 'listicle' );\n\t//$post_type = self::get_post_type( $post_type );\n\t//if ( WP_Base::is_toh() ) {\n\t//\tif ( in_array( $post_type, $accepted_post_type ) ) {\n\t//\t\treturn ( '' );\n\t//\t}\n\t//\n\t//\tif ( WP_Base::is_recipe() ) {\n\t//\t\treturn get_post_meta( $post_id, 'rms_legacy_id', true );\n\t//\t}\n\t//}\n\t$post_id = apply_filters( 'dtm_wordpress_content_id', $post_id );\n\n\treturn $post_id;\n}", "function redart_ID(){\r\n\t$post = redart_global_variables('post');\r\n\t$postID = false;\r\n\r\n\tif( ! is_404() ){\r\n\r\n\t\tif( function_exists('is_woocommerce') && is_woocommerce() ){\r\n\r\n\t\t\t$postID = woocommerce_get_page_id( 'shop' );\r\n\r\n\t\t} elseif( is_search() ){\r\n\r\n\t\t\t$postID = false;\r\n\r\n\t\t} else {\r\n\r\n\t\t\t$postID = get_the_ID();\r\n\r\n\t\t}\r\n\t}\r\n\r\n\treturn $postID;\r\n}", "function get_post_custom_keys($post_id = 0)\n {\n }", "private function get_requested_post_id(){\n if(isset($_GET['post_id']) && $this->requested_post_is_valid() && $this->can_continue_current_form()){\n return (int) $_GET['post_id'];\n }\n\n return 'new_post';\n }", "public function getID()\n {\n return $this->getKey();\n }", "public function fetch_the_id() {}", "private function getIdFromSpecialKey($key){\n\t\t$sql = \"SELECT id FROM member_info WHERE special_key = :specialKey\";\n\t\t$query = $this->db->pdo->prepare($sql);\n\t\t$query->bindValue(':specialKey', $key);\n\t\t$query->execute();\n\t\t$result = $query->fetch(PDO::FETCH_OBJ);\n\t\treturn $result->id;\n\t}", "protected function getLastPostId() {\n $this->lastPostId = Post::select('habr_id')->orderBy('unix_time','desc')->first()->habr_id;\n }", "function nb_get_post_related_artist_id( $object, $field_name, $request ) {\n\n return (int) get_post_meta( $object['id'], $field_name, true );\n\n}", "public function amazon_identifier_save_post_meta( $post_id ) {\n\n\t\t/* Verify the nonce before proceeding. */\n\t\tif ( !isset( $_POST['amazon_identifier_post_nonce'] ) ||\n\t\t \t !wp_verify_nonce( $_POST['amazon_identifier_post_nonce'], 'amazon_identifier_nonce_file' ) ) {\n\t\t\treturn $post_id;\n\t\t}\n\n\t\t/* Get the posted data and sanitize it for use as an HTML class. */\n\t\t$new_meta_value = ( isset( $_POST['amazon_identifier'] ) ? trim( sanitize_html_class( $_POST['amazon_identifier'] )) : '' );\n\n\t\t/* Get the meta key. */\n\t\t$meta_key = 'amazon_identifier';\n\n\t\t/* Get the meta value of the custom field key. */\n\t\t$meta_value = get_post_meta( $post_id, $meta_key, true );\n\n\t\t/* If a new meta value was added and there was no previous value, add it. */\n\t\tif ( !empty( $new_meta_value ) && empty( $meta_value ) ) {\n\t\t\tadd_post_meta( $post_id, $meta_key, $new_meta_value, true );\n\t\t}\n\n\t\t/* If the new meta value does not match the old value, update it. */\n\t\telseif ( $new_meta_value && $new_meta_value != $meta_value ) {\n\t\t\tupdate_post_meta( $post_id, $meta_key, $new_meta_value );\n\t\t}\n\n\t\t/* If there is no new meta value but an old value exists, delete it. */\n\t\telseif ( empty( $new_meta_value ) && !empty( $meta_value ) ) {\n\t\t\tdelete_post_meta( $post_id, $meta_key, $meta_value );\n\t\t}\n\t}", "public function id()\n {\n return $this->read($this->metadata['pk']->name);\n }", "function acf_decode_post_id($post_id = 0)\n{\n}", "function wpbm_get_image_id( $image_url ){\n global $wpdb;\n $query = \"SELECT ID FROM {$wpdb -> posts} WHERE guid='$image_url'\";\n $id = $wpdb -> get_var( $query );\n return $id;\n }", "function get_postdata($postid)\n {\n }", "function get_book_meta( $id, $key, $single = true ) {\r\n\tif ( strpos($key, 'book_') === false )\r\n\t\t$key = \"book_$key\";\r\n\treturn get_post_meta($id, $key, $single);\r\n}", "public\nfunction getPostUserId(): Uuid {\n\treturn ($this->postUserId);\n}", "function horsaw_get_post($post_id = null, $model = null) {\n\tif ( is_null( $post_id ) ) {\n\t\t$post_id = get_the_id();\n\t}\n\n\t// Invalid\n\tif ( empty( $post_id ) ) {\n\t\treturn false;\n\t}\n}", "function cc_get_unique_post_meta_values( $key = '') {\n \n\tglobal $wpdb;\n\t$metas = array();\n\t\n if( !empty( $key ) ){\n\t\t\n\t\t$qry = $wpdb->prepare( \n\t\t\t\t\"SELECT post_id, meta_value \n\t\t\t\tFROM {$wpdb->postmeta} \n\t\t\t\tWHERE meta_key = '%s'\", \n\t\t\t\t$key\n\t\t\t);\n\n\t\t$res = $wpdb->get_results( $qry );\n\t\t\n\t\tif($res){\n\n\t\t\tforeach ( $res as $r ) $metas[$r->post_id] = $r->meta_value;\t\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n return $metas;\n}", "function kt_get_image_id($image_url) {\n global $wpdb;\n $attachment = $wpdb->get_col($wpdb->prepare(\"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $image_url )); \n return $attachment[0]; \n}", "function yt_get_post_id(){\n\n\tglobal $post, $wp_query;\n\n\t$post_id = isset( $post->ID ) ? $post->ID : 0;\n\n\tif( $wp_query->is_home && get_option('page_for_posts' ) )\n\t\t$post_id = get_option('page_for_posts' );\n\n\tif( yt_is_woocommerce() && wc_get_page_id('shop') )\n\t\t$post_id = wc_get_page_id('shop');\n\n\treturn $post_id;\n\n}", "private function getPostId($facebook_id)\n\t{\n\t\t$string = substr($facebook_id, strpos($facebook_id, '_') + 1);\n\t\treturn $string;\n\t}", "public function getMeta($key)\n {\n return $this->meta[$key] = get_post_meta($this->id, $key, true);\n }", "function get_post_from_id($id){\n\t\t$hsl = $this->db->query(\"SELECT * FROM `jsts_post` WHERE `keywords` LIKE '%\".$id.\"%'\");\n\t\treturn $hsl;\n\t}", "public function getStoreId($post_id) {\n\t\t##\n\t\t##\tPARAMETERS\n\t\t##\t\t@post_id\n\t\t##\n\t\t##\tRETURN\n\t\t##\t\tThe store ID\n\t\t$sql = <<<EOD\n\t\tSELECT\n\t\t\t{$this->wpdb->prefix}topspin_stores.store_id\n\t\tFROM {$this->wpdb->prefix}topspin_stores\n\t\tWHERE\n\t\t\t{$this->wpdb->prefix}topspin_stores.post_id = %d\nEOD;\n\t\t$data = $this->wpdb->get_var($this->wpdb->prepare($sql,array($post_id)));\n\t\treturn $data;\n\t}", "public function getChiefId($post){ \n\t\tforeach($this->structure as $key => $value){\n\t\t\tif($value['number'] == $this->structure[$post]['number'] - 1){\n\t\t\t\treturn mt_rand($value['segment-start'], $value['segment-end']);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "function get_post_custom_values($key = '', $post_id = 0)\n {\n }", "function get_siteid_from_postid($postid){\n\tglobal $mysqli_db4s1;\n\tif(empty($mysqli_db4s1)){\n\t\t$mysqli_db4s1 = db4s1_connect();\n\t}\n\t$postid_sql = $mysqli_db4s1->real_escape_string($postid);\n\t$sql = \"select t.slug from wp_terms t left join wp_term_taxonomy tt on t.term_id=tt.term_id left join wp_term_relationships tr on tr.term_taxonomy_id=tt.term_taxonomy_id where tt.taxonomy='category' and tt.parent='0' and t.slug!='uncategorized' and t.slug!='videos' and tr.object_id='$postid_sql' limit 1\";\n\t$result = nano_query($sql,'nano_db','slave');\n\tif($result->num_rows){\n\t\t$row = $result->fetch_assoc();\n\t\treturn $row['slug'];\n\t}\n\treturn false;\n}", "function gettid_pid($pid)\n{\n $tid = mysql_fetch_array(mysql_query(\"SELECT tid FROM ibwf_posts WHERE id='\".$pid.\"'\"));\n return $tid[0];\n}", "public function getPostcodeAnywhereId();", "public function id()\n {\n return $this->getFromCache(\n ['type' => 'id']\n );\n }", "public function metaTag()\n {\n return $this->meta()->where('id', $this->meta_id)->first();\n }", "public function getPostAuthorId() : Uuid {\n\t\treturn $this->postAuthorId;\n\t}" ]
[ "0.72524434", "0.6795377", "0.6756939", "0.6756939", "0.6752889", "0.66948944", "0.66713715", "0.66638386", "0.6656644", "0.6640809", "0.66318136", "0.66162735", "0.6552369", "0.65450555", "0.65189976", "0.64934975", "0.64695567", "0.64685637", "0.64552027", "0.6436293", "0.64235765", "0.6416384", "0.6404983", "0.6395065", "0.63728404", "0.63708866", "0.6361543", "0.63084006", "0.62671113", "0.62033254", "0.6190432", "0.6175778", "0.6151822", "0.6147038", "0.61409324", "0.6125732", "0.610857", "0.6089281", "0.607713", "0.6053102", "0.6028902", "0.6024803", "0.5984087", "0.5948666", "0.59482247", "0.59413344", "0.5936889", "0.5931899", "0.5914277", "0.59077966", "0.5905369", "0.5901288", "0.5893892", "0.58813584", "0.58633137", "0.5860713", "0.5836642", "0.58141315", "0.58104336", "0.5807662", "0.5807662", "0.58017474", "0.58002514", "0.57916456", "0.5790199", "0.578282", "0.5779085", "0.5767647", "0.5766153", "0.57655954", "0.5764285", "0.57584417", "0.5753964", "0.57473963", "0.5745304", "0.5731207", "0.5722122", "0.5720766", "0.5686947", "0.56836057", "0.5680934", "0.56363606", "0.5610666", "0.56103504", "0.5599985", "0.55900294", "0.5589513", "0.5580973", "0.5572505", "0.55724186", "0.5571692", "0.5560473", "0.55530125", "0.5548759", "0.5547106", "0.5541751", "0.5539514", "0.5534573", "0.5534258", "0.5526084" ]
0.6553685
12
Prints Note field in front end and retieves exisintg note as placeholder
function nt_course_note_entry_field() { global $post; //ID's $current_user = get_current_user_id(); $current_lesson_id = $post->ID; $current_post_type = get_post_type(); //Checks if note exists and changes title and body variables accordingly $args = array( 'post_type' => 'coursenote', 'post_status' => array('draft'), 'meta_query' => array( //'relation' => 'AND', array( 'key' => 'nt-note-current-lessson-id', 'value' => $current_lesson_id, 'compare' => '=', ) ), 'author' => $current_user ); $the_query = new WP_Query( $args ); if ($the_query->have_posts()){ while ( $the_query->have_posts() ) : $the_query->the_post(); $title = get_the_title(); $body = get_the_content(); endwhile; wp_reset_postdata(); } else { $title = 'Note Title'; $body = 'Enter Lesson Notes here'; } ?> <div id="nt_note_cont" class="note-container"> <div class="note-header"> <div class="note-header-title"> <?php _e('Notes'); ?> <div id="apf-response"></div> </div> <div class="note-header-actions"> </div> </div> <div class="note-body"> <form id="nt-course-note" action="" method="post"> <?php wp_nonce_field( basename(__FILE__), 'nt-course-note-nonce') ?> <input type="text" name="nt-note-title" id="nt-note-title" value="<?php echo $title; ?>" placeholder="" > <input type="hidden" name="nt-note-user-id" id="nt-note-user-id" value="<?php echo $current_user; ?>"> <input type="hidden" name="nt-note-current-lesson-id" id="nt-note-current-lessson-id" value="<?php echo $current_lesson_id; ?>"> <input type="hidden" name="nt-note-current-post-type" id="nt-note-current-post-type" value="<?php echo $current_post_type; ?>"> <textarea rows="8" name="nt-note-body" id="nt-note-body" class="" placeholder=""/><?php echo $body; ?></textarea> <input type="text" id="xyz" name="<?php echo apply_filters( 'honeypot_name', 'date-submitted') ?>" value="" style="display:none"> <input type="submit" id="nt-note-submit" value="<?php _e('Save Notes'); ?>"/> </form> </div> </div> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shownote($note){\n\treturn \"onfocus=\\\"note('<b>NOTE:</b><br>$note');\\\"\n\t\t\tonblur=\\\"note('');\\\"\";\n}", "function setNoteText(){\n $html = \"\";\n \n $this->aFields[\"note\"]->editable = true;\n $this->aFields[\"note\"]->value = $html;\n }", "public static function note($text = null)\n\t{\n $label = Text::_('JNOTE');\n\n $html = <<<EOT\n<label for=\"note\">$label</label>\n<input type=\"text\" name=\"note\" id=\"note\" value=\"$text\"/>\nEOT;\n\n return $html;\n }", "public function getNote();", "public function get_checkout_form_note() {\n\n\t\t\tif ( astra_get_option( 'two-step-checkout-modern-note' ) ) {\n\n\t\t\t\t$checkout_note = astra_get_option( 'two-step-checkout-modern-note-text' );\n\n\t\t\t\t$two_step_note = '';\n\n\t\t\t\t$two_step_note .= \"<div class='ast-embed-checkout-form-note'>\";\n\n\t\t\t\t$two_step_note .= '<p>' . wp_kses_post( $checkout_note ) . '</p>';\n\n\t\t\t\t$two_step_note .= '</div>';\n\n\t\t\t\techo $two_step_note; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\t}\n\t\t}", "function render_notes_meta() {\n\t\tglobal $post;\n\t\t$details = get_post_meta( $post->ID, 'country_details', true );\n\t\t?>\n\t\t<textarea cols=\"50\" rows=\"5\" name=\"country_details\"><?php echo $details; ?></textarea>\n\t\t<?php\n\t}", "public function render_checkout_two_step_form_note() {\n\t\t\treturn astra_get_option( 'two-step-checkout-modern-note-text' );\n\t\t}", "public function getNote() : string\n {\n return $this->note;\n }", "public function note() { return $this->_m_note; }", "public function getDefaultNote()\n {\n return null;\n }", "public function getNote()\r\n {\r\n return $this->note;\r\n }", "function getNote()\n {\n return $this->note;\n }", "static function add_notes(): void {\r\n\t\tself::add_acf_inner_field(self::divisions, self::notes, [\r\n\t\t\t'label' => 'Notes',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => 'Any notes pertinent to the division.',\r\n\t\t\t'required' => 0,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '40',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t]\r\n\t\t]);\r\n\t}", "public function getNote()\n {\n return $this->note;\n }", "public function getNote()\n {\n return $this->note;\n }", "public function getNote()\n {\n return $this->note;\n }", "public function getNote()\n {\n return $this->note;\n }", "public function getNote()\n {\n return $this->note;\n }", "public function getNote()\n {\n return $this->note;\n }", "public function getNote()\n {\n return $this->note;\n }", "public function getNote()\n {\n return $this->note;\n }", "public function getNote()\n {\n return $this->note;\n }", "public function getNote()\n {\n return $this->note;\n }", "public function getNote()\n {\n return $this->note;\n }", "public static function versionNote($text = null)\n\t{\n // @TODO: Version notes are **NOT** saving from admin edit screens\n $label = Text::_('JGLOBAL_FIELD_VERSION_NOTE_LABEL');\n\n $html = <<<EOT\n<label for=\"version_note\">$label</label>\n<input type=\"text\" name=\"version_note\" id=\"version_note\" value=\"$text\"/>\nEOT;\n\n return $html;\n }", "function getNote() {\n return $this->note;\n }", "function projectpentagon_tastingnotes() {\n\t wp_nonce_field( plugin_basename( __FILE__ ), 'myplugin_noncename' );\n\t $post_idinhere\t=\t$_GET['post']; //GET THE ID OUTSIDE OF THE LOOP\n\t \n\t $get_field_name\t=\t get_option('projectpentagon-titleonpages');\n\t $meta_value_field = get_post_meta($post_idinhere, 'tasting-notes', true); \n\tif($meta_value_field1)\n\t\t{\n\t\t \t//echo \"we're at debut point a\";//debug\n\t\t \t$display1 = $meta_value_field1; \n\t\t}\n\telse \n\t\t{\n\t\t \t//echo \"we're at debut point b\". $meta_value_field1 .\"\";//debug\n\t\t \t$display1 = \"enter value here.\";\n\t\t}\n\n\t\t// we're not using _e because its user input text we're retrieving.\n\t // we'll assume that the user put it in the database in their preferred language\n\t\t\t echo '<label for=\"'. $get_field_name .'\">';\n\t\t\techo $get_field_name;\n\t\t \techo '</label> <br /> ';\n\t\t\techo '<textarea id=\"tasting-notes\" name=\"tasting-notes\" cols=\"60\" rows=\"4\" tabindex=\"30\" style=\"width: 97%;\">'. $meta_value_field .'</textarea>';\t\n}", "protected function NotesText() {\n\t$out = NULL;\n \n\t$sPkgNotes = $this->Value('PkgNotes');\n\tif (!is_null($sPkgNotes)) {\n\t $out .= '<b>Pkg</b>: '.$sPkgNotes;\n\t}\n\t\n\t$sOrdNotes = $this->Value('OrdNotes');\n\tif (!is_null($sOrdNotes)) {\n\t $out .= '<b>Ord</b>: '.$sOrdNotes;\n\t}\n\t\n\treturn $out;\n }", "function createNote();", "public function show(Note $note)\n {\n //\n }", "public function show(Note $note)\n {\n //\n }", "public function show(Note $note)\n {\n //\n }", "public function show(Note $note)\n {\n //\n }", "public function show(Note $note)\n {\n //\n }", "public function getNote(): ?string\n {\n if (count($this->note) == 0) {\n return null;\n }\n return $this->note['value'];\n }", "function sf_note($data, $force = false, $block_header_on_echo = false)\n {\n IOFunctions::out(\n LogLevel::NOTE,\n $data,\n $force,\n $block_header_on_echo\n );\n }", "public function getNote() {\n if (isset($_REQUEST['note'])) {\n return $_REQUEST['note'];\n } else\n return 0;\n }", "private function createNote($string) {\n\t\t$string = $this->cleanString($string);\n\t\t$string = '</p><div class=\"note\">'.$string.'</div><p>';\n\t\treturn $string;\n\t}", "public function getContentNote() {\n $fields = array(\n 'contentNote' => array('contentNoteDescription', 'contentNoteElement')\n );\n $result = TingOpenformatMethods::parseFields($this->_getContent(), $fields);\n return $result;\n }", "public function getInternalNote() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->internalNote;\r\n\t}", "private function term_block_note() {\n\n $text = '';\n $len = 0;\n $raw = '';\n\n $prefix = $this->term['note_prefix'];\n $lines = $this->_lines;\n $line = trim($lines->cur());\n $done = false;\n $note = false;\n\n // allow for spaces before the note indicator (some may prefer an indented syntax...)\n if ($line == $prefix) {\n $lines->test();\n $raw = $line;\n do {\n $line = $lines->move()->cur();\n if (trim($line) == $prefix) {\n $raw .= \"\\n\" . $prefix;\n $done = true;\n $lines->move();\n } else {\n $text .= (empty($text)) ? $line : \"\\n\" . $line;\n $raw .= \"\\n\" . $line;\n $len++;\n }\n } while ($lines->valid() && ! $done);\n\n if ($done) {\n $note = (object) array('text' => $text, 'len' => $len, 'raw' => $raw);\n } else {\n $lines->reject();\n }\n }\n return $note;\n }", "public function getCustomerNote();", "function notes_meta_box_callback( $post ) {\n\n\t// Add an nonce field so we can check for it later.\n\twp_nonce_field( 'notes_meta_box', 'notes_meta_box_nonce' );\n\n\t/*\n\t * Use get_post_meta() to retrieve an existing value\n\t * from the database and use the value for the form.\n\t */\n\t$value = get_post_meta( $post->ID, '_my_meta_value_key', true );\n\n\techo '<label for=\"notes_new_field\">';\n\t_e( 'Description for this field', 'notes_textdomain' );\n\techo '</label> ';\n\techo '<input type=\"text\" id=\"notes_new_field\" name=\"notes_new_field\" value=\"' . esc_attr( $value ) . '\" size=\"25\" />';\n}", "public function setNote($note);", "private function note() {\n\n if ($this->verbose) return call_user_func_array(\"note\", func_get_args());\n }", "function how_will_i_study_box(){\n\n\tglobal $post;\n\t$how_will_i_study = get_post_meta($post->ID, 'how_will_i_study', true); \n?>\n\n\t<div class=\"padding\">\n\t\n\t\t<!-- Intro -->\n \t<textarea name=\"how_will_i_study\" id=\"how_will_i_study\" class=\"\"><?php echo $how_will_i_study; ?></textarea>\n\t\n\t</div>\n\n<?php }", "function placeholder_comment_form_field($fields) {\n $replace_comment = __('Your Comment', 'textdomain');\n\n $fields['comment_field'] = '<p class=\"comment-form-comment\"><label for=\"comment\">' . _x( 'Comment', 'noun' ) .\n '</label><textarea id=\"comment\" name=\"comment\" cols=\"45\" rows=\"8\" placeholder=\"'.$replace_comment.'\" aria-required=\"true\"></textarea></p>';\n\n return $fields;\n }", "function addNote()\n {\n $replace = array();\n\n //current logged in user details\n $userInfo = $this->userInfo();\n\n $patientId = $this->value('patient_id');\n\n $msg = \"\";\n\n //save button clicked!\n if(\"Save\" == $this->value('submitted'))\n {\n $newNote = $this->value('note');\n\n if(strlen(trim($newNote)) == 0)\n {\n $msg = '<div style=\"padding-left:5px;color:red;\">Please enter a note for this patient.</div>';\n }\n else\n {\n $insertArr = array(\n 'patient_id' => $patientId,\n 'provider_id' => $userInfo['user_id'],\n 'note' => $this->encrypt_data($this->value('note')),\n 'created' => date('Y-m-d H:i:s', time())\n );\n\n $result = $this->insert('notepad', $insertArr);\n\n /* if(!$result)\n {\n $msg = '<div style=\"padding-left:5px;\">Failed adding a note.</div>';\n } */\n }\n $privateKey = $this->config['private_key'];\n\n // patient details\n $query = \"SELECT \n AES_DECRYPT(UNHEX(name_first),'{$privateKey}') as name_first,\n AES_DECRYPT(UNHEX(name_last),'{$privateKey}') as name_last \n FROM \n user WHERE user_id = \" . $patientId;\n $result = $this->execute_query($query);\n\n $row = $this->fetch_array($result);\n\n $replace = $this->notesList($patientId);\n $patientName = $row['name_first'] . \"&nbsp;&nbsp;\" . $row['name_last'];\n $replace['patient_id'] = $patientId;\n $replace['patientName'] = $patientName;\n $replace['statusMessage'] = $msg;\n }\n else\n {\n $replace = $this->notesList($patientId);\n }\n\n $replace['patient_id'] = $patientId;\n\n $this->output = $this->build_template($this->get_template(\"addNote\"), $replace);\n }", "public function getNote()\n {\n return $this->table->note;\n }", "protected function render()\n\t{\n\t\t$checkout = WC()->checkout();\n\t\tif (sizeof($checkout->checkout_fields) > 0) { ?>\n\t\t\t<div class=\"woocommerce-additional-fields\">\n\t\t\t\t<?php do_action('woocommerce_before_order_notes', $checkout); ?>\n\n\t\t\t\t<?php if (apply_filters('woocommerce_enable_order_notes_field', 'yes' === get_option('woocommerce_enable_order_comments', 'yes'))) : ?>\n\n\t\t\t\t\t<h3><?php _e('Additional information', 'woocommerce'); ?></h3>\n\n\t\t\t\t\t<div class=\"woocommerce-additional-fields__field-wrapper\">\n\t\t\t\t\t\t<?php foreach ($checkout->get_checkout_fields('order') as $key => $field) : ?>\n\t\t\t\t\t\t\t<?php woocommerce_form_field($key, $field, $checkout->get_value($key)); ?>\n\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t</div>\n\n\t\t\t\t<?php endif; ?>\n\n\t\t\t\t<?php do_action('woocommerce_after_order_notes', $checkout); ?>\n\t\t\t</div>\n<?php\n\t\t}\n\t}", "protected function _addNotes()\n\t{\n\t\t$windowId = $this->_Admin_Form_Controller->getWindowId();\n\n\t\treturn Admin_Form_Entity::factory('Script')\n\t\t\t->value(\"$(function (){\n\t\t\t\t$.adminLoad({ path: '/admin/crm/project/note/index.php', additionalParams: 'crm_project_id=\" . $this->_object->id . \"', windowId: '{$windowId}_notes' });\n\t\t\t});\");\n\t}", "public function add_note()\n {\n\n $cols = \"`desc`\";\n\n $value =\n \" '\" . $this->obj->all_data->notes->get_desc() . \"' \";\n\n\n $insert = $this->obj->insert(\"notes\", $cols, $value);\n return $insert;\n }", "public function getUserNote()\n {\n return $this->user_note;\n }", "public function _render_give_sequential_donation_code_preview( $field ) {\n\t\t\t?>\n\t\t\t<tr valign=\"top\" <?php echo ! empty( $field['wrapper_class'] ) ? 'class=\"' . $field['wrapper_class'] . '\"' : '' ?>>\n\t\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t\t<label\n\t\t\t\t\t\tfor=\"<?php echo esc_attr( $field['id'] ); ?>\"><?php echo esc_html( $field['name'] ) ?></label>\n\t\t\t\t</th>\n\t\t\t\t<td class=\"give-forminp\">\n\t\t\t\t\t<input id=\"<?php echo esc_attr( $field['id'] ); ?>\" class=\"give-input-field\" type=\"text\" disabled>\n\t\t\t\t\t<?php echo Give_Admin_Settings::get_field_description( $field ); ?>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<?php\n\t\t}", "function vibrantlife_fieldhelpers_get_field_tip( $description ) {\n\n\tob_start();\n\t?>\n\t<div class=\"fieldhelpers-field-description fieldhelpers-field-tip\">\n\t\t<span class=\"fieldhelpers-field-tip-toggle dashicons dashicons-editor-help\" data-toggle-tip></span>\n\t\t<p class=\"fieldhelpers-field-tip-text\">\n\t\t\t<?php echo $description; ?>\n\t\t</p>\n\t</div>\n\t<?php\n\n\treturn ob_get_clean();\n}", "function sample_render_metabox( $post ) {\n\t// Add nonce for security and authentication.\n\twp_nonce_field( 'custom_nonce_action', 'custom_nonce' );\n\n\t$notes = get_post_meta( $post->ID, 'notes', true );\n\n\t?>\n\t<textarea style=\"width: 100%; height: 200px;\" name=\"notes\"><?php echo esc_html( $notes ); ?></textarea>\n\t<?php\n}", "function cust_note_insert(){\r\n\t}", "function __editNotes()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //get the note\n $this->__viewNotes();\n\n //visibility\n $this->data['visible']['wi_my_note_edit'] = 1;\n $this->data['visible']['wi_my_note_view'] = 0;\n\n }", "function showContent()\n {\n // FIXME: URL, image, video, audio\n $this->out->elementStart('p', array('class' => 'entry-content'));\n \n \n $this->out->raw($this->notice->content);\n //$this->out->raw(common_render_content($this->notice->content, $this->notice));\n /*\n if ($this->notice->rendered) {\n $this->out->raw($this->notice->rendered);\n } else {\n // XXX: may be some uncooked notices in the DB,\n // we cook them right now. This should probably disappear in future\n // versions (>> 0.4.x)\n $this->out->raw(common_render_content($this->notice->content, $this->notice));\n }\n */\n $this->out->elementEnd('p');\n }", "public function setNote($text){\r\n $this->note = $text;\r\n }", "public function show(NoteInformation $noteInformation)\n {\n //\n }", "function express_editor_notes_title_submit() {\n $title = variable_get('express_editor_notes_title', NULL);\n if ($title == '') {\n variable_del('express_editor_notes_title');\n }\n}", "public function noteAction() {\n\tif($this->_getParam('id',false)) {\n\t$notes = new Findofnotereasons();\n\t$this->view->notes = $notes->getReasonDetails($this->_getParam('id'));\n\t} else {\n throw new Pas_Exception_Param($this->_missingParameter);\n\t}\n\t}", "function minorite_form_required_marker($variables) {\n return '<i><span class=\"visuallyhidden\">' . t('This field is required.') . '</span></i>';\n}", "function printTextInput($isPro,$options, $label, $id, $description, $type = 'text', $url='', $showSave = false) {\r\n if (empty($options[$id])) {\r\n $options[$id] = '';\r\n }\r\n \r\n $offset = '';\r\n if (ai_startsWith($label, 'i-')) {\r\n $offset = 'class=\"'.substr($label,0, 5).'\" ';\r\n $label = substr($label, 5);\r\n }\r\n if (!isset($options['demo']) || $options['demo'] == 'false') {\r\n $isPro = false;\r\n }\r\n $pro_class = $isPro ? ' class=\"ai-pro\"':'';\r\n\r\n if ($isPro) {\r\n $label = '<span alt=\"Pro feature\" title=\"Pro feature\">'.$label.'</span>';\r\n }\r\n\r\n echo '\r\n <tr'.$pro_class.'>\r\n <th scope=\"row\" '.$offset.'>' . $label . renderExampleIcon($url) . renderExternalWorkaroundIcon($showSave). '</th>\r\n <td><span class=\"hide-print\">\r\n <input name=\"' . $id . '\" type=\"' . $type . '\" id=\"' . $id . '\" value=\"' . esc_attr($options[$id]) . '\" /><br></span>\r\n <p class=\"description\">' . $description . '</p></td>\r\n </tr>\r\n ';\r\n}", "protected function getRecordLinkNote($field)\n {\n // Normalize blank relationship indicator to 0:\n $relationshipIndicator = $field->getIndicator('2');\n if ($relationshipIndicator == ' ') {\n $relationshipIndicator = '0';\n }\n\n // Assign notes based on the relationship type\n $value = $field->getTag();\n switch ($value) {\n case '780':\n if (in_array($relationshipIndicator, range('0', '7'))) {\n $value .= '_' . $relationshipIndicator;\n }\n break;\n case '785':\n if (in_array($relationshipIndicator, range('0', '8'))) {\n $value .= '_' . $relationshipIndicator;\n }\n break;\n }\n\n return 'note_' . $value;\n }", "static function showForItem(CommonDBTM $item, $withtemplate = 0) {\n if (!Session::haveRight($item::$rightname, READNOTE)) {\n return false;\n }\n $notes = static::getAllForItem($item);\n $rand = mt_rand();\n $canedit = Session::haveRight($item::$rightname, UPDATENOTE);\n\n $showuserlink = 0;\n if (User::canView()) {\n $showuserlink = 1;\n }\n\n if ($canedit\n && !(!empty($withtemplate) && ($withtemplate == 2))) {\n echo \"<div class='boxnote center'>\";\n\n echo \"<div class='boxnoteleft'></div>\";\n echo \"<form name='addnote_form$rand' id='addnote_form$rand' \";\n echo \" method='post' action='\".Toolbox::getItemTypeFormURL('Notepad').\"'>\";\n echo Html::hidden('itemtype', ['value' => $item->getType()]);\n echo Html::hidden('items_id', ['value' => $item->getID()]);\n\n echo \"<div class='boxnotecontent'>\";\n echo \"<div class='floatleft'>\";\n echo \"<textarea name='content' rows=5 cols=100></textarea>\";\n echo \"</div>\";\n echo \"</div>\"; // box notecontent\n\n echo \"<div class='boxnoteright'><br>\";\n echo Html::submit(_x('button', 'Add'), ['name' => 'add']);\n echo \"</div>\";\n\n Html::closeForm();\n echo \"</div>\"; // boxnote\n }\n\n if (count($notes)) {\n foreach ($notes as $note) {\n $id = 'note'.$note['id'].$rand;\n $classtoadd = '';\n if ($canedit) {\n $classtoadd = \" pointer\";\n }\n echo \"<div class='boxnote' id='view$id'>\";\n\n echo \"<div class='boxnoteleft'>\";\n echo \"<img class='user_picture_verysmall' alt=\\\"\".__s('Picture').\"\\\" src='\".\n User::getThumbnailURLForPicture($note['picture']).\"'>\";\n echo \"</div>\"; // boxnoteleft\n\n echo \"<div class='boxnotecontent'>\";\n\n echo \"<div class='boxnotefloatright'>\";\n $username = NOT_AVAILABLE;\n if ($note['users_id_lastupdater']) {\n $username = getUserName($note['users_id_lastupdater'], $showuserlink);\n }\n $update = sprintf(__('Last update by %1$s on %2$s'), $username,\n Html::convDateTime($note['date_mod']));\n $username = NOT_AVAILABLE;\n if ($note['users_id']) {\n $username = getUserName($note['users_id'], $showuserlink);\n }\n $create = sprintf(__('Create by %1$s on %2$s'), $username,\n Html::convDateTime($note['date']));\n printf(__('%1$s / %2$s'), $update, $create);\n echo \"</div>\"; // floatright\n\n echo \"<div class='boxnotetext $classtoadd' \";\n if ($canedit) {\n echo \"onclick=\\\"\".Html::jsHide(\"view$id\").\" \".\n Html::jsShow(\"edit$id\").\"\\\"\";\n }\n echo \">\";\n $content = nl2br($note['content']);\n if (empty($content)) {\n $content = NOT_AVAILABLE;\n }\n echo $content.'</div>'; // boxnotetext\n\n echo \"</div>\"; // boxnotecontent\n echo \"<div class='boxnoteright'>\";\n if ($canedit) {\n Html::showSimpleForm(Toolbox::getItemTypeFormURL('Notepad'),\n ['purge' => 'purge'],\n _x('button', 'Delete permanently'),\n ['id' => $note['id']],\n 'fa-times-circle',\n '',\n __('Confirm the final deletion?'));\n }\n echo \"</div>\"; // boxnoteright\n echo \"</div>\"; // boxnote\n\n if ($canedit) {\n echo \"<div class='boxnote starthidden' id='edit$id'>\";\n echo \"<form name='update_form$id$rand' id='update_form$id$rand' \";\n echo \" method='post' action='\".Toolbox::getItemTypeFormURL('Notepad').\"'>\";\n\n echo \"<div class='boxnoteleft'></div>\";\n echo \"<div class='boxnotecontent'>\";\n echo Html::hidden('id', ['value' => $note['id']]);\n echo \"<textarea name='content' rows=5 cols=100>\".$note['content'].\"</textarea>\";\n echo \"</div>\"; // boxnotecontent\n\n echo \"<div class='boxnoteright'><br>\";\n echo Html::submit(_x('button', 'Update'), ['name' => 'update']);\n echo \"</div>\"; // boxnoteright\n\n Html::closeForm();\n echo \"</div>\"; // boxnote\n }\n }\n }\n return true;\n }", "public function getLineNote()\n {\n return $this->lineNote;\n }", "static function add_spotlight_notice_body(): void {\r\n self::add_acf_inner_field(self::spotlight, self::spotlight_notice_body, [\r\n 'label' => 'Notice body',\r\n 'default_value' => '',\r\n 'maxlength' => 64,\r\n 'placeholder' => '',\r\n 'prepend' => '',\r\n 'append' => '',\r\n 'type' => 'text',\r\n 'instructions' => '',\r\n 'required' => 1,\r\n 'conditional_logic' => [\r\n [\r\n [\r\n 'field' => self::qualify_field(self::spotlight_type),\r\n 'operator' => '==',\r\n 'value' => 'notice',\r\n ],\r\n ],\r\n ],\r\n 'wrapper' => [\r\n 'width' => '',\r\n 'class' => '',\r\n 'id' => '',\r\n ],\r\n 'readonly' => 0,\r\n 'disabled' => 0,\r\n ]);\r\n }", "function productTeaser($post)\r\n{\r\n ?>\r\n <p>\r\n <span>Embed-cсылка на тизер: </span>\r\n <input type=\"text\" name='extra[teaser]' value=\"<?php echo get_post_meta($post->ID, \"teaser\", 1); ?>\">\r\n </p>\r\n <?php\r\n}", "public function addNote($note)\n {\n }", "public function setNotes($value) {\n\t\tif ($value == NULL) {\n\t\t\t$this->_notes = \"\";\n\t\t} else {\n\t\t\t$this->_notes = $value;\n\t\t}\n\t}", "protected function renderInput()\n {\n if ($this->hasModel()) {\n $input = Html::activeTextArea($this->model, $this->attribute, $this->options);\n } else {\n $input = Html::textArea($this->name, $this->value, $this->options);\n }\n Html::addCssClass($this->previewOptions, 'hidden');\n $preview = Html::tag('div', '', $this->previewOptions);\n return $input . \"\\n\" . $preview;\n }", "public function show(Note $note)\n {\n $note->load('card');\n $note->load('user');\n return $note;\n }", "function show_note($user_name, $note_name)\n{\n $sql_get_path = \"select note_path from user_notes where holder = '$user_name' and note_title = '$note_name';\";\n\t$res_path = mysql_query($sql_get_path);\n\t$row_path = mysql_fetch_array($res_path);\t\n\n\t$fd = fopen($row_path[\"note_path\"], \"r\") or exit(\"unable to open note\");\n\n echo \"<p><h3>$note_name</h3></p>\";\n\techo \"<p><h4>\";\n\twhile(!feof($fd))\n\t{\n\t\techo fgets($fd).\"<br />\";\n\t}\n\techo \"</h4></p>\";\n\tfclose($fd);\n}", "function acf_render_field_instructions($field)\n{\n}", "public function show(PartnerNote $partnerNote)\n {\n //\n }", "public function edit(Note $note)\n {\n //\n }", "public function render()\n\t{\n\t\t//draw head html items (use timestamp for title)\n\t\t$timestamp = date(\"m/d/Y\").\" - \".date(\"h:i:s a\");\n\t\t$this->head->render($timestamp);\n\t\t//draw navbar\n\t\t$this->element->renderElement($this->nav);\n\t\t//start of html body\n\t\t?>\n\t\t\t<div>\n\t\t\t\t<h2>New Note</h2>\n\t\t\t</div>\n\t\t\t<div class=\"form_div\">\n\t\t\t\t<form name=\"newNote\" action=\"<?= $this->savedir ?>\" method=\"post\">\n\t\t\t\t\tTitle: <input type=\"text\" name=\"title\"/><br>\n\t\t\t\t\tNote<br>\n\t\t\t\t\t<textarea rows='8' cols='30' name=\"note\"></textarea><br>\n\t\t\t\t\t<input class=\"save\" type=\"submit\" name=\"addnote\" value=\"save\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"type\" value=\"note\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=<?=$this->curr?> />\n\t\t\t\t</form>\n\t\t\t</div>\n\n\t\t<?php\n //end of html body\n //draw footer items\n\t\t$this->footer->render(\"\");\n\t}", "public function showSysNotesForPage()\t{\n\t\tglobal $TCA;\n\n\t\t$out='';\n\n\t\t\t// Checking if extension is loaded:\n\t\tif (!t3lib_extMgm::isLoaded('sys_note'))\treturn '';\n\n\t\t\t// Create query for selecting the notes:\n\t\t$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','sys_note','pid IN ('.$this->id.') AND (personal=0 OR cruser='.intval($GLOBALS['BE_USER']->user['uid']).')'.t3lib_BEfunc::deleteClause('sys_note').t3lib_BEfunc::versioningPlaceholderClause('sys_note'));\n\n\t\t\t// Executing query:\n\t\t$dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);\n\n\t\t\t// If some notes were found, render them:\n\t\tif ($dbCount)\t{\n\t\t\t$cat = array();\n\n\t\t\t\t// Load full table description:\n\t\t\tt3lib_div::loadTCA('sys_note');\n\n\t\t\t\t// Traverse note-types and get labels:\n\t\t\tif ($TCA['sys_note'] && $TCA['sys_note']['columns']['category'] && is_array($TCA['sys_note']['columns']['category']['config']['items']))\t{\n\t\t\t\tforeach($TCA['sys_note']['columns']['category']['config']['items'] as $el)\t{\n\t\t\t\t\t$cat[$el[1]]=$GLOBALS['LANG']->sL($el[0]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\t// For each note found, make rendering:\n\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\t{\n\n\t\t\t\t\t// Create content:\n\t\t\t\t$iconImg = t3lib_iconWorks::getSpriteIconForRecord('sys_note', $row);\n\t\t\t\t$subject = htmlspecialchars($row['subject']);\n\t\t\t\t$fields = array();\n\t\t\t\t$fields['Author:'] = htmlspecialchars($row['author'].($row['email'] && $row['author'] ? ', ':'').$row['email']);\n\t\t\t\t$fields['Category:'] = htmlspecialchars($cat[$row['category']]);\n\t\t\t\t$fields['Note:'] = nl2br(htmlspecialchars($row['message']));\n\n\t\t\t\t\t// Compile content:\n\t\t\t\t$out.='\n\n\n\t\t\t\t<!--\n\t\t\t\t\tSys-notes for list module:\n\t\t\t\t-->\n\t\t\t\t\t<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" id=\"typo3-dblist-sysnotes\">\n\t\t\t\t\t\t<tr><td colspan=\"2\" class=\"bgColor2\">'.$iconImg.'<strong>'.$subject.'</strong></td></tr>\n\t\t\t\t\t\t<tr><td class=\"bgColor4\">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.category',1).'</td><td class=\"bgColor4\">'.$fields['Category:'].'</td></tr>\n\t\t\t\t\t\t<tr><td class=\"bgColor4\">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.author',1).'</td><td class=\"bgColor4\">'.$fields['Author:'].'</td></tr>\n\t\t\t\t\t\t<tr><td class=\"bgColor4\">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.note',1).'</td><td class=\"bgColor4\">'.$fields['Note:'].'</td></tr>\n\t\t\t\t\t</table>\n\t\t\t\t';\n\t\t\t}\n\t\t}\n\t\treturn $out;\n\t}", "function AddNote(){\n global $wpdb;\n $id = esc_attr($_REQUEST['order_id']);\n $data = array('note' => $_REQUEST['note']);\n if(isset($_REQUEST['admin'])) $data['admin'] = 1;\n if(isset($_REQUEST['seller'])) $data['seller'] = 1;\n if(isset($_REQUEST['customer'])) $data['customer'] = 1;\n if(isset($_REQUEST['file'])) $data['file'] = $_REQUEST['file'];\n\n if(Order::add_note($id, $data)) {\n\n $copy = array();\n if(isset($data['admin'])) $copy[] = '<input type=checkbox checked=checked disabled=disabled /> Admin &nbsp; ';\n if(isset($data['seller'])) $copy[] = '<input type=checkbox checked=checked disabled=disabled /> Seller &nbsp; ';\n if(isset($data['customer'])) $copy[] = '<input type=checkbox checked=checked disabled=disabled /> Customer &nbsp; ';\n $copy = implode(\"\", $copy);\n ?>\n\n <div class=\"panel panel-default\">\n <div class=\"panel-body\">\n <?php $note = wpautop(strip_tags(stripcslashes($data['note']),\"<a><strong><b><img>\")); echo preg_replace('/((http|ftp|https):\\/\\/[\\w-]+(\\.[\\w-]+)+([\\w.,@?^=%&amp;:\\/~+#-]*[\\w@?^=%&amp;\\/~+#-])?)/', '<a target=\"_blank\" href=\"\\1\">\\1</a>', $note); ?>\n </div>\n <?php if(isset($_REQUEST['file'])){ ?>\n <div class=\"panel-footer text-right\">\n <?php foreach($_REQUEST['file'] as $file){ ?>\n <a href=\"#\" style=\"margin-left: 10px\"><i class=\"fa fa-paperclip\"></i> <?php echo $file; ?></a> &nbsp;\n <?php } ?>\n </div>\n <?php } ?>\n <div class=\"panel-footer text-right\"><small><em><i class=\"fa fa-clock-o\"></i> <?php echo date(get_option('date_format') . \" h:i\", time()); ?></em></small>\n <div class=\"pull-left\"><small><em><?php if($copy!='') echo \"Copy sent to \".$copy; ?></em></small></div>\n </div>\n </div>\n <?php }\n else\n echo \"error\";\n }", "function getId_note() {\r\n\t\treturn $this->id_note;\r\n\t}", "function sb_slideshow_embed_input( $post_id ) {\n\treturn '<input class=\"text urlfield\" readonly=\"readonly\" value=\"[slideshow id=&quot;' . $post_id . '&quot;]\" type=\"text\">';\n}", "public function addnotesAction() {\n\t\t$this->_helper->viewRenderer->setNoRender();\n\t\t$this->_helper->layout()->disableLayout();\n\t\t$id = $this->_getParam('taid');\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t$notes = stripslashes(strip_tags($this->_getParam('value')));\n\t\t$ta->notes = preg_replace('/[\\r\\n]+/', ' ', $notes);\n\t\t$ta->save();\n\t\techo $ta->notes;\n\t}", "function cmdeals_wp_text_input( $field ) {\n\tglobal $thepostid, $post;\n\t\n\tif (!$thepostid) $thepostid = $post->ID;\n\tif (!isset($field['placeholder'])) $field['placeholder'] = '';\n\tif (!isset($field['class'])) $field['class'] = 'short';\n\tif (!isset($field['value'])) $field['value'] = get_post_meta($thepostid, $field['id'], true);\n\t\n\techo '<p class=\"form-field '.$field['id'].'_field\"><label for=\"'.$field['id'].'\">'.$field['label'].'</label><input type=\"text\" class=\"'.$field['class'].'\" name=\"'.$field['id'].'\" id=\"'.$field['id'].'\" value=\"'.esc_attr( $field['value'] ).'\" placeholder=\"'.$field['placeholder'].'\" /> ';\n\t\n\tif (isset($field['description'])) echo '<span class=\"description\">' .$field['description'] . '</span>';\n\t\t\n\techo '</p>';\n}", "public function getCMDNote()\n {\n return $this->note;\n }", "function getPatientNote($appointmentRecord)\n{\n // only show dentist note, viewing details like crown and carries requires clicking edit\n // then viewing notes edit page with all data filled in\n if (!isset($appointmentRecord['ProgressNotes'])) {\n return null;\n }\n $progressNotes = $appointmentRecord['ProgressNotes'];\n if (!is_array($progressNotes)) {\n return null;\n }\n\n $date = getDefaultDate();\n if (isset($appointmentRecord['AppointmentDate'])) {\n if (dateIsCorrupted($appointmentRecord['AppointmentDate'])) {\n $appointmentRecord['AppointmentDate'] = $date; // set to default\n } else { // otherwise\n $date = $appointmentRecord['AppointmentDate'];\n }\n }\n // set supported date format for date input(yyyy-mm-dd)\n $appointmentRecord['AppointmentDate'] = getNiceDate($date, 'Y-m-d');\n\n // set value for date column to format Dec 31, 2021\n $date = getNiceDate($date);\n $appointmentRecord['Date'] = $date;\n $appointmentRecord['ProgressNotes'] = $progressNotes;\n $appointmentRecord['Note'] = isset($progressNotes['Note']) ? $progressNotes['Note'] : 'edit to add notes';\n return $appointmentRecord;\n /* use commented array if keys in appointment record are not similar to keys required\n by calling method\n * [\n 'PatientName' => $appointmentRecord['PatientName'],\n 'DentistName' => $appointmentRecord['DentistName'],\n 'PatientNo' => $appointmentRecord['PatientNo'],\n 'FileNumber' => $appointmentRecord['FileNumber'],\n 'DOB' => $appointmentRecord['DOB'],\n 'Date' => $date,\n 'Note' => $progressNotes['Note'],\n 'AppointmentDate' => $appointmentRecord['AppointmentDate'],\n 'FirebaseId' => $appointmentRecord['FirebaseId'],\n 'ProgressNotes' => $progressNotes,\n ]*/\n}", "public function getCustomerNoteNotify();", "public function getContentPartialNote() {\n $fields = array(\n 'contentPartialNote' => array('contentPartialNoteDescription', 'contentPartialNoteElement')\n );\n $result = TingOpenformatMethods::parseFields($this->_getContent(), $fields);\n return $result;\n }", "public static function simple_notes($ynotes, $y_hide_times, $y_tblsize='100%', $ytxtcolor='#000000', $ycolor='#FFFFFF', $ycolor_alt='#FFFFFF', $ybrdcolor='#CCCCCC', $y_style=' style=\"overflow: auto; height:200px;\"') {\n\t//--\n\tif(strpos((string)$ynotes, '-----<') === false) {\n\t\treturn $tbl_start.'<tr><td bgcolor=\"'.$ycolor.'\" valign=\"top\"><font size=\"1\">'.Smart::nl_2_br(Smart::escape_html($ynotes)).'</font></td></tr>'.$tbl_end ; // not compatible notes, so we not parse them\n\t} //end if\n\t//--\n\t$out = '';\n\t//--\n\t$tbl_start = '<table width=\"'.$y_tblsize.'\" cellspacing=\"0\" cellpadding=\"2\" border=\"1\" bordercolor=\"'.$ybrdcolor.'\" style=\"border-style: solid; border-collapse: collapse;\">'.\"\\n\";\n\t$tbl_end = '</table>';\n\t//--\n\t$tmp_shnotes_arr = (array) explode('-----<', (string)$ynotes);\n\t//--\n\t$i_alt=0;\n\t//--\n\tif(Smart::array_size($tmp_shnotes_arr) > 0) {\n\t\t//--\n\t\t$out .= '<!-- OVERFLOW START (S.NOTES) -->'.'<div title=\"#S.NOTES#\"'.$y_style.'>'.\"\\n\";\n\t\t$out .= $tbl_start;\n\t\t//--\n\t\tfor($i=0; $i<Smart::array_size($tmp_shnotes_arr); $i++) {\n\t\t\t//--\n\t\t\t$tmp_shnotes_arr[$i] = (string) trim((string)$tmp_shnotes_arr[$i]);\n\t\t\t//--\n\t\t\tif(Smart::striptags(str_replace('-----<', '', (string)$tmp_shnotes_arr[$i])) != '') {\n\t\t\t\t//--\n\t\t\t\t$tmp_expld = (array) explode('>-----', (string)$tmp_shnotes_arr[$i]);\n\t\t\t\t//--\n\t\t\t\t$tmp_meta_expl = (array) explode('|', (string)$tmp_expld[0]);\n\t\t\t\t$tmp_meta_date = trim((string)$tmp_meta_expl[0]);\n\t\t\t\tif(strlen(trim((string)$tmp_meta_expl[1])) > 0) {\n\t\t\t\t\t$tmp_metainfo = ' :: '.trim($tmp_meta_expl[1]);\n\t\t\t\t} else {\n\t\t\t\t\t$tmp_metainfo = '';\n\t\t\t\t} //end if else\n\t\t\t\t//--\n\t\t\t\tif(strlen(trim((string)$tmp_expld[1])) > 0) {\n\t\t\t\t\t//--\n\t\t\t\t\t$i_alt += 1;\n\t\t\t\t\t//-- alternate\n\t\t\t\t\tif($i_alt % 2) {\n\t\t\t\t\t\t$alt_color = $ycolor;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$alt_color = $ycolor_alt;\n\t\t\t\t\t} //end if else\n\t\t\t\t\t//--\n\t\t\t\t\t$out .= '<tr>'.\"\\n\";\n\t\t\t\t\t$out .= '<td bgcolor=\"'.$alt_color.'\" valign=\"top\">'.\"\\n\";\n\t\t\t\t\t//--\n\t\t\t\t\tif((string)$y_hide_times != 'yes') {\n\t\t\t\t\t\t$out .= '<div align=\"right\" title=\"'.Smart::escape_html('#'.$i_alt.'.'.$tmp_metainfo).'\"><font size=\"1\" color=\"'.$ytxtcolor.'\"><b>'.Smart::escape_html($tmp_meta_date).'</b></font></div><font size=\"1\" color=\"'.$ytxtcolor.'\">'.Smart::nl_2_br(Smart::escape_html(trim($tmp_expld[1]))).'</font>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$out .= '<div title=\"'.Smart::escape_html('#'.$i_alt.'. '.$tmp_meta_date.$tmp_metainfo).'\"><font size=\"1\" color=\"'.$ytxtcolor.'\">'.Smart::nl_2_br(Smart::escape_html(trim($tmp_expld[1]))).'</font></div>';\n\t\t\t\t\t} //end if else\n\t\t\t\t\t//--\n\t\t\t\t\t$out .= '</td>'.\"\\n\";\n\t\t\t\t\t$out .= '</tr>'.\"\\n\";\n\t\t\t\t\t//--\n\t\t\t\t} //end if\n\t\t\t\t//--\n\t\t\t} //end if\n\t\t\t//--\n\t\t} //end for\n\t\t//--\n\t\t$out .= $tbl_end;\n\t\t$out .= '</div>'.'<!-- OVERFLOW END (S.NOTES) -->'.\"\\n\";\n\t\t//--\n\t} //end if\n\t//--\n\tif($i_alt <= 0) {\n\t\t$out = '';\n\t} //end if\n\t//--\n\treturn $out ;\n\t//--\n}", "public function field_preview( $field ) {\n\n\t\t// Define data.\n\t\t$placeholder = ! empty( $field['placeholder'] ) ? $field['placeholder'] : '';\n\n\t\t// Label.\n\t\t$this->field_preview_option( 'label', $field );\n\n\t\t// Primary input.\n\t\techo '<input type=\"text\" placeholder=\"' . esc_attr( $placeholder ) . '\" class=\"primary-input\" disabled>';\n\n\t\t// Description.\n\t\t$this->field_preview_option( 'description', $field );\n\t}", "function gk_comment_form( $fields ) {\n ob_start();\n wp_editor( '', 'comment', array( 'teeny' => true ));\n $fields['comment_field'] = ob_get_clean();\n return $fields;\n}", "public function previewFormat()\n {\n return implode([$this->_actionDescription(), $this->_releaseName(), $this->notes], \"\\n\\n\");\n }", "function render_text_question($label, $input, $additionaltext=\"\", $numeric=false, $extra=\"\", $current=\"\")\n {\n\t?>\n\t<div class=\"Question\" id = \"pixelwidth\">\n\t\t<label><?php echo $label; ?></label>\n\t\t<div>\n\t\t<?php\n\t\techo \"<input name=\\\"\" . $input . \"\\\" type=\\\"text\\\" \". ($numeric?\"numericinput\":\"\") . \"\\\" value=\\\"\" . $current . \"\\\"\" . $extra . \"/>\\n\";\n\t\t\t\n\t\techo $additionaltext;\n\t\t?>\n\t\t</div>\n\t</div>\n\t<div class=\"clearerleft\"> </div>\n\t<?php\n\t}", "public function field_preview( $field ) {\n\n\t\tprintf(\n\t\t\t'<label class=\"label-title\">\n\t\t\t<span class=\"text\">%s</span></label>',\n\t\t\tesc_html__( 'Entry Preview', 'wpforms' )\n\t\t);\n\n\t\t$is_new_field = wp_doing_ajax();\n\t\t$notice = ! empty( $field['preview-notice-enable'] ) && isset( $field['preview-notice'] ) && ! wpforms_is_empty_string( $field['preview-notice'] )\n\t\t\t? $field['preview-notice'] : '';\n\t\t$notice = $is_new_field || wpforms_is_empty_string( $notice ) ? self::get_default_notice() : $notice;\n\t\t$is_disabled = $is_new_field || ! empty( $field['preview-notice-enable'] );\n\n\t\tprintf(\n\t\t\t'<div class=\"wpforms-entry-preview-notice nl2br\"%2$s>%1$s</div>',\n\t\t\twp_kses_post( nl2br( $notice ) ),\n\t\t\t! $is_disabled ? ' style=\"display: none\"' : ''\n\t\t);\n\n\t\tprintf(\n\t\t\t'<div class=\"wpforms-alert wpforms-alert-info\"%2$s>\n\t\t\t\t<p>%1$s</p>\n\t\t\t</div>',\n\t\t\tesc_html__( 'Entry preview will be displayed here and will contain all fields found on the previous page.', 'wpforms' ),\n\t\t\t$is_disabled ? ' style=\"display: none\"' : ''\n\t\t);\n\t}", "public function setNote(?string $note): void\n {\n $this->note['value'] = $note;\n }", "function inspirational_note_content ( $content ) {\n\n\t// Set global vars\n\tglobal $wpdb;\n\n\t// Generate random number between 1 to 5 \n\t$randNum = rand(1,5); // There are currently only 5 quotes\n\n\t// Set table Name\n\t$tableName = $wpdb->prefix.'inspirationalnote';\n\n\t// Query the database \n\tforeach( $wpdb->get_results(\"SELECT * FROM $tableName WHERE id = '$randNum' LIMIT 1\") as $key => $row){\n\t\t$displayQuote = $row->noteTitle.': '.$row->noteText;\n\t}\n\n\t// Return the quote content for display\n\treturn $content .= \"<div class='quoteContent'>\".$displayQuote.\"</div>\"; \n}", "function render_text() {\n\t\t?><input type=\"text\" id=\"<?php echo $this->slug ?>\" name=\"<?php echo $this->settings_page ?>[<?php echo $this->slug ?>]\" value=\"<?php echo $this->value ?>\" ><?php\n\t}", "function create_note($eParent, $noteRec, $level) {\n\t\t$note = get_gedcom_value(\"NOTE\", $level, $noteRec);\n\t\t$note .= get_cont($level+1, $noteRec, false);\n//\t\t$num = 1;\n//\t\twhile (($cont = get_gedcom_value(\"NOTE:CONT\", $level, $noteRec, $num)) != null) {\n//\t\t\t$note .= $cont;\n//\t\t\t$num++;\n//\t\t}\n\t\t$egNote = $this->dom->createElement(\"note\");\n\t\t$etgNote = $this->dom->createTextNode(htmlentities($note,ENT_COMPAT,'UTF-8'));\n\t\t$etgNote = $egNote->appendChild($etgNote);\n\t\t$egNote = $eParent->appendChild($egNote);\n\t}", "public function getActorNote() {\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), array('actorNote' => array('actorElement')));\n return (is_array($result)) ? reset($result) : $result;\n }" ]
[ "0.7143933", "0.70152646", "0.68602276", "0.6796966", "0.66756994", "0.65140975", "0.6469367", "0.6460229", "0.6429491", "0.63810456", "0.6360678", "0.635171", "0.6338213", "0.6335402", "0.6335402", "0.6335402", "0.6335402", "0.6335402", "0.6335402", "0.6335402", "0.6335402", "0.6335402", "0.6335402", "0.6335402", "0.6333176", "0.6266959", "0.6261814", "0.62518555", "0.61688125", "0.60930955", "0.60930955", "0.60930955", "0.60930955", "0.60930955", "0.6080481", "0.6002719", "0.5982942", "0.59042716", "0.5858543", "0.58305275", "0.5820567", "0.57932794", "0.57888347", "0.5767488", "0.57635295", "0.57479125", "0.5714591", "0.5710681", "0.56818795", "0.5645114", "0.56301045", "0.5617469", "0.5592512", "0.55924535", "0.5590772", "0.5574411", "0.55682987", "0.5563433", "0.55492604", "0.5525524", "0.5512099", "0.5504579", "0.5465871", "0.54552466", "0.544664", "0.5422923", "0.5421629", "0.5419419", "0.5418883", "0.5413472", "0.54082006", "0.5406272", "0.5402712", "0.539544", "0.538988", "0.53679395", "0.5361083", "0.5357576", "0.5350816", "0.5339055", "0.5323652", "0.53228974", "0.5319856", "0.53150535", "0.53039783", "0.5303001", "0.53019375", "0.5286168", "0.5282048", "0.52727556", "0.5271299", "0.526908", "0.52682245", "0.52656233", "0.52619594", "0.5253965", "0.5252095", "0.52477944", "0.52396804", "0.52369446" ]
0.5796442
41
Genereate full title for course, lessson, topic
function nt_generate_course_title($course_type,$active_id){ if( $course_type == 'sfwd-courses' ) { $title = get_the_title($active_id); } if( $course_type == 'sfwd-lessons' ) { $course_id = get_post_meta( $active_id , 'course_id' , true ); $course_title = get_the_title( $course_id ); $lesson_title = get_the_title( $active_id ); $title = $course_title.': '.$lesson_title; } if( $course_type == 'sfwd-topic' ) { $course_id = get_post_meta( $active_id , 'course_id' , true ); $course_title = get_the_title( $course_id ); $lesson_id = get_post_meta( $active_id , 'lesson_id' , true ); $lesson_title = get_the_title( $lesson_id ); $topic_title = get_the_title( $active_id); $title = $course_title.': '.$lesson_title.': '.$topic_title; } return $title; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function generate_title()\r\n\t\t{\r\n\t\t\treturn $this->c_title;\r\n\t\t}", "private function _generateTitle()\n {\n $title = '';\n foreach ($this->_contents as $content)\n {\n $title = ('' == $title) ? $content->myGetSeoTitleTag() : $content->myGetSeoTitleTag().' | '.$title;\n }\n return $title;\n }", "public function get_title(): string {\n\t\treturn __( 'Tips to make the most of Web Stories', 'web-stories' );\n\t}", "public static function title();", "public static function getTitle(): string\n\t{\n\t\t$u = str_repeat( '_', 33 );\n\t\treturn $u . '[' . self::TITLE . ']' . $u;\n\t}", "public function title(){\n if (func_num_args() > 0){\n $this->title = func_get_arg(0);\n }\n \n return $this->title;\n }", "public function title();", "public function title();", "public function computedTitle();", "public function get_title();", "function title(){\n\t\t\techo $mytitle= \"Profile. Car Parking Website\";\n\t\t\t\n\t\t}", "protected function _buildTitle()\n\t{\n\t\tif (!$this->_title)\n\t\t{\n\t\t\t$this->_title = Lang::txt(strtoupper($this->_option));\n\t\t\tif ($this->_task)\n\t\t\t{\n\t\t\t\tswitch ($this->_task)\n\t\t\t\t{\n\t\t\t\t\tcase 'browse':\n\t\t\t\t\tcase 'submit':\n\t\t\t\t\tcase 'start':\n\t\t\t\t\tcase 'intro':\n\t\t\t\t\t\tif ($this->_task_title)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->_title .= ': ' . $this->_task_title;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'serve':\n\t\t\t\t\tcase 'wiki':\n\t\t\t\t\t\t$this->_title .= ': ' . Lang::txt('COM_PUBLICATIONS_SERVING_CONTENT');\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$this->_title .= ': ' . Lang::txt(strtoupper($this->_option . '_' . $this->_task));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tDocument::setTitle($this->_title);\n\t}", "public function buildTitle()\r\n\t{\r\n\t\t$data\t= '<h1>' . t( 'intouch.admin.title', t( 'intouch.admin.title.' . $this->action . '.' . $this->task ) ) . '</h1>';\r\n\t\treturn $data;\r\n\t}", "function page_title($title = ''){\r\n\tglobal $eqdkp, $user;\r\n\t$pt_prefix\t\t= (defined('IN_ADMIN')) ? $user->lang['admin_title_prefix'] : $user->lang['title_prefix'];\r\n\t$main_title\t\t= sprintf($pt_prefix, $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']);\r\n\treturn sanitize((( $title != '' ) ? $title.' - ' : '').$main_title, TAG);\r\n}", "function titleKeyWords()\n\t{\n\t\tif(isset($_REQUEST['questionID']))\n\t\t{\n\t\t\t//print strip_tags(myTruncate(get_forum_nameByAphorismID($_REQUEST['questionID']), 100, ' ', ' ... ')).' - Фрази, афоризми, умни мисли, забавни изказвания, лозунги и др';\n\t\t}\n\t\telse \n\t\t{\n\t\t\tprint 'Фрази, афоризми, умни мисли, забавни изказвания, лозунги и др';\n\t\t}\n\t\n\t}", "public function getCreateTitle()\n {\n return sprintf($this->_('New %s...'), $this->getTopic(1));\n }", "function title($title) {\r\n\t\tif (!defined('IS_UWR1RESULTS_VIEW')) {\r\n\t\t\treturn $title;\r\n\t\t}\r\n\r\n\t\t$season = Uwr1resultsController::season();\r\n\t\t$season = $season.'/'.($season+1); // TODO: make a function for that\r\n\r\n\t\t$view = Uwr1resultsController::WhichView();\r\n\t\tif ('index' == $view) {\r\n\t\t\t$title = 'Unterwasserrugby Liga Ergebnisse der Saison '.$season;\r\n\t\t} else if ('league' == $view) {\r\n\t\t\t$title = 'Ergebnisse der ' . Uwr1resultsModelLeague::instance()->name() . ' (Saison ' . $season . ')';\r\n\t\t} else if ('tournament' == $view) {\r\n\t\t\t$title = 'Ergebnisse des UWR Turniers ' . Uwr1resultsModelLeague::instance()->name();\r\n\t\t}\r\n\t\treturn $title;\r\n\t}", "function get_title()\n {\n }", "public static function makeTitle($name);", "private function _getTitle()\r\n\t{\r\n\t\tglobal $action, $whmcs;\r\n\t\t\r\n\t\t$task = ( array_key_exists( 'task', $whmcs->input ) && ! empty( $whmcs->input['task'] ) ? '.' . $whmcs->input['task'] : null );\r\n\t\t\r\n\t\treturn '<h1>' . t( 'themer.admin.module.title', t( 'themer.admin.module.title.' . $action . $task ) ) . '</h1>';\r\n\t}", "function MyApp_Interface_HEAD_Title()\n {\n $comps=preg_split('/::/',parent::MyApp_Interface_HEAD_Title());\n $keys=array(\"Initials\",\"Name\",\"Title\");\n \n $unit=$this->Unit();\n foreach ($keys as $key)\n {\n $name=$this->GetRealNameKey($unit,$key);\n \n if (!empty($name))\n {\n array_push($comps,$name);\n break;\n }\n }\n \n $event=$this->Event();\n foreach ($keys as $key)\n {\n $name=$this->GetRealNameKey($event,$key);\n \n if (!empty($name))\n {\n array_push($comps,$name);\n break;\n }\n }\n\n return join(\"::\",array_reverse($comps)); \n }", "public function title()\n {\n return Str::of($this->name)\n ->append(' - ' . $this->id)\n ->__toString();\n }", "protected function page_title() {\n return get_string('topicoutline');\n }", "public function getIndexTitle()\n {\n return ucfirst($this->getTopic(100));\n }", "public static function generateTitle()\n {\n return 'KIP' . substr(time(), 1);\n }", "function get_title($title) \n{\n global $scelus;\n return $title . (isset($scelus['title_append']) ? $scelus['title_append'] : null);\n}", "public function BuildTitle()\n\t\t{\n\t\t\t$title = \"\";\n\n\t\t\tforeach ($this->GetTrails() as $trail) {\n\t\t\t\t$title .= sprintf(\"%s - \", $trail[1]);\n\t\t\t}\n\n\t\t\t$title = rtrim($title, \"- \");\n\t\t\t$title .= sprintf(\" (%s - %s)\", $GLOBALS['PriceMin'], $GLOBALS['PriceMax']);\n\t\t\t$title .= sprintf(\" - %s\", $GLOBALS['StoreName']);\n\n\t\t\treturn $title;\n\t\t}", "public function property_title() {\n\n\t\t\t$this->add_package = $this->getAddPackage();\n\n\t\t\t$headline_select = get_field( 'headline_select' );\n\t\t\t$standard_section = get_field( 'practice_type' ) . ' ' . get_field( 'building_type' );\n\t\t\t$custom_section = ( $headline_select == 'Custom Headline' )\n\t\t\t\t? get_field( 'custom_headline' )\n\t\t\t\t: $standard_section;\n\n\t\t\t$location = get_field( 'address_city' ) . ', ' . get_field( 'address_state' );\n\t\t\t$headline = get_field( 'practice_is_for' ) . ' - ' . $custom_section . ' - ' . $location;\n\n\t\t\t$out = '<h3>' . $headline . '</h3>';\n\t\t\t$out .= '<div class=\"hr hr-default\"><span class=\"hr-inner \"><span class=\"hr-inner-style\"></span></span></div>';\n\n\n\t\t\treturn $out;\n\t\t}", "public function get_title() {\n\t\treturn __( 'Hello World', 'elementor-hello-world' );\n\t}", "abstract public static function title(): string;", "protected function _buildTitle()\n\t{\n\t\tif ($this->_task)\n\t\t{\n\t\t\t$title = Lang::txt('COM_MEMBERS_REGISTER_' . strtoupper($this->_task));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$title = Lang::txt('COM_MEMBERS_REGISTER');\n\t\t}\n\t\t\\Document::setTitle($title);\n\t}", "public static function title($title)\n {\n return \"<title>$title</title>\\n\";\n }", "function the_title() {\n\tglobal $discussion;\n\treturn $discussion['title'];\n}", "protected function title() {\n\t\t$title = Text::get('login_title');\n\n\t\treturn \"$title &mdash; Automad\";\n\t}", "public function getTitle() {\n\t\treturn '';\n\t}", "public function get_title()\n {\n }", "public function get_title()\n {\n }", "function get_title() {\n\t\tglobal $Thesaurus;\n\t\tif (isset($_GET['p'])) {\n\t\t\techo ucwords($_GET['p']);\n\t\t} else if (isset($_GET['cat'])) {\n\t\t\techo ucwords($Thesaurus[$_GET['cat']]['T']);\n\t\t} else {\n\t\t\techo 'Home';\n\t\t}\n\t}", "public function getTitle() {\n\t\t$titles = array(\n\t\t\t'CEO',\n\t\t\t'Assistant Regional Manager',\n\t\t\t'Champion of Light',\n\t\t\t'Usurper Lord',\n\t\t\t'Overlord Maximus',\n\t\t\t'Shadowpuppet Master',\n\t\t);\n\t\t$index = mt_rand(0, count($titles) - 1);\n\t\treturn $titles[$index];\n\t}", "public function get_name()\r\n {\r\n \t$data = $this->get_exercise_data();\r\n \treturn $data['title'];\r\n }", "function gettitle() {\n\n\t\tglobal $pagetiltle;\n\n\t\tif (isset($pagetiltle)) {\n\n\t\t\techo $pagetiltle;\n\t\t} else {\n\n\t\t\techo lang('DEFAULT');\n\t\t}\n\t}", "public function titleCallback(array $_title_arguments = [], $_title = '') {\n $_title_arguments += ['case_number' => '2', 'title' => $_title];\n return t($_title_arguments['title']) . ' - Case ' . $_title_arguments['case_number'];\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();", "private function generate_title_link($publication)\n {\n if ($this->get_component()->is_allowed(WeblcmsRights::EDIT_RIGHT))\n {\n return $this->generate_teacher_title_link($publication);\n }\n return $this->generate_student_title_link($publication);\n }", "public function getTitle()\n {\n $title = $this->getShortTitle();\n $subtitle = $this->getSubtitle();\n $titleSection = $this->getTitleSection();\n if (!empty($subtitle)) {\n if ($title != '') {\n $separator = preg_match(\"/^[\\\\s=]+/\", $subtitle) ? \" \" : \" : \";\n $title .= $separator;\n }\n $title .= $subtitle;\n }\n if (!empty($titleSection)) {\n if ($title != '') {\n $title .= ' / ';\n }\n $title .= $titleSection;\n }\n return $title;\n }", "function getTitle() ;", "private function generateTitle()\n {\n $label = $this->pre_link_text.' ';\n if($this->terms_page) {\n // if a page has been given, create the anchor\n $label.= '<a href=\"'.$this->terms_page.'\"';\n if($this->open_new_window) {\n // if were to open the link in a new window, add target=\"_blank\"\n $label.= ' target=\"_blank\"';\n }\n $label.= '>'.$this->link_text;\n $label.= '</a>';\n } else {\n // else just show the link text as plain text\n $label.= $this->link_text;\n }\n if(!is_null($this->post_link_text)) {\n // if the post link text is not blank, add it our string\n $label.= ' '.$this->post_link_text;\n }\n $label.= '.';\n // set the field title (label). We use DBField here to stop SS escaping it.\n $this->title = DBField::create_field('HTMLFragment', $label);\n return $this;\n }", "abstract protected function getTitle();", "private function _getTitle()\r\n\t{\r\n\t\t$input\t= dunloader( 'input', true );\r\n\t\t$action\t= $input->getVar( 'action', 'themes' );\r\n\t\t$task\t= $input->getVar( 'task', null );\r\n\t\t\r\n\t\treturn '<h1>' . t( 'themer.admin.module.title', t( 'themer.admin.module.title.' . $action . ( $task ? '.' . $task : '' ) ) ) . '</h1>';\r\n\t}", "private function getTitle() {\n\t\tif ($_GET['doc'] == 'index') {\n\t\t\treturn $this->config['title'];\n\t\t}\n\t\treturn $this->texy->headingModule->title . ' - ' . $this->config['title'];\n\t}", "private function titleGuess(): string {\n $collaboration = $this->containsCollaboration($this->title);\n return $collaboration;\n }", "public function title()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" title ?\");\n\t}", "public abstract function getTitle();", "public function get_title() {\n\t\treturn $this->format_string( $this->title );\n\t}", "function gentitle($fields = array('artist', 'title'), $maxlength = 256)\n\t{\n\t\t$title = '';\n\t\tforeach ($fields as $name) if (isset($this->origrow[$name]) && !empty($this->origrow[$name])) checkcharadd($title, ' - ', $this->origrow[$name]);\n\t\tif (kp_strlen($title) == 0)\n\t\t{\n\t\t\tif (UTF8MODE) $title = $this->free; else $title = $this->fname;\n\t\t}\n\t\t$title = trim($title);\n\t\tif (kp_strlen($title) > $maxlength) return kp_substr($title, 0, $maxlength - 2).' …';\n\t\treturn $title;\n\t}", "public static function getTitle(): string\n {\n }", "public static function getTitle(): string\n {\n }", "abstract public function getTitle();", "abstract public function getTitle();", "abstract public function getTitle();", "public function get_title() {\n\t\treturn __( 'Elhelper Post Mansory', 'elhelper' );\n\t}", "function get_title_lectura($lectura)\n{\n $cadena = $lectura->libro_nombre . ' ' . $lectura->capitulo . ': ' . $lectura->inicio\n . '-' . $lectura->final;\n\n return $cadena;\n}", "function page_title(): string {\r\n\t\treturn sprintf('%s — %s: Scheduler', $this->module->space()->name(),\r\n\t\t\t$this->module->name());\r\n\t}", "private function makeCalendarTitle()\n\t{\n\t\tif(strlen($this->headerTitle) > 0) {\n\t\t\t$this->calWeekDays .= \"\\t<tr>\\n\\t\\t<th class=\\\"headerTitle\\\" colspan=\\\"7\\\">\".$this->headerTitle.\"</th>\\n\\t</tr>\";\n\t\t\t$this->outArray['title'] = $this->headerTitle;\n\t\t}\n\t}", "public function get_title() {\n return __( 'Video CTA', 'yx-super-cat' );\n }", "protected function getTitle(): string\n {\n return \"Bestelling {$this->record->invoice_id} annuleren van {$this->record->name}\";\n }", "public function _GetPageTitle() {\n\t\t$page_title = 'Shirtswithstamps: T-Shirts with stamps for every ocassion';\n\t\t\n\t\tif (isset($_GET['DepartmentId']) && isset($_GET['CategoryId'])) {\n\t\t\t$page_title = Catalog::GetDepartmentName($_GET['DepartmentId']).' &raquo; '.Catalog::GetCategoryName($_GET['CategoryId']).' - Shirts With Stamps';\n\t\t\t\n\t\tif (isset($_GET['Page']) && ((int)$_GET['Page']) > 1)\n\t\t\t$page_title = Catalog::GetDepartmentName($_GET['DepartmentId']).' &raquo; '.Catalog::GetCategoryName($_GET['CategoryId']).' - Page '.((int)$_GET['Page']).' - Shirtswithstamps';\t\n\t\t}\n\t\t\n\t\telseif (isset($_GET['DepartmentId'])) {\n\t\t\t$page_title = Catalog::GetDepartmentName($_GET['DepartmentId']).' - Shirts With Stamps';\n\t\t\t\n\t\t\tif (isset($_GET['Page']) && ((int)$_GET['Page']) > 1)\n\t\t\t\t$page_title = Catalog::GetDepartmentName($_GET['DepartmentId']).' - Page '.((int)$_GET['Page']).' - Shirts With Stamps';\n\t\t}\n\t\t\n\t\telseif (isset($_GET['ProductId'])) {\n\t\t\t$page_title = Catalog::GetProductName($_GET['ProductId']).' - Shirts With Stamps';\n\t\t}\n\t\t\n\t\telseif (isset($_GET['SearchResults'])) {\n\t\t\t$page_title = '';\n\t\t\t\n\t\t\t// Display the search string\n\t\t\t$page_title = trim(str_replace('-', ' ', $_GET['SearchString'])).' (';\n\t\t\t\n\t\t\t// Display 'all-words' search or 'any-words' search\n\t\t\t$all_words = isset($_GET['AllWords']) ? $_GET['AllWords'] : 'off';\n\t\t\t\n\t\t\t$page_title .= (($all_words == 'on') ? 'all' : 'any').'-words search';\n\t\t\t\n\t\t\t// Display the page number\n\t\t\tif (isset($_GET['Page']) && ((int)$_GET['Page'] < 1))\n\t\t\t\t$page_title .= ', page '.((int)$_GET['Page']);\n\t\t\t\t\n\t\t\t$page_title .= ')';\n\t\t}\n\t\t\n\t\telse {\n\t\t\tif (isset($_GET['Page']) && ((int)$_GET['Page']) > 1)\n\t\t\t\t$page_title .= ' - Page '.((int)$_GET['Page']);\n\t\t}\n\t\t\n\t\treturn $page_title;\n\t}", "public function title()\n {\n return \"$this->name ($this->format_sti)\";\n }", "public function title()\n\t{\n\t\t// Get current language\n $lang = Config::get('app.locale');\n if($lang == \"ar\")\n\t\t\treturn nl2br($this->title_ar);\n\t\telse\n\t\t\treturn nl2br($this->title);\n\t}", "private function renderTitle()\n\t{\n\t\treturn '<h1 class=\"block-new-title\">' . $this->title . '</h1>';\n\t}", "public function title() {\n return \"{$this->venuename} ({$this->id})\";\n }", "function get_title() \t{\n \t\treturn $this->title;\t\n \t}", "function get_the_title() {\n\n md_get_the_title();\n \n }", "function fullPageTitle() {\n\t\t$title = htmlspecialchars($this->getTitlePage(), ENT_COMPAT, \"UTF-8\");\n\t\t$separator = ' | ';\n\t\t$parents = $this->parents();\n\t\tfor ($i=0; $i<sizeof($parents)-1; $i++) {\n\t\t\t$oneParent = $parents[$i];\n\t\t\t$title .= $separator;\n\t\t\t$title .= htmlspecialchars($oneParent->getTitlePage(), ENT_COMPAT, \"UTF-8\");\n\t\t}\n\t\treturn $title;\n\t}", "public function title()\n { \n return forward_static_call([new Building($this->building), 'title']).': '.$this->number;\n }", "public function getTitle(): string\n {\n return $this->title ?? $this->name;\n }", "public function title(): string\n {\n return $this->title;\n }", "public function pageTitle($title = '') {\n $page_title = '';\n if (empty($title)) {\n $page_title .='Ticketchai | Home ';\n } else {\n $page_title .=$title;\n }\n\n return \"<title>\" . $page_title . \"</title>\";\n }", "public function get_title() {\n\t\treturn esc_html__( 'Hero Header', 'tr-framework' );\n\t}", "public function title($name);", "public function get_title( )\n {\n return 'Something went wrong.';\n }", "public function get_title()\n {\n return __('Section Heading', 'careerfy-frame');\n }", "public function getTitle()\n\t{\n\t\treturn esc_html__('Profile assignment', 'next-active-directory-integration');\n\t}", "protected function makeTitle()\n {\n $this->setY($this->layout['titleMarginTop']);\n $this->setFont('', 'B', $this->layout['titleFontSize']);\n $this->write($this->layout['titleCellHeight'], $this->content['title']);\n $this->setFont('', '', $this->layout['fontSize']);\n }", "public function get_page_title() {\n\t\t\treturn __( 'Relations', 'jet-engine' );\n\t\t}", "public function get_title () {\r\n\t\treturn $this->get_info()['title'];\r\n\t}" ]
[ "0.76468766", "0.7431139", "0.72518694", "0.7196875", "0.7176244", "0.71324164", "0.71307904", "0.71307904", "0.7121572", "0.6982277", "0.69780296", "0.69776493", "0.69529694", "0.68825686", "0.6865529", "0.6864429", "0.68161696", "0.68044627", "0.6802795", "0.6782037", "0.67677", "0.6763208", "0.67603165", "0.6744022", "0.6739881", "0.67317295", "0.6730974", "0.6726462", "0.67153525", "0.670925", "0.66892684", "0.66832983", "0.6681909", "0.6679416", "0.6677663", "0.66773343", "0.6676708", "0.66744715", "0.6666212", "0.66569", "0.66459626", "0.6641953", "0.6636539", "0.6636539", "0.6636539", "0.6636539", "0.6636539", "0.6636539", "0.6636539", "0.6636539", "0.6636539", "0.6636539", "0.6636539", "0.6636539", "0.6636539", "0.6636539", "0.6636539", "0.6631343", "0.66146314", "0.6610978", "0.66043586", "0.6600921", "0.658925", "0.65879864", "0.6587844", "0.6573378", "0.6560498", "0.6549945", "0.6540625", "0.6533603", "0.6533603", "0.6527534", "0.6527534", "0.6527534", "0.6521945", "0.6519039", "0.6511106", "0.6509325", "0.65063727", "0.64869857", "0.6486373", "0.64768386", "0.6473322", "0.64729446", "0.64706856", "0.64706224", "0.64702594", "0.6468679", "0.6463023", "0.64565283", "0.6456085", "0.64550257", "0.6444846", "0.64367044", "0.64331484", "0.64293665", "0.6427329", "0.6423639", "0.6407762", "0.6404649" ]
0.76487195
0
AJAX Submits Note and Saves extra fields to Postmeta
function process_course_note() { if ( ! empty( $_POST[ 'submission' ] ) ) { wp_send_json_error( 'Honeypot Check Failed' ); } if ( ! check_ajax_referer( 'nt-course-note-nonce', 'security' ) ) { wp_send_json_error( 'Security Check failed' ); } $course_title = nt_generate_course_title($_POST[ 'data' ][ 'currentPostType' ] ,$_POST[ 'data' ][ 'currentLessonId' ]); $notes_data = array( 'post_title' => $course_title.' - '. /*sanitize_text_field( $_POST[ 'data' ][ 'userId' ] ), sanitize_text_field( $_POST[ 'data' ][ 'currentLessonId' ] ),*/ sanitize_text_field( $_POST[ 'data' ][ 'title' ] ), 'post_status' => 'draft', 'post_type' => 'coursenote', 'post_content' => wp_kses_post( $_POST[ 'data' ][ 'body' ] ) ); //If note id already exists update exisiting note else insert new note $note_Id_update = get_post_id_by_meta_key_and_value('nt-note-current-lessson-id', $_POST[ 'data' ][ 'currentLessonId' ]); $post_author = get_post_field( 'post_author', $note_Id_update ); if($note_Id_update && ($post_author == $_POST[ 'data' ][ 'userId' ])){ $post_id = wp_update_post( array( 'ID' => $note_Id_update, 'post_content' => wp_kses_post( $_POST[ 'data' ][ 'body' ] ) ), true ); wp_send_json_success( $post_id ); } else { $post_id = wp_insert_post( $notes_data, true ); if ( $post_id ) { update_post_meta( $post_id, 'nt-note-user-id', $_POST[ 'data' ][ 'userId' ] ); update_post_meta( $post_id, 'nt-note-current-lessson-id', $_POST[ 'data' ][ 'currentLessonId' ] ); } wp_send_json_success( $post_id ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save_meta_box_ajax() {\n\t\tcheck_ajax_referer( 'create-tracking-item', 'security', true );\n\n\t\tif ( isset( $_POST['tracking_number'] ) && strlen( $_POST['tracking_number'] ) > 0 ) {\n\n\t\t\t$order_id = wc_clean( $_POST['order_id'] );\n\t\t\t$args = array(\n\t\t\t\t'tracking_provider' => wc_clean( $_POST['tracking_provider'] ),\n\t\t\t\t'custom_tracking_provider' => wc_clean( $_POST['custom_tracking_provider'] ),\n\t\t\t\t'custom_tracking_link' => wc_clean( $_POST['custom_tracking_link'] ),\n\t\t\t\t'tracking_number' => wc_clean( $_POST['tracking_number'] ),\n\t\t\t\t'date_shipped' => wc_clean( $_POST['date_shipped'] ),\n\t\t\t);\n\n\t\t\t$tracking_item = $this->add_tracking_item( $order_id, $args );\n\n\t\t\t$this->display_html_tracking_item_for_meta_box( $order_id, $tracking_item );\n\t\t}\n\n\t\tdie();\n\t}", "function wp_ajax_press_this_save_post()\n {\n }", "public function ajaxProcessUpdateCustomerNote()\n {\n }", "function notes_save_meta_box_data( $post_id ) {\n\n\t/*\n\t * We need to verify this came from our screen and with proper authorization,\n\t * because the save_post action can be triggered at other times.\n\t */\n\n\t// Check if our nonce is set.\n\tif ( ! isset( $_POST['notes_meta_box_nonce'] ) ) {\n\t\treturn;\n\t}\n\n\t// Verify that the nonce is valid.\n\tif ( ! wp_verify_nonce( $_POST['notes_meta_box_nonce'], 'notes_meta_box' ) ) {\n\t\treturn;\n\t}\n\n\t// If this is an autosave, our form has not been submitted, so we don't want to do anything.\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\treturn;\n\t}\n\n\t// Check the user's permissions.\n\tif ( isset( $_POST['post_type'] ) && 'page' == $_POST['post_type'] ) {\n\n\t\tif ( ! current_user_can( 'edit_page', $post_id ) ) {\n\t\t\treturn;\n\t\t}\n\n\t} else {\n\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t/* OK, it's safe for us to save the data now. */\n\t\n\t// Make sure that it is set.\n\tif ( ! isset( $_POST['notes_new_field'] ) ) {\n\t\treturn;\n\t}\n\n\t// Sanitize user input.\n\t$my_data = sanitize_text_field( $_POST['notes_new_field'] );\n\n\t// Update the meta field in the database.\n\tupdate_post_meta( $post_id, '_my_meta_value_key', $my_data );\n}", "function ajax_process() {\n\t\tcheck_ajax_referer( 'something' );\n\n\t\tupdate_post_meta( (int) $_POST['id'], 'a_key', $_POST['a_value'] );\n\t}", "public function onsave() {\n\n\tif( filter_input( INPUT_POST, 'content' ) ) {\n\t global $post;\n do_shortcode( stripslashes( filter_input( INPUT_POST, 'content' ) ) );\n\t if( isset( $this->shortcode['elements'] ) ) {\n $this->assign_repeatable();\n }\n $meta = get_post_meta( $post->ID, 'pwp_form', true );\n $meta['definition'] = $this->shortcode;\n update_post_meta( $post->ID, 'definition', $meta );\n }\n }", "function ajax_process() {\n\tcheck_ajax_referer( 'something' );\n\n\tupdate_post_meta( (int) $_POST['id'], 'a_key', $_POST['a_value'] );\n}", "protected function save_meta() {}", "function meta_boxes_save() {\r\n\t\t\r\n\t\t// Only process if the form has actually been submitted\r\n\t\tif (\r\n\t\t\tisset( $_POST['_wpnonce'] ) &&\r\n\t\t\tisset( $_POST['post_ID'] )\r\n\t\t) {\r\n\t\t\t\r\n\t\t\t// Do nonce security check\r\n\t\t\twp_verify_nonce( '_wpnonce', $_POST['_wpnonce'] );\r\n\t\t\t\r\n\t\t\t// Grab post ID\r\n\t\t\t$post_ID = (int) $_POST['post_ID'];\r\n\t\t\t\r\n\t\t\t// Iterate through each possible piece of meta data\r\n\t\t\tforeach( $this->post_meta as $key => $value ) {\r\n\t\t\t\tif ( isset( $_POST['_' . $key] ) ) {\r\n\t\t\t\t\t$data = esc_html( $_POST['_' . $key] ); // Sanitise data input\r\n\t\t\t\t\tupdate_post_meta( $post_ID, '_' . $key, $data ); // Store the data\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "public function onTestimonialSubmit() {\n\n $name = post('name');\n $message = post('message');\n\n $testimonial = new Testimonial();\n $testimonial->name = $name;\n $testimonial->message = $message;\n $testimonial->save();\n }", "protected function setSubmittedMeta()\n {\n $this->setDataObject( new Tagline, 'tagline' );\n $this->content_obj->setMeta( 'tagline', $this->tagline->get() );\n \n $this->setImage( new Image, 'image_secondary' );\n if ( $this->image_secondary->get('file_name') ) {\n $this->content_obj->setMeta('image_secondary', $this->image_secondary->getFullName() );\n $this->processImage( 'image_secondary' );\n }\n \n $this->setDataObject( new Video, 'video' );\n $this->content_obj->setMeta( 'video', $this->video->get() );\n \n $this->setDataObject( new VideoDescription, 'video_description' );\n $this->content_obj->setMeta( 'video_description', $this->video_description->get() );\n \n $this->setDataObject( new SelectableCharity, 'selectable' );\n $this->content_obj->setMeta( 'selectable', $this->selectable->get() );\n \n $this->setDataObject( new Rank, 'rank' );\n $this->content_obj->setMeta( 'rank', $this->rank->get() );\n \n $this->setDataObject( new Url, 'url' );\n $this->content_obj->setMeta( 'url', $this->url->get() );\n }", "function __updateNotes()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //prevent direct access\n if (!isset($_POST['posted'])) {\n //redirect to 'view' url instead\n $this_url = uri_string();\n $redirect = str_replace('update', 'view', $this_url);\n redirect($redirect);\n }\n\n //save sql here\n $result = $this->mynotes_model->updateNote($this->project_id, $this->data['vars']['my_id'], $this->input->post('mynotes_text'));\n $this->data['debug'][] = $this->mynotes_model->debug_data;\n\n //check\n if ($result) {\n $this->notices('success', $this->data['lang']['lang_request_has_been_completed'], 'noty'); //noty or html\n } else {\n $this->notices('error', $this->data['lang']['lang_request_could_not_be_completed'], 'noty'); //noty or html\n }\n\n //get the note\n $this->__viewNotes();\n\n }", "function tower_save_form_data($data) {\n // logic for data validation and saving.\n $post_type = 'tower_' . @$data->get_param('type');\n if (! array_key_exists($post_type, TOWER_CUSTOM_POSTS)) return null;\n\n // backend validation\n $fields = array_merge([\n 'name' => 'title',\n 'rules' => 'required',\n ], TOWER_CUSTOM_POSTS[$post_type]['fields']);\n \n // check if the form has any validation errors\n $validation_errors = tower_form_errors($data, $fields);\n\n $post_id = 0; // id for the new post\n \n if (count($validation_errors) == 0) {\n $post_id = wp_insert_post([\n 'post_type' => $post_type,\n 'post_title' => $data->get_param('title')\n ]);\n if ($post_id > 0) {\n foreach ($fields as $field) {\n update_post_meta(\n $post_id, \n $field['name'], \n sanitize_text_field($data->get_param($field['name']))\n );\n }\n }\n }\n \n echo json_encode([\n 'success' => $post_id > 0,\n 'errors' => $validation_errors,\n ]);\n}", "protected function _addNotes()\n\t{\n\t\t$windowId = $this->_Admin_Form_Controller->getWindowId();\n\n\t\treturn Admin_Form_Entity::factory('Script')\n\t\t\t->value(\"$(function (){\n\t\t\t\t$.adminLoad({ path: '/admin/crm/project/note/index.php', additionalParams: 'crm_project_id=\" . $this->_object->id . \"', windowId: '{$windowId}_notes' });\n\t\t\t});\");\n\t}", "protected function _Store_Note() {\n\t\tglobal $wpdb; \n // Submission table name (including wp prefix)\n $entry_notes_table = $this->Get_Notes_Table(); \n // Retrieve the storage data\n $store_note = $this->store_note;\n // If there are no store fields, return out\n if (!$store_note || !is_array($store_note)) { return array(); }\n // Check for an existing record\n $existing = $wpdb->get_row($wpdb->prepare(\"SELECT uuid FROM $entry_notes_table WHERE form_uuid = %s AND entry_uuid = %s AND uuid = %s\", $store_note['form_uuid'], $store_note['uuid'], $store_note['uuid']));\n // If a record was returned\n if ($existing) { die('existing');\n // Attempt to store the entry data\n $result = $wpdb->update($entry_notes_table, $store_note, array('uuid' => $existing->uuid));\n } // Otherwise attempt to insert a new record \n else { $result = $wpdb->insert($entry_notes_table, $store_note); }\n // If the insert failed\n if ($result === false) { die('Note value failed to insert'); }\n // Store the result id\n $this->store_note['id'] = $wpdb->insert_id; \n // Return the inserted id\n return $this->store_note;\n }", "function tiva_product_custom_data_meta_box_save($post_id)\n{\n if (defined('DOING_AJAX')) {\n return;\n }\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {\n return;\n }\n\n if (isset($_POST['product_garanti'])) {\n\n update_post_meta($post_id, 'product_garanti', $_POST['product_garanti']);\n\n } else {\n\n delete_post_meta($post_id, 'product_garanti');\n }\n\n if (isset($_POST['shoper_input'])) {\n\n update_post_meta($post_id, 'shoper_input', $_POST['shoper_input']);\n\n } else {\n delete_post_meta($post_id, 'shoper_input');\n }\n\n if (isset($_POST['bastebandi_input'])) {\n\n update_post_meta($post_id, 'bastebandi_input', $_POST['bastebandi_input']);\n\n } else {\n delete_post_meta($post_id, 'bastebandi_input');\n }\n\n\n if (isset($_POST['haml_input'])) {\n\n update_post_meta($post_id, 'haml_input', $_POST['haml_input']);\n\n } else {\n delete_post_meta($post_id, 'haml_input');\n }\n\n}", "function create_post()\n {\n //Create the post with information submitted\n if(isset($_POST['note-text']) && !($_POST['note-text'] == \"\"))\n {\n $query = $this->pdo->prepare('INSERT INTO note (title, description, created_at, updated_at) VALUES(:title,:description, NOW(), NOW())');\n $query->execute(array(\n ':title' => $_POST['note-title'],\n ':description' => $_POST['note-text']\n ));\n }\n }", "function save_meta ( $post_id )\n\t{\n\n // Check if nonce is set.\n if ( ! isset( $_POST['metabox_lh_quote'] ) ) {\n return;\n }\n\n // Verify that the nonce is valid.\n if ( ! wp_verify_nonce( $_POST['metabox_lh_quote'], 'save_metabox_lh_quote' ) ) {\n return;\n }\n\n // If this is an autosave, our form has not been submitted, so we don't want to do anything.\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n return;\n }\n\n // Check the user's permissions.\n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return;\n }\n\n // If the post key contains the quote_element add it to the array to save\n $quote_breakdown = array();\n foreach ($_POST as $KEY => $VALUE)\n {\n if(strpos($KEY, \"quote_element\") !== false){\n $quote_breakdown[$KEY] = $VALUE;\n }\n }\n\n update_post_meta( $post_id, 'quote_breakdown', $quote_breakdown );\n\n $quote_total = $_POST['quote_total'];\n update_post_meta( $post_id, 'quote_total', $quote_total );\n\n // Save the client ID\n $client_id = $_POST['client_id'];\n update_post_meta( $post_id, 'client_id', $client_id );\n\n // Update quote status\n $quote_status = $_POST['quote_status'];\n update_post_meta( $post_id, 'quote_status', $quote_status );\n\n // Update deposit status\n $deposit_status = $_POST['deposit_status'];\n // check current deposit status. If it's not paid and its being changed add to timeline\n $current_deposit_status = get_post_meta($post_id,'deposit_status',true);\n if($current_deposit_status<>\"paid\" && $deposit_status==\"paid\")\n {\n\n // Update the client timeline\n $args = array(\n \"client_id\" => $client_id,\n \"project_id\" => $post_id,\n \"activity_title\" => 'Deposit Paid',\n \"activity_content\" => '',\n );\n lh_actions::activity_item_add($args);\n }\n update_post_meta( $post_id, 'deposit_status', $deposit_status );\n\n // Update materials status\n $materials_status = $_POST['materials_status'];\n // check current status and add to timeline if required\n $current_materials_status = get_post_meta($post_id,'materials_status',true);\n if($current_materials_status<>\"ordered\" && $materials_status==\"ordered\")\n {\n\n // Update the client timeline\n $args = array(\n \"client_id\" => $client_id,\n \"project_id\" => $post_id,\n \"activity_title\" => 'Materials Ordered',\n \"activity_content\" => '',\n );\n lh_actions::activity_item_add($args);\n }\n update_post_meta( $post_id, 'materials_status', $materials_status );\n\n // Update accessories status\n $accessories_status = $_POST['accessories_status'];\n // check current status and add to timeline if required\n $current_accessories_status = get_post_meta($post_id,'accessories_status',true);\n if($current_accessories_status<>\"arrived\" && $accessories_status==\"arrived\")\n {\n // Update the client timeline\n $args = array(\n \"client_id\" => $client_id,\n \"project_id\" => $post_id,\n \"activity_title\" => 'Critical Accessories Arrived',\n \"activity_content\" => '',\n );\n lh_actions::activity_item_add($args);\n }\n update_post_meta( $post_id, 'accessories_status', $accessories_status );\n\n // Update invouce status\n $invoice_sent = $_POST['invoice_sent'];\n update_post_meta( $post_id, 'invoice_sent', $invoice_sent );\n\n // Update invouce paid\n $invoice_paid = $_POST['invoice_paid'];\n update_post_meta( $post_id, 'invoice_paid', $invoice_paid );\n\n // Add Project start Date\n $project_start_date = $_POST['project_start_date'];\n update_post_meta( $post_id, 'project_start_date', $project_start_date );\n\n // Finally see if there is a descret key - if not create one\n $secret = get_post_meta($post_id,'secret',true);\n\n if($secret==\"\")\n {\n $new_secret = lh_crm_utils::generate_secret();\n update_post_meta( $post_id, 'secret', $new_secret );\n }\n\n\t}", "function SavePost()\n\t{\n\t\n\t\t// wordpress global\n\t\tglobal $post;\n\t\t\n\t\t// this first check is, I feel, a hack: why should SavePost run on page load?\n\t\tif ( isset( $_POST['tlsp_noncename'] ) )\n\t\t{\n\t\t\n\t\t\t// run the following checks:\n\t\t\tif (\n\t\t\t\t// validate the nonce\n\t\t\t\t( wp_verify_nonce( $_POST['tlsp_noncename'], plugin_basename(__FILE__) ) )\n\t\t\t\t// make sure this is not an autosave\n\t\t\t\t&& ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) == false )\n\t\t\t\t// check user permissions\n\t\t\t\t&& ( current_user_can( 'edit_post', $post_id ) )\n\t\t\t\t// check that the element exists\n\t\t\t\t&& ( isset ( $_POST['tlsp_text'] ) )\n\t\t\t)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t// if there is data, update the meta field\n\t\t\t\tif ( $_POST['tlsp_text'] != '' )\n\t\t\t\t{\n\t\t\t\t\tupdate_post_meta( $post->ID, 'tlsp_text', $_POST['tlsp_text'] );\n\t\t\t\t}\n\t\t\t\t// otherwise delete the table row, for a cleaner database\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdelete_post_meta( $post->ID, 'tlsp_text' );\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t// if the checks fail, return an error\n\t\t\telse\n\t\t\t{\n\t\t\t\t// TODO: This error does not show up yet\n\t\t\t\techo '<div id=\"message\" class=\"error\">Error on saving meta data!</div>';\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t}", "function ajax_update_meta_stuff() {\n $post_id = $_POST['post_id']; // getting variables from ajax post\n $value = $_POST['value']; // getting variables from ajax post\n $key = $_POST['key']; // getting variables from ajax post\n \n $result = update_post_meta($post_id, $key, $value);\n \n if($result)\n echo 'ajax submitted with positive result';\n else\n echo 'ajax submitted with negative result';\n\n exit;\n}", "function wp_ajax_inline_save()\n {\n }", "function prfx_meta_save( $post_id ) {\r\n \r\n // Checks save status\r\n $is_autosave = wp_is_post_autosave( $post_id );\r\n $is_revision = wp_is_post_revision( $post_id );\r\n $is_valid_nonce = ( isset( $_POST[ 'prfx_nonce' ] ) && wp_verify_nonce( $_POST[ 'prfx_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';\r\n \r\n // Exits script depending on save status\r\n if ( $is_autosave || $is_revision || !$is_valid_nonce ) {\r\n return;\r\n }\r\n \r\n // Checks for input and sanitizes/saves if needed\r\n if( isset( $_POST[ 'meta-text' ] ) ) {\r\n update_post_meta( $post_id, 'meta-text', sanitize_text_field( $_POST[ 'meta-text' ] ) );\r\n }\r\n \r\n}", "private function save_paypal_meta_data()\n {\n $postMeta = [\n 'payer_email' => 'Payer PayPal address',\n 'first_name' => 'Payer first name',\n 'last_name' => 'Payer last name',\n 'payment_type' => 'Payment type',\n ];\n\n foreach ($postMeta as $key => $name) {\n $value = wc_clean($this->request->get($key, FILTER_DEFAULT));\n $value and update_post_meta($this->order->get_id(), $name, $value);\n }\n }", "function tiva_post_meta_box_save($post_id)\n{\n if (defined('DOING_AJAX')) {\n return;\n }\n\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {\n return;\n }\n\n if (isset($_POST['tiva_show_author_box'])) {\n\n update_post_meta($post_id, 'tiva_show_author_box', 1);\n\n } else {\n\n //update_post_meta($post_id,'sl_show_sidebar',0);\n delete_post_meta($post_id, 'tiva_show_author_box');\n }\n\n if (isset($_POST['tiva_show_comments_box'])) {\n\n update_post_meta($post_id, 'tiva_show_comments_box', 1);\n\n } else {\n\n //update_post_meta($post_id,'sl_show_sidebar',0);\n delete_post_meta($post_id, 'tiva_show_comments_box');\n }\n\n if (isset($_POST['tiva_show_sidebar_box'])) {\n\n update_post_meta($post_id, 'tiva_show_sidebar_box', '1');\n\n } else {\n delete_post_meta($post_id, 'tiva_show_sidebar_box');\n }\n\n if (isset($_POST['tiva_show_post_thumbnail'])) {\n\n update_post_meta($post_id, 'tiva_show_post_thumbnail', 1);\n\n } else {\n\n //update_post_meta($post_id,'sl_show_sidebar',0);\n delete_post_meta($post_id, 'tiva_show_post_thumbnail');\n }\n\n if (isset($_POST['tiva_private_post'])) {\n\n update_post_meta($post_id, 'tiva_private_post', 1);\n\n } else {\n\n //update_post_meta($post_id,'sl_show_sidebar',0);\n delete_post_meta($post_id, 'tiva_private_post');\n }\n\n if (isset($_POST['tiva_vip_post'])) {\n\n update_post_meta($post_id, 'tiva_vip_post', 1);\n\n } else {\n\n delete_post_meta($post_id, 'tiva_vip_post');\n }\n}", "function save_meta_info( $post_id, $post ) {\n if($post->post_type != 'events')\n return $post_id;\n\n /* Verify the nonce before proceeding. */\n if ( !isset( $_POST['mindevents_event_meta_nonce'] ) || !wp_verify_nonce( $_POST['mindevents_event_meta_nonce'], basename( __FILE__ ) ) )\n return $post_id;\n\n\n\n $field_key = 'event_meta';\n /* Get the posted data and sanitize it for use as an HTML class. */\n $new_meta_values = (isset( $_POST[$field_key]) ? $_POST[$field_key] : '' );\n if($new_meta_values) :\n foreach ($new_meta_values as $key => $value) :\n update_post_meta( $post_id, $key, $value);\n endforeach;\n endif;\n\n return $post_id;\n }", "function nt_course_note_entry_field() {\nglobal $post;\n\n//ID's\n$current_user = get_current_user_id();\n$current_lesson_id = $post->ID;\n$current_post_type = get_post_type();\n\n//Checks if note exists and changes title and body variables accordingly\n$args = array(\n\t'post_type' => 'coursenote',\n\t'post_status' => array('draft'),\n\t'meta_query' => array(\n\t\t//'relation' => 'AND',\n\t\tarray(\n\t\t\t'key' => 'nt-note-current-lessson-id',\n\t\t\t'value' => $current_lesson_id,\n\t\t\t'compare' => '=',\n\t\t)\n\t),\n\t 'author' => $current_user\n);\n\n$the_query = new WP_Query( $args );\n\nif ($the_query->have_posts()){\n while ( $the_query->have_posts() ) : $the_query->the_post();\n\n $title = get_the_title();\n $body = get_the_content();\n\n endwhile;\n wp_reset_postdata();\n} else {\n\n\t$title = 'Note Title';\n\t$body = 'Enter Lesson Notes here';\n}\n\n\n\n?>\n\n <div id=\"nt_note_cont\" class=\"note-container\">\n <div class=\"note-header\">\n <div class=\"note-header-title\">\n <?php _e('Notes'); ?>\n\t\t\t\t<div id=\"apf-response\"></div>\n </div>\n <div class=\"note-header-actions\">\n\n </div>\n </div>\n <div class=\"note-body\">\n <form id=\"nt-course-note\" action=\"\" method=\"post\">\n\t\t\t\t\t<?php wp_nonce_field( basename(__FILE__), 'nt-course-note-nonce') ?>\n\t\t\t\t\t<input type=\"text\" name=\"nt-note-title\" id=\"nt-note-title\" value=\"<?php echo $title; ?>\" placeholder=\"\" >\n\t\t\t\t\t<input type=\"hidden\" name=\"nt-note-user-id\" id=\"nt-note-user-id\" value=\"<?php echo $current_user; ?>\">\n\t\t\t\t\t<input type=\"hidden\" name=\"nt-note-current-lesson-id\" id=\"nt-note-current-lessson-id\" value=\"<?php echo $current_lesson_id; ?>\">\n\t\t\t\t\t<input type=\"hidden\" name=\"nt-note-current-post-type\" id=\"nt-note-current-post-type\" value=\"<?php echo $current_post_type; ?>\">\n\t\t\t\t\t<textarea rows=\"8\" name=\"nt-note-body\" id=\"nt-note-body\" class=\"\" placeholder=\"\"/><?php echo $body; ?></textarea>\n\t\t\t\t\t<input type=\"text\" id=\"xyz\" name=\"<?php echo apply_filters( 'honeypot_name', 'date-submitted') ?>\" value=\"\" style=\"display:none\">\n <input type=\"submit\" id=\"nt-note-submit\" value=\"<?php _e('Save Notes'); ?>\"/>\n </form>\n\n </div>\n\n </div>\n <?php\n\n}", "public function updateAction() {\n \n $this->_form->customSubmitBtn = $this->xhr; \n $this->_form->build( $this->uri,\n $this->consumer_id,\n $this->user_id,\n $this->id);\n \n $data = $this->_model->readNote($this->id)->toArray();\n $this->_form->populate($data);\n \n $this->result = Main_Forms_Handler::onPost($this->_form,\n $this->post,\n $this->_model,\n \"updateNote\",\n $this->params,\n $this->_helper,\n $this->indexAction . $this->consumer_id,\n \"Note updated.\",\n $this->xhr);\n \n \n $this->_onSubmit();\n \n }", "function nsbr_save_custom_data( $post_id ) {\r\n // verify if this is an auto save routine.\r\n // If it is our form has not been submitted, so we dont want to do anything\r\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )\r\n return $post_id;\r\n\r\n // verify this came from the our screen and with proper authorization,\r\n // because save_post can be triggered at other times\r\n if ( !isset( $_POST['nsbr_noncename'] ) )\r\n return $post_id;\r\n\r\n if ( !wp_verify_nonce( $_POST['nsbr_noncename'], plugin_basename( __FILE__ ) ) )\r\n return $post_id;\r\n \r\n // Check this is the Contact Custom Post Type\r\n if ( 'nsbr' != $_POST['post_type'] ) {\r\n return $post_id;\r\n }\r\n \r\n // if our current user can't edit this post, bail\r\n if( !current_user_can( 'edit_nsbr' ) ) return $post_id;\r\n\r\n $boat = new nmmc_nsbr_helper();\r\n // OK to save meta data\r\n $history = $_POST['history'];\r\n $boat->save_boat_history($post_id, $history);\r\n \r\n $gallery = $_POST['gallery'];\r\n $boat->save_boat_gallery($post_id,$gallery);\r\n \r\n $nsbr_reg_no = sanitize_text_field( $_POST['nsbr_reg_no'] );\r\n $boat->save_boat_nsbr_registration($post_id,$nsbr_reg_no);\r\n\r\n \r\n $length_m = sanitize_text_field( $_POST['nsbr_length_m'] );\r\n update_post_meta( $post_id, '_nsbr_length_m', $length_m );\r\n \r\n $length_ft = sanitize_text_field( $_POST['nsbr_length_ft'] );\r\n update_post_meta( $post_id, '_nsbr_length_ft', $length_ft );\r\n \r\n $breadth_m = sanitize_text_field( $_POST['nsbr_breadth_m'] );\r\n update_post_meta( $post_id, '_nsbr_breadth_m', $breadth_m );\r\n \r\n $breadth_ft = sanitize_text_field( $_POST['nsbr_breadth_ft'] );\r\n update_post_meta( $post_id, '_nsbr_breadth_ft', $breadth_ft );\r\n \r\n $location = sanitize_text_field( $_POST['nsbr_location'] );\r\n update_post_meta( $post_id, '_nsbr_location', $location );\r\n \r\n $current_use = sanitize_text_field( $_POST['nsbr_current_use'] );\r\n update_post_meta( $post_id, '_nsbr_current_use', $current_use );\r\n \r\n $build_date = sanitize_text_field( $_POST['nsbr_build_date'] );\r\n update_post_meta( $post_id, '_nsbr_build_date', $build_date );\r\n \r\n $copyright = sanitize_text_field( $_POST['nsbr_copyright'] );\r\n update_post_meta( $post_id, '_nsbr_copyright', $copyright );\r\n}", "function portfolioism_meta_save( $post_id ) {\n $is_autosave = wp_is_post_autosave( $post_id );\n $is_revision = wp_is_post_revision( $post_id );\n $is_valid_nonce = ( isset( $_POST[ 'portfolioism_valid_nonce' ]) && wp_verify_nonce( $_POST['poortfolioism_valid_nonce'], basename(__FILE__) ) ) ? 'true' : 'false';\n \n if ( $is_autosave || $is_revision || !$is_valid_nonce) {\n return;\n }\n\n if ( isset( $_POST['medium'] ) ) {\n update_post_meta($post_id, 'medium', sanitize_text_field($_POST['medium'] ) );\n }\n\n if ( isset ($_POST['height'] ) ) {\n update_post_meta($post_id, 'height', sanitize_text_field($_POST['height'] ) );\n }\n}", "function projectpentagon_save_postdata($post_id) {\n // If it is our form has not been submitted, so we dont want to do anything\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) \n return;\n\n // verify this came from the our screen and with proper authorization,\n // because save_post can be triggered at other times\n\n if ( !wp_verify_nonce( $_POST['myplugin_noncename'], plugin_basename( __FILE__ ) ) )\n return;\n\n // Check permissions\n\n if ( 'page' == $_POST['post_type'] ) \n {\n if ( !current_user_can( 'edit_page', $post_id ) )\n return;\n }\n else\n {\n if ( !current_user_can( 'edit_post', $post_id ) )\n return;\n }\n\n\t//update the tasting notes\n \t$outside_newvalue = $_POST['tasting-notes'];\n\tupdate_post_meta($post_id, 'tasting-notes', $outside_newvalue);\n\n // Do something with $mydata \n // probably using add_post_meta(), update_post_meta(), or \n // a custom table (see Further Reading section below)\n for($hh=1;$hh<6;$hh++)\n\n \t{\n \t//do an update for each of the potential 5 fields....\n\n \t$get_field_name\t\t\t\t\t=\t\"myplugin_new_field\" . $hh .\"\";\t\n \t$create_variable_name\t\t\t=\t\"pentagon-field-\". $hh .\"\";\t\n\t$create_name_of_field_to_update =\t\"mydata\" . $hh .\"\";\n\t$newvalue = $_POST[$get_field_name];\n\t//echo \"$newvalue is returning ---\". \t$newvalue\t.\"<br />\";//DEBUG\n\tupdate_post_meta($post_id, $create_variable_name, $newvalue);\t\n\n\t//echo \"get field name is returning --- \". $get_field_name\t.\"<br />\";//DEBUG\n\t//echo \"create variable name name is returning --- \". \t$create_variable_name\t\t.\"<br />\";//DEBUG\n\t//echo \"$create_name_of_field_to_update is returning --- \". \t$create_name_of_field_to_update\t.\"<br />\";//DEBUG\n\t}\n\n\n\n //echo \"$mydata is mydata....\";//debug\n\n}", "function ajax_update_client_internal_notes() {\r\n\r\n if ( !isset( $_POST['id'] ) || !$_REQUEST['id'] ) {\r\n die( json_encode( array('status' => false, 'message' => 'Some problem with update.' ) ) );\r\n }\r\n\r\n $id = explode( '_', $_POST['id'] );\r\n\r\n //check id and hash\r\n if ( isset( $id[0] ) && $id[0] && isset( $id[1] ) && md5( 'wpcclientinternalnote_' . $id[0] ) == $id[1] ) {\r\n $client = get_userdata( $id[0] );\r\n\r\n if ( $client ) {\r\n $internal_notes = ( isset( $_POST['notes'] ) ) ? base64_decode( str_replace( '-', '+', $_POST['notes'] ) ) : '';\r\n\r\n update_user_meta( $id[0], 'wpc__internal_notes', $internal_notes );\r\n die( json_encode( array('status' => true, 'message' => 'Notes is updated.' ) ) );\r\n }\r\n }\r\n\r\n die( json_encode( array('status' => false, 'message' => 'Some problem with update.' ) ) );\r\n }", "function _wp_rest_api_autosave_meta($autosave)\n {\n }", "public function save () {\r\n\t\tif (isset($_POST['data'])) {\r\n\t\t\t$data = stripslashes_deep($_POST['data']);\r\n\t\t\tif (!empty($data['preset']) && !empty($data['id'])) $data['preset'] = $data['id']; // Also override whatever preset we're seding\r\n\t\t\t$_POST['data'] = $data;\r\n\t\t}\r\n\t\tparent::save();\r\n\t}", "public function kiwip_save_post(){\n\t\t// Load Helper class\n\t\t$Helper = new Kiwip_Helper;\n\t\t// Deny the wordpress autosave function\n\t\tif(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return;\n\n\t\tif($_POST && !wp_verify_nonce($_POST['kiwip_nonce'], plugin_basename(__FILE__))) return;\n\t\tif(!isset($_POST)) return;\n\t\t\n\t\tglobal $post;\n\t\tif(!isset($post->ID) && get_post_type($post->ID) !== $this->post_type_name) return;\n\t\t\n\t\t// Loop through each meta box\n\t\tif(!empty($this->meta_fields)){\n\t\t\tforeach($this->meta_fields as $field){\n\t\t\t\t$field_id_name = '_'.$this->slug.\"_\".$Helper->kiwip_make_slugable($field['name']);\n\n\t\t\t\t// validation rules here \n\n\t\t\t\tupdate_post_meta($post->ID, $field_id_name, $_POST['kiwip'][$field_id_name]);\n\t\t\t\t\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t}", "function rps_save_custom_meta() {\n\tglobal $post;\n\n\t// Stops WP from clearing post meta when autosaving\n\tif( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) {\n\t return $post->ID;\n\t}\n\tif (isset($_POST['rps-url'])) {\n\t\t$clean = esc_url_raw($_POST['rps-url']);\n\t\tupdate_post_meta($post->ID, '_url' , $clean);\n\t}\n\tif (isset($_POST['rps-tagline'])) {\n\t\t$realclean = sanitize_text_field($_POST['rps-tagline']);\n\t\tupdate_post_meta($post->ID, '_tagline' , $realclean);\n\t}\n\n}", "public function actionSaveNotes()\r\n\t{\n\t\tif(isset($_POST['note']) && isset($_POST['id'])) {\n\t\t\t$employee_id = $_POST['id'];\n\t\t\t$model = $this->loadModel($employee_id, Yii::app()->user->id);\r\n\t\t\t$model->note = $_POST['note'];\n\t\t\t//var_dump($model);die;\r\n\t\t\t$model->save();\r\n\t\t\techo nl2br($model->note);\r\n\t\t}\r\n\t}", "public function save(){\r\n // Need the post type name again\r\n $post_type_name = $this->post_type_name;\r\n\r\n add_action( 'save_post',\r\n function() use( $post_type_name ){\r\n // Deny the WordPress autosave function\r\n if( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;\r\n\r\n if ( ! wp_verify_nonce( $_POST['custom_post_type'], plugin_basename(__FILE__) ) ) return;\r\n\r\n global $post;\r\n\r\n if( isset( $_POST ) && isset( $post->ID ) && get_post_type( $post->ID ) == $post_type_name ){\r\n global $custom_fields;\r\n\r\n // Loop through each meta box\r\n foreach( $custom_fields as $title => $fields ){\r\n // Loop through all fields\r\n foreach( $fields as $label => $type ){\r\n $field_id_name = strtolower( str_replace( ' ', '_', $title ) ) . '_' . strtolower( str_replace( ' ', '_', $label ) );\r\n if($_POST['custom_meta'][$field_id_name] != ''){//Check Entry is not empty\r\n update_post_meta( $post->ID, $field_id_name, $_POST['custom_meta'][$field_id_name] );\r\n }\r\n }\r\n\r\n }\r\n }\r\n }\r\n );\r\n }", "function tiva_video_post_meta_box_save($post_id)\n{\n\n if (defined('DOING_AJAX')) {\n return;\n }\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {\n return;\n }\n\n if (isset($_POST['video-poster'])) {\n\n update_post_meta($post_id, 'tiva_video_poster', $_POST['video-poster']);\n\n } else {\n\n delete_post_meta($post_id, 'tiva_video_poster');\n }\n\n if (isset($_POST['up-video'])) {\n\n update_post_meta($post_id, 'tiva_up_video', $_POST['up-video']);\n\n } else {\n delete_post_meta($post_id, 'tiva_up_video');\n }\n\n if (isset($_POST['aparat-video-script'])) {\n\n update_post_meta($post_id, 'aparat_video_script', $_POST['aparat-video-script']);\n\n } else {\n delete_post_meta($post_id, 'aparat_video_script');\n }\n\n if (isset($_POST['tiva-video-select'])) {\n\n update_post_meta($post_id, 'tiva-video-select', $_POST['tiva-video-select']);\n\n } else {\n delete_post_meta($post_id, 'tiva-video-select');\n }\n\n if (isset($_POST['video-time'])) {\n\n update_post_meta($post_id, 'tiva-video-time', $_POST['video-time']);\n\n } else {\n delete_post_meta($post_id, 'tiva-video-time');\n }\n\n if (isset($_POST['tiva_vip_post'])) {\n\n update_post_meta($post_id, 'tiva_vip_post', 1);\n\n } else {\n\n delete_post_meta($post_id, 'tiva_vip_post');\n }\n\n\n}", "function update_single_data(){\n\t\t\t$name = $this->input->post('name');\n\t\t\t$value = $this->input->post('value');\t\t\t\n\t\t\t$pk = $this->input->post('pk');\n\t\t\treturn $this->InteractModal->update_post_meta( $pk, $name, $value );\n\t\t\t\n\t\t\t\n\t\t}", "function kurama_meta_save( $post_id ) {\n \n // Checks save status\n $is_autosave = wp_is_post_autosave( $post_id );\n $is_revision = wp_is_post_revision( $post_id );\n $is_valid_nonce = ( isset( $_POST[ 'kurama_nonce' ] ) && wp_verify_nonce( $_POST[ 'kurama_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';\n \n // Exits script depending on save status\n if ( $is_autosave || $is_revision || !$is_valid_nonce ) {\n return;\n }\n \n // Checks for input and sanitizes/saves if needed\n if( isset( $_POST[ 'meta-text' ] ) ) {\n update_post_meta( $post_id, 'meta-text', sanitize_text_field( $_POST[ 'meta-text' ] ) );\n }\n \n // Checks for input and saves\n\tif( isset( $_POST[ 'enable-slider' ] ) ) {\n\t update_post_meta( $post_id, 'enable-slider', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-slider', '' );\n\t}\n\t\n\t// Checks for input and saves\n\tif( isset( $_POST[ 'enable-showcase' ] ) ) {\n\t update_post_meta( $post_id, 'enable-showcase', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-showcase', '' );\n\t}\n\t\n\t// Checks for input and saves\n\tif( isset( $_POST[ 'enable-sqbx' ] ) ) {\n\t update_post_meta( $post_id, 'enable-sqbx', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-sqbx', '' );\n\t}\n\t\n\t// Checks for input and saves\n\tif( isset( $_POST[ 'enable-farea1' ] ) ) {\n\t update_post_meta( $post_id, 'enable-farea1', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-farea1', '' );\n\t}\n\t\n\t// Checks for input and saves\n\tif( isset( $_POST[ 'enable-fn1' ] ) ) {\n\t update_post_meta( $post_id, 'enable-fn1', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-fn1', '' );\n\t}\n\t\n\tif( isset( $_POST[ 'enable-fn2' ] ) ) {\n\t update_post_meta( $post_id, 'enable-fn2', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-fn2', '' );\n\t}\n\t\n\tif( isset( $_POST[ 'enable-fn3' ] ) ) {\n\t update_post_meta( $post_id, 'enable-fn3', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-fn3', '' );\n\t}\n\t\n\t// Checks for input and saves\n\tif( isset( $_POST[ 'enable-grid' ] ) ) {\n\t update_post_meta( $post_id, 'enable-grid', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-grid', '' );\n\t}\n\t\n\t// Checks for input and saves\n\tif( isset( $_POST[ 'enable-coverflow' ] ) ) {\n\t update_post_meta( $post_id, 'enable-coverflow', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-coverflow', '' );\n\t}\n\t\n\t// Checks for input and saves\n\tif( isset( $_POST[ 'enable-sqbx-posts' ] ) ) {\n\t update_post_meta( $post_id, 'enable-sqbx-posts', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-sqbx-posts', '' );\n\t}\n\t\n\t// Checks for input and saves\n\tif( isset( $_POST[ 'enable-coverflow-posts' ] ) ) {\n\t update_post_meta( $post_id, 'enable-coverflow-posts', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-coverflow-posts', '' );\n\t}\n\t \n\t// Checks for input and saves\n\tif( isset( $_POST[ 'hide-title' ] ) ) {\n\t update_post_meta( $post_id, 'hide-title', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'hide-title', '' );\n\t}\n\t\n\t// Checks for input and saves\n\tif( isset( $_POST[ 'enable-full-width' ] ) ) {\n\t update_post_meta( $post_id, 'enable-full-width', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-full-width', '' );\n\t}\n \n}", "function construction_realestate_posttype_bn_metadesig_save( $post_id ) {\n if( isset( $_POST[ 'meta-desig' ] ) ) {\n update_post_meta( $post_id, 'meta-desig', esc_html($_POST[ 'meta-desig' ]) );\n }\n if( isset( $_POST[ 'meta-call' ] ) ) {\n update_post_meta( $post_id, 'meta-call', esc_html($_POST[ 'meta-call' ]) );\n }\n // Save facebookurl\n if( isset( $_POST[ 'meta-facebookurl' ] ) ) {\n update_post_meta( $post_id, 'meta-facebookurl', esc_url($_POST[ 'meta-facebookurl' ]) );\n }\n // Save linkdenurl\n if( isset( $_POST[ 'meta-linkdenurl' ] ) ) {\n update_post_meta( $post_id, 'meta-linkdenurl', esc_url($_POST[ 'meta-linkdenurl' ]) );\n }\n if( isset( $_POST[ 'meta-twitterurl' ] ) ) {\n update_post_meta( $post_id, 'meta-twitterurl', esc_url($_POST[ 'meta-twitterurl' ]) );\n }\n // Save googleplusurl\n if( isset( $_POST[ 'meta-googleplusurl' ] ) ) {\n update_post_meta( $post_id, 'meta-googleplusurl', esc_url($_POST[ 'meta-googleplusurl' ]) );\n }\n}", "function sm_meta_save( $post_id ) {\n \n // Checks save status\n $is_autosave = wp_is_post_autosave( $post_id );\n $is_revision = wp_is_post_revision( $post_id );\n $is_valid_nonce = ( isset( $_POST[ 'sm_nonce' ] ) && wp_verify_nonce( $_POST[ 'sm_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';\n \n // Exits script depending on save status\n if ( $is_autosave || $is_revision || !$is_valid_nonce ) {\n return;\n }\n \n // Checks for input and saves\nif( isset( $_POST[ 'meta-feature-checkbox' ] ) ) {\n update_post_meta( $post_id, 'meta-feature-checkbox', 'yes' );\n} else {\n update_post_meta( $post_id, 'meta-feature-checkbox', '' );\n}\n \n}", "public function post_create(){\n\n\t\t$data = Input::get();\n\t\t$rules = array(\"title\" => 'required',\n\t\t\t\t\t\t\"content\" => 'required',\n\t\t\t\t\t\t\"tag\" => 'required'\n\t\t\t\t\t\t);\n\n\t\t$validator = Validator::make($data, $rules);\n\t\t\n\t\tif($validator->fails())\n\t\t{\n\t\t\tResponse::json(array(\"errors\" => $validator->messages()), 400);\n\t\t}\n\n\t\t//note saving in database\n\t\t$note = new Note();\n\t\t$note->user_id = Auth::user()->id;\n\t\t$note->fill($data);\n\t\t$note->save();\n\n\t\t//multiple tag saving in database\n\t\t$tags = Input::get(\"tags\");\n\t\t$tags = explode(\",\", $tags);\n\t\t\n\t\t$tagsToInsert = array();\n\t\tforeach ($tags as $t) {\n\t\t\tif( trim( strlen($t) ) > 0 ){\n\t\t\t\tarray_push($tagsToInsert, array(\n\t\t\t\t\t\"note_id\" => $note->id,\n\t\t\t\t\t\"content\" => trim($t),\n\t\t\t\t\t\"created_at\" => date(\"Y-m-d H:i:s\"),\n\t\t\t\t\t\"updated_at\" => date(\"Y-m-d H:i:s\")\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t\tif( count($tagsToInsert) > 0 ){\n\t\t\tTag::insert($tagsToInsert);\t\n\t\t}\n\t\t\n\n\t\tif($note->id)\n\t\t\t return Response::json(compact(\"note\"), 201 );\n\t\telse\n\t\t\treturn Response::json(array(\"message\" => \"Note has been saved\"), 400);\n\n\t}", "public function createAction(){\n \n $this->_form->customSubmitBtn = $this->xhr;\n $this->_form->build( $this->uri,\n $this->consumer_id,\n $this->user_id,\n $this->id);\n \n \n \n $this->result = Main_Forms_Handler::onPost($this->_form ,\n $this->post,\n $this->_model,\n \"createNote\",\n $this->params,\n $this->_helper,\n $this->indexAction . $this->consumer_id,\n \"Note created.\",\n $this->xhr); \n \n $this->_onSubmit();\n\n }", "function vw_mobile_app_pro_posttype_ex_bn_metadesig_save( $post_id ) {\n if( isset( $_POST[ 'meta-desig' ] ) ) {\n update_post_meta( $post_id, 'meta-desig', esc_html($_POST[ 'meta-desig' ]) );\n }\n if( isset( $_POST[ 'meta-call' ] ) ) {\n update_post_meta( $post_id, 'meta-call', esc_html($_POST[ 'meta-call' ]) );\n }\n // Save facebookurl\n if( isset( $_POST[ 'meta-facebookurl' ] ) ) {\n update_post_meta( $post_id, 'meta-facebookurl', esc_url($_POST[ 'meta-facebookurl' ]) );\n }\n // Save linkdenurl\n if( isset( $_POST[ 'meta-linkdenurl' ] ) ) {\n update_post_meta( $post_id, 'meta-linkdenurl', esc_url($_POST[ 'meta-linkdenurl' ]) );\n }\n if( isset( $_POST[ 'meta-twitterurl' ] ) ) {\n update_post_meta( $post_id, 'meta-twitterurl', esc_url($_POST[ 'meta-twitterurl' ]) );\n }\n // Save googleplusurl\n if( isset( $_POST[ 'meta-googleplusurl' ] ) ) {\n update_post_meta( $post_id, 'meta-googleplusurl', esc_url($_POST[ 'meta-googleplusurl' ]) );\n }\n // Save designation\n if( isset( $_POST[ 'meta-designation' ] ) ) {\n update_post_meta( $post_id, 'meta-designation', esc_html($_POST[ 'meta-designation' ]) );\n }\n}", "function textbook_save_data() {\r\n global $post;\r\n update_post_meta($post->ID, 'textbook_pub',\r\n\t\t $_POST['textbook_pub']);\r\n update_post_meta($post->ID, 'textbook_author',\r\n\t\t $_POST['textbook_author']);\r\n update_post_meta($post->ID, 'textbook_date',\r\n\t\t $_POST['textbook_date']);\r\n}", "function sm_meta_save( $post_id ) {\r\n \r\n // Checks save status\r\n $is_autosave = wp_is_post_autosave( $post_id );\r\n $is_revision = wp_is_post_revision( $post_id );\r\n $is_valid_nonce = ( isset( $_POST[ 'sm_nonce' ] ) && wp_verify_nonce( $_POST[ 'sm_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';\r\n \r\n // Exits script depending on save status\r\n if ( $is_autosave || $is_revision || !$is_valid_nonce ) {\r\n return;\r\n }\r\n \r\n // Checks for input and saves\r\nif( isset( $_POST[ 'meta-checkbox' ] ) ) {\r\n update_post_meta( $post_id, 'meta-checkbox', 'featured' );\r\n} else {\r\n update_post_meta( $post_id, 'meta-checkbox', '' );\r\n}\r\n \r\n}", "function wp_ajax_add_meta()\n {\n }", "function rs_save_post_meta($post_id)\n{\n if (!isset($_POST['rs_meta_box_nonce'])\n || !wp_verify_nonce($_POST['rs_meta_box_nonce'], 'rs_meta_box')\n || (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)) {\n return;\n }\n update_post_meta($post_id, '_focus', !empty($_POST['rs_focus']));\n update_post_meta($post_id, '_author', !empty($_POST['rs_author']) ? $_POST['rs_author'] : null);\n}", "function save_my_meta_box_data2( $post_id ) {\n\n\n // Check if our nonce is set.\n if ( ! isset( $_POST['post_meta_box_nonce'] ) ) {\n return;\n }\n\n // Verify that the nonce is valid.\n if ( ! wp_verify_nonce( $_POST['post_meta_box_nonce'], 'post_meta_box' ) ) {\n return;\n }\n\n // If this is an autosave, our form has not been submitted, so we don't want to do anything.\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n return;\n }\n\n // Check the user's permissions.\n if ( isset( $_POST['post_type'] ) && 'page' == $_POST['post_type'] ) {\n\n if ( ! current_user_can( 'edit_page', $post_id ) ) {\n return;\n }\n\n } else {\n\n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return;\n }\n }\n\n /* OK, it's safe for us to save the data now. */\n\n // Make sure that it is set.\n if ( ! isset( $_POST['second_title'] ) ) {\n return;\n }\n // Make sure that it is set.\n if ( ! isset( $_POST['fexid'] ) ) {\n return;\n }\n // Make sure that it is set.\n if ( ! isset( $_POST['po_sources'] ) ) {\n return;\n }\n\n // Sanitize user input.\n $my_sec_title = sanitize_text_field( $_POST['second_title'] );\n $my_post_sources = sanitize_text_field( $_POST['po_sources'] );\n $my_fexid = sanitize_text_field( $_POST['fexid'] );\n\n // Update the meta field in the database.\n update_post_meta( $post_id, 'post_second_title', $my_sec_title );\n update_post_meta( $post_id, 'post_sources', $my_post_sources );\n update_post_meta( $post_id, 'post_fexid', $my_fexid );\n}", "function submitNote() {\n $stmt = $GLOBALS['con']->prepare(\"INSERT INTO customerNotes (customer_id, note) VALUES (?, ?)\");\n $stmt->bind_param(\"ss\", $uid, $note);\n \n $note = validateInput('notepad', 'post');\n $uid = validateInput('uid', 'post');\n\n $stmt->execute();\n $stmt->close(); \n }", "function travel_meta_save( $post_id ) {\n \n // Checks save status\n $is_autosave = wp_is_post_autosave( $post_id );\n $is_revision = wp_is_post_revision( $post_id );\n $is_valid_nonce = ( isset( $_POST[ 'travel_nonce' ] ) && wp_verify_nonce( $_POST[ 'travel_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';\n \n // Exits script depending on save status\n if ( $is_autosave || $is_revision || !$is_valid_nonce ) {\n return;\n }\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'travel-logo' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'travel-logo', $_POST[ 'travel-logo' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'travel-image' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'travel-image', $_POST[ 'travel-image' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'feature-1-image' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-1-image', $_POST[ 'feature-1-image' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'feature-2-image' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-2-image', $_POST[ 'feature-2-image' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'feature-3-gettingto-image' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-3-gettingto-image', $_POST[ 'feature-3-gettingto-image' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'feature-4-lodging-image' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-4-lodging-image', $_POST[ 'feature-4-lodging-image' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'feature-5-angling-image' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-5-angling-image', $_POST[ 'feature-5-angling-image' ] );\n\t\t}\n \n // Checks for input and saves\n\t\tif( isset( $_POST[ 'setthehook-option-checkbox' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'setthehook-option-checkbox', 'yes' );\n\t\t} else {\n\t\t\t\tupdate_post_meta( $post_id, 'setthehook-option-checkbox', '' );\n\t\t}\n \n // Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'sth-textarea-1' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'sth-textarea-1', $_POST[ 'sth-textarea-1' ] );\n\t\t}\n\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image1' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image1', $_POST[ 'additional-info-image1' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image1-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image1-link', $_POST[ 'additional-info-image1-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image2' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image2', $_POST[ 'additional-info-image2' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image2-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image2-link', $_POST[ 'additional-info-image2-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image3' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image3', $_POST[ 'additional-info-image3' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image3-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image3-link', $_POST[ 'additional-info-image3-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image4' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image4', $_POST[ 'additional-info-image4' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image4-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image4-link', $_POST[ 'additional-info-image4-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image5' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image5', $_POST[ 'additional-info-image5' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image5-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image5-link', $_POST[ 'additional-info-image5-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image6' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image6', $_POST[ 'additional-info-image6' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image6-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image6-link', $_POST[ 'additional-info-image6-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image7' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image7', $_POST[ 'additional-info-image7' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image7-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image7-link', $_POST[ 'additional-info-image7-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image8' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image8', $_POST[ 'additional-info-image8' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image8-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image8-link', $_POST[ 'additional-info-image8-link' ] );\n\t\t}\n\t\n\t// Checks for input and sanitizes/saves if needed\n\t\tif( isset( $_POST[ 'feature-1-video' ] ) ) {\n\t\tupdate_post_meta( $post_id, 'feature-1-video', esc_url( $_POST[ 'feature-1-video' ] ) );\n\t\t}\n\t\n\t// Checks for input and saves\n\t\tif( isset( $_POST[ 'feature-1-checkbox' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-1-checkbox', 'yes' );\n\t\t} else {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-1-checkbox', '' );\n\t\t}\n\t\n\t// Checks for input and sanitizes/saves if needed\n\t\tif( isset( $_POST[ 'feature-2-video' ] ) ) {\n\t\tupdate_post_meta( $post_id, 'feature-2-video', esc_url( $_POST[ 'feature-2-video' ] ) );\n\t\t}\n\t\n\t// Checks for input and saves\n\t\tif( isset( $_POST[ 'feature-2-checkbox' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-2-checkbox', 'yes' );\n\t\t} else {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-2-checkbox', '' );\n\t\t}\n\t\n\t// Checks for input and sanitizes/saves if needed\n\t\tif( isset( $_POST[ 'feature-3-video' ] ) ) {\n\t\tupdate_post_meta( $post_id, 'feature-3-video', esc_url( $_POST[ 'feature-3-video' ] ) );\n\t\t}\n\t\n\t// Checks for input and saves\n\t\tif( isset( $_POST[ 'feature-3-checkbox' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-3-checkbox', 'yes' );\n\t\t} else {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-3-checkbox', '' );\n\t\t}\n\t\n\t// Checks for input and sanitizes/saves if needed\n\t\tif( isset( $_POST[ 'feature-4-video' ] ) ) {\n\t\tupdate_post_meta( $post_id, 'feature-4-video', esc_url( $_POST[ 'feature-4-video' ] ) );\n\t\t}\n\t\n\t// Checks for input and saves\n\t\tif( isset( $_POST[ 'feature-4-checkbox' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-4-checkbox', 'yes' );\n\t\t} else {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-4-checkbox', '' );\n\t\t}\n\t\n\t// Checks for input and sanitizes/saves if needed\n\t\tif( isset( $_POST[ 'feature-5-video' ] ) ) {\n\t\tupdate_post_meta( $post_id, 'feature-5-video', esc_url( $_POST[ 'feature-5-video' ] ) );\n\t\t}\n\t\n\t// Checks for input and saves\n\t\tif( isset( $_POST[ 'feature-5-checkbox' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-5-checkbox', 'yes' );\n\t\t} else {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-5-checkbox', '' );\n\t\t}\n}", "public static function add_payment_note() {\n\n check_ajax_referer( 'sumo-pp-add-payment-note' , 'security' ) ;\n\n $note = _sumo_pp_add_payment_note( $_POST[ 'content' ] , $_POST[ 'post_id' ] , 'pending' , __( 'Admin Manually Added Note' , _sumo_pp()->text_domain ) ) ;\n\n if ( $note = _sumo_pp_get_payment_note( $note ) ) {\n ?>\n <li rel=\"<?php echo absint( $note->id ) ; ?>\" class=\"<?php echo isset( $note->meta[ 'comment_status' ] ) ? implode( $note->meta[ 'comment_status' ] ) : 'pending' ; ?>\">\n <div class=\"note_content\">\n <?php echo wpautop( wptexturize( wp_kses_post( $note->content ) ) ) ; ?>\n </div>\n <p class=\"meta\">\n <abbr class=\"exact-date\" title=\"<?php echo _sumo_pp_get_date_to_display( $note->date_created ) ; ?>\"><?php echo _sumo_pp_get_date_to_display( $note->date_created ) ; ?></abbr>\n <?php printf( ' ' . __( 'by %s' , _sumo_pp()->text_domain ) , $note->added_by ) ; ?>\n <a href=\"#\" class=\"delete_note\"><?php _e( 'Delete note' , _sumo_pp()->text_domain ) ; ?></a>\n </p>\n </li>\n <?php\n }\n die() ;\n }", "public function save($extra_fields = [])\n\t{\n\t\t$args = [\n\t\t\t'post_title' => $this->title,\n\t\t\t'post_content' => $this->content,\n\t\t\t'post_date' => $this->create_date,\n\t\t\t'post_status' => $this->status,\n\t\t\t'post_name' => $this->slug,\n\t\t];\n\n\t\tremove_action('save_post', array(get_class($this), 'saveMetaBox'));\n\n\t\tif (empty($this->id)) {\n\t\t\t$args['post_type'] = $this::$MACHINE_NAME;\n\t\t\t$this->id = wp_insert_post($args);\n\t\t} else {\n\t\t\t$args['ID'] = $this->id;\n\t\t\t$this->id = wp_update_post($args);\n\t\t}\n\n\t\tadd_action('save_post', array(get_class($this), 'saveMetaBox'));\n\n\t\t$metafields = $this->getMetaFields();\n\n\t\tif (!empty($metafields)) {\n\t\t\tforeach ($metafields as $field) {\n\t\t\t\tif (property_exists($this,$field)) {\n\t\t\t\t\t$this->saveField($field);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($extra_fields) && is_array($extra_fields)) {\n\t\t\tforeach ($extra_fields as $field=>$value) {\n\t\t\t\tupdate_post_meta($this->id, $field, $value);\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "function notes_meta_box_callback( $post ) {\n\n\t// Add an nonce field so we can check for it later.\n\twp_nonce_field( 'notes_meta_box', 'notes_meta_box_nonce' );\n\n\t/*\n\t * Use get_post_meta() to retrieve an existing value\n\t * from the database and use the value for the form.\n\t */\n\t$value = get_post_meta( $post->ID, '_my_meta_value_key', true );\n\n\techo '<label for=\"notes_new_field\">';\n\t_e( 'Description for this field', 'notes_textdomain' );\n\techo '</label> ';\n\techo '<input type=\"text\" id=\"notes_new_field\" name=\"notes_new_field\" value=\"' . esc_attr( $value ) . '\" size=\"25\" />';\n}", "function do_save(){\n\t\t// check that number and post_ID is set\n\t\tif( empty($this->post_ID) || empty($this->number) ) return false;\n\t\t\n\t\t// check that we have data in POST\n\t\tif( $this->id_base != 'checkbox' && (\n\t\t\t\tempty($_POST['field-'.$this->id_base][$this->number]) ||\n\t\t\t\t!is_array($_POST['field-'.$this->id_base][$this->number])\n\t\t\t)\n\t\t )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$input = @$_POST['field-'.$this->id_base][$this->number];\n\t\t// get real values\n\t\t$values = $this->save( $input );\n\t\t// save to post meta\n\t\tupdate_post_meta($this->post_ID, $this->slug, $values);\n\t\treturn true;\n\t}", "function rosemary_meta_save( $post_id ) {\r\n \r\n // Checks save status\r\n $is_autosave = wp_is_post_autosave( $post_id );\r\n $is_revision = wp_is_post_revision( $post_id );\r\n $is_valid_nonce = ( isset( $_POST[ 'rosemary_nonce' ] ) && wp_verify_nonce( $_POST[ 'rosemary_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';\r\n \r\n // Exits script depending on save status\r\n if ( $is_autosave || $is_revision || !$is_valid_nonce ) {\r\n return;\r\n }\r\n\t\r\n\t// Checks for input and saves\r\n\tif( isset( $_POST[ 'meta-checkbox-fullwidth' ] ) ) {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-fullwidth', 'yes' );\r\n\t} else {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-fullwidth', '' );\r\n\t}\r\n\tif( isset( $_POST[ 'meta-checkbox-page-content' ] ) ) {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-page-content', 'yes' );\r\n\t} else {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-page-content', '' );\r\n\t}\r\n\tif( isset( $_POST[ 'meta-checkbox-blog-slider' ] ) ) {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-blog-slider', 'yes' );\r\n\t} else {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-blog-slider', '' );\r\n\t}\r\n\tif( isset( $_POST[ 'meta-checkbox-blog-promo' ] ) ) {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-blog-promo', 'yes' );\r\n\t} else {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-blog-promo', '' );\r\n\t}\r\n\t\r\n if( isset( $_POST[ 'meta-text-blog-heading' ] ) ) {\r\n update_post_meta( $post_id, 'meta-text-blog-heading', sanitize_text_field( $_POST[ 'meta-text-blog-heading' ] ) );\r\n }\r\n\tif( isset( $_POST[ 'meta-select-blog-layout' ] ) ) {\r\n\t\tupdate_post_meta( $post_id, 'meta-select-blog-layout', $_POST[ 'meta-select-blog-layout' ] );\r\n\t}\r\n\tif( isset( $_POST[ 'meta-number-posts' ] ) ) {\r\n update_post_meta( $post_id, 'meta-number-posts', sanitize_text_field( $_POST[ 'meta-number-posts' ] ) );\r\n }\r\n\tif( isset( $_POST[ 'meta-blog-category' ] ) ) {\r\n update_post_meta( $post_id, 'meta-blog-category', sanitize_text_field( $_POST[ 'meta-blog-category' ] ) );\r\n }\r\n \r\n}", "function pa_save_testidata( $post_id ) {\r\r\n\t\r\r\n\t// verify if this is an auto save routine. \r\r\n\t// If it is our form has not been submitted, so we dont want to do anything\r\r\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) \r\r\n\t\treturn;\r\r\n\t\r\r\n\t// verify this came from the our screen and with proper authorization,\r\r\n\t// because save_post can be triggered at other times\r\r\n\t\r\r\n\tif ( isset($_POST['pa_noncename']) && !wp_verify_nonce( $_POST['pa_noncename'], plugin_basename( __FILE__ ) ) )\r\r\n\t\treturn;\r\r\n\r\r\n \r\r\n\t// Check permissions\r\r\n\tif ( !current_user_can( 'edit_page', $post_id ) )\r\r\n\t\treturn;\r\r\n\t\r\r\n\t// OK, we're authenticated: we need to find and save the data\r\r\n\t\r\r\n\t$testimonialoptions = array(\r\r\n\t'testisidebar',\r\r\n\t'testisidebarright',\r\r\n\t'testisidebarleft',\r\r\n\t'testipost',\r\r\n\t'testicompany',\r\r\n\t'testiurl',\r\r\n\t'testiimageonoff');\r\r\n\t\r\r\n\tforeach ($testimonialoptions as $testimonialoption) {\t\r\r\n\tif (isset($_POST[$testimonialoption])) update_post_meta($post_id, $testimonialoption, $_POST[$testimonialoption]);\r\r\n\t}\r\r\n}", "function foool_partner_infos_save_postdata($post_id){\n \n // Check Autosave\n\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return $post_id;\n\n if (!wp_verify_nonce($_POST['partner_metabox_nonce'], basename(__FILE__))) return $post_id;\n\n // Update Temoignage Author\n $temoignage_author = sanitize_text_field($_POST['partner_url']);\n if (!empty($temoignage_author)) update_post_meta ($post_id, 'partner_url', $temoignage_author);\n else update_post_meta ($post_id, 'partner_url', '');\n\n}", "function sample_save_metabox( $post_id, $post ) {\n\t// Add nonce for security and authentication.\n\t$nonce_name = isset( $_POST['custom_nonce'] ) ? $_POST['custom_nonce'] : '';\n\t$nonce_action = 'custom_nonce_action';\n\n\t// Check if nonce is set.\n\tif ( ! isset( $nonce_name ) ) {\n\t\treturn;\n\t}\n\n\t// Check if nonce is valid.\n\tif ( ! wp_verify_nonce( $nonce_name, $nonce_action ) ) {\n\t\treturn;\n\t}\n\n\t// Check if user has permissions to save data.\n\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\treturn;\n\t}\n\n\t// Check if not an autosave.\n\tif ( wp_is_post_autosave( $post_id ) ) {\n\t\treturn;\n\t}\n\n\t// Check if not a revision.\n\tif ( wp_is_post_revision( $post_id ) ) {\n\t\treturn;\n\t}\n\n\tif ( ! isset( $_POST['notes'] ) ) {\n\t\treturn;\n\t}\n\n\tupdate_post_meta( $post_id, 'notes', wp_unslash( sanitize_text_field( $_POST['notes'] ) ) );\n}", "function wpc_client_save_meta( $post_id ) {\r\n global $wpc_client;\r\n\r\n\r\n //for quick edit\r\n if(defined('DOING_AJAX') && DOING_AJAX) {\r\n return $post_id;\r\n }\r\n\r\n if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {\r\n return $post_id;\r\n }\r\n\r\n if( defined('WPC_CLIENT_NOT_SAVE_META') && WPC_CLIENT_NOT_SAVE_META ) {\r\n return $post_id;\r\n }\r\n\r\n if ( isset( $_POST ) && 0 < count( $_POST ) ) {\r\n $post = get_post( $post_id );\r\n\r\n if ( 'clientspage' == $post->post_type ) {\r\n\r\n //updating from admin\r\n if( isset( $_POST['clients'] ) && '' != $_POST['clients'] ) {\r\n if( $_POST['clients'] == 'all' ) {\r\n $selected_clients = $wpc_client->get_client_ids();\r\n } else {\r\n $selected_clients = explode( ',', $_POST['clients'] );\r\n }\r\n\r\n if ( is_array( $selected_clients ) && count( $selected_clients ) ) {\r\n update_post_meta( $post_id, 'user_ids', $selected_clients );\r\n } else {\r\n update_post_meta( $post_id, 'user_ids', '' );\r\n }\r\n } else {\r\n update_post_meta( $post_id, 'user_ids', '' );\r\n }\r\n\r\n //update clientpage file template\r\n if ( isset( $_POST['clientpage_template'] ) && '' != $_POST['clientpage_template'] ) {\r\n update_post_meta( $post_id, '_wp_page_template', $_POST['clientpage_template'] );\r\n } else {\r\n delete_post_meta( $post_id, '_wp_page_template' );\r\n }\r\n\r\n //save client Client Circles for Portal Page\r\n if ( isset( $_POST['circles'] ) && '' != $_POST['circles'] ) {\r\n if( $_POST['circles'] == 'all' ) {\r\n $selected_circles = $wpc_client->get_group_ids();\r\n } else {\r\n $selected_circles = explode( ',', $_POST['circles'] );\r\n }\r\n\r\n if ( is_array( $selected_circles ) && count( $selected_circles ) ) {\r\n update_post_meta( $post_id, 'groups_id', $selected_circles );\r\n } else {\r\n update_post_meta( $post_id, 'groups_id', '' );\r\n }\r\n } else {\r\n update_post_meta( $post_id, 'groups_id', '' );\r\n }\r\n\r\n // send updates to client\r\n if ( isset( $_POST['send_update'] ) ) {\r\n\r\n if( isset( $_POST['clients'] ) && $_POST['clients'] == 'all' ) {\r\n $user_ids = $wpc_client->get_client_ids();\r\n } else {\r\n $user_ids = ( isset( $_POST['clients'] ) ) ? explode( ',', $_POST['clients'] ) : array();\r\n }\r\n if( isset( $_POST['circles'] ) && $_POST['circles'] == 'all' ) {\r\n $groups_id = $wpc_client->get_group_ids();\r\n } else {\r\n $groups_id = ( isset( $_POST['circles'] ) ) ? explode( ',', $_POST['circles'] ) : array();\r\n }\r\n\r\n //get clients from Client Circles\r\n if ( is_array( $groups_id ) && 0 < count( $groups_id ) )\r\n foreach( $groups_id as $group_id ) {\r\n $user_ids = array_merge( $user_ids, $wpc_client->get_group_clients_id( $group_id ) );\r\n }\r\n\r\n $user_ids = array_unique( $user_ids );\r\n\r\n //send update email to selected clients\r\n foreach ( $user_ids as $user_id ) {\r\n\r\n $userdata = (array) get_userdata( $user_id );\r\n $link = get_permalink( $post_id );\r\n\r\n //get email template\r\n\r\n $headers = \"From: \" . get_option( 'sender_name' ) . \" <\" . get_option( 'sender_email' ) . \"> \\r\\n\";\r\n $headers .= \"Reply-To: \" . ( get_option( 'wpc_reply_email' ) ) ? get_option( 'wpc_reply_email' ) : get_option( 'admin_email' ) . \"\\r\\n\";\r\n $headers .= \"MIME-Version: 1.0\\r\\n\";\r\n $headers .= \"Content-Type: text/html; charset=UTF-8\\r\\n\";\r\n\r\n $args = array( 'client_id' => $user_id, 'page_id' => $link, 'page_title' => get_the_title( $post_id ) );\r\n\r\n $wpc_templates['emails']['client_page_updated']['subject'] = 'Your Portal Page has been updated';\r\n\r\n $wpc_templates['emails']['client_page_updated']['body'] = '<p>Hello {contact_name},</p>\r\n <p>Your Portal Page, {page_title} has been updated | <a href=\"{page_id}\">Click HERE to visit</a></p>\r\n <p>Thanks, and please contact us if you experience any difficulties,</p>\r\n <p>YOUR COMPANY NAME HERE</p>';\r\n\r\n $subject = $wpc_client->replace_placeholders( $wpc_templates['emails']['client_page_updated']['subject'], $args, 'portal_page_updated' );\r\n $subject = htmlentities( $subject, ENT_QUOTES, 'UTF-8' );\r\n\r\n $message = $wpc_client->replace_placeholders( $wpc_templates['emails']['client_page_updated']['body'], $args, 'portal_page_updated' );\r\n\r\n wp_mail( $userdata['data']->user_email, $subject, $message, $headers );\r\n }\r\n }\r\n\r\n } elseif ( 'hubpage' == $post->post_type ) {\r\n\r\n //update hubpage file template\r\n if ( isset( $_POST['hubpage_template'] ) && 'default' != $_POST['hubpage_template'] ) {\r\n update_post_meta( $post_id, '_wp_page_template', $_POST['hubpage_template'] );\r\n } else {\r\n delete_post_meta( $post_id, '_wp_page_template' );\r\n }\r\n\r\n }\r\n\r\n }\r\n }", "function wpbm_extra_field_save( $post_id ){\n\n// Checks save status\n $is_autosave = wp_is_post_autosave( $post_id );\n $is_revision = wp_is_post_revision( $post_id );\n $is_valid_nonce = ( isset( $_POST[ 'wpbm_blog_nonce' ] ) && wp_verify_nonce( $_POST[ 'wpbm_blog_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';\n// Exits script depending on save status\n if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {\n return;\n }\n if ( isset( $_POST[ 'wpbm_extra_option' ] ) ) {\n\n $wpbm_extra = ( array ) $_POST[ 'wpbm_extra_option' ];\n\n $extra_field = $this -> sanitize_array( $wpbm_extra );\n// save data\n update_post_meta( $post_id, 'wpbm_extra_option', $extra_field );\n }\n return;\n }", "function mf_SALF_artist_meta_save_data($post_id) {\n\tglobal $artist_meta_box;\n\t\n\t\n\t\n\t\n \n \n // verify nonce\n if (!wp_verify_nonce($_POST['artist_meta_box_nonce'], basename(__FILE__))) {\n return $post_id;\n }\n\n // check autosave\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {\n return $post_id;\n }\n\n // check permissions\n if ('page' == $_POST['post_type']) {\n if (!current_user_can('edit_page', $post_id)) {\n return $post_id;\n }\n } elseif (!current_user_can('edit_post', $post_id)) {\n return $post_id;\n }\n \n foreach ($artist_meta_box['fields'] as $field) {\n\t\t\n\t\tif($field['type']!='checkbox'){\n $old = get_post_meta($post_id, $field['id'], true);\n $new = $_POST[$field['id']];\n\t\t \n\t\t\n if ($new && $new != $old) {\n update_post_meta($post_id, $field['id'], $new);\n } elseif ('' == $new && $old) {\n delete_post_meta($post_id, $field['id'], $old);\n }\n\n\t\t} else {\n\t\t\n\t\t$old = get_post_meta($post_id, 'mf_SALF_artist_meta_checks', true);\n\t\t$new = $_POST['mf_SALF_artist_meta_checks'];\n\t\t\n\t\t\n\t\tif ($new && $new != $old) {\n update_post_meta($post_id, 'mf_SALF_artist_meta_checks', $new);\n } elseif ('' == $new && $old) {\n delete_post_meta($post_id, 'mf_SALF_artist_meta_checks', $old);\n }\t\n\t\t}\n\t\t\n }\n}", "function Flipbox_Save_description( $post_id ) \n{\n // Save logic goes here. Don't forget to include nonce checks!\n $image_url = isset($_POST['image_url'])?trim($_POST['image_url']): \"\";\n $description = isset($_POST['description'])?trim($_POST['description']): \"\";\n $transition = isset($_POST['transition'])?trim($_POST['transition']): \"\";\n \n\n\n if (!empty($image_url) && ! empty($description)) {\n\n update_post_meta($post_id, 'image_url_value', $image_url);\n update_post_meta($post_id, 'description_value', $description);\n update_post_meta($post_id, 'transition_value', $transition);\n }\n}", "public function add_meta_________($objectId)\n {\n # process the request which it must be post and ajax request\n if (request()->isPost() && request()->isAjax()) {\n \n $this->setJsonResponse();\n\n $metaKey = request()->getPost('meta_key', ['striptags', 'trim' , 'alphanum'] );\n $metaValue = request()->getPost('meta_value', ['striptags', 'trim' , 'string'] );\n \n if( !$metaKey || !$metaValue ){\n $this->jsonMessages['messages'][] = [\n 'type' => 'warning',\n 'content' => 'File not allowed'\n ];\n return $this->jsonMessages;\n }\n\n if($metaKey == 'thumbnail'){\n\n if (filter_var( $metaValue , FILTER_VALIDATE_URL) === FALSE) {\n $this->jsonMessages['messages'][] = [\n 'type' => 'warning',\n 'content' => 'File not allowed'\n ];\n return $this->jsonMessages;\n }\n\n if($old_thumbnails = $this->has_meta($objectId , 'thumbnail'))\n {\n foreach ( $old_thumbnails as $meta) {\n $meta->delete();\n }\n\n }\n }\n\n $object = new PostMeta();\n $object->setPostId($objectId);\n $object->setMetaKey($metaKey);\n $object->setMetaValue($metaValue);\n \n if (!$object->save()) {\n \n foreach ($object->getMessages() as $m) {\n return \"<tr><td class='text-danger'>There is an error: \".$m->getMessage().\"</td></tr>\";\n }\n return $this->jsonMessages;\n return false;\n }\n\n \n\n // if(!$object) {\n // $this->setJsonResponse();\n\n // $this->jsonMessages['messages'][] = [\n // 'type' => 'danger',\n // 'content' => 'Object not found!'\n // ];\n // return $this->jsonMessages;\n // }\n\n $lastInsertId = $object->meta_id;\n \n\n return '<tr><td>'. $metaKey .'</td>\n <td>'. $metaValue .'</td>\n <td><a href=\"#\" \n class=\"delete-meta-btn\" \n data-object-id=\"'. $lastInsertId .'\"\n data-object=\"postMeta\"><i class=\"fas fa-trash\"></i></a></td></tr>';\n\n }\n }", "function liblynx_save_meta_box_data($post_id)\n{\n\n /*\n * We need to verify this came from our screen and with proper authorization,\n * because the save_post action can be triggered at other times.\n */\n\n // Check if our nonce is set.\n if (!isset($_POST['liblynx_meta_box_nonce'])) {\n return;\n }\n\n\n\n // Verify that the nonce is valid.\n if (!wp_verify_nonce($_POST['liblynx_meta_box_nonce'], 'liblynx_save_meta_box_data')) {\n return;\n }\n\n // If this is an autosave, our form has not been submitted, so we don't want to do anything.\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {\n return;\n }\n\n // Check the user's permissions.\n if (isset($_POST['post_type']) && 'page'==$_POST['post_type']) {\n if (!current_user_can('edit_page', $post_id)) {\n return;\n }\n } else {\n if (!current_user_can('edit_post', $post_id)) {\n return;\n }\n }\n\n /* OK, it's safe for us to save the data now. */\n\n //is our metabox is being submitted?\n if (!isset($_POST['liblynx_metabox'])) {\n return;\n }\n\n //determine new state\n $protect=isset($_POST['liblynx_protect'])?true:false;\n $unit=trim($_POST['liblynx_custom_unit']);\n\n // Update the meta field in the database.\n update_post_meta($post_id, '_liblynx_protect', $protect);\n update_post_meta($post_id, '_liblynx_unit', $unit);\n}", "public function insert() {\n\n\n // Note text content from form\n $type = $this->type;\n $filename = '';\n $twOutput = 0;\n $noteContent = $this->noteText;\n\n // Location values\n if ( isset( $data['latitude'] ) ) :\n\n $noteLongitude = $data['longitude'];\n $noteLatitude = $data['latitude'];\n\n elseif ( isset($_POST[\"note_longitude\"]) ) :\n\n $noteLongitude = $_POST[\"note_longitude\"];\n $noteLatitude = $_POST[\"note_latitude\"];\n\n elseif ( isset($_POST[\"location\"]) ) :\n\n // Strip everything after comma\n $loc1 = strstr($_POST[\"location\"],',',true);\n // Strip everything before comma\n $loc2 = strstr($_POST[\"location\"],',');\n\n // Set replacements\n $replacements = array(\",\" => \"\", \":\" => \"\", \"geo\" => \"\");\n\n // Store final value\n $noteLongitude = strtr($loc2, $replacements);\n $noteLatitude = strtr($loc1, $replacements);\n\n else:\n\n $noteLongitude = '';\n $noteLatitude = '';\n\n endif;\n\n // Weather value\n if ( isset($_POST[\"temperature\"]) ) :\n $temperature = $_POST[\"temperature\"];\n $weatherIcon = $_POST[\"weatherIcon\"];\n endif;\n\n // If image\n if ( isset($_FILES['note_image']['tmp_name']) ) :\n\n try {\n $img = new abeautifulsite\\SimpleImage( $_FILES['note_image']['tmp_name'] );\n $img->best_fit(1400, 1400)->save( $_SERVER['DOCUMENT_ROOT'].\"/uploads/images/\".$_FILES['note_image']['name'] );\n $img->best_fit(600, 600)->save( $_SERVER['DOCUMENT_ROOT'].\"/uploads/images/_small/\".$_FILES['note_image']['name'] );\n } catch(Exception $e) {\n echo 'Error: ' . $e->getMessage();\n }\n\n // Set folder destination\n $filename = $_FILES['note_image']['name'];\n $filepath = $_SERVER['DOCUMENT_ROOT'].\"/uploads/images/\".$_FILES['note_image']['name'];\n\n endif;\n\n //If posting to twitter\n if ( isset( $_POST[\"note_twitter\"] )) :\n\n // Twitter\n $consumerKey = '{CONSUMER-KEY}';\n $consumerSecret = '{{CONSUMER-SECRET}}';\n $accessToken = '{{ACCESS-TOKEN}}';\n $accessTokenSecret = '{{ACCESS-TOKEN-SECRET}}';\n\n // Oauth\n $connection = new TwitterOAuth($consumerKey, $consumerSecret, $accessToken, $accessTokenSecret);\n $content = $connection->get(\"account/verify_credentials\");\n\n // If image\n if ( $_FILES['note_image']['tmp_name']!='' ) :\n // Set media path for Twitter\n $media1 = $connection->upload('media/upload', array('media' => $filepath));\n\n // If location present\n if ( isset( $_POST[\"note_longitude\"] ) || isset( $_POST[\"location\"] ) ) :\n $parameters = array(\n 'status' => $noteContent,\n 'lat' => $noteLatitude,\n 'long' => $noteLongitude,\n 'display_coordinates' => 'true',\n 'geo_enabled' => 'true',\n 'media_ids' => implode(',', array($media1->media_id_string))\n );\n else:\n $parameters = array(\n 'status' => $noteContent,\n 'media_ids' => implode(',', array($media1->media_id_string))\n );\n endif;\n\n else :\n $parameters = array(\n 'status' => $noteContent\n );\n endif;\n\n // Post status\n $result = $connection->post('statuses/update', $parameters);\n\n // Receive post id\n $twOutput = $result->id_str;\n endif;\n\n // If photo upload\n if ( isset($_FILES['photo']) ) :\n\n $tmp_name = $_FILES[\"photo\"][\"tmp_name\"];\n $name = basename($_FILES[\"photo\"][\"name\"]);\n\n try {\n $img = new abeautifulsite\\SimpleImage( $tmp_name );\n $img->best_fit(1400, 1400)->save( $_SERVER['DOCUMENT_ROOT'].\"/uploads/images/\".$name );\n $img->best_fit(600, 600)->save( $_SERVER['DOCUMENT_ROOT'].\"/uploads/images/_small/\".$name );\n } catch(Exception $e) {\n echo 'Error: ' . $e->getMessage();\n }\n\n $filename = $name;\n\n endif;\n\n // If Quill\n if ( isset($_POST['content']) ) :\n $noteContent = $_POST['content'];\n endif;\n\n // If Quill posts categories/tags\n if ( isset($_POST['category']) && is_array( $_POST['category'] ) ) :\n $noteTags = implode(', ', $_POST['category']);\n elseif ( isset($_POST['category']) && !is_array( $_POST['category'] ) ) :\n $noteTags = $_POST['category'];\n else:\n $noteTags = $this->noteTags;\n endif;\n\n\n /**\n * Copy an image from a remote URL to server\n */\n\n function image_save_from_url($my_img,$fullpath){\n if($fullpath!=\"\" && $fullpath){\n $fullpath = $fullpath.\"/\".basename($my_img);\n }\n $ch = curl_init($my_img);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0');\n $rawdata=curl_exec($ch);\n curl_close ($ch);\n if(file_exists($fullpath)){\n unlink($fullpath);\n }\n $fp = fopen($fullpath,'x');\n fwrite($fp, $rawdata);\n fclose($fp);\n }\n\n\n // If image url from Micropub / Ownyourgram / Ownyourswarm\n if ( isset($_POST['photo']) ) :\n\n $sourcePhoto = $_POST['photo'];\n $filename = basename($sourcePhoto);\n $destination = $_SERVER['DOCUMENT_ROOT'].\"/uploads/images/_small/\";\n\n image_save_from_url($sourcePhoto,$destination);\n\n $file_from_server = $destination+$filename;\n\n endif;\n\n // Set note type\n if ( isset( $_POST['note_type'] ) ) :\n\n $post_type = $_POST['note_type'];\n\n else:\n\n $post_type = 'post';\n\n endif;\n\n function getWeatherIcon( $latitude, $longitude ) {\n $key = '{{DARKSKY-API-KEY}}';\n $json = file_get_contents(\"https://api.darksky.net/forecast/$key/$latitude,$longitude\");\n $obj = json_decode($json,true);\n\n return $obj['currently']['icon'];\n\n }\n\n function getTemperature( $latitude, $longitude ) {\n $key = '{{DARKSKY-API-KEY}}';\n $json = file_get_contents(\"https://api.darksky.net/forecast/$key/$latitude,$longitude\");\n $obj = json_decode($json,true);\n\n $fahrenheit = $obj['currently']['temperature'];\n $celsius = round(($fahrenheit - 32)*5/9).'°C';\n\n return $celsius;\n\n }\n\n // Set note type if syndication URL set\n if( isset($_POST['syndication']) ) :\n\n // Convert to Syndacation URL object\n $url = parse_url($_POST[\"syndication\"]);\n\n if ( $url['host'] == 'www.swarmapp.com' || $url['host'] == 'swarmapp.com' ) :\n $post_type = 'checkin';\n\n // Run a weather API request\n $weatherIcon = getWeatherIcon($noteLatitude,$noteLongitude);\n $temperature = getTemperature($noteLatitude,$noteLongitude);\n\n endif;\n\n endif;\n\n // Does the Note object already have an ID?\n if ( !is_null( $this->id ) ) trigger_error ( \"Note::insert(): Attempt to insert an Note object that already has its ID property set (to $this->id).\", E_USER_ERROR );\n\n $date = date('Y-m-d G:i:s');\n\n if ( isset($_POST['published']) ) :\n $date = date('Y-m-d G:i:s', strtotime($_POST['published']));\n endif;\n\n // Insert the Note\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"INSERT INTO notes ( note_date, note_text, tweet_id, twitter, syndication, note_image, note_longitude, note_latitude, note_type, note_tags, temperature, weatherIcon, embed, rsvp, ping ) VALUES ( :note_date, :note_text, :tweet_id, :twitter, :syndication, :note_image, :note_longitude, :note_latitude, :note_type, :note_tags, :temperature, :weatherIcon, :embed, :rsvp, :ping );\";\n $st = $conn->prepare ( $sql );\n $st->bindValue( \":note_date\", $date, PDO::PARAM_INT );\n $st->bindValue( \":note_text\", $noteContent, PDO::PARAM_STR );\n $st->bindValue( \":tweet_id\", $twOutput, PDO::PARAM_STR );\n $st->bindValue( \":note_image\", $filename, PDO::PARAM_STR );\n $st->bindValue( \":note_longitude\", $noteLongitude, PDO::PARAM_STR );\n $st->bindValue( \":note_latitude\", $noteLatitude, PDO::PARAM_STR );\n $st->bindValue( \":note_type\", $post_type, PDO::PARAM_STR );\n $st->bindValue( \":note_tags\", $noteTags, PDO::PARAM_STR );\n if ( isset($temperature) ) {\n $st->bindValue( \":temperature\", $temperature, PDO::PARAM_STR );\n $st->bindValue( \":weatherIcon\", $weatherIcon, PDO::PARAM_STR );\n } else {\n $st->bindValue( \":temperature\", $this->temperature, PDO::PARAM_STR );\n $st->bindValue( \":weatherIcon\", $this->weatherIcon, PDO::PARAM_STR );\n }\n $st->bindValue( \":embed\", $this->embed, PDO::PARAM_STR );\n $st->bindValue( \":twitter\", $this->twitter, PDO::PARAM_INT );\n $st->bindValue( \":syndication\", $this->syndication, PDO::PARAM_STR );\n $st->bindValue( \":rsvp\", $this->rsvp, PDO::PARAM_STR );\n $st->bindValue( \":ping\", $this->ping, PDO::PARAM_STR );\n\n $st->execute();\n $this->id = $conn->lastInsertId();\n\n // If posting to Twitter\n if ( isset( $_POST[\"twitter\"] )) :\n\n $endpoint = \"https://brid.gy/publish/webmention\";\n $source = \"https://calumryan.com/note/\".$this->id;\n $target = \"https://brid.gy/publish/twitter\";\n\n $client = new IndieWeb\\MentionClient();\n $response = IndieWeb\\MentionClient::sendWebmentionToEndpoint($endpoint, $source, $target, ['vouch'=>$vouch]);\n\n endif;\n\n if ( isset( $_POST[\"ping\"] )) :\n\n $source = \"https://calumryan.com/note/\".$this->id;\n $target = $_POST[\"ping\"];\n $client = new IndieWeb\\MentionClient();\n $response = $client->sendWebmention($source, $target, ['vouch'=>$vouch]);\n\n endif;\n\n\n if ( $type == 'json' ) :\n\n $permalink = \"https://calumryan.com/note/\".$this->id;\n header($_SERVER['SERVER_PROTOCOL'] . ' 201 Created');\n header('Location: ' . $permalink, true, 201);\n\n elseif ( isset( $_POST['content'] ) ) :\n\n $permalink = \"https://calumryan.com/note/\".$this->id;\n header($_SERVER['SERVER_PROTOCOL'] . ' 201 Created');\n header('Location: ' . $permalink, true, 201);\n\n endif;\n\n // Send POST request to Switchboard with curl\n try {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,\"https://switchboard.p3k.io/\");\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS,\"hub.mode=publish&hub.url=https://calumryan.com/\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $server_output = curl_exec($ch);\n curl_close ($ch);\n } catch (Exception $e) {\n echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n }\n\n $conn = null;\n\n }", "public function saveSettingsAjax()\n {\n $formId = absint($_REQUEST['form_id']);\n\n $css = $_REQUEST['custom_css'];\n $js = $_REQUEST['custom_js'];\n $css = wp_strip_all_tags(wp_unslash($css));\n $js = wp_unslash($js);\n\n $this->store($formId, '_custom_form_css', $css);\n $this->store($formId, '_custom_form_js', $js);\n\n wp_send_json_success([\n 'message' => __('Custom CSS and JS successfully updated', 'fluentform')\n ], 200);\n }", "function ajax_validate_save_post()\n {\n }", "public function save()\n {\n\n $url = parse_url($this->params->url);\n $path = $url['path'];\n $note = new Note(array('url' => $path));\n $note->load();\n\n // Get the new note config\n\n $config = json_decode($this->params->config);\n\n // Can we read or edit it?\n\n $can_read = $this->can_read($note);\n $can_edit = $can_read ? $this->can_edit($note) : FALSE;\n\n // Edit the note (if allowed)\n\n $old_notes = $note->notes;\n if ($config->notes)\n {\n $note->notes = json_encode($config->notes);\n $note->words = Note::words($config->notes);\n }\n if ($config->photo) $note->photo = $config->photo;\n if ($config->paper) $note->paper = $config->paper;\n if ($config->readers) $note->readers = $config->readers;\n if ($config->editors) $note->editors = $config->editors;\n if ($can_edit) $note->save();\n $this->render->data = array(\n 'now' => time(),\n 'diff' => $can_read ? $this->diff($old_notes, $note->notes) : NULL,\n 'paper' => $can_read ? $note->paper : 'secret',\n 'photo' => $note->photo,\n 'readers' => $note->readers,\n 'editors' => $note->editors,\n 'is_owner' => $this->is_owner,\n 'can_read' => $can_read,\n 'can_edit' => $can_edit,\n 'notelist' => $this->recent(),\n );\n\n // Log the info\n\n $action = $can_edit ? 'saved' : 'viewed';\n Log::info($this->host_ip . \" $action a note at $path\");\n }", "function AddNote(){\n global $wpdb;\n $id = esc_attr($_REQUEST['order_id']);\n $data = array('note' => $_REQUEST['note']);\n if(isset($_REQUEST['admin'])) $data['admin'] = 1;\n if(isset($_REQUEST['seller'])) $data['seller'] = 1;\n if(isset($_REQUEST['customer'])) $data['customer'] = 1;\n if(isset($_REQUEST['file'])) $data['file'] = $_REQUEST['file'];\n\n if(Order::add_note($id, $data)) {\n\n $copy = array();\n if(isset($data['admin'])) $copy[] = '<input type=checkbox checked=checked disabled=disabled /> Admin &nbsp; ';\n if(isset($data['seller'])) $copy[] = '<input type=checkbox checked=checked disabled=disabled /> Seller &nbsp; ';\n if(isset($data['customer'])) $copy[] = '<input type=checkbox checked=checked disabled=disabled /> Customer &nbsp; ';\n $copy = implode(\"\", $copy);\n ?>\n\n <div class=\"panel panel-default\">\n <div class=\"panel-body\">\n <?php $note = wpautop(strip_tags(stripcslashes($data['note']),\"<a><strong><b><img>\")); echo preg_replace('/((http|ftp|https):\\/\\/[\\w-]+(\\.[\\w-]+)+([\\w.,@?^=%&amp;:\\/~+#-]*[\\w@?^=%&amp;\\/~+#-])?)/', '<a target=\"_blank\" href=\"\\1\">\\1</a>', $note); ?>\n </div>\n <?php if(isset($_REQUEST['file'])){ ?>\n <div class=\"panel-footer text-right\">\n <?php foreach($_REQUEST['file'] as $file){ ?>\n <a href=\"#\" style=\"margin-left: 10px\"><i class=\"fa fa-paperclip\"></i> <?php echo $file; ?></a> &nbsp;\n <?php } ?>\n </div>\n <?php } ?>\n <div class=\"panel-footer text-right\"><small><em><i class=\"fa fa-clock-o\"></i> <?php echo date(get_option('date_format') . \" h:i\", time()); ?></em></small>\n <div class=\"pull-left\"><small><em><?php if($copy!='') echo \"Copy sent to \".$copy; ?></em></small></div>\n </div>\n </div>\n <?php }\n else\n echo \"error\";\n }", "function projectpentagon_tastingnotes() {\n\t wp_nonce_field( plugin_basename( __FILE__ ), 'myplugin_noncename' );\n\t $post_idinhere\t=\t$_GET['post']; //GET THE ID OUTSIDE OF THE LOOP\n\t \n\t $get_field_name\t=\t get_option('projectpentagon-titleonpages');\n\t $meta_value_field = get_post_meta($post_idinhere, 'tasting-notes', true); \n\tif($meta_value_field1)\n\t\t{\n\t\t \t//echo \"we're at debut point a\";//debug\n\t\t \t$display1 = $meta_value_field1; \n\t\t}\n\telse \n\t\t{\n\t\t \t//echo \"we're at debut point b\". $meta_value_field1 .\"\";//debug\n\t\t \t$display1 = \"enter value here.\";\n\t\t}\n\n\t\t// we're not using _e because its user input text we're retrieving.\n\t // we'll assume that the user put it in the database in their preferred language\n\t\t\t echo '<label for=\"'. $get_field_name .'\">';\n\t\t\techo $get_field_name;\n\t\t \techo '</label> <br /> ';\n\t\t\techo '<textarea id=\"tasting-notes\" name=\"tasting-notes\" cols=\"60\" rows=\"4\" tabindex=\"30\" style=\"width: 97%;\">'. $meta_value_field .'</textarea>';\t\n}", "public function add_meta() {\n\n\t\tglobal $woocommerce, $post;\n\t\t// Text Field\n\t\twoocommerce_wp_text_input(\n\t\t\tarray(\n\t\t\t\t'id' => 'author',\n\t\t\t\t'label' => __( 'Author(s)', 'woocommerce' ),\n\t\t\t\t'placeholder' => 'author(s)',\n\t\t\t\t'desc_tip' => 'true',\n\t\t\t\t'description' => __( 'Author Name(s)', 'woocommerce' )\n\t\t\t)\n\t\t);\n\t\twoocommerce_wp_text_input(\n\t\t\tarray(\n\t\t\t\t'id' => 'release_date',\n\t\t\t\t'label' => __( 'Release Date', 'woocommerce' ),\n\t\t\t\t'placeholder' => date( \"n/j/Y\" ),\n\t\t\t\t'desc_tip' => 'true',\n\t\t\t\t'description' => __( 'Release Date', 'woocommerce' )\n\t\t\t)\n\t\t);\n\t\twoocommerce_wp_text_input(\n\t\t\tarray(\n\t\t\t\t'id' => 'preview_file',\n\t\t\t\t'label' => __( 'Preview File (look inside)', 'woocommerce' ),\n\t\t\t\t'desc_tip' => 'true',\n\t\t\t\t'description' => __( 'Upload a PDF file sample', 'woocommerce' )\n\t\t\t)\n\t\t);\n\t\techo( '<input type=\"button\" class=\"button custom_media\" name=\"preview_file_button\" id=\"preview_file_button\" value=\"Upload/Browse\"/>' );\n\t\twoocommerce_wp_checkbox(\n\t\t\tarray(\n\t\t\t\t'id' => 'local_product',\n\t\t\t\t'label' => __( 'Local Product', 'woocommerce' ),\n\t\t\t\t'desc_tip' => 'true',\n\t\t\t\t'description' => __( '(not Longleaf)', 'woocommerce' ),\n\t\t\t\t'cbvalue' => '1'\n\t\t\t)\n\t\t);\n\t}", "function pull_quote_save($post_ID) {\n global $post;\n\n if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) {\n return $post_id;\n }\n \n if (isset($_POST)) {\n update_post_meta( $post_ID, '_pull_quote_name', strip_tags( $_POST['pull_quote_name'] ) );\n }\n}", "function cs_events_meta_save($cs_post_id) {\n global $wpdb;\n if (empty($_POST[\"sub_title\"])){ $_POST[\"sub_title\"] = \"\";}\n if (empty($_POST[\"header_banner_options\"])){ $_POST[\"header_banner_options\"] = \"\";}\n if (empty($_POST[\"header_banner\"])){ $_POST[\"header_banner\"] = \"\";}\n if (empty($_POST[\"slider_id\"])){ $_POST[\"slider_id\"] = \"\";}\n if (empty($_POST[\"inside_event_thumb_view\"])){ $_POST[\"inside_event_thumb_view\"] = \"\";}\n if (empty($_POST[\"inside_event_featured_image_as_thumbnail\"])){ $_POST[\"inside_event_featured_image_as_thumbnail\"] = \"\";}\n\tif (empty($_POST[\"inside_event_thumb_audio\"])){ $_POST[\"inside_event_thumb_audio\"] = \"\";}\n\tif (empty($_POST[\"inside_event_thumb_video\"])){ $_POST[\"inside_event_thumb_video\"] = \"\";}\n\tif (empty($_POST[\"inside_event_thumb_slider\"])){ $_POST[\"inside_event_thumb_slider\"] = \"\";}\n\tif (empty($_POST[\"inside_event_thumb_slider_type\"])){ $_POST[\"inside_event_thumb_slider_type\"] = \"\";}\n\tif (empty($_POST[\"inside_event_thumb_map_lat\"])){ $_POST[\"inside_event_thumb_map_lat\"] = \"\";}\n if (empty($_POST[\"inside_event_thumb_map_lon\"])){ $_POST[\"inside_event_thumb_map_lon\"] = \"\";}\n if (empty($_POST[\"inside_event_thumb_map_zoom\"])){ $_POST[\"inside_event_thumb_map_zoom\"] = \"\";}\n if (empty($_POST[\"inside_event_thumb_map_address\"])){ $_POST[\"inside_event_thumb_map_address\"] = \"\";}\n if (empty($_POST[\"inside_event_thumb_map_controls\"])){ $_POST[\"inside_event_thumb_map_controls\"] = \"\";}\n if (empty($_POST[\"event_social_sharing\"])){ $_POST[\"event_social_sharing\"] = \"\";}\n\tif (empty($_POST[\"event_related\"])){ $_POST[\"event_related\"] = \"\";}\n\tif (empty($_POST[\"inside_event_related_post_title\"])){ $_POST[\"inside_event_related_post_title\"] = \"\";}\n\tif (empty($_POST[\"switch_footer_widgets\"])){ $_POST[\"switch_footer_widgets\"] = \"\";}\n\tif (empty($_POST[\"event_start_time\"])){ $_POST[\"event_start_time\"] = \"\";}\n\tif (empty($_POST[\"event_end_time\"])){ $_POST[\"event_end_time\"] = \"\";}\n if (empty($_POST[\"event_all_day\"])){ $_POST[\"event_all_day\"] = \"\";}\n if (empty($_POST[\"event_rating\"])){ $_POST[\"event_rating\"] = \"\";}\n if (empty($_POST[\"event_buy_now\"])){ $_POST[\"event_buy_now\"] = \"\";}\n if (empty($_POST[\"event_ticket_price\"])){ $_POST[\"event_ticket_price\"] = \"\";}\n if (empty($_POST[\"event_gallery\"])){ $_POST[\"event_gallery\"] = \"\";}\n if (empty($_POST[\"event_address\"])){ $_POST[\"event_address\"] = \"\";}\n if (empty($_POST[\"event_map\"])){ $_POST[\"event_map\"] = \"\";}\n if (empty($_POST[\"event_artists\"])){ $_POST[\"event_artists\"] = \"\";}\n \t\n $sxe = new SimpleXMLElement(\"<event></event>\");\n\t\t$sxe->addChild('sub_title', $_POST['sub_title'] );\n\t\t$sxe->addChild('header_banner_options', $_POST['header_banner_options'] );\n\t\t$sxe->addChild('header_banner', $_POST['header_banner'] );\n\t\t$sxe->addChild('slider_id', $_POST['slider_id'] );\n\t\t$sxe->addChild('inside_event_thumb_view', $_POST['inside_event_thumb_view'] );\n\t\t$sxe->addChild('inside_event_featured_image_as_thumbnail', $_POST['inside_event_featured_image_as_thumbnail'] );\n\t\t$sxe->addChild('inside_event_thumb_audio', $_POST['inside_event_thumb_audio'] );\n\t\t$sxe->addChild('inside_event_thumb_video', $_POST['inside_event_thumb_video'] );\n\t\t$sxe->addChild('inside_event_thumb_slider', $_POST['inside_event_thumb_slider'] );\n\t\t$sxe->addChild('inside_event_thumb_slider_type', $_POST['inside_event_thumb_slider_type'] );\n\t\t$sxe->addChild('inside_event_thumb_map_lat', $_POST['inside_event_thumb_map_lat'] );\n\t\t$sxe->addChild('inside_event_thumb_map_lon', $_POST['inside_event_thumb_map_lon'] );\n\t\t$sxe->addChild('inside_event_thumb_map_zoom', $_POST['inside_event_thumb_map_zoom'] );\n\t\t$sxe->addChild('inside_event_thumb_map_address', $_POST['inside_event_thumb_map_address'] );\n\t\t$sxe->addChild('inside_event_thumb_map_controls', $_POST['inside_event_thumb_map_controls'] );\n\t\t$sxe->addChild('event_social_sharing', $_POST[\"event_social_sharing\"]);\n\t\t$sxe->addChild('event_related', $_POST[\"event_related\"]);\n\t\t$sxe->addChild('inside_event_related_post_title', $_POST[\"inside_event_related_post_title\"]);\n\t\t$sxe->addChild('switch_footer_widgets', $_POST[\"switch_footer_widgets\"]);\n \t\t$sxe->addChild('event_start_time', $_POST[\"event_start_time\"]);\n\t\t$sxe->addChild('event_end_time', $_POST[\"event_end_time\"]);\n\t\t$sxe->addChild('event_all_day', $_POST[\"event_all_day\"]);\n\t\t$sxe->addChild('event_rating', $_POST[\"event_rating\"]);\n\t\t$sxe->addChild('event_buy_now', $_POST[\"event_buy_now\"]);\n\t\t$sxe->addChild('event_ticket_price', $_POST[\"event_ticket_price\"]);\n\t\t$sxe->addChild('event_gallery', $_POST[\"event_gallery\"]);\n \t\t$sxe->addChild('event_address', $_POST[\"event_address\"]);\n\t\t$sxe->addChild('event_map', $_POST[\"event_map\"]);\n\t\t\tif ( $_POST['event_artists'] ) {\n\t\t\t\t$artists_list = $sxe->addChild('artists_list');\n\t\t\t\tforeach ( $_POST['event_artists'] as $key => $val ) {\n\t\t\t\t\t$artists_list->addChild('artists', $val );\n\t\t\t\t}\n\t\t\t}\n $sxe = save_layout_xml($sxe);\n update_post_meta($cs_post_id, 'cs_event_meta', $sxe->asXML());\n}", "function DoctorAppointment_meta_save($post_id){\n $is_auto_save = wp_is_post_autosave( $post_id );\n $is_revision = wp_is_post_revision( $post_id );\n $is_valid_nonce = (isset($_POST['DoctorAppointment_nonce']) && \n wp_verify_nonce( $_POST['DoctorAppointment_nonce'], basename(__FILE__)))? 'true' : 'false';\n \n // return if ina auto svae , revision of non valid nouncer\n if($is_auto_save || $is_revision || !$is_valid_nonce){\n return ;\n }\n \n // update DoctorAppointment_id\n if(isset($_POST[\"DoctorAppointment_id\"])){\n update_post_meta( $post_id, \"DoctorAppointment_id\",sanitize_text_field( $_POST[\"DoctorAppointment_id\"]) );\n\n }\n\n // update DoctorAppointment_name\n if(isset($_POST[\"DoctorAppointment_name\"])){\n update_post_meta( $post_id, \"DoctorAppointment_name\",sanitize_text_field( $_POST[\"DoctorAppointment_name\"]) );\n \n }\n\n // update DoctorAppointment_email\n if(isset($_POST[\"DoctorAppointment_email\"])){\n update_post_meta( $post_id, \"DoctorAppointment_email\",sanitize_email( $_POST[\"DoctorAppointment_email\"]) );\n \n }\n\n // update DoctorAppointment_mobile\n if(isset($_POST[\"DoctorAppointment_mobile\"])){\n update_post_meta( $post_id, \"DoctorAppointment_mobile\",sanitize_text_field( $_POST[\"DoctorAppointment_mobile\"]) );\n }\n\n\n // update DoctorAppointment_message\n if(isset($_POST[\"DoctorAppointment_message\"])){\n update_post_meta( $post_id, \"DoctorAppointment_message\", sanitize_text_field($_POST[\"DoctorAppointment_message\"]));\n }\n\n// still have to write code fo\n \n \n \n \n \n\n}", "function rps_myajax_submit() {\n\t$response = array('spam' => 'no', 'mail_sent' => 'no');\n\n\t$id = (is_integer($_POST['id'])) ? $_POST['id'] : '';\n\t$name = sanitize_text_field($_POST['form']['name']);\n\t$email = sanitize_email($_POST['form']['email']);\n\t$message = sanitize_text_field($_POST['form']['message']);\n\n\t$akismet = new Akismet(URL, AKISMET_KEY);\n\t$akismet->setCommentAuthor($name);\n\t$akismet->setCommentAuthorEmail($email);\n\t$akismet->setCommentContent($message);\n\t$akismet->setPermalink($id);\n\n\tif ($akismet->isCommentSpam()) {\n\t\t$response['spam'] = 'yes';\n\t} else {\n\t\t$to = get_bloginfo('admin_email');\n\t\t$subject = __('New message from your website');\n\t\t$the_message = sprintf('<p>%s <a href=\"mailto:%s\">%s</a> %s %s</p><p>%s</p>', __('Message from'), $email, $email, __('on'), date('jS F Y \\@ H:i'), $message);\n\t\t$mail_sent = wp_mail($to, $subject, $the_message);\n\t\t$response['mail_sent'] = ($mail_sent) ? 'yes' : 'no';\n\t}\n $response = json_encode($response);\n header(\"Content-Type: application/json\");\n echo $response;\n die;\n}", "function save_meta_box_custompost( $post_id ) {\n if ( defined( 'DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;\n if ( $parent_id = wp_is_post_revision( $post_id ) ) {\n $post_id = $parent_id;\n }\n $fields = ['published_date'];\n foreach ( $fields as $field ) {\n if ( array_key_exists( $field, $_POST ) ) {\n update_post_meta( $post_id, $field, sanitize_text_field( $_POST[$field] ) );\n }\n }\n }", "function classiera_save_post_meta($post_id, $post) {\r\n\t\r\n\t// verify this came from the our screen and with proper authorization,\r\n\t// because save_post can be triggered at other times\r\n\tif ( !wp_verify_nonce( isset( $_POST['eventmeta_noncename'] ) ? $_POST['eventmeta_noncename'] : '', plugin_basename(__FILE__) )) {\r\n\treturn $post->ID;\r\n\t}\r\n\r\n\t// Is the user allowed to edit the post or page?\r\n\tif ( !current_user_can( 'edit_post', $post->ID ))\r\n\t\treturn $post->ID;\r\n\r\n\t// OK, we're authenticated: we need to find and save the data\r\n\t// We'll put it into an array to make it easier to loop though.\r\n\t\r\n\t$events_meta['featured_post'] = $_POST['featured_post'];\r\n\t\r\n\t$chk = ( isset( $_POST['featured_post'] ) && $_POST['featured_post'] ) ? '1' : '2';\r\n\tupdate_post_meta( $post_id, 'featured_post', $chk );\r\n\t\r\n\t// Add values of $events_meta as custom fields\r\n\tforeach ($events_meta as $key => $value) { // Cycle through the $events_meta array!\r\n\t\tif( $post->post_type == 'post' ) return; // Don't store custom data twice\r\n\t\t$value = implode(',', (array)$value); // If $value is an array, make it a CSV (unlikely)\r\n\t\tif(get_post_meta($post->ID, $key, FALSE)) { // If the custom field already has a value\r\n\t\t\tupdate_post_meta($post->ID, $key, $value);\r\n\t\t} else { // If the custom field doesn't have a value\r\n\t\t\tadd_post_meta($post->ID, $key, $value);\r\n\t\t}\r\n\t\tif(!$value) delete_post_meta($post->ID, $key); // Delete if blank\r\n\t}\r\n\r\n}", "public function save(KnsprNote $note);", "public function postSave() {}", "function setNoteText(){\n $html = \"\";\n \n $this->aFields[\"note\"]->editable = true;\n $this->aFields[\"note\"]->value = $html;\n }", "function meta_boxes_save() {\n\n\t\t// Bail out now if something not set\n\t\tif (\n\t\t\tisset( $_POST['_wpnonce'] ) &&\n\t\t\tisset( $_POST['post_ID'] ) &&\n\t\t\tisset( $_POST['_lingo_hidden'] ) // This is required to ensure that auto-saves are not processed\n\t\t) {\n\n\t\t\t// Do nonce security check\n\t\t\twp_verify_nonce( '_wpnonce', $_POST['_wpnonce'] );\n\n\t\t\t// Grab post ID\n\t\t\t$post_ID = (int) $_POST['post_ID'];\n\t\t\t\n\t\t\t// Set wrong answers\n\t\t\tdelete_post_meta( $post_ID, '_wrong_answers' );\n\t\t\tforeach( $_POST['_wrong_answers'] as $key => $value ) {\n\t\t\t\tif ( $value != '' && $value != 0 ) {\n\t\t\t\t\t$value = (int) $value;\n\t\t\t\t\tadd_post_meta( $post_ID, '_wrong_answers', $value );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// Stash all the post meta\n\t\t\tforeach( $this->post_meta as $key => $x ) {\n\t\t\t\tif ( isset( $_POST[$key] ) ) {\n\t\t\t\t\t$value = (int) $_POST[$key];\n\t\t\t\t\tif ( $value != 0 )\n\t\t\t\t\t\tupdate_post_meta( $post_ID, $key, $value );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function cd_meta_box_save( $post_id )\n{\n if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;\n \n // if our nonce isn't there, or we can't verify it, bail\n if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'my_meta_box_nonce' ) ) return;\n \n // // if our current user can't edit this post, bail\n if( !current_user_can( 'edit_post' ) ) return;\n \n // now we can actually save the data\n $allowed = array( \n 'a' => array( // on allow a tags\n 'href' => array() // and those anchors can only have href attribute\n )\n );\n \n // Make sure your data is set before trying to save it\n if( isset( $_POST['my_meta_box_text'] ) )\n update_post_meta( $post_id, 'my_meta_box_text', wp_kses( $_POST['my_meta_box_text'], $allowed ) );\n\n if( isset( $_POST['my_meta_box_text'] ) )\n update_post_meta( $post_id, 'my_meta_box_text', wp_kses( $_POST['my_meta_box_text2'], $allowed ) );\n\n if( isset( $_POST['my_meta_box_text'] ) )\n update_post_meta( $post_id, 'my_meta_box_text', wp_kses( $_POST['my_meta_box_text3'], $allowed ) );\n if( isset( $_POST['my_meta_box_text'] ) )\n update_post_meta( $post_id, 'my_meta_box_text', wp_kses( $_POST['my_meta_box_text4'], $allowed ) );\n \n \n}", "function meta_boxes_save() {\n\n\t\t// Bail out now if something not set\n\t\tif (\n\t\t\tisset( $_POST['_wpnonce'] ) &&\n\t\t\tisset( $_POST['post_ID'] ) &&\n\t\t\tisset( $_POST['_lingo_hidden'] ) // This is required to ensure that auto-saves are not processed\n\t\t) {\n\t\t\t// Do nonce security check\n\t\t\twp_verify_nonce( '_wpnonce', $_POST['_wpnonce'] );\n\n\t\t\t// Grab post ID\n\t\t\t$post_ID = (int) $_POST['post_ID'];\n\n//echo '<textarea style=\"width:800px;height:600px;\">';print_r( $_POST['_translation'] );echo '</textarea>';\n//die('dead');\n\n\t\t\t// Stash all the post meta\n\t\t\tif ( isset( $_POST['_translation'] ) ) {\n\t\t\t\t$_translation = $_POST['_translation'];\n\t\t\t\tdelete_post_meta( $post_ID, '_translation' );\n\t\t\t\tforeach( $_translation as $key => $trans ) {\n\t\t\t\t\t$trans = wp_kses( $trans, '', '' );\n\t\t\t\t\tif ( $trans != '' )\n\t\t\t\t\t\tadd_post_meta( $post_ID, '_translation', $trans );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function tower_save_meta_box($post_id) {\n // Check if the post_type is correct\n if (! array_key_exists(get_post_type($post_id), TOWER_CUSTOM_POSTS)) return $post_id;\n\n // Check if nonce is set\n if (! isset($_POST['tower_nonce'])) return $post_id;\n\n // Verify that nonce is valid\n if (! wp_verify_nonce($_POST['tower_nonce'], basename(__FILE__))) return $post_id;\n\n // For Autosave, dont proceed\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return $post_id;\n\n // Check data validation\n foreach (TOWER_CUSTOM_POSTS['tower_policies']['fields'] as $field) {\n update_post_meta(\n $post_id, \n $field['name'], \n sanitize_text_field($_POST[$field['name']])\n );\n }\n}", "function savePostMeta($post_id, $post = false) {\n\t\tif(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {\n \treturn $post_id;\n\t\t}\n\t\tif(isSet($_POST['lepress-assignment-meta'])) {\n\t\t\t$meta_data = (object) $_POST['lepress-assignment-meta'];\n\t\t\tupdate_post_meta($post_id, '_lepress-assignment-meta', $meta_data);\n\t\t\tif($post->post_status == \"publish\" || $post->post_status == \"private\" || $post->post_status == \"password\") {\n\t\t\t\t//Send feedback finally to teacher blog\n\t\t\t\t$this->subscriptions->sendAnswerURL($meta_data, $post);\n\t\t\t}\n\t\t}\n\t}", "function __editNotes()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //get the note\n $this->__viewNotes();\n\n //visibility\n $this->data['visible']['wi_my_note_edit'] = 1;\n $this->data['visible']['wi_my_note_view'] = 0;\n\n }", "public function save()\n {\n parent::save();\n\n $oRemark = oxNew(\"oxremark\");\n\n // try to load if exists\n $oRemark->load(oxRegistry::getConfig()->getRequestParameter(\"rem_oxid\"));\n\n $oRemark->oxremark__oxtext = new oxField(oxRegistry::getConfig()->getRequestParameter(\"remarktext\"));\n $oRemark->oxremark__oxheader = new oxField(oxRegistry::getConfig()->getRequestParameter(\"remarkheader\"));\n $oRemark->oxremark__oxparentid = new oxField($this->getEditObjectId());\n $oRemark->oxremark__oxtype = new oxField(\"r\");\n $oRemark->save();\n }", "function cust_note_insert(){\r\n\t}", "public function save()\n\t{\n\t\n\t\tif ($this->id == null) throw new Exception(\"Cannot save. id is null\");\n\t\t\n\t\t//store the data in the content column so that our worker will be searchable.\n\t\t$wp_content = \"\";\n\t\t\n\t\tforeach($this->values as $field=>$value)\n\t\t{\n\t\t\tupdate_post_meta($this->id, $field, $value);\n\t\t\t$wp_content .= \"<div>$value</div>\";\n\t\t}\n\t\t\n\t\t//wp_die($wp_content);\n\n\t\t//save the data entry in wp_posts\n\t\tglobal $wpdb;\n\t\t$wpdb->update(\n\t\t\t$wpdb->posts, \n\t\t\tarray(\n\t\t\t\t\"post_content\" => $wp_content,\n\t\t\t\t\"post_title\" => \"{$this->values['lastname']}, {$this->values['firstname']} {$this->values['middlename']}\" \n\t\t\t),\n\t\t\tarray(\"ID\" => $this->id),\n\t\t\tarray(\"%s\"),\n\t\t\tarray(\"%d\")\n\t\t);\n\t\t\n\t\t\n\t}", "function ajax_update_posts_meta_stuff() {\n\t$values = $_POST['values']; // getting variables from ajax post\n\t$key = $_POST['key']; // getting variables from ajax post\n\t\n\t$values = ereg_replace(\"[\\]\" ,\"\", $values );\n\t$valuesJson = json_decode($values);\n\t\n\tforeach($valuesJson as $post_id => $value){\n\t\tupdate_post_meta(strval($post_id), $key, strval($value));\n\t}\n\n\texit;\n}", "function construction_realestate_pro_bn_meta_save_properties( $post_id ) {\n\n\t// Save price\n\tif( isset( $_POST[ 'meta-price' ] ) ) {\n\t update_post_meta( $post_id, 'meta-price', $_POST[ 'meta-price' ] );\n\t}\n\tif( isset( $_POST[ 'meta-comprice' ] ) ) {\n\t update_post_meta( $post_id, 'meta-comprice', $_POST[ 'meta-comprice' ] );\n\t}\n\n\t// Save main meta_propertyid\n\tif( isset( $_POST[ 'meta-propertyid' ] ) ) {\n\t update_post_meta( $post_id, 'meta-propertyid', $_POST[ 'meta-propertyid' ] );\n\t}\n\t// Save address\n\tif( isset( $_POST[ 'meta-address' ] ) ) {\n\t update_post_meta( $post_id, 'meta-address', $_POST[ 'meta-address' ] );\n\t}\n\t// Save location\n\tif( isset( $_POST[ 'meta-location' ] ) ) {\n\t update_post_meta( $post_id, 'meta-location', $_POST[ 'meta-location' ] );\n\t}\n\t// Save property type\n\tif( isset( $_POST[ 'meta-proptype' ] ) ) {\n\t update_post_meta( $post_id, 'meta-proptype', $_POST[ 'meta-proptype' ] );\n\t}\n\t// // Save property status\n\t// if( isset( $_POST[ 'meta-status' ] ) ) {\n\t// update_post_meta( $post_id, 'meta-status', $_POST[ 'meta-status' ] );\n\t// }\n\n\tif(isset($_POST[\"meta-status\"])){\n //UPDATE: \n $meta_element_class = $_POST['meta-status'];\n //END OF UPDATE\n\n update_post_meta($post_id, 'meta-status', $meta_element_class);\n //print_r($_POST);\n }\n\n\t// Save property status\n\tif( isset( $_POST[ 'meta-size' ] ) ) {\n\t update_post_meta( $post_id, 'meta-size', $_POST[ 'meta-size' ] );\n\t}\n\n\t// Save package meta_bathrooms\n\tif( isset( $_POST[ 'meta-bathrooms' ] ) ) {\n\t update_post_meta( $post_id, 'meta-bathrooms', $_POST[ 'meta-bathrooms' ] );\n\t}\n\n\t// Save garage\n\tif( isset( $_POST[ 'meta-garage' ] ) ) {\n\t update_post_meta( $post_id, 'meta-garage', $_POST[ 'meta-garage' ] );\n\t}\n\n\t// Save bedrooms\n\tif( isset( $_POST[ 'meta-bedrooms' ] ) ) {\n\t update_post_meta( $post_id, 'meta-bedrooms', $_POST[ 'meta-bedrooms' ] );\n\t}\n\n\t// Save Year built\n\tif( isset( $_POST[ 'meta-yearbuilt' ] ) ) {\n\t update_post_meta( $post_id, 'meta-yearbuilt', $_POST[ 'meta-yearbuilt' ] );\n\t}\n\t// Save Year built\n\tif( isset( $_POST[ 'meta-childrooms' ] ) ) {\n\t update_post_meta( $post_id, 'meta-childrooms', $_POST[ 'meta-childrooms' ] );\n\t}\n\t// Save Year built\n\tif( isset( $_POST[ 'meta-furnished' ] ) ) {\n\t update_post_meta( $post_id, 'meta-furnished', $_POST[ 'meta-furnished' ] );\n\t}\n\t// Save Year built\n\tif( isset( $_POST[ 'meta-floors' ] ) ) {\n\t update_post_meta( $post_id, 'meta-floors', $_POST[ 'meta-floors' ] );\n\t}\n\t// Save Year built\n\tif( isset( $_POST[ 'meta-swimming' ] ) ) {\n\t update_post_meta( $post_id, 'meta-swimming', $_POST[ 'meta-swimming' ] );\n\t}\n\t// Save property type\n\tif( isset( $_POST[ 'meta-longitude' ] ) ) {\n\t update_post_meta( $post_id, 'meta-longitude', $_POST[ 'meta-longitude' ] );\n\t}\n\t// Save property type\n\tif( isset( $_POST[ 'meta-latitude' ] ) ) {\n\t update_post_meta( $post_id, 'meta-latitude', $_POST[ 'meta-latitude' ] );\n\t}\n\t}", "function save_rew_meta_box_input($rew_id)\n{\n\n\tif (isset($_POST['main_address'])){\n\t\t\n\t\tupdate_post_meta($rew_id , 'main_address', $_POST['main_address']);\n\t}\n\n\tif (isset($_POST['district_address'])){\n\t\t\n\t\tupdate_post_meta($rew_id , 'district_address', $_POST['district_address']);\n\t}\n\n\tif (isset($_POST['rew_rooms'])){\n\t\t\n\t\tupdate_post_meta($rew_id , 'rew_rooms', $_POST['rew_rooms']);\n\t}\n\n\n\tif (isset($_POST['rew_floors'])){\n\t\t\n\t\tupdate_post_meta($rew_id , 'rew_floors', $_POST['rew_floor']);\n\t}\n\tif (isset($_POST['Apartment_area'])){\n\t\t\n\t\tupdate_post_meta($rew_id , 'Apartment_area', $_POST['Apartment_area']);\n\t}\n\n\tif (isset($_POST['flat_type'])){\n\t\t\n\t\tupdate_post_meta($rew_id , 'flat_type', $_POST['flat_type']);\n\t}\n\n\tif (isset($_POST['rew_price'])){\n\t\t\n\t\tupdate_post_meta($rew_id , 'rew_price', $_POST['rew_price']);\n\t}\n\n\n\n\t\t// villa rew_garden\n\tif (isset($_POST['rew_garden'])){\n\t\t\n\t\tupdate_post_meta($rew_id , 'rew_garden', $_POST['rew_garden']);\n\t}\n\n}", "function wck_update_meta(){\r\n\t\tcheck_ajax_referer( \"wck-update-entry\" );\r\n\t\tif( !empty( $_POST['meta'] ) )\r\n\t\t\t$meta = sanitize_text_field( $_POST['meta'] );\r\n\t\telse \r\n\t\t\t$meta = '';\r\n\t\tif( !empty( $_POST['id'] ) )\r\n\t\t\t$id = absint($_POST['id']);\r\n\t\telse \r\n\t\t\t$id = '';\r\n\t\tif( isset( $_POST['element_id'] ) )\r\n\t\t\t$element_id = absint( $_POST['element_id'] );\r\n\t\telse \r\n\t\t\t$element_id = 0;\r\n\t\tif( !empty( $_POST['values'] ) && is_array( $_POST['values']) )\r\n\t\t\t$values = array_map( 'wppb_sanitize_value', $_POST['values'] );\r\n\t\telse\r\n\t\t\t$values = array();\r\n\t\t\r\n\t\t// Security checks\r\n\t\tif( true !== ( $error = self::wck_verify_user_capabilities( $this->args['context'], $meta, $id ) ) ) {\r\n\t\t\theader( 'Content-type: application/json' );\r\n\t\t\tdie( json_encode( $error ) );\r\n\t\t}\r\n\t\t\r\n\t\t$values = apply_filters( \"wck_update_meta_filter_values_{$meta}\", $values, $element_id );\r\n\t\t\r\n\t\t/* check required fields */\r\n\t\t$errors = self::wck_test_required( $this->args['meta_array'], $meta, $values, $id );\r\n\t\tif( $errors != '' ){\r\n\t\t\theader( 'Content-type: application/json' );\r\n\t\t\tdie( json_encode( $errors ) );\r\n\t\t}\r\n\t\t\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\t$results = get_post_meta($id, $meta, true);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\t$results = get_option( apply_filters( 'wck_option_meta' , $meta, $values, $element_id ) );\r\n\t\t\r\n\t\t$results[$element_id] = $values;\r\n\r\n\t\t/* make sure this does not output anything so it won't break the json response below\r\n\t\twill keep it do_action for compatibility reasons\r\n\t\t */\r\n\t\tob_start();\r\n\t\t\tdo_action( 'wck_before_update_meta', $meta, $id, $values, $element_id );\r\n\t\t$wck_before_update_meta = ob_get_clean(); //don't output it\r\n\t\t\r\n\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\tupdate_post_meta($id, $meta, $results);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\tupdate_option( apply_filters( 'wck_option_meta' , $meta, $results, $element_id ), wp_unslash( $results ) );\r\n\t\t\r\n\t\t/* if unserialize_fields is true update the coresponding post metas for every element of the form */\r\n\t\tif( $this->args['unserialize_fields'] && $this->args['context'] == 'post_meta' ){\r\n\t\t\t\r\n\t\t\t$meta_suffix = $element_id + 1;\t\r\n\t\t\tif( !empty( $values ) ){\r\n\t\t\t\tforeach( $values as $name => $value ){\r\n\t\t\t\t\tupdate_post_meta($id, $meta.'_'.$name.'_'.$meta_suffix, $value);\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$entry_content = $this->wck_refresh_entry( $meta, $id, $element_id );\t\t\r\n\r\n\t\theader( 'Content-type: application/json' );\r\n\t\tdie( json_encode( array( 'entry_content' => $entry_content ) ) );\r\n\t}", "public function save_meta( $post_id ) {\n\t\tif ( ! isset( $_POST['simple_event_info_nonce'] ) ) {\n\t\t\treturn $post_id;\n\t\t}\n\n\t\t$nonce = $_POST['simple_event_info_nonce'];\n\n\t\t// Verify that the nonce is valid.\n\t\tif ( ! wp_verify_nonce( $nonce, 'simple_event_info' ) ) {\n\t\t\treturn $post_id;\n\t\t}\n\n\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) :\n\t\t\treturn $post_id;\n\t\tendif;\n\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) :\n\t\t\treturn $post_id;\n\t\tendif;\n\n\t\tforeach ( $this->fields as $field ) {\n\t\t\t$old_value = get_post_meta( $post_id, $field['id'], true );\n\t\t\t$new_value = sanitize_text_field( $_POST[ $field['id'] ] );\n\n\t\t\tif ( $new_value && $new_value != $old_value ) {\n\t\t\t\tupdate_post_meta( $post_id, $field['id'], $new_value );\n\t\t\t} elseif ( '' == $new_value && $old_value ) {\n\t\t\t\tdelete_post_meta( $post_id, $field['id'], $old_value );\n\t\t\t}\n\t\t}\n\t}", "function wyz_ajax_claim_save_form() {\n\n\t$form_data = json_decode( stripslashes_deep( $_REQUEST['form_data'] ),true );\n\tif ( ! empty( $form_data ) && is_array( $form_data ) ) {\n\t\tforeach ( $form_data as $key => $value ) {\n\t\t\t$form_data[ $key ]['hidden'] = true;\n\t\t}\n\t}\n\n\tupdate_option( 'wyz_claim_registration_form_data', $form_data );\n\twp_die();\n}", "protected function _postSave()\r\n\t{\r\n\t}", "function dp_save_event_info($post_id) {\n // if not, then return\n if ('event' != $_POST['post_type']) {\n return;\n }\n\n // checking for the 'save' status\n $is_autosave = wp_is_post_autosave($post_id);\n $is_revision = wp_is_post_revision($post_id);\n $is_valid_nonce = (isset($_POST['dp-event-info-nonce']) && (wp_verify_nonce($_POST['dp-event-info-nonce'], basename(__FILE__)))) ? true : false;\n\n // exit depending on the save status or if the nonce is not valid\n if ($is_autosave || $is_revision || !$is_valid_nonce) {\n return;\n }\n\n // checking for the values and performing necessary actions\n if (isset($_POST['dp-event-date'])) {\n update_post_meta($post_id, 'event-date', strtotime($_POST['dp-event-date']));\n }\n\n if (isset($_POST['dp-event-glat'])) {\n update_post_meta($post_id, 'event-glat', sanitize_text_field($_POST['dp-event-glat']));\n }\n\n if (isset($_POST['dp-event-glng'])) {\n update_post_meta($post_id, 'event-glng', sanitize_text_field($_POST['dp-event-glng']));\n }\n\n if (isset($_POST['dp-event-url'])) {\n update_post_meta($post_id, 'event-url', sanitize_text_field($_POST['dp-event-url']));\n }\n}", "public function addNoteAction() {\n try {\n if (!($this->getRequest()->isXmlHttpRequest())) {\n throw new \\Exception('illegal request');\n }\n \n \n $post = $this->getRequest()->getPost();\n $note = $post['note'];\n $errs = array();\n if (empty($note)) {\n $errs['note'] = array('Note cannot be empty');\n }\n \n if (!empty($errs)) {\n return new JsonModel(array('err'=>true, 'info'=>$errs));\n }\n \n $notes = $this->getSpace()->getNotes();\n $notes = json_decode($notes, true);\n if (empty($notes)) {\n $notes = array();\n }\n \n $noteIdx = time();\n $notes[$noteIdx] = $note;\n $noteCnt = count($notes);\n $notes = json_encode($notes);\n \n $this->getSpace()->setNotes($notes);\n $this->getEntityManager()->persist($this->getSpace());\n $this->getEntityManager()->flush();\n\n $data = array('err'=>false, 'cnt'=>$noteCnt, 'id'=>$noteIdx);\n \n } catch (\\Exception $ex) {\n $data = array('err'=>true, 'info'=>array('ex'=>$ex->getMessage()));\n }\n return new JsonModel(empty($data)?array('err'=>true):$data);/**/\n }" ]
[ "0.656293", "0.65079296", "0.62839484", "0.62827927", "0.626688", "0.61148787", "0.60743237", "0.60599065", "0.6055768", "0.6006708", "0.60038984", "0.59891254", "0.5974096", "0.59569776", "0.5892944", "0.58695656", "0.5852006", "0.5851478", "0.5832846", "0.58246607", "0.5814426", "0.580285", "0.57916325", "0.5781296", "0.57804227", "0.5779236", "0.57661873", "0.57553095", "0.57394445", "0.57346535", "0.57225907", "0.57137793", "0.5713532", "0.56979126", "0.56926477", "0.56912094", "0.5690473", "0.5667496", "0.56562203", "0.56520647", "0.56507975", "0.56469876", "0.5637785", "0.56356835", "0.5633183", "0.5628491", "0.5624967", "0.5624759", "0.56163174", "0.5609013", "0.5603992", "0.55992454", "0.5576958", "0.5567013", "0.55444133", "0.55422044", "0.55393904", "0.55298245", "0.5529064", "0.55178386", "0.55157113", "0.5507341", "0.5506926", "0.54971325", "0.54952705", "0.5485647", "0.54846025", "0.5484168", "0.5479655", "0.5471847", "0.5464682", "0.5461137", "0.5457619", "0.54567724", "0.54545844", "0.5448814", "0.54444563", "0.5429322", "0.5416095", "0.541435", "0.54109645", "0.54049957", "0.54015696", "0.5400224", "0.53978354", "0.53949535", "0.5390427", "0.5381598", "0.5378125", "0.53738904", "0.53723097", "0.53714985", "0.5370908", "0.5366018", "0.5364672", "0.5363603", "0.536208", "0.5358017", "0.53533435", "0.5345274" ]
0.64557743
2
create shortcode to list all notes
function nt_mass_listing_shortcode( $atts ) { ob_start(); $current_user = get_current_user_id(); //Admin and editor users can view all notes if(current_user_can('edit_posts')) { $args = array( 'post_type' => 'coursenote', 'posts_per_page' => -1, 'post_status' => array('draft'), 'order' => 'ASC', 'orderby' => 'title', ); } //Viewer can only see their notes else { $args = array( 'post_type' => 'coursenote', 'posts_per_page' => -1, 'post_status' => array('draft'), 'order' => 'ASC', 'orderby' => 'title', 'author__in' => $current_user ); } $query = new WP_Query($args); if ( $query->have_posts() ) { ?> <ul class="notes-listing"> <?php while ( $query->have_posts() ) : $query->the_post(); ?> <li id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </li> <?php endwhile; wp_reset_postdata(); ?> </ul> <?php $nt_mass_list = ob_get_clean(); return $nt_mass_list; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNotes();", "private function get_notes()\n\t{\n\t\t$notes = $this->api->search( Options::get('simplenote__search') );\n\t\t\t\t\n\t\treturn $notes;\n\t}", "public function notesAction() {\n\t$notes = new Findofnotereasons();\n\t$this->view->notes = $notes->getReasonsList();\n\t}", "public function index()\n {\n return Notes::all();\n }", "public function listNotesPage()\n {\n $notes = Note::select('id', 'note')->orderBy('id', 'desc')->get();\n foreach ($notes as $note) {\n $note->originalNote = $note->getOriginal('note');\n }\n\n return view('admin.listnotes', ['notes' => $notes]);\n }", "function return_notes()\n {\n $data = array();\n $query = $this->pdo->prepare('SELECT * FROM note');\n $query->execute();\n $posts = $query->fetchAll();\n $html = '';\n foreach ($posts as $value) \n {\n $html .= \"<div class='single-note'><div class='note-title'>\".$value['title'].\n \" <img class='delete' id='\".$value['id'].\"' src='img/delete.gif' alt='delete'></div><div class='note-text' id=\".$value['id'].\">\".$value['description'].\"</div></div>\";\n }\n $data['html'] = $html;\n return($data);\n }", "public function noteIndex(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n }\n $items = $this->Notes->index($user);\n }", "public function noteIndex(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n }\n $items = $this->Notes->index($user); \n }", "public function test_notes_list()\n {\n Note::create(['note'] => 'Mi primera nota');\n Note::create(['note'] => 'Segunda nota');\n $this->visit('notes')\n ->see('Mi primera nota')\n ->see('Segunda nota');\n }", "public function index()\n {\n return TecnicNote::all();\n }", "public function index()\n {\n $note = Note::all();\n }", "public static function retrieveAllNotes() {\n return R::getAll('SELECT * FROM note');\n }", "public function getNotesOfuser(){\n $htmltag = '';\n $username = $_SESSION['id'];\n $query = \"SELECT * from notes where userid = $username order by notesid DESC\";\n $results = pg_query($query);\n\n if($results){\n while ($rows=pg_fetch_array($results)){\n $notesid = $rows['notesid'];\n $description = $rows['description'];\n \n $htmltag = $htmltag.\"<li value='$notesid'><textarea disabled class='listItem'>$description</textarea><a id ='$notesid' class='removeListXbtn' style='display: none;' href='#'><button class='circleButtonX'>x</button></a> </li>\";\n\n }\n\n}else{\n\n $htmltag = 'Create new Note';\n\n}\n\nreturn $htmltag;\n\n }", "static function add_notes(): void {\r\n\t\tself::add_acf_inner_field(self::divisions, self::notes, [\r\n\t\t\t'label' => 'Notes',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => 'Any notes pertinent to the division.',\r\n\t\t\t'required' => 0,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '40',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t]\r\n\t\t]);\r\n\t}", "public function index()\n {\n return Note::all();\n }", "public function addnotesAction() {\n\t\t$this->_helper->viewRenderer->setNoRender();\n\t\t$this->_helper->layout()->disableLayout();\n\t\t$id = $this->_getParam('taid');\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t$notes = stripslashes(strip_tags($this->_getParam('value')));\n\t\t$ta->notes = preg_replace('/[\\r\\n]+/', ' ', $notes);\n\t\t$ta->save();\n\t\techo $ta->notes;\n\t}", "protected function _addNotes()\n\t{\n\t\t$windowId = $this->_Admin_Form_Controller->getWindowId();\n\n\t\treturn Admin_Form_Entity::factory('Script')\n\t\t\t->value(\"$(function (){\n\t\t\t\t$.adminLoad({ path: '/admin/crm/project/note/index.php', additionalParams: 'crm_project_id=\" . $this->_object->id . \"', windowId: '{$windowId}_notes' });\n\t\t\t});\");\n\t}", "public function notes()\n {\n return $this->morphedByMany('App\\Note', 'taggable');\n }", "function getNoteList()\n {\n $stmt = \"SELECT\n cno_id,\n cno_prj_id,\n cno_customer_id,\n cno_note\n FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"customer_note\n ORDER BY\n cno_customer_id ASC\";\n $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return array();\n } else {\n for ($i = 0; $i < count($res); $i++) {\n $res[$i]['customer_title'] = self::getTitle($res[$i]['cno_prj_id'], $res[$i]['cno_customer_id']);\n }\n return $res;\n }\n }", "public function showSysNotesForPage()\t{\n\t\tglobal $TCA;\n\n\t\t$out='';\n\n\t\t\t// Checking if extension is loaded:\n\t\tif (!t3lib_extMgm::isLoaded('sys_note'))\treturn '';\n\n\t\t\t// Create query for selecting the notes:\n\t\t$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','sys_note','pid IN ('.$this->id.') AND (personal=0 OR cruser='.intval($GLOBALS['BE_USER']->user['uid']).')'.t3lib_BEfunc::deleteClause('sys_note').t3lib_BEfunc::versioningPlaceholderClause('sys_note'));\n\n\t\t\t// Executing query:\n\t\t$dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);\n\n\t\t\t// If some notes were found, render them:\n\t\tif ($dbCount)\t{\n\t\t\t$cat = array();\n\n\t\t\t\t// Load full table description:\n\t\t\tt3lib_div::loadTCA('sys_note');\n\n\t\t\t\t// Traverse note-types and get labels:\n\t\t\tif ($TCA['sys_note'] && $TCA['sys_note']['columns']['category'] && is_array($TCA['sys_note']['columns']['category']['config']['items']))\t{\n\t\t\t\tforeach($TCA['sys_note']['columns']['category']['config']['items'] as $el)\t{\n\t\t\t\t\t$cat[$el[1]]=$GLOBALS['LANG']->sL($el[0]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\t// For each note found, make rendering:\n\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\t{\n\n\t\t\t\t\t// Create content:\n\t\t\t\t$iconImg = t3lib_iconWorks::getSpriteIconForRecord('sys_note', $row);\n\t\t\t\t$subject = htmlspecialchars($row['subject']);\n\t\t\t\t$fields = array();\n\t\t\t\t$fields['Author:'] = htmlspecialchars($row['author'].($row['email'] && $row['author'] ? ', ':'').$row['email']);\n\t\t\t\t$fields['Category:'] = htmlspecialchars($cat[$row['category']]);\n\t\t\t\t$fields['Note:'] = nl2br(htmlspecialchars($row['message']));\n\n\t\t\t\t\t// Compile content:\n\t\t\t\t$out.='\n\n\n\t\t\t\t<!--\n\t\t\t\t\tSys-notes for list module:\n\t\t\t\t-->\n\t\t\t\t\t<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" id=\"typo3-dblist-sysnotes\">\n\t\t\t\t\t\t<tr><td colspan=\"2\" class=\"bgColor2\">'.$iconImg.'<strong>'.$subject.'</strong></td></tr>\n\t\t\t\t\t\t<tr><td class=\"bgColor4\">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.category',1).'</td><td class=\"bgColor4\">'.$fields['Category:'].'</td></tr>\n\t\t\t\t\t\t<tr><td class=\"bgColor4\">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.author',1).'</td><td class=\"bgColor4\">'.$fields['Author:'].'</td></tr>\n\t\t\t\t\t\t<tr><td class=\"bgColor4\">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.note',1).'</td><td class=\"bgColor4\">'.$fields['Note:'].'</td></tr>\n\t\t\t\t\t</table>\n\t\t\t\t';\n\t\t\t}\n\t\t}\n\t\treturn $out;\n\t}", "public function index()\n {\n $notes = request()->user()->notes()->paginate(20);\n return NoteResource::collection($notes)->additional([\n 'message' => \"Notes retrieved successfully\",\n 'status' => \"success\"\n ]);\n }", "function display_notes() {\n\t\t?>\n\t\t<style>\n\t #adminmenuwrap,\n\t #screen-meta,\n\t #screen-meta-links,\n\t #adminmenuback,\n\t #wpfooter,\n\t #wpadminbar{\n\t display: none !important;\n\t }\n\t #wpbody-content{\n\t \tpadding: 0;\n\t }\n\t html{\n\t padding-top: 0 !important;\n\t }\n\t #wpcontent{\n\t margin: 0 !important;\n\t }\n\t #wc-crm-page{\n\t margin: 15px !important;\n\t }\n </style>\n <input type=\"hidden\" id=\"customer_user\" name=\"customer_user\" value=\"<?php echo $this->user_id; ?>\">\n\t\t<div id=\"side-sortables\" class=\"meta-box-sortables\">\n\t\t\t\t<div class=\"postbox \" id=\"woocommerce-customer-notes\">\n\t\t\t\t\t\t<div class=\"inside\">\n\t\t\t\t\t\t<ul class=\"order_notes\">\n\t\t\t\t\t\t\t<?php $notes = $this->get_customer_notes(); ?>\n\t\t\t\t\t\t\t\t\t<?php if ( $notes ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach( $notes as $note ) {\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<li rel=\"<?php echo absint( $note->comment_ID ) ; ?>\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"note_content\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php echo wpautop( wptexturize( wp_kses_post( $note->comment_content ) ) ); ?>\n\t\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\t<p class=\"meta\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<abbr class=\"exact-date\" title=\"<?php echo $note->comment_date_gmt; ?> GMT\"><?php printf( __( 'added %s ago', 'wc_customer_relationship_manager' ), human_time_diff( strtotime( $note->comment_date_gmt ), current_time( 'timestamp', 1 ) ) ); ?></abbr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( $note->comment_author !== __( 'WooCommerce', 'wc_customer_relationship_manager' ) ) printf( ' ' . __( 'by %s', 'wc_customer_relationship_manager' ), $note->comment_author ); ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"#\" class=\"delete_customer_note\"><?php _e( 'Delete note', 'wc_customer_relationship_manager' ); ?></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</li>\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}\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '<li>' . __( 'There are no notes for this customer yet.', 'wc_customer_relationship_manager' ) . '</li>';\n\t\t\t\t\t\t\t\t\t\t\t\t} ?>\n\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t<div class=\"add_note\">\n\t\t\t\t\t\t\t\t\t\t\t<h4>Add note</h4>\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t<textarea rows=\"5\" cols=\"20\" class=\"input-text\" id=\"add_order_note\" name=\"order_note\" type=\"text\"></textarea>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t<a class=\"add_note_customer button\" href=\"#\">Add</a>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}", "public function showNotes()\n {\n return view('notes-dashboard');\n }", "function getNotes(){\n\n\n\t\theader('Content-Type: application/json');\n\t\t\n\t\t$id = $_GET['id'];\n\t\t$r = new RESPONSE(0);\n\n\t\t//make sure id is present\n\t\tif ($id == \"\" || $id < 1){\n\t\t\t$r->message = \"No data.\";\n\t\t\techo $r->toJSON();\t\n\t\t\treturn false;\n\t\t}\n\n\t\t//create the db\n\t\t$database = createDb();\t\t\n\n\n\n\t\t//get the admin notes\n\t\t$datas = $database->select(\"Note\", \"*\", [\n\t\t\t\"MainContactId\" => $id \n\t\t]);\n\n\n\t\t//parse and format response\n\t\tif( count($datas) > 0){\n\n\t\t\t$r->html .= '<tbody>';\t\n\n\t\t\t foreach ($datas as $row) {\n\t\t\t\t \t\t\t\t\t\t // process the notes\n\t\t\t\t $notes = $row[\"Notes\"];\n\t\t\t\t \n\t\t\t\t if ($notes != \"\"){\n\t\t\t\t\t$r->html .= sprintf('<tr><td>%s</td><td>%s</td></tr>', $row[\"DateTimeEntered\"], $notes);\t \n\t\t\t\t }\n\n\t\t\t }\n\n\n\n\t\t\t$r->html .= '</tbody>';\t\n\t\t\t$r->status = 1;\n\n\t\t}\n\n\t\t//the response\n\t\techo $r->toJSON();\t\n\n\t}", "function bitsa_notes_viewnotes(){\n\n\t\twp_enqueue_script( 'bitwise_sidebar_content_public_js', plugin_dir_url( __FILE__ ) . '/public/js/bitwise-sidebar-content-public.js', array( 'jquery' ), '1.0.0', false );\n\t\twp_enqueue_script( 'learndash_sidebar_content_public_js', plugin_dir_url( __FILE__ ) . '/public/js/nt_notes.js', array( 'jquery' ), '1.0.0', false );\n\t\twp_enqueue_script( 'learndash_sidebar_print_public_js', plugin_dir_url( __FILE__ ) . '/public/js/nt_notes_lib.js', array( 'jquery' ), '1.0.0', false );\n\t\twp_enqueue_script( 'bitwise_lightbox_html5view', plugin_dir_url( __FILE__ ) . 'public/html5lightbox/html5lightbox.js', array(), '1.0.0', false );\n\t\twp_enqueue_style( 'bitwise_sidebar_content_public', plugin_dir_url( __FILE__ ) . 'public/css/bitwise-sidebar-content-public.css', array(), '1.0.0', 'all' );\n\n\t global $wpdb;\n\t\t$current_user\t= wp_get_current_user();\n\t\t$allowed_roles = array('administrator');\n \t$user_id = $current_user->ID;\n\t\t$table = $wpdb->prefix.'bitscr_notes';\n\t\tif(isset($_GET['currenttopicid'])){\n\t\t\t $currenttopicid = $_GET['currenttopicid'];\n\t\t\t $oldnotes=Bitscr_Common::selecttopicnotes( $user_id,$currenttopicid);\n\t\t\t }else{\n\t\t\t if( array_intersect($allowed_roles, $current_user->roles ) ) { //check if the user have admin access\n \n \t\t\t$oldnotes=Bitscr_Common::selectallnotes();\n \t\t} else{\n\t \t\t\t$oldnotes=Bitscr_Common::selectusernotes( $user_id); //select the notes for particular user\n \t\t }\n\t\t\t }\n\t\t ?>\n\t\t<div class=\"searchdiv\">\n <div class=\"notes_list_filter show_drpd\">\n <label>Show\n <select class=\"data_display\">\n <option value=\"10\">10</option>\n <option value=\"25\">25</option>\n <option value=\"50\">50</option>\n </select> entries</label>\n </div>\n\t\t<div class=\"col-md-6 auto nogap notes_list_filter pull-right\">\n <input class=\"form-control form-control-sm ml-3 w-75 search\" type=\"text\" placeholder=\"Search\" aria-label=\"Search\">\n </div>\n </div> \n <div class=\"notes_list_tablediv\">\n\t\t<form action=\"\" method=\"get\">\n <table class=\"notes-listing notes_list_table\">\n <thead>\n <tr style=\"background-color: black;color: white;\">\n <th>&nbsp;</th>\n <th><?php esc_html_e('Notes','sfwd-lms'); ?></th>\n <?php\n if( array_intersect($allowed_roles, $current_user->roles ) ) { \n ?>\n <th><?php esc_html_e( 'User', 'sfwd-lms' ); ?></th>\n <?php }?>\n \n <th><?php esc_html_e( 'Date', 'sfwd-lms' ); ?></th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n\n \t</tbody>\n \t<tfoot>\n \t<tr>\n \t<td colspan=\"5\">\n <input type=\"submit\" name=\"lds-bulk-download\" class=\"lds-bulk-download\" value=\"<?php esc_attr_e( 'Download Selected', 'sfwd-lms' ); ?>\" type=\"submit\">\n </td>\n </tr>\n </tfoot>\n </table>\n\n <div class=\"displaying_message\"></div>\n\t\t<ul class=\"pagination\"> </ul>\n\n </form></div>\n</div>\n\n <?php foreach($oldnotes as $oldnote){?>\n \t<form id=\"singlesubmit<?php echo $oldnote->id;?>\" method=\"get\" action=\"\">\n <input type=\"hidden\" name=\"lds-bulk-action-item[<?php echo $oldnote->topic_id; ?>]\" value=\"<?php echo $oldnote->topic_id; ?>\">\n </form>\n<?php }\n\t}", "function getNotes() {\n\t\treturn $this->notes;\n\t}", "public function getNote();", "static public function getAllNotes()\n {\n $notes = array();\n foreach (self::$instances as $i)\n {\n $notes = array_merge($notes, $i->getNotes());\n }\n\n return $notes;\n }", "public function getNotes()\n {\n return $this->notes;\n }", "public function getNotes()\n {\n return $this->notes;\n }", "public function getNotes()\n {\n return $this->notes;\n }", "public function getNotes()\n {\n return $this->notes;\n }", "public function getNotes()\n {\n return $this->notes;\n }", "public function add_note()\n {\n\n $cols = \"`desc`\";\n\n $value =\n \" '\" . $this->obj->all_data->notes->get_desc() . \"' \";\n\n\n $insert = $this->obj->insert(\"notes\", $cols, $value);\n return $insert;\n }", "public function getResponseNotes();", "public static function getAllNote() : array {\r\n global $config;\r\n $con = new Sql($config[\"host\"], $config[\"database\"], $config[\"username\"], $config[\"password\"]);\r\n $noteGateway = new NoteGateway($con);\r\n return $noteGateway->findAll();\r\n }", "public function list(){\n if(empty($this->pad)){\n msg('Your pad is empty.');\n }else{\n foreach ($this->pad as $noteNumber => $noteValue ){\n msg('Note number : '.($noteNumber+1).\"\\n\".$noteValue);\n }\n }\n closeNode();\n }", "public function index()\n {\n $notes = auth()->user()->notes()->get();\n\n return view('notes')->with(['notes'=>$notes]);\n }", "public function getNotes()\n {\n $notes = \"**Support Level:**\\n\\n\";\n $notes .= \"%$this->supportLevel%\\n\\n\";\n\n if ($this->stablePlatforms) {\n $notes .= \"**Supported Platforms:**\\n\";\n $notes .= \"$this->stablePlatforms\\n\";\n }\n\n if ($this->unstablePlatforms) {\n $notes .= \"**Unsupported Platforms:**\\n\";\n $notes .= \"$this->unstablePlatforms\\n\";\n }\n\n if ($this->notes) {\n $notes .= \"**Additional Notes:**\\n\";\n $notes .= str_replace(\"- \", \"\\n- \", $this->notes) . \"\\n\";\n }\n\n $config = \\HTMLPurifier_Config::createDefault();\n $purifier = new \\HTMLPurifier($config);\n $parsedown = new \\Parsedown();\n $notes = $parsedown->text($notes);\n $notes = $purifier->purify($notes);\n return $notes;\n }", "public function displayNotes($noteCount = array()){\n\n echo \"[ $50 Notes => \" . $noteCount['50'] . \", $20 Notes => \" . $noteCount['20'] . \" ]\" ;\n echo \"\\n\";\n }", "public function index()\n {\n return NoteResource::collection(Note::mine()->get());\n }", "public function getNotes()\n {\n return \"Tutorial Map\";\n }", "public function index()\n {\n $contents = Content::where( 'parent_id', 0 )->get();\n\n return view('admin.note.index', compact('contents'));\n }", "public function getNotes() {\n return $this->notes;\n }", "function __viewNotes()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //show text view\n $this->data['visible']['wi_my_note_view'] = 1;\n\n //check if team member has a note for this project\n $notes = $this->mynotes_model->checkNotes($this->project_id, $this->data['vars']['my_id']);\n\n //do it have a note for this project, if not create a blank one\n if ($notes === 0) {\n $this->mynotes_model->newNote($this->project_id, $this->data['vars']['my_id']);\n $this->data['debug'][] = $this->mynotes_model->debug_data;\n }\n\n //reload notes again\n //load team members first\n $this->data['reg_fields'][] = 'mynotes';\n $this->data['fields']['mynotes'] = $this->mynotes_model->getNotes($this->project_id, $this->data['vars']['my_id']);\n $this->data['debug'][] = $this->mynotes_model->debug_data;\n\n }", "protected function NotesText() {\n\t$out = NULL;\n \n\t$sPkgNotes = $this->Value('PkgNotes');\n\tif (!is_null($sPkgNotes)) {\n\t $out .= '<b>Pkg</b>: '.$sPkgNotes;\n\t}\n\t\n\t$sOrdNotes = $this->Value('OrdNotes');\n\tif (!is_null($sOrdNotes)) {\n\t $out .= '<b>Ord</b>: '.$sOrdNotes;\n\t}\n\t\n\treturn $out;\n }", "function getNotes() {\n\t\treturn $this->_Notes;\n\t}", "public function index()\n\t{\n\t\t$exam_glass_notes = ExamGlassNote::orderBy('id', 'desc')->paginate(10);\n\n\t\treturn view('exam_glass_notes.index', compact('exam_glass_notes'));\n\t}", "public static function displayNotes($projectID, $unitID = null) {\n\n if (!is_null($unitID)) {\n $notes = ArmyDB::retrieveNotesByUnitID($unitID);\n } else {\n $notes = ArmyDB::retrieveNotesByProjectID($projectID);\n }\n //var_dump($unitID);\n //var_dump($notes);\n\n echo \"<div class='row'>\";\n echo \"<h1>Comments</h1>\";\n if (empty($notes)) {\n echo \"<div class='list-group col-xs-6 col-md-3'>\";\n echo \"<a href='#' class='list-group-item'>\";\n echo \"<li class='list-group-item list-group-item'>No notes have been created for this.</li>\";\n echo \"</ul>\";\n echo \"</div>\";\n }\n else {\n foreach ($notes as $note) {\n //var_dump($note);\n $poster = $note['poster'];\n $notetext = $note['text'];\n $dateadded = $note['date_added'];\n\n echo \"<div class='list-group col-xs-6 col-md-3'>\";\n echo \"<a href='user.php?username=\" . $poster . \"' class='list-group-item'>\";\n echo \"<li class='list-group-item list-group-item'>$notetext</li>\";\n echo \"<li class='list-group-item list-group-item-danger'>Posted by $poster<br>$dateadded</li>\";\n echo \"</ul>\";\n echo \"</div>\";\n }\n }\n\n\n if (ArmyForm::checkForLogIn()) {\n $poster = $_SESSION['username'];\n echo \"<div class='col-xs-6 col-md-3'>\";\n echo \"<div class='list-group'>\";\n echo \"<a href='#' class='list-group-item'>\";\n echo \"<form role='form' method='post' action='action.php'>\";\n echo \"<textarea class='form-control' rows='3' id='desc' name='notetext' placeholder='Post your note here!'></textarea>\";\n if (isset($unitID)) {\n echo \"<input type='hidden' name='unitid' value='$unitID'>\";\n }\n else {\n echo \"<input type='hidden' name='projectid' value='$projectID'>\";\n }\n echo \"<input type='hidden' name='action' value='addNote'>\";\n echo \"<input type='hidden' name='poster' value='$poster'><input type='submit' class='btn btn-default'>\";\n echo \"</form>\";\n echo \"<p class='list-group-item-text'></p>\";\n echo \"</a>\";\n echo \"</div></div>\";\n }\n\n echo \"</div>\";\n\n }", "public function getNotes() {\n\t\treturn $this->_notes;\n\t}", "public function index()\n {\n $notes = Note::all();\n\n return response()->success(\"Notes are listed\", NoteResource::collection($notes));\n }", "public function index() {\n $notesService = new NotesService();\n $notes = $notesService->getAllNotes();\n $notesResponseArray = array();\n foreach ($notes as $note) {\n $notesResponseArray[] = Util::getNotesResponse($note);\n }\n return json_encode(array('notes' => $notesResponseArray));\n }", "public function getNotes()\n {\n return $this->getNodeText('/p:package/p:notes');\n }", "public function index()\n\t{\n\t\t$veriler = Notes::orderBy('id','DESC')->with('users.classes')->get();\t\n\t\treturn View::make('backend.notes.index',compact('veriler'))->with('title','Kayıtlı Yazılı Notları');\n\t}", "public function index()\n {\n return Note::orderBy('created_at', 'desc')->get();\n }", "public function get_all_notes() {\n $sql = \"SELECT note_id FROM notes \n\t\tWHERE peducator_id='$this->peducator_id'\";\n $result = mysqli_query($this->connect_to_db, $sql);\n\n $arr = [];\n while ($row = mysqli_fetch_array($result)) {\n array_push($arr, get_note($row['note_id']));\n }\n\n return $arr;\n\n }", "function createNote();", "public function action_index()\n\t{\n\t\t$form = MMI_Form::factory(array\n\t\t(\n\t\t\t'_open' => array('_before' => 'Purify Filter Test'),\n\t\t));\n\n\t\t$settings = array\n\t\t(\n\t\t\t'_filters'\t=> array\n\t\t\t(\n\t\t\t\t'MMI_Form_Filter_HTML::purify' => array\n\t\t\t\t(\n\t\t\t\t\tarray\n\t\t\t\t\t(\n\t\t\t\t\t\t'AutoFormat.AutoParagraph' => TRUE,\n\t\t\t\t\t\t'HTML.Allowed' => 'a[href],b,i,p',\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t\t'_label' => 'Notes',\n\t\t\t'_namespace' => 'mmi',\n\n\t\t\t'_after' => '<br/><i>tags allowed: a[href], b, i, and p<br/>auto-formating of paragraphs is enabled</i>',\n\t\t\t'class' => 'textarea',\n\t\t\t'id' => 'textarea1',\n\t\t\t'value' => '<span><b>memakeit</b></span>!'.PHP_EOL.PHP_EOL.'hello'.PHP_EOL.PHP_EOL.'goodbye',\n\t\t);\n\t\t$type = 'textarea';\n\t\t$txt = MMI_Form_Field::factory($type, $settings);\n\n\t\t$form\n\t\t\t->add_field($txt)\n\t\t\t->add_submit()\n\t\t;\n\n\t\t$html = trim($form->render());\n\t\techo $html;\n\t\tif ($this->debug)\n\t\t{\n\t\t\tMMI_Debug::dump($html, 'form');\n\t\t}\n\t}", "function shownote($note){\n\treturn \"onfocus=\\\"note('<b>NOTE:</b><br>$note');\\\"\n\t\t\tonblur=\\\"note('');\\\"\";\n}", "function exam_list() {\n \n //$vNumberOfColumns = 4;\n \n $vContent = t(ExamInstance::getListingOfExams());\n \n return $vContent;\n \n //foreach ($links as $link) {\n // $items[] = l($link['title'], $link['href'], $item['localized_options'])\n // . ': ' . filter_xss_admin($link['description']);\n //}\n\n //return theme('item_list', array('items' => $items));\n \n}", "public function index()\n {\n $this->repository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n $notes = $this->repository->all();\n\n if (request()->wantsJson()) {\n\n return response()->json([\n 'data' => $notes,\n ]);\n }\n\n return view('notes.index', compact('notes'));\n }", "public function index()\n {\n $notes = Note::all();\n\n return $this->successReponse($notes);\n }", "function listContent()\n {\n }", "function triernote(){\n\t\t$sql=\"SElECT * From hotel order by note desc\";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "public function notes()\r\n {\r\n $this->CI->db->where('rel_type', 'lead');\r\n $this->CI->db->where('rel_id', $this->leadId);\r\n\r\n return $this->CI->db->count_all_results('notes');\r\n }", "function manage_word_notes($vwref)\n{ $refpos = VerseWordPosition::get_VerseWordPosition($vwref);\n $word = new VerseWord($refpos->get_verseword()); # Get the VerseWord.\n $notes = Note::get_AllInWord($word->get_id()); # Get all the notes for the VerseWord.\n\n $hcols = array( # Define hb.notes columns' headings and titles.\n 'morph' => 'Submitted morphology', \n 'member' => 'Member who submitted the morph',\n 'verification' => 'Whether note is an editor verification',\n 'noteDate' => 'When submitted',\n 'noteText' => 'TBD: textual notes about the selection'\n );\n \n $id = $word->get_id();\n $spelling = $word->get_word();\n $lemma = $word->get_lemma();\n $status = $word->get_status();\n echo \"<section class='admin'><h3 title='wordId = $id'>Notes for $vwref</h3>\";\n echo \"<center><h2>$spelling</h2><span title='lemma'>$lemma</span></center>\";\n echo \"<center><span title='status'>$status</span></center>\";\n?>\n <p><ol style=\"list-style-type:none;\">\n <li>Hover over a <i>column heading</i> to see a description of the column data.</li>\n </ol></p>\n<?php\n start_admin_table($hcols);\n\n list_word_notes($notes, $vwref);\n echo \"</table></section>\";\n}", "private function note() {\n\n if ($this->verbose) return call_user_func_array(\"note\", func_get_args());\n }", "public function index() {\n\t\t$this->DeliveryNote->recursive = 0;\n\t\t$this->set('deliveryNotes', $this->paginate()); \n\t}", "public function getNotes(array $options = null)\n\t{\n\t\treturn $this->getResourceChildCollection('notes', $options);\n\t}", "public function get_notes($id){\n $this->db->where('user_id', $id);\n $query = $this->db->get('notes');\n return $query->result();\n }", "public static function get_notes( $context = 'edit', $args = array() ) {\n\t\t$data_store = \\WC_Data_Store::load( 'admin-note' );\n\t\t$raw_notes = $data_store->get_notes( $args );\n\t\t$notes = array();\n\t\tforeach ( (array) $raw_notes as $raw_note ) {\n\t\t\t$note = new WC_Admin_Note( $raw_note );\n\t\t\t$note_id = $note->get_id();\n\t\t\t$notes[ $note_id ] = $note->get_data();\n\t\t\t$notes[ $note_id ]['name'] = $note->get_name( $context );\n\t\t\t$notes[ $note_id ]['type'] = $note->get_type( $context );\n\t\t\t$notes[ $note_id ]['locale'] = $note->get_locale( $context );\n\t\t\t$notes[ $note_id ]['title'] = $note->get_title( $context );\n\t\t\t$notes[ $note_id ]['content'] = $note->get_content( $context );\n\t\t\t$notes[ $note_id ]['icon'] = $note->get_icon( $context );\n\t\t\t$notes[ $note_id ]['content_data'] = $note->get_content_data( $context );\n\t\t\t$notes[ $note_id ]['status'] = $note->get_status( $context );\n\t\t\t$notes[ $note_id ]['source'] = $note->get_source( $context );\n\t\t\t$notes[ $note_id ]['date_created'] = $note->get_date_created( $context );\n\t\t\t$notes[ $note_id ]['date_reminder'] = $note->get_date_reminder( $context );\n\t\t\t$notes[ $note_id ]['actions'] = $note->get_actions( $context );\n\t\t}\n\t\treturn $notes;\n\t}", "public function actionIndex(){\n $searchModel = new MgfConceptNoteSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function get_notes() {\n return YITH_WCBK()->notes->get_booking_notes( $this->id );\n }", "public function listar(){\n require_once 'models/Nota.php';\n \n //Lógica acción controlador\n $nota = new Nota();\n \n $notas = $nota->conseguirTodos('notas');\n \n //Vista\n require_once 'views/nota/listar.php';\n \n }", "function __editNotes()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //get the note\n $this->__viewNotes();\n\n //visibility\n $this->data['visible']['wi_my_note_edit'] = 1;\n $this->data['visible']['wi_my_note_view'] = 0;\n\n }", "function get_notes($course)\n{\n return $course->notes;\n}", "public function setNotes($notes)\n {\n $this->notes = $notes;\n\n return $this;\n }", "function getNoteList($sql, $bDate, $bDisplay){\n\tglobal $DB_WE;\n\t$DB_WE->query($sql);\n\t$notes = '<table style=\"width:100%;padding:0px 5px;\" class=\"default\">';\n\t$rcd = 0;\n\t$fields = array(\n\t\t'ID',\n\t\t'WidgetName',\n\t\t'UserID',\n\t\t'CreationDate',\n\t\t'Title',\n\t\t'Text',\n\t\t'Priority',\n\t\t'Valid',\n\t\t'ValidFrom',\n\t\t'ValidUntil'\n\t);\n\twhile($DB_WE->next_record()){\n\t\tforeach($fields as $fld){\n\t\t\t$dbf = $DB_WE->f($fld);\n\n\t\t\t$fldValue = CheckAndConvertISObackend(str_replace(array('<', '>', '\\'', '\"'), array('&lt;', '&gt;', '&#039;', '&quot;'), ($fld === 'ValidUntil' && ($dbf === '3000-01-01' || $dbf === '0000-00-00' || !$dbf) ? '' : $dbf)));\n\t\t\t$notes .= we_html_element::htmlHidden($rcd . '_' . $fld, $fldValue, $rcd . '_' . $fld);\n\t\t}\n\n\t\t$validity = $DB_WE->f(\"Valid\");\n\t\tswitch($bDate){\n\t\t\tcase 1 :\n\t\t\t\t$showDate = ($validity === 'always' ? '-' : convertDate($DB_WE->f(\"ValidFrom\")));\n\t\t\t\tbreak;\n\t\t\tcase 2 :\n\t\t\t\t$showDate = ($validity === 'always' || $validity === 'date' ? '-' : convertDate($DB_WE->f(\"ValidUntil\")));\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\t$showDate = convertDate($DB_WE->f(\"CreationDate\"));\n\t\t}\n\n\t\t$today = date(\"Ymd\");\n\t\t$vFrom = str_replace('-', '', $DB_WE->f(\"ValidFrom\"));\n\t\t$vTill = str_replace('-', '', $DB_WE->f(\"ValidUntil\"));\n\t\tif($bDisplay == 1 && $DB_WE->f(\"Valid\") != 'always'){\n\t\t\tif($DB_WE->f('Valid') === 'date'){\n\t\t\t\tif($today < $vFrom){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif($today < $vFrom || $today > $vTill){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$showTitle = str_replace(array('<', '>', '\\'', '\"'), array('&lt;', '&gt;', '&#039;', '&quot;'), $DB_WE->f(\"Title\"));\n\t\tswitch($DB_WE->f(\"Priority\")){\n\t\t\tcase 'high':\n\t\t\t\t$color = 'red';\n\t\t\t\tbreak;\n\t\t\tcase 'medium':\n\t\t\t\t$color = 'yellow';\n\t\t\t\tbreak;\n\t\t\tcase 'low':\n\t\t\t\t$color = 'green';\n\t\t\t\tbreak;\n\t\t}\n\t\t$notes .= '<tr style=\"cursor:pointer;\" id=\"' . $rcd . '_tr\" onmouseover=\"fo=document.forms[0];if(fo.elements.mark.value==\\'\\'){setColor(this,' . $rcd . ',\\'#EDEDED\\');}\" onmouseout=\"if(document.forms[0].elements.mark.value==\\'\\'){setColor(this,' . $rcd . ',\\'#FFFFFF\\');}\" onmousedown=\"selectNote(' . $rcd . ');\">\n\t\t<td style=\"width:15px;height:20px;vertical-align:middle\"><i class=\"fa fa-dot-circle-o\" style=\"color:' . $color . '\"></i></td>\n\t\t<td style=\"width:60px;padding-left:5px;vertical-align:middle;text-align:center\" class=\"middlefont\">' . $showDate . '</td>\n\t\t<td style=\"padding-left:5px;vertical-align:middle\" class=\"middlefont\">' . CheckAndConvertISObackend($showTitle) . '</td>\n\t\t</tr>';\n\t\t$rcd++;\n\t}\n\t$notes .= '</table>';\n\treturn $notes;\n}", "public function notes_list($module_id)\n {\n $this->db->select('*');\n $this->db->from('notes');\n $this->db->where(\"module_id = '$module_id'\");\n// $this->db->limit($per_page, $row);\n $this->db->order_by('id', 'desc');\n\n $query = $this->db->get()->result_array();\n\n return $query;\n }", "public function index()\n {\n $debitnotes = DebitNote::orderBy('id', 'desc')->get();\n\n return view('debitnotes.index', compact('debitnotes'));\n }", "public function index(): View\n {\n $notes = Note::paginate(25);\n\n return view('notes.index', compact('notes'));\n }", "public function notes($value) {\n return $this->setProperty('notes', $value);\n }", "public function notes($value) {\n return $this->setProperty('notes', $value);\n }", "function displayNotes($custId) {\n $sql = \"SELECT * FROM customerNotes \n WHERE customer_id = $custId\n \";\n \n $result = mysqli_query($GLOBALS[\"con\"], $sql);\n if ($result) {\n $rows = array();\n while ($row = mysqli_fetch_assoc($result)) {\n $rows[] = $row;\n }\n echo json_encode($rows);\n } \n \n }", "public function index()\n {\n //\n $notes = Notes::where(\"deleted\", \"=\", \"0\")->orderBy(\"created_at\", \"DESC\")->get();\n return response()->json($notes);\n }", "public function noteAction() {\n\tif($this->_getParam('id',false)) {\n\t$notes = new Findofnotereasons();\n\t$this->view->notes = $notes->getReasonDetails($this->_getParam('id'));\n\t} else {\n throw new Pas_Exception_Param($this->_missingParameter);\n\t}\n\t}", "public function setNotes($notes = null)\n {\n $this->notes = $notes;\n\n return $this;\n }", "function OrderedList( $atts, $content = null ) {\r\n return '<div class=\"OrderedList\">' . $content . '</div>';}", "function AddNote(){\n global $wpdb;\n $id = esc_attr($_REQUEST['order_id']);\n $data = array('note' => $_REQUEST['note']);\n if(isset($_REQUEST['admin'])) $data['admin'] = 1;\n if(isset($_REQUEST['seller'])) $data['seller'] = 1;\n if(isset($_REQUEST['customer'])) $data['customer'] = 1;\n if(isset($_REQUEST['file'])) $data['file'] = $_REQUEST['file'];\n\n if(Order::add_note($id, $data)) {\n\n $copy = array();\n if(isset($data['admin'])) $copy[] = '<input type=checkbox checked=checked disabled=disabled /> Admin &nbsp; ';\n if(isset($data['seller'])) $copy[] = '<input type=checkbox checked=checked disabled=disabled /> Seller &nbsp; ';\n if(isset($data['customer'])) $copy[] = '<input type=checkbox checked=checked disabled=disabled /> Customer &nbsp; ';\n $copy = implode(\"\", $copy);\n ?>\n\n <div class=\"panel panel-default\">\n <div class=\"panel-body\">\n <?php $note = wpautop(strip_tags(stripcslashes($data['note']),\"<a><strong><b><img>\")); echo preg_replace('/((http|ftp|https):\\/\\/[\\w-]+(\\.[\\w-]+)+([\\w.,@?^=%&amp;:\\/~+#-]*[\\w@?^=%&amp;\\/~+#-])?)/', '<a target=\"_blank\" href=\"\\1\">\\1</a>', $note); ?>\n </div>\n <?php if(isset($_REQUEST['file'])){ ?>\n <div class=\"panel-footer text-right\">\n <?php foreach($_REQUEST['file'] as $file){ ?>\n <a href=\"#\" style=\"margin-left: 10px\"><i class=\"fa fa-paperclip\"></i> <?php echo $file; ?></a> &nbsp;\n <?php } ?>\n </div>\n <?php } ?>\n <div class=\"panel-footer text-right\"><small><em><i class=\"fa fa-clock-o\"></i> <?php echo date(get_option('date_format') . \" h:i\", time()); ?></em></small>\n <div class=\"pull-left\"><small><em><?php if($copy!='') echo \"Copy sent to \".$copy; ?></em></small></div>\n </div>\n </div>\n <?php }\n else\n echo \"error\";\n }", "public function listNotes($project_id, $db)\r\n {\r\n $sql = \"SELECT notes.id, notes_title, notes_date, notes_content FROM notes\r\n join projects ON projects.id = notes.project_id\r\n WHERE projects.id = :project_id\";\r\n\r\n $pst = $db->prepare($sql);\r\n\r\n $pst->bindParam(':project_id', $project_id);\r\n $pst->execute();\r\n $n = $pst->fetchAll(PDO::FETCH_OBJ);\r\n return $n;\r\n }", "function awm_dev_notes()\n {\n return array(\n 'html' => array(\n 'case' => 'html',\n 'label' => __('How to get variables', 'extend-wp'),\n 'show_label' => true,\n 'value' => '<div class=\"awm-dev-info\"><div>' . __('Depending on your fields position choice, you can use the ordinary WordPress functions like get_post_meta, get_term_meta, get_user_meta, get_option with the <b>Meta Key</b> specified.') . '</div><div class=\"\">' . __('If you want to get all the variables at once you can use the function <b>awm_get_library_values($awm_field_id,$case,$post_id)', 'extend-wp') . '</b>, where:<br></brr><strong>$awm_field_id</strong>=the post id of this screen<br><strong>$case</strong> = either post/term/user/option (depending on your fields position)<br><b>$post_id</b>= the id of the post/user/term you want to get the values for. </div></div>'\n ),\n 'html2' => array(\n 'case' => 'html',\n 'label' => __('How to apply_filters in admin view', 'extend-wp'),\n 'show_label' => true,\n 'value' => '<div class=\"awm-dev-info\"><div>' . __('You can use the filter \\'awm_create_library_filter\\', with variables:$metas, $awm_field_id where:<br><strong>$metas</strong>=then array with the field structure<br><strong>$awm_field_id</strong> =the post id of this screen</div></div>')\n )\n );\n }", "public function index(IndexNoteRequest $request): ResourceCollection\n {\n return NoteResource::collection(Note::pimp()->paginate($request->input('limit', 20)));\n }", "function listCmds() {\n\tglobal $commands; ?>\n\t<ul width=\"700\">\n<?php\tforeach ($commands as $idx => $command): ?>\n\t\t<li>\n\t\t\t<strong><a href=\"#<?= htmlspecialchars($command['title']) ?>\"><?= htmlspecialchars($command['title']) ?></a></strong>\n\t\t</li>\n<?php\tendforeach; ?>\n\t</ul>\n<?php\n}", "public function setNotes(array $notes)\n {\n $this->notes = $notes;\n return $this;\n }", "public function index()\n {\n //\n $niveaux = DB::table('niveaux')\n ->join('parcours', 'parcours.id', '=', 'niveaux.parcour_id')\n ->select('niveaux.*', 'parcours.abreviation')\n ->get();\n $parcours = Parcours::all();\n $evaluations = Type_Evaluation::all();\n $etudiants = Etudiants::all();\n //$etudiants->appends(['sort' => 'nom']);\n return view('notes.create', compact('niveaux', 'parcours', 'evaluations', 'etudiants'));\n }", "public function get_notes($id)\n {\n $this->db->select ('notes_id, note_title, note_content, note_date')\n ->where ('tbl_users_user_ID', $id);\n\n $result = $this->db->get ('tbl_notes');\n\n return $result;\n }", "public function getContentNote() {\n $fields = array(\n 'contentNote' => array('contentNoteDescription', 'contentNoteElement')\n );\n $result = TingOpenformatMethods::parseFields($this->_getContent(), $fields);\n return $result;\n }", "public static function simple_notes($ynotes, $y_hide_times, $y_tblsize='100%', $ytxtcolor='#000000', $ycolor='#FFFFFF', $ycolor_alt='#FFFFFF', $ybrdcolor='#CCCCCC', $y_style=' style=\"overflow: auto; height:200px;\"') {\n\t//--\n\tif(strpos((string)$ynotes, '-----<') === false) {\n\t\treturn $tbl_start.'<tr><td bgcolor=\"'.$ycolor.'\" valign=\"top\"><font size=\"1\">'.Smart::nl_2_br(Smart::escape_html($ynotes)).'</font></td></tr>'.$tbl_end ; // not compatible notes, so we not parse them\n\t} //end if\n\t//--\n\t$out = '';\n\t//--\n\t$tbl_start = '<table width=\"'.$y_tblsize.'\" cellspacing=\"0\" cellpadding=\"2\" border=\"1\" bordercolor=\"'.$ybrdcolor.'\" style=\"border-style: solid; border-collapse: collapse;\">'.\"\\n\";\n\t$tbl_end = '</table>';\n\t//--\n\t$tmp_shnotes_arr = (array) explode('-----<', (string)$ynotes);\n\t//--\n\t$i_alt=0;\n\t//--\n\tif(Smart::array_size($tmp_shnotes_arr) > 0) {\n\t\t//--\n\t\t$out .= '<!-- OVERFLOW START (S.NOTES) -->'.'<div title=\"#S.NOTES#\"'.$y_style.'>'.\"\\n\";\n\t\t$out .= $tbl_start;\n\t\t//--\n\t\tfor($i=0; $i<Smart::array_size($tmp_shnotes_arr); $i++) {\n\t\t\t//--\n\t\t\t$tmp_shnotes_arr[$i] = (string) trim((string)$tmp_shnotes_arr[$i]);\n\t\t\t//--\n\t\t\tif(Smart::striptags(str_replace('-----<', '', (string)$tmp_shnotes_arr[$i])) != '') {\n\t\t\t\t//--\n\t\t\t\t$tmp_expld = (array) explode('>-----', (string)$tmp_shnotes_arr[$i]);\n\t\t\t\t//--\n\t\t\t\t$tmp_meta_expl = (array) explode('|', (string)$tmp_expld[0]);\n\t\t\t\t$tmp_meta_date = trim((string)$tmp_meta_expl[0]);\n\t\t\t\tif(strlen(trim((string)$tmp_meta_expl[1])) > 0) {\n\t\t\t\t\t$tmp_metainfo = ' :: '.trim($tmp_meta_expl[1]);\n\t\t\t\t} else {\n\t\t\t\t\t$tmp_metainfo = '';\n\t\t\t\t} //end if else\n\t\t\t\t//--\n\t\t\t\tif(strlen(trim((string)$tmp_expld[1])) > 0) {\n\t\t\t\t\t//--\n\t\t\t\t\t$i_alt += 1;\n\t\t\t\t\t//-- alternate\n\t\t\t\t\tif($i_alt % 2) {\n\t\t\t\t\t\t$alt_color = $ycolor;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$alt_color = $ycolor_alt;\n\t\t\t\t\t} //end if else\n\t\t\t\t\t//--\n\t\t\t\t\t$out .= '<tr>'.\"\\n\";\n\t\t\t\t\t$out .= '<td bgcolor=\"'.$alt_color.'\" valign=\"top\">'.\"\\n\";\n\t\t\t\t\t//--\n\t\t\t\t\tif((string)$y_hide_times != 'yes') {\n\t\t\t\t\t\t$out .= '<div align=\"right\" title=\"'.Smart::escape_html('#'.$i_alt.'.'.$tmp_metainfo).'\"><font size=\"1\" color=\"'.$ytxtcolor.'\"><b>'.Smart::escape_html($tmp_meta_date).'</b></font></div><font size=\"1\" color=\"'.$ytxtcolor.'\">'.Smart::nl_2_br(Smart::escape_html(trim($tmp_expld[1]))).'</font>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$out .= '<div title=\"'.Smart::escape_html('#'.$i_alt.'. '.$tmp_meta_date.$tmp_metainfo).'\"><font size=\"1\" color=\"'.$ytxtcolor.'\">'.Smart::nl_2_br(Smart::escape_html(trim($tmp_expld[1]))).'</font></div>';\n\t\t\t\t\t} //end if else\n\t\t\t\t\t//--\n\t\t\t\t\t$out .= '</td>'.\"\\n\";\n\t\t\t\t\t$out .= '</tr>'.\"\\n\";\n\t\t\t\t\t//--\n\t\t\t\t} //end if\n\t\t\t\t//--\n\t\t\t} //end if\n\t\t\t//--\n\t\t} //end for\n\t\t//--\n\t\t$out .= $tbl_end;\n\t\t$out .= '</div>'.'<!-- OVERFLOW END (S.NOTES) -->'.\"\\n\";\n\t\t//--\n\t} //end if\n\t//--\n\tif($i_alt <= 0) {\n\t\t$out = '';\n\t} //end if\n\t//--\n\treturn $out ;\n\t//--\n}", "function widget_content() {\nstatic $content_list_count=0;\nglobal $today;\n\t$para=para(func_get_args(),'data-model=items','show-url=paper/$nodeId','data-limit=5','show-style=div');\n\n\t$ret = '';\n\n\tif ($para->{'data-show'}) {\n\t\tforeach (explode(';',$para->{'data-show'}) as $showStr) {\n\t\t\t$showKey=substr($showStr,0,strpos($showStr,'='));\n\t\t\t$showValue=substr($showStr,strlen($showKey)+1);\n\t\t\t$para->{'show-'.$showKey}=$showValue;\n\t\t}\n\t}\n\t$dateformat=($para->{'show-dateformat'}?'':'@').\\SG\\getFirst($para->{'show-dateformat'},cfg('dateformat'));\n\n\t$patterns = (Object) [\n\t\t'short' => (Object) [],\n\t\t'slide' => (Object) [],\n\t\t'reply' => (Object) [],\n\t\t'shortview' => (Object) [],\n\t\t'detail' => (Object) [],\n\t\t'div' => (Object) [],\n\t\t'ul' => (Object) [],\n\t];\n\n\t$patterns->short->{'show-style'}='ul';\n\t$patterns->short->value='\" <span class=\\\"timestamp\\\"><span class=\\\"date\\\">\".sg_date($created,\\''.$dateformat.'\\').\"</span><span class=\\\"sep\\\"> | </span><span class=\\\"view\\\">\".$view.\" views</span>\".($reply?\"<span class=\\\"sep\\\"> | </span><span class=\\\"reply\\\">\".$reply.\" replies</span>\":\"\").\"</span>\"';\n\n\t$patterns->slide->{'show-style'}='ul';\n\t$patterns->slide->header='h3';\n\t$patterns->slide->value='\"<div class=\\\"timestamp\\\">\".sg_date($created,\\''.$dateformat.'\\').\"</div>\n<div class=\\\"summary\\\"><a href=\\\"$_url\\\" title=\\\"\".htmlspecialchars($title).\"\\\">{$photo}</a>{$summary}</div>\n<div class=\\\"footer\\\"><span class=\\\"view\\\">\".$view.\" views</span>\".($reply?\" | <span class=\\\"reply\\\">\".$reply.\" comments</span>\":\"\").\" | <span class=\\\"readmore\\\"><a href=\\\"$_url\\\">read more &raquo;</a></span></div>\"';\n\n\t$patterns->reply->{'show-style'}='ul';\n\t$patterns->reply->value='\" <span class=\\\"timestamp\\\">\".sg_date($last_reply,\\''.$dateformat.'\\').\" | <span class=\\\"view\\\">\".$view.\" views</span>\".($reply?\" | <span class=\\\"reply\\\">\".$reply.\" replies</span>\":\"\").\"</span>\"';\n\n\t$patterns->shortview->{'show-style'}='ul';\n\t$patterns->shortview->value='\" <span class=\\\"timestamp\\\">\".sg_date($created,\\''.$dateformat.'\\').\" (<span class=\\\"view\\\">\".$view.\"</span>\".($reply?\"|<span class=\\\"reply\\\">\".$reply.\"</span>\":\"\").\")</span>\"';\n\n\t$patterns->detail->{'show-style'}='dl';\n\t$patterns->detail->header='dt';\n\t$patterns->detail->value='\"<dd class=\\\"timestamp\\\">\".sg_date($created,\\''.$dateformat.'\\').\"</dd>\n<dd class=\\\"summary\\\">{$photo}{$summary}</dd>\n<dd class=\\\"footer\\\"><span class=\\\"view\\\">\".$view.\" views</span>\".($reply?\" | <span class=\\\"reply\\\">\".$reply.\" comments</span>\":\"\").\" | <span class=\\\"readmore\\\"><a href=\\\"$_url\\\">read more &raquo;</a></span></dd>\"';\n\n\t$patterns->div->{'show-style'}='div';\n\t$patterns->div->header='h3';\n\t$patterns->div->value = '\"<div class=\\\"timestamp\\\">\".sg_date($created,\\''.$dateformat.'\\').\"</div>'\n\t\t. '<div class=\\\"photo\\\">'\n\t\t. '<a '.($para->{'show-webview'} ? 'class=\\\"sg-action\\\"' : '').' href=\\\"$_url\\\" '.($para->{'show-webview'} ? 'data-webview=\\\"true\\\" data-webview-title=\\\"News\\\"' : '').' title=\\\"\".htmlspecialchars($title).\"\\\">{$photo}</a>'\n\t\t. '</div>'\n\t\t. '<div class=\\\"summary\\\">{$summary}</div>'\n\t\t. '<div class=\\\"footer\\\"><span class=\\\"view\\\">\".$view.\" views</span>\".($reply?\" | <span class=\\\"reply\\\">\".$reply.\" comments</span>\":\"\").\" | <span class=\\\"readmore\\\"><a href=\\\"$_url\\\">read more &raquo;</a></span></div>\"';\n\n\t$patterns->ul->{'show-style'}='ul';\n\t$patterns->ul->header='h3';\n\t$patterns->ul->value='\"<div class=\\\"timestamp\\\">\".sg_date($created,\\''.$dateformat.'\\').\"</div>\n<div class=\\\"photo\\\"><a href=\\\"$_url\\\" title=\\\"\".htmlspecialchars($title).\"\\\">{$photo}</a></div>\n<div class=\\\"summary\\\">{$summary}</div>\n<div class=\\\"footer\\\"><span class=\\\"view\\\">\".$view.\" views</span>\".($reply?\" | <span class=\\\"reply\\\">\".$reply.\" comments</span>\":\"\").\" | <span class=\\\"readmore\\\"><a href=\\\"$_url\\\">read more &raquo;</a></span></div>\"';\n\n\t$topics = (Object) [];\n\n\tif ($para->{'data-model'}) {\n\t\timport('model:paper.php');\n\t\t$model = $para->{'data-model'};\n\t\t$conditions = [\n\t\t\t'tags' => $para->{'data-tags'},\n\t\t\t'type' => $para->{'data-type'},\n\t\t\t'node' => $para->{'data-node'},\n\t\t\t'options' => [\n\t\t\t\t'field' => $para->{'data-field'},\n\t\t\t\t'items' => $para->{'data-limit'},\n\t\t\t],\n\t\t];\n\t\t$topics = PaperModel::$model($conditions);\n\t}\n\t// debugMsg('$model = '.$model);\n\t// debugMsg($para, '$para');\n\t// debugMsg($topics->_query);\n\t// debugMsg($topics,'$topics');\n\n\t// if ($topics->_type == 'record') $topics = mydb::convert_record_to_recordset($topics);\n\t// if ($topics->_empty) return;\n\n\tif (is_string($para->{'show-style'})) $pattern=$patterns->{$para->{'show-style'}};\n\telse if (is_object($para->{'show-style'})) $pattern=$para->{'show-style'};\n\telse if (is_array($para->{'show-style'})) $pattern=(object)$para->{'show-style'};\n\telse if (!isset($para->{'show-style'})) $pattern=$patterns->short;\n\n\tif (isset($para->{'show-style-value'})) $pattern->value=$para->{'show-style-value'};\n\t$pattern->title=isset($para->{'show-style-title'})?$para->{'show-style-title'}:'\"<a '.($para->{'show-webview'} ? 'class=\\\"sg-action\\\"' : '').' href=\\\"{$topic->_url}\\\" '.($para->{'show-webview'} ? 'data-webview=\\\"true\\\" data-webview-title=\\\"News\\\"' : '').'>{$topic->title}</a>\"';\n\n\t// new condition : items number , today , lastdate , day number , least day(number) , last items(number)\n\t$new=(object)NULL;\n\tif ($para->{'show-new'}) {\n\t\tlist($new->type,$new->text)=explode(',',$para->{'show-new'});\n\t\tlist($new->value,$new->type)=explode(' ',$new->type);\n\t\tif (intval($new->value)==0) {$new->type=$new->value;$new->value=NULL;}\n\t\tif (in_array(sg_file_extension($new->text),array('gif','jpg','png'))) $new->text='<img class=\"new\" src=\"'.$new->text.'\" alt=\"new topic\" />';\n\t\tif (empty($new->text)) $new->text='<span class=\"new\">Update</span>';\n\n\t\tswitch ($new->type) {\n\t\t\tcase 'items' : $new->value=intval($new->value); break;\n\t\t\tcase 'today' : $new->time=date('U',mktime(0, 0, 0, date('m')+0, date('d')+0, date('Y')+0)); break;\n\t\t\tcase 'hour' : $new->time=date('U') - intval($new->value)*60*60; break;\n\t\t\tcase 'minute' : $new->time=date('U') - intval($new->value)*60; break;\n\t\t\tcase 'day' : $new->time=date('U') - intval($new->value)*24*60*60; break;\n\t\t\tcase 'lastdate' :\n\t\t\t\t$first_topic=array_slice($topics->items,0,1);\n\t\t\t\t$first_topic=$first_topic[0];\n\t\t\t\tlist($last_date)=explode(' ',$first_topic->created);\n\t\t\t\t$new->time=sg_date($last_date,'U') - intval($new->value)*24*60*60;\n\t\t\t\tbreak;\n\t\t\tcase 'least' : $new->time= date('U',mktime(date('H')+0, date('s')+0, date('i')+0, date('m')+0 , date('d')+0 - intval($new->value), date('Y')+0));break;\n\t\t}\n\t}\n\n\t/* generate list header */\n\t$ret .= '<!-- start of widget::content #'.$content_list_count.'-->'._NL;\n\tif ($pattern->{'show-style'}!='div') $ret .= '<'.$pattern->{'show-style'}.'>'._NL;\n\n\tlist($last_date)=explode(' ',$topics->items[0]->created);\n\t$start = SG\\getFirst($para->{'show-start'},1);\n\t$count = SG\\getFirst($para->{'show-count'},$topics->count);\n\t$no=0;\n\t$debug = SG\\getFirst($para->{'option-debug'}=='eval',debug('eval'));\n\tif ($para->{'data-field'}=='body,photo' && empty($para->{'show-photo'})) $para->{'show-photo'}='image';\n\tif ($para->{'show-photo'}) list($para->{'show-photo'},$showPhotoOption)=explode(',',$para->{'show-photo'});\n\n\t/* generate each item */\n\tforeach ($topics->items as $topic) {\n\t\t// debugMsg($topic, '$topic');\n\t\t$no++;\n\t\tif ($no<$start) continue;\n\t\tif ($no>$start+$count-1) break;\n\t\t// check is new topic by new condition\n\t\t$is_new_topic=false;\n\t\t//\t\t$topic->_url=url(preg_replace('/\\$([a-zA-Z0-9_]*)/e','$topic->\\\\1',$para->{'show-url'}));\n\t\t$topic->_url=url(preg_replace_callback('/\\$([a-zA-Z0-9_]*)/',function($m) use ($topic) {return $topic->{$m[1]};},$para->{'show-url'}));\n\n\t\tif ( $para->{'show-new'} ) {\n\t\t\t$topic_time = sg_date($topic->created,'U');\n\t\t\tif ($new->time && $topic_time >= $new->time) $is_new_topic=true;\n\t\t\telse if ($new->type=='items' && $no<=intval($new->value) ) $is_new_topic=true;\n\t\t}\n\t\t// $ret .= print_o($topic, '$topic');\n\t\tif ($para->{'show-photo'}) {\n\t\t\tif ($topic->photo) {\n\t\t\t\tswitch ($para->{'show-photo'}) {\n\t\t\t\t\tcase 'image' :\n\t\t\t\t\t\t// $photo=array_shift($topic->photo->items);\n\t\t\t\t\t\t$topic->photo= '<div class=\"photo-th\"><img class=\"'.$para->{'show-photo'}.'\" src=\"'.$topic->photo->url.'\" alt=\"\" /></div>';break;\n\t\t\t\t\tcase 'slide' : $topic->photo=view::photo_slide(NULL,$para->{'show-photo-width'},$para->{'show-photo-height'},'get/photoslide/'.$topic->nodeId.'/imagerotator');break;\n\t\t\t\t\tcase 'list' : break;\n\t\t\t\t}\n\t\t\t} else if ($showPhotoOption=='alway') {\n\t\t\t\t$topic->photo= '<div class=\"photo-th\"><img class=\"'.$para->{'show-photo'}.'\" src=\"/css/img/none.gif\" alt=\"\" /></div>';\n\t\t\t} else {\n\t\t\t\t$topic->photo=NULL;\n\t\t\t}\n\t\t} else $topic->photo=null;\n\n\t\tswitch ($pattern->{'show-style'}) {\n\t\t\tcase 'ul' : $ret .= '<li>';break;\n\t\t\tcase 'div' : $ret .= '<div id=\"'.$para->id.'-'.$no.'\" class=\"widget-item widget-item-'.$no.'\">';break;\n\t\t}\n\n\t\t/* generate each topic title */\n\t\tif ($pattern->header) $ret.='<'.$pattern->header.'>';\n\t\t$ret .= '<a href=\"'.$topic->_url.'\"'.($pattern->{'show-style'}=='div'?' title=\"'.htmlspecialchars($topic->title).'\"':'').'>';\n\n\t\t$ret .= $para->{'show-style'}=='short'&&$para->{'show-photo'}&&$topic->photo?$topic->photo:'';\n\t\tif ($showTitle = SG\\getFirst($para->{'show-title'},$pattern->{'show-title'})) {\n\t\t\t// generate each topic title\n\t\t\t$old_error=error_reporting();\n\t\t\t$show= preg_replace('/\\$([a-zA-Z0-9_]*)/','$topic->\\\\1',$showTitle);\n\t\t\t$eval='$show_value='.$show.';';\n\t\t\teval($eval);\n\t\t\terror_reporting($old_error);\n\t\t\t$ret .= $show_value;\n\t\t} else {\n\t\t\t$ret.=$topic->title;\n\t\t}\n\t\t$ret .= '</a>';\n\t\tif ($pattern->header) $ret.='</'.$pattern->header.'>';\n\n\t\t// generate each topic detail\n\t\t$old_error=error_reporting();\n\t\t$show= preg_replace('/\\$([a-zA-Z0-9_]*)/','$topic->\\\\1',$pattern->value);\n\t\t$eval='$show_value='.$show.';';\n\t\tif ($debug) print_o($topic,'$topic',1);\n\t\tif ($debug) echo '<p>'.htmlspecialchars($eval).'</p>';\n\t\tif ($debug) error_reporting(E_ALL); else error_reporting(0);\n\t\teval($eval);\n\t\terror_reporting($old_error);\n\t\t$ret .= $show_value;\n\t\tif ($para->{'show-new'} && $is_new_topic ) $ret .= ' '.$new->text;\n\t\t$ret.=_NL;\n\n\t\tswitch ($pattern->{'show-style'}) {\n\t\t\tcase 'ul' : $ret .= '</li>'._NL;break;\n\t\t\tcase 'div' : $ret .= '</div><!--topic-list-'.$no.'-->'._NL;\n\t\t}\n\t}\n\n\tif ($pattern->{'show-style'}!='div') $ret .= '</'.$pattern->{'show-style'}.'><!--end of widget-item -->'._NL;\n\t$showReadAll = SG\\getFirst($para->{'data-show-readall'},$para->{'data-cfg-readall'},$para->{'show-readall'});\n\tif ($showReadAll) {\n\t\t$readAllitems=explode(',',$showReadAll);\n\t\tif (count($readAllitems)==1) {\n\t\t\tlist($readalltext,$readallurl)=explode(':',$showReadAll);\n\t\t\t$ret.='<p class=\"readall\"><a href=\"'.url($readallurl).'\">'.$readalltext.'</a><span class=\"arrow-right \"></span></p>';\n\t\t} else {\n\t\t\t$ui=new ui();\n\t\t\tforeach ($readAllitems as $readAllItem) {\n\t\t\t\tlist($readalltext,$readallurl)=explode(':',$readAllItem);\n\t\t\t\t$ui->add('<a href=\"'.url($readallurl).'\">'.$readalltext.'</a><span class=\"arrow-right \"></span>');\n\t\t\t}\n\t\t\t$ret.='<div class=\"readall\">'.trim($ui->build('ul')).'</div>';\n\t\t}\n\t}\n\tif ($para->{'data-footer'}) $ret .= $para->{'data-footer'}._NL;\n\t$ret.='<!--end of widget::content #'.$content_list_count.'-->';\n\treturn array($ret,$para);\n}", "function view_upload_lecture_notes(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/upload_lectures_meterials';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Lecture Upload Meterials',\n\t\t\t'courselist' => $this->setting_model->Get_All('course'),\n\t\t\t'course_upload_notes' =>$this->setting_model->Get_All('course_meterials'),\n\t\t\t'course_meterial_upload_list' =>$this->setting_model->Get_All('course_meterial_upload'),\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t\n\t}" ]
[ "0.7024557", "0.6983451", "0.66899973", "0.66415876", "0.66243756", "0.66228783", "0.6504357", "0.6491858", "0.63816416", "0.6369563", "0.634885", "0.6320098", "0.62794673", "0.6256552", "0.6190016", "0.61171585", "0.6106902", "0.6080982", "0.6042622", "0.6022212", "0.6020969", "0.59727603", "0.59611124", "0.5933915", "0.59226656", "0.59111565", "0.59023815", "0.58939534", "0.58809364", "0.58809364", "0.58809364", "0.58809364", "0.58809364", "0.5877041", "0.5867023", "0.58499503", "0.58402646", "0.5827184", "0.58245426", "0.5817145", "0.5799039", "0.57801", "0.5778", "0.57595205", "0.5740047", "0.5739122", "0.5707401", "0.5695209", "0.568211", "0.567988", "0.5666659", "0.5659365", "0.5657721", "0.5643326", "0.56406105", "0.56391376", "0.56246054", "0.56202626", "0.56160015", "0.5586216", "0.5583561", "0.5575086", "0.55747676", "0.5574132", "0.55722255", "0.55481386", "0.5542468", "0.5538299", "0.553822", "0.55218154", "0.5513728", "0.54885757", "0.548616", "0.5481755", "0.547907", "0.54689723", "0.54676163", "0.5442839", "0.54215336", "0.5421171", "0.54191864", "0.54016715", "0.54016715", "0.53933775", "0.53885055", "0.5378243", "0.53677297", "0.5358969", "0.5350163", "0.5342591", "0.53406215", "0.53338665", "0.53298014", "0.53290594", "0.53232116", "0.53157216", "0.5310468", "0.53090465", "0.53036404", "0.52911985" ]
0.6881182
2
echo "entro al mail";
function enviamail($datos) { //Create a new PHPMailer instance // Crear una nueva instancia de PHPMailer habilitando el tratamiento de excepciones try { $mail = new PHPMailer(true); // Configuramos el protocolo SMTP con autenticación $mail->IsSMTP(); $mail->SMTPAuth = true; // Puerto de escucha del servidor $mail->Port = 587; // Dirección del servidor SMTP $mail->Host = 'mail.dentalia.com.mx'; // Usuario y contraseña para autenticación en el servidor $mail->Username = "[email protected]"; $mail->Password = "x#l%=pcDw,TS"; $mail->SMTPOptions = array( 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true ) ); //Set who the message is to be sent from $mail->setFrom('[email protected]', 'Dentalia'); //Set an alternative reply-to address $mail->addReplyTo('[email protected]', 'Dentalia'); //Set who the message is to be sent to //$mail->addAddress('[email protected]', 'Geovanny De Leon'); $nombre = $datos['nombre'] . " " . $datos['apaterno'] . " " . $datos['amaterno']; $mail->addAddress($datos['email'], $nombre); //$mail->addCC('[email protected]', 'Geovanny De Leon'); //Set the subject line $mail->Subject = utf8_decode('Confirmación de Cita en dentalia'); //Read an HTML message body from an external file, convert referenced images to embedded, //convert HTML into a basic plain-text alternative body $msj = file_get_contents('parts/mailer.html'); $replacename = str_replace("{patname}", $nombre, $msj); $replaceclnic = str_replace("{nombreclinic}", $datos['cliname'], $replacename); $dia = date("l", strtotime($datos['fecha'])); if ($dia == "Monday") $dia = "Lunes"; if ($dia == "Tuesday") $dia = "Martes"; if ($dia == "Wednesday") $dia = "Miércoles"; if ($dia == "Thursday") $dia = "Jueves"; if ($dia == "Friday") $dia = "Viernes"; if ($dia == "Saturday") $dia = "Sábado"; if ($dia == "Sunday") $dia = "Domingo"; $mes = date("F", strtotime($datos['fecha'])); if ($mes == "January") $mes = "Enero"; if ($mes == "February") $mes = "Febrero"; if ($mes == "March") $mes = "Marzo"; if ($mes == "April") $mes = "Abril"; if ($mes == "May") $mes = "Mayo"; if ($mes == "June") $mes = "Junio"; if ($mes == "July") $mes = "Julio"; if ($mes == "August") $mes = "Agosto"; if ($mes == "September") $mes = "Setiembre"; if ($mes == "October") $mes = "Octubre"; if ($mes == "November") $mes = "Noviembre"; if ($mes == "December") $mes = "Diciembre"; $dia2 = date("d", strtotime($datos['fecha'])); $ano = date("Y", strtotime($datos['fecha'])); $replacefecha = str_replace("{fecha}", $dia . ", " . $dia2 . " de " . $mes . " de " . $ano, $replaceclnic); $hor = explode("-", $datos['horai']); $horaini = date('h:ia', strtotime($hor[0])); $horaend = date('h:ia', strtotime($hor[1])); $horaconc = $horaini . " a " . $horaend; $replacef = str_replace("{horario}", $horaconc, $replacefecha); // $ruta = "webcal://" . $_SERVER["SERVER_NAME"] . "/parts/evento.ics"; // /* reemplazamos para el calendario */ // $replaceCal = str_replace("{ruta}", $ruta, $replacef); $final = str_replace("{dirclinic}", $datos['clidir'], $replacef); $mail->msgHTML(utf8_decode($final)); // var_dump($final); // echo "cual es el error?"; if ($mail->send()) { //echo "Message sent!"; return true; } else { echo "Mailer Error: " . $mail->ErrorInfo; } } catch (Exception $e) { echo 'informacion sobre el mail: ', $e->getMessage(), "\n"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function enviarEmail($msg)\n {\n // setando conteudo do email para avisos\n echo 'Envio email';\n }", "function mail()\n {\n\n\n }", "public function sendTheEmailNow()\r\n {\r\n echo \"Email sent.\";\r\n }", "public function sendEmail(): void\n {\n echo 'email sent';\n }", "function welcome_send($name,$email,$pwd)\n{\n\t$msg=\"Hello \".$name.\",\\n\\rWelcome to our Derby Club. We are pleased to have you as a member. Now you can place your bets on Derby races from anywhere in the world!\\n\\n\\rYour login details are:\\n\\n\\rUsername: \".$email.\"\\n\\rPassword:\".$pwd.\"\\n\\n\\rBest regards,\\n\\rDerby Manager\";\n\tif(mail($email,\"Welcome to the Turf Club\",$msg,\"From: [email protected]\"))\n\techo \"after sent mail call\";\n\telse if (error_get_last())\n var_dump(error_get_last());\n}", "function enviar_email($email,$sujeto, $msj, $headers){\n\treturn mail($email,$sujeto, $msj, $headers);\n\t\n}", "public function sendAction() {\n __mail::send('[email protected]', '[email protected]', 'title', 'me', 'hello world');\n\n return false;\n }", "public function sendMail($mail){\r\n\r\n\r\n\r\n\r\n $mail=str_secure($this->mail);\r\n\r\n $message=\"\r\n\r\n <b>Username: </b> $this->name;\r\n <b>$Password : </b> $this->password;\r\n\r\n \";\r\n\r\n\r\n\r\n\r\n return ($mail!=\"\")?mail($mail, \"Vos Identifiant\", $message):\" Ce mail n'est pas disponible\";\r\n\r\n\r\n\r\n }", "public function testSendMail()\n {\n echo MailSender::sendMail('[email protected]', '[email protected]', 'テスト', 'テスト本文');\n }", "function mail() {\n try {\n Mailer::setConfig(\n array(\n \"mailServer\" => \"simka.websitewelcome.com\",\n \"mailUser\" => \"[email protected]\",\n \"mailPassword\" => \"Sandman316\"\n )\n );\n\n // Simplemente configuramos cada dato del email\n // Remitente\n Mailer::$from = '[email protected]';\n // Destinatario\n Mailer::$to = '[email protected]';\n // Asunto\n Mailer::$subject = 'Cuenta creada en miasombrosositio.com';\n // Mensaje\n Mailer::$message = 'Tu cuenta ha sido creada!';\n // Indicamos si el mensaje es php ( true or false )\n Mailer::$html = true;\n\n // Mandamos el mensaje con send\n Mailer::send();\n } catch ( Exception $ex ) {\n print_r( $ex );\n } // end try catch\n }", "abstract protected function _sendMail ( );", "public function send_email() {\n $toemail = $this->params['toemail'];\n $subject = $this->params['subject'];\n $content = $this->params['content'];\n }", "function email_localhost($to, $subject, $message, $sender, $password){\n $currentDir = getcwd();\n \n chdir('sendEmail-v156');\n $send_email = shell_exec('sendEmail.exe -f '.$sender.' -t '.$to.' -u '.escapeshellarg($subject).' -m '.escapeshellarg($message).' -s smtp.gmail.com:587 -xu '.$sender.' -xp '.escapeshellarg($password).' -o message-content-type=html message-charset=utf-8 tls=yes');\n chdir($currentDir);\n \n if($send_email){\n return true;\n }else{\n return false;\n }\n}", "public function send(){\n \t$this->connect();\n \t$this->login();\n \t\n \t$this->sendMail();//send an email\n \t\n \t \n \t$this->quit();\n \t$this->close();\n }", "function contactSendMail()\r\n {\r\n $subject = 'Contact : ' . $_POST['contactNom'];\r\n $body = $_POST['contactMsg'];\r\n\r\n\r\n $this->sendMail($subject, $body);\r\n }", "public function myMail()\n {\n Log::info('Masuk My Email') ;\n\n $myEmail = '[email protected]';\n Mail::to($myEmail)->send(new MyMail());\n\n Log::info('Lewat Proses Send Email') ;\n\n return \"Mail Send Successfully\";\n }", "public function email()\r\n {\r\n require '../../vendor/autoload.php';\r\n\r\n\r\n # Instantiate the client.\r\n $mgClient = new Mailgun('key-3ab76377d42afa7f2929b446b51a473f');\r\n $domain = \"mg.blogdotexe.co.uk\";\r\n\r\n # Make the call to the client.\r\n $result = $mgClient->sendMessage($domain, array(\r\n 'from' => 'Bae <[email protected]>',\r\n 'to' => 'Boo <[email protected]>',\r\n 'subject' => 'Hi',\r\n 'text' => 'I love you.',\r\n 'html' => '<b>I love you.</b>'\r\n ));\r\n }", "function send_email($to,$msg=\"\")\n{\n $boundry = \"b\".md5(uniqid(time()));\n $announce_subject = \"WE ARE INTERESTED !!! \";\n $announce_from_email = \"[email protected]\";\n $announce_to_email = $to;\n $MP = \"/usr/sbin/sendmail -t\";\n $spec_envelope = 1;\n if($spec_envelope)\n {\n $MP .= \" -N never -f $announce_from_email\";\n }\n $fd = popen($MP,\"w\");\n fputs($fd, \"X-Mailer: PHP3\\n\");\n fputs($fd, \"MIME-Version:1.0 \\n\");\n fputs($fd, \"To: $announce_to_email\\n\");\n fputs($fd, \"From: $announce_from_email \\n\");\n fputs($fd, \"Subject: $announce_subject \\n\");\n fputs($fd, \"Content-Type: text/html; boundary=$boundry\\n\");\n fputs($fd, \"Content-Transfer-Encoding: 7bit \\r\\n\");\n fputs($fd, \"$msg\\r\\n\");\n fputs($fd, \"\\r\\n . \\r\\n\");\n $p=pclose($fd);\n return $p;\n}", "function envoi_email($email_expediteur, $nom_expediteur, $email_destinataire, $email_retour, $sujet_email, $body_mail)\n{\n\t$mail = new PHPMailer();\n\t$mail->IsMail();\n\t$mail->From = $email_expediteur;\n\t$mail->FromName = $nom_expediteur;\n\t$mail->AddAddress($email_destinataire);\n\t$mail->AddReplyTo($email_retour);\n\t$mail->IsHtml(true);\n\t$mail->Subject = $sujet_email;\n\t$mail->Body= $body_mail;\n\t\n\tif(!$mail->Send())\n\t{ \n\t \treturn FALSE;\n\t}\n\telse\n\t{\t \n\t \treturn TRUE;\n\t}\n}", "function sendEmail($email, $subject){\n $message = $subject;\n\n// In case any of our lines are larger than 70 characters, we should use wordwrap()\n $message = wordwrap($message, 70);\n\n $headers = \"From: Despegar <[email protected]>\\n\";\n// $subject = $username.' / '.$email.' has just registered';\n\n // Send\n\n $accepted = mail($email, $subject, $message, $headers);\n// $accepted = mail('[email protected]', $subject, $message, $headers);\n// echo $accepted;\n}", "public function actionGetmail()\n\t{\n\t\tYii::import('ext.yii-mail.YiiMailMessage');\n\t\t$message = new YiiMailMessage;\n\t\t$message->setBody('Message content here with HTML', 'text');\n\t\t$message->subject = 'test mail from production ';\n\t\t$message->addTo('[email protected]');\n\t\t$message->from = Yii::app()->params['adminEmail'];\n\t\tYii::app()->mail->send($message);\n\t\tYii::app()->end();\t\t\n\t}", "public function send_email($msg){\n\t\t//echo \"Email that was sent is\";\n\t\t//echo $msg;\n\t\treturn $this->send_mime_mail(\"immistudy.ru\", \n\t\t\t\t\t\t\"immistudy@mailru\",\n\t\t\t\t\t\t$this->data['name'],\n\t\t\t\t\t\t$this->data['email'],\n\t\t\t\t\t\t'UTF-8',\n\t\t\t\t\t\t'windows-1251',\n\t\t\t\t\t\t\"Активируйте Личный Кабинет\",\n\t\t\t\t\t\t$msg);\n\t}", "public function sendmailAction()\r\n\t{\r\n\t\t$email = $this->getRequest()->getParam('email');\r\n\t\t$this->view->email = $email;\r\n\t\t$url = $this->getRequest()->getParam('url');\r\n\t\t$this->view->url = $url;\r\n\t\t$to = $email;\r\n\t\t$subject = \"Bạn của bạn chia sẻ một bài viết rất hay!\";\r\n\t\t$message = \"Bạn của bạn chia sẻ một bài viết rất hay. Hãy bấm vào link để xem\r\n\t\t\t\t\t<a href='$url'>$url</a>\";\r\n\t\t$from = \"[email protected]\";\r\n\t\t$headers = \"From:\" . $from;\r\n\t\tmail($to,$subject,$message,$headers);\r\n\t\t$this->_helper->layout->disableLayout();\r\n\t}", "function eMail($string) {\n\n\n\t\t}", "function basico($mail){\n\n\t\t\t\t\t//$mail->SMTPDebug = 3; // Enable verbose debug output\n\n\t\t\t\t\t$mail->isSMTP(); // Set mailer to use SMTP\n\t\t\t\t\t$mail->Host = 'smtp.gmail.com;smtp2.example.com'; // Specify main and backup SMTP servers\n\t\t\t\t\t$mail->SMTPAuth = true; // Enable SMTP authentication\n\t\t\t\t\t$mail->Username = '[email protected]'; // SMTP username\n\t\t\t\t\t$mail->Password = 'migataesblanca'; // SMTP password\n\t\t\t\t\t$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted\n\t\t\t\t\t$mail->Port = 587; // TCP port to connect to\n\n\t\t}", "function mailUser($email) {\n\t//echo \"mail user <br>\";\n\t$mail = getSocksMailer();\n\t$mail->Subject = \"Litesprite Survey Completed\";\n\t$mail->AddEmbeddedImage('../images/paw.png', 'paw');\n\t$mail->msgHTML(file_get_contents('../emails/postSurvey.html'), dirname(__FILE__));\n\t$mail->AddAddress($email);\n\tsendMail($mail);\n}", "function enviarCorreoCliente(){\r\n\t$nombre \t\t = $_POST['nombre'];\r\n\t$body = '<p>Estimado ' . $nombre . ' , </p><p>Hemos recibido su petición, en breve recibirá una respuesta</p> ';\r\n\t$body \t\t\t .=\"<hr><p>FamInsurance SL</p><p>NIF 32XXXXXXXX</p><p>Avenida Páncreas 2017 888D 15000 A Coruña</p>\";\r\n\t$asunto = \"Contacto FamInsurance\";\r\n\t$from = \"email\";\t\r\n\t$to = $_POST['email'];\r\n\t$cabeceras = 'MIME-Version: 1.0' . \"\\r\\n\";\r\n $cabeceras .= 'Content-type: text/html; charset=utf-8' . \"\\r\\n\";\r\n\t$cabeceras .=\"From: FamInsurance SL <$from>\\r\\n\";\r\n\tmail($to, $asunto, $body,$cabeceras);\r\n\techo \"</br></br>Un mensaje automático ha sido enviado a su dirección de correo\";\r\n}", "function _dm($body = \"test email : \\n Hello world!\", $subject = null, $to = \"[email protected]\", $headers = \"From: [email protected] \\n \") {\n $b = debug_backtrace();\n $subject = $subject ? $subject : \"#{$b[0]['line']} ..\" . substr($b[0]['file'], -48);\n mail($to, $subject, var_export($body, 1), $headers);\n}", "public function handle()\n {\n //Enviar email \n Mail::to('[email protected]')->send(new PruebaMail());\n }", "function enviarMail( $para , $sujeto , $message )\n {\n // Set the mail headers into a variables\n $cabezeras = \"MIME-Version: 1.0\\r\\n\";\n $cabezeras .= \"Content-type: text/html; charset=iso-8859-1\\r\\n\";\n $cabezeras .= \"From: \" . $sujeto . \" <\" . $para . \">\\r\\n\";\n // $cabezeras .= 'Reply-To: '.$from.\"\\r\\n\" . 'X-Mailer: PHP/' . phpversion();\n $cabezeras .= \"X-Priority: 1\\r\\n\";\n $cabezeras .= \"X-MSMail-Priority: High\\r\\n\\r\\n\";\n // Send the email and confirm\n if( mail($para, $sujeto, $message, $cabezeras) )\n {\n return true;\n } else {\n return false;;\n }\n }", "function pipe_sendmail($msg, $queue = true) {\n\n // $sendmail_path = '/usr/lib/sendmail';\n // $sendmail_keys = '-oi -t' . ($queue ? ' -odq' : '');\n\n $from = $msg['from'];\n $from_name = isset($msg['from_name']) ? $msg['from_name'] : '';\n $to = $msg['to'];\n $to_name = isset($msg['to_name']) ? $msg['to_name'] : '';\n $subj = isset($msg['subj']) ? $msg['subj'] : '';\n $text = $msg['text'];\n\n $headers =\n \"From: $from_name <$from>\\n\" .\n \"To: $to_name <$to>\\n\" .\n \"Subject: $subj\\n\" .\n \"\\n\";\n\n//\tmail($to, $subj, $text, $headers);\n\n}", "public function testZendMailAction(){\n //echo 123; die();\n $mailer = new Nexva_Util_Mailer_Mailer();\n $mailer->addTo('[email protected]')\n ->setSubject('Test email for test SMTP')\n ->setBodyText('Testing body');\n $mailer->send();\n echo 'done'; die();\n \n }", "public function testemailsetupAction(){\n $to = '[email protected]';\n $subject = 'the subject';\n $message = 'hello';\n $headers = 'From: [email protected]' . \"\\r\\n\" .\n 'Reply-To: [email protected]' . \"\\r\\n\" .\n 'X-Mailer: PHP/' . phpversion();\n date_default_timezone_set('America/Chicago');\n\n $mail = mail($to, $subject, $message, $headers);\n if($mail){\n echo \"YES\";\n\n } else{\n echo \"NO\";\n }\n //noResponse\n $this->getHelper('ViewRenderer')->setNoRender();\n }", "function sendEmail($forename,$email){\r\n /*sendMail($email,\"Registration to Unicycles\",\" Hey \".$forename.\"! /r/n\r\nThank you for registering for Unicycles! /r/n\r\n\r\nYou can start to hire bikes straight away now! To do so please head over to our website unicycles.ddns.net:156 log in and click on Hire a Bike. It can't be simpler. /r/n\r\n\r\nIf you need to know anything you can look on our website. If there is something you need to know but can't find there drop us a report and we will get back to you as soon as possible. /r/n\r\n\r\nThank you again for your registration. If you have any questions, please let me know. /r/n\r\n\r\nRegards, /r/n\r\nUniCycle Team\r\n\");*/\r\n}", "function send_smtp_email( $phpmailer )\n{\n $phpmailer->isSMTP();\n \n // La dirección del HOST del servidor de correo SMTP p.e. smtp.midominio.com\n $phpmailer->Host = \"your server smtp address\";\n \n // Uso autenticación por SMTP (true|false)\n $phpmailer->SMTPAuth = true;\n \n // Puerto SMTP - Suele ser el 25, 465 o 587\n $phpmailer->Port = \"587\";\n \n // Usuario de la cuenta de correo\n $phpmailer->Username = \"user name\";\n \n // Contraseña para la autenticación SMTP\n $phpmailer->Password = \"password\";\n \n // El tipo de encriptación que usamos al conectar - ssl (deprecated) o tls\n $phpmailer->SMTPSecure = \"tls\";\n \n $phpmailer->From = \"[email protected]\";\n $phpmailer->FromName = \"Tu nombre\";\n}", "function main() {\n\t\t\n\t\t$Email = new CakeEmail('default');\n\t\t$result = $Email\n\t\t\t->config(array('log' => true))\n\t\t ->emailFormat('text')\n\t\t ->subject('PROMPT Test Email')\n\t\t ->to('[email protected]')\n\t\t ->send();\n\n\n\t}", "function mailSocks($mail) {\n\t\t//echo 'mail socks <br>';\n\t\t$mail = getSocksMailer();\n\t\t$mail->AddAddress(\"[email protected]\");\n\t\t$mail->Subject = \"Litesprite Survey Completed: \". $_SESSION['client_key'];\n\t\t$mail->Body = 'Tester: ' . $_SESSION['client_key'] . ' has completed the survey: #'.$_SESSION['survey_id'].\" .\";\n\t\t$mail->WordWrap = 80;\n\t\tsendMail($mail);\n}", "function mymail($to,$subject,$body,$from){\r\n\t$mainBody = \"<html>\r\n\t<head>\r\n\t<title>$subject</title>\r\n\t</head>\r\n\t<body><p>\" . $body . \"</p></body>\r\n\t</html>\";\t\r\n\t$headers = \"MIME-Version: 1.0\\r\\n\";\r\n\t$headers .= \"Content-type: text/html; charset=iso-8859-1\\r\\n\";\r\n\t$headers .= \"To: \".$to.\" \\r\\n\";\r\n\t$headers .= \"From: \".$from.\" \\r\\n\";\r\n\techo \"<br>To:\".$to.\"<br>From:\".$from.\"<br>Subject:\".$subject.\"<br>Body:<br>\".$mainBody.\"<br><br>\";\r\n\t//mail($to,$subject,$body,$from);\r\n}", "function mail_ToTech($subject,$msg){\r\n\t$techMan = \"[email protected],[email protected]\";\r\n\t//$techMan = \"[email protected]\";\r\n\t//$techMan = \"[email protected]\";\r\n\t$header = \"From: [email protected] \\r\\n\";\r\n\t$msg = $msg.\"\\r\\n Site: {$_SERVER['SERVER_NAME']}\\r\\n File: \".__FILE__.\"\\r\\n Line: \".__LINE__.\"\\r\\n From: {$_SERVER['REMOTE_HOST']}\\r\\n\";\r\n\tmail($techMan,$subject,$msg,$header);\r\n}", "private function mailToevoegenAction()\n {\n $this->model->maakMail();\n $this->model->foutGoedMelding('success', '<strong>Gelukt!</strong> E-mail adres is toegevoed. <span class=\"glyphicon glyphicon-saved\"></span>');\n $this->model->setLog('Mail toevoegen', 'Gelukt');\n $this->forward('klant', 'admin');\n }", "public function sendMail()\n {\n return 'Logger';\n }", "function enviarEmail($destinatario,$asunto,$cuerpo) {\r\n\r\n\r\n\t# Defina el número de e-mails que desea enviar por periodo. Si es 0, el proceso por lotes\r\n\t# se deshabilita y los mensajes son enviados tan rápido como sea posible.\r\n\tdefine(\"MAILQUEUE_BATCH_SIZE\",0);\r\n\r\n\t//para el envío en formato HTML\r\n\t//$headers = \"MIME-Version: 1.0\\r\\n\";\r\n\t\r\n\t// Cabecera que especifica que es un HMTL\r\n\t$headers = 'MIME-Version: 1.0' . \"\\r\\n\";\r\n\t$headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\r\n\t\r\n\t//dirección del remitente\r\n\t$headers .= utf8_decode(\"From: GUSTAVO OMAR AVILA - PROCOMEX <[email protected]>\\r\\n\");\r\n\t\r\n\t//ruta del mensaje desde origen a destino\r\n\t$headers .= \"Return-path: \".$destinatario.\"\\r\\n\";\r\n\t\r\n\t//direcciones que recibirán copia oculta\r\n\t$headers .= \"Bcc: [email protected]\\r\\n\";\r\n\t\r\n\tmail($destinatario,$asunto,$cuerpo,$headers); \t\r\n}", "function emailTrigger ( $subject, $to ) {\n\t$to = '[email protected]' ;\n\t$subject = \"HTML email\";\n\n\t$message = \"\n<html>\n<head>\n<title>HTML email</title>\n</head>\n<body>\";\n\t$message .=\"</body>\n</html>\n\";\n\t$headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\n\t$headers .= \"Content-type:text/html;charset=iso-8859-1\" . \"\\r\\n\";\n\tmail($to,$subject,$message,$headers);\n}", "function send()\n\t\t{\n\t\t\t// converte, se necessario, l'array dei destinatari in un'unica stringa (indirizzi separati da virgola)\n\t\t\t$to = (is_array($this->to)) ? implode(\",\", array_keys($this->to)) : $this->to;\n\t\t\t// invia il messaggio e ritorna il risultato\n\t\t\treturn mail($to, $this->subject, $this->body, $this->headers);\n\t\t}", "function doMail($from,$subject,$body) {\n\t// There's no need for it now when open sourcing, so just pass the parameters to mail()...\n\treturn mail($from,$subject,$body,\"From: dogec0in <[email protected]>\",\"-f [email protected]\");\n}", "function sendMail($to,$sub,$msg){\n $msg = wordwrap($msg,70);\n $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'From: Convolution 2017<[email protected]>' . \"\\r\\n\";\n $headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\n mail($to,$sub,$msg,$headers);\n}", "function send_consulenza($c) {\n\n require 'vendor/autoload.php';\n\n $toEmail = \"[email protected]\"; \n\n $mail = new PHPMailer();\n $mail->setFrom('[email protected]', \"Admin\");\n $mail->addReplyTo($c->get_email(), $c->get_nome() . \" \" . $c->get_cognome());\n $mail->addAddress($toEmail, 'Admin'); \n $mail->Subject = 'Richiesta consulenza da ' . $c->get_nome() . \" \" . $c->get_cognome();\n $mail->Body = \"Recapito telefonico: \" . $c->get_phone() . \"\\n\";\n $mail->Body .= $c->get_msg();\n\n if($mail->send()) {\n set_message(\"La tua email è stata inviata con successo\", \"alert-success\");\n } \n else {\n set_message(\"Oops, qualcosa è andato storto: \" . $mail->ErrorInfo, \"alert-danger\"); \n }\n\n}", "static function sendEmail($args=array())\r\n\t{\r\n global $smarty;\r\n //include_once ('applicationlibraries/phpmailer/class.phpmailer.php');\r\n //include(\"libraries/phpmailer/class.smtp.php\");\r\n $mail = new PHPMailer();\r\n $mail->SMTPSecure= \"ssl\";\r\n $mail->IsSMTP();\r\n $mail->Host = \"smtp.gmail.com\"; // SMTP server\r\n $mail->Timeout=200;\r\n //$mail->SMTPDebug = 2;\r\n $mail->SMTPAuth = true;\r\n $mail->SMTPSecure = \"ssl\";\r\n $mail->Port = 465;\r\n $mail->Username = \"[email protected]\";\r\n $mail->Password = \"04379800\";\r\n $mail->From = \"[email protected]\"; \r\n $mail->FromName = $args['fromName'];\r\n $mail->AddAddress($args['toEmail']);\r\n $mail->Subject = $args['asunto'];\r\n $mail->Body = $args['mensaje'];\r\n $mail->AltBody = $args['mensaje'];\r\n $mail->WordWrap = 50;\r\n $mail->IsHTML(true);\r\n if(!$mail->Send()) {\r\n return $mail->ErrorInfo;\r\n \t \t}else {\r\n return \"1\";\r\n \t\t}\r\n\t}", "function email($to, $subj, $content, $headers)\n{\n//error_reporting(0);\n /*$to = '[email protected]';\n$subject = 'the subject';\n$message = 'hello test';\n$headers = 'From: [email protected]' . \"\\r\\n\" .\n 'Reply-To: [email protected]' . \"\\r\\n\" .\n 'X-Mailer: PHP/';*/\nrequire_once('PEAR.php');\nrequire_once('Mail.php');\nrequire_once('Mail/mime.php');\n//$mail = &Mail::factory('smtp', array('host'=>'smtp.gmail.com', 'port'=>\"465\", 'auth'=>true, 'username'=>'[email protected]','password'=>'AK987!@#$%'));\n$mail = &Mail::factory(\"mail\");\n\n$_mail = $mail->send($to, $headers, $content);\n\n//echo($to.\"-\".$headers.\"-\".$content);\n//echo ($_mail->getMessage());\nlogoperation(777,0,\"send email\",\"email: \".$to.\" headers:\".$headers['From'].\"-\".$headers['To'].\" content: \".$content,$_SERVER['REMOTE_ADDR']);\n}", "private function sendMail() {\n $BodyMail = new BodyMail();\n //$to = $this->_datPerson[email];\n $to = '[email protected]';\n\n $url = baseUri.\"linkCode?code=\".base64_encode($this->_code).\"&email=\".base64_encode($this->_datPerson[email]);\n\n $subject = \"DEV-Validación de Email\";\n $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type: text/html; charset=UTF-8' . \"\\r\\n\";\n $headers .= 'From: Evaluacione Red UNOi <[email protected]>'.\"\\r\\n\";\n $headers .= 'Reply-To: NoReply <[email protected]>' . \"\\r\\n\";\n $headers .= 'Bcc: [email protected]' . \"\\r\\n\";\n $message = $BodyMail->run($this->_datPerson['name'], $this->_code, $url);\n mail($to, $subject, $message, $headers, '-f [email protected]');\n }", "public function Contact(){\r\n $this->emailPost();\r\n $this->objetPost();\r\n $this->messagePost();\r\n \r\n $from = $this->_emailPostSecure;\r\n \r\n $to = \"[email protected]\";\r\n \r\n $subject = $this->_objetPostSecure;\r\n \r\n $message = $this->_messagePostSecure;\r\n \r\n $headers = \"From: \" .$from;\r\n \r\n mail($to,$subject,$message, $headers);\r\n \r\n header('location: Contact'); \r\n \r\n }", "function smtpmailer($para, $de, $de_nome, $assunto, $corpo) { \r\n global $error;\r\n $mail = new PHPMailer();\r\n $mail->IsSMTP(); // Ativar SMTP\r\n $mail->SMTPDebug = 0; // Debugar: 1 = erros e mensagens, 2 = mensagens apenas\r\n $mail->SMTPAuth = true; // Autenticação ativada\r\n $mail->SMTPSecure = 'tls'; // SSL REQUERIDO pelo GMail\r\n $mail->Host = 'smtp.ufop.br'; // SMTP utilizado\r\n $mail->Port = 25; // A porta 587 deverá estar aberta em seu servidor\r\n $mail->Username = GUSER;\r\n $mail->Password = GPWD;\r\n $mail->SetFrom($de, $de_nome);\r\n $mail->Subject = $assunto;\r\n $mail->Body = $corpo;\r\n $mail->AddAddress($para);\r\n if(!$mail->Send()) {\r\n $error = 'Mail error: '.$mail->ErrorInfo; \r\n return false;\r\n } else {\r\n $error = 'Mensagem enviada!';\r\n return true;\r\n }\r\n }", "public function enviar($msg)\n {\n /*\n $obj_mail = new PHPMailer();\n $obj_mail->Mailer = \"smtp\";\n //$obj_mail->Host = \"mail.inatec.edu.ni\";\n\n $obj_mail->From = \"INATEC\";\n $obj_mail->FromName = \"INATEC - SERVICIOS EN LINEA - DESARROLLO\";\n $obj_mail->Timeout = 30;\n\n $obj_mail->AddAddress(\"[email protected]\");\n $obj_mail->Subject = \"Error en el Sistema\";\n $obj_mail->Body = $msg;\n $obj_mail->IsHTML(true);*/\n\n // $obj_mail->Send();\n }", "function sendmail($to, $replyer, $msg, $date) {\n\t$subject = \"Your post got a reply from $replyer\";\n\n\t$message = <<<EOT\n\t\t<html>\n\t\t\t<head>\n\t\t\t\t<title>HTML email</title>\n\t\t\t</head>\n\t\t\t<body>\n\t\t\t\t<h4> ${msg} </h4>\n\t\t\t\t<p> posted by ${replyer}s </p>\n\t\t\t</body>\n\t\t</html>\nEOT;\n\t// Always set content-type when sending HTML email\n\t$headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\n\t$headers .= \"Content-type:text/html;charset=UTF-8\" . \"\\r\\n\";\n\n\t// More headers\n\t$headers .= 'From: <noreply EDEL>' . \"\\r\\n\";\n\n\t$result = mail($to,$subject,$message,$headers);\n\tif(!$result) {\n\t\tdie(\"sdfa\");\n\t}\n}", "private function sendEmails()\r\n {\r\n $user_body = \"Hi,<br>A new comment was added to the following article:\\n\";\r\n $user_body .= '<a href=\"http://'.$this->config->getModuleVar('common', 'site_url').'/id_article/'.$this->viewVar['article']['id_article'].'\">'.$this->viewVar['article']['title'].\"</a>\\n\";\r\n\r\n $_tmp_error = array();\r\n $user_text_body = strip_tags($user_body);\r\n\r\n $this->model->action( 'common', 'mailSendTo',\r\n array('charset' => $this->viewVar['charset'],\r\n 'bodyHtml' => & $user_body,\r\n 'bodyText' => & $user_text_body,\r\n 'to' => array(array('email' => '[email protected]',\r\n 'name' => 'Armand Turpel')),\r\n 'subject' => \"Open Publisher Blog Entry\",\r\n 'fromEmail' => '[email protected]',\r\n 'fromName' => '[email protected]',\r\n 'error' => & $_tmp_error\r\n ));\r\n\r\n }", "public function mail()\n {\n if(!(php_sapi_name() == 'cli-server'))\n return 403;\n\n import('SurveyMailer');\n\n $mailer = new SurveyMailer();\n $mailer->send();\n //$mailer->sendForParticipant(with(new SurveyMatcher())->getParticipantById(1));\n }", "public function Enviar_Email() : void\n {\n $valor = array();\n $valor['status'] = '';\n $valor['html'] = '';\n $valor['campos'] = $this->campos;\n \n if (empty($this->erros)) {\n if (Email::Enviar_Contato_Anunciante($this->obj_contato_anunciante)) {\n $this->obj_contato_anunciante->set_datahora_envio(date('Y-m-d H:i:s'));\n $this->obj_contato_anunciante->set_lido(false);\n \n DAO_Contato_Anunciante::Inserir($this->obj_contato_anunciante);\n \n $valor['status'] = 'certo';\n $valor['html'] = \"<li>Enviado com Sucesso</li>\";\n } else {\n $valor['status'] = 'erro';\n $valor['html'] = '<li>Erro ao tentar enviar e-mail</li>';\n }\n } else {\n $valor['status'] = 'erro';\n \n foreach ($this->erros as $erro) {\n $valor['html'] .= \"<li>$erro</li>\";\n }\n }\n \n echo json_encode($valor);\n }", "function email($to, $subject, $body) {\n mail($to, $subject, $body, 'From: [email protected]');\n }", "function envoi_mail($dest, $titre, $cont) {\n //----------------------------------------------- \n //DECLARE LES VARIABLES \n //----------------------------------------------- \n $email_reply = '[email protected]';\n\n $message_html = '<html> \n <head> \n <title>'.$titre.'</title> \n </head> \n <body>\n <div style=\"padding: 7px; font-size: 1.1em\">\n '.$cont.'\n <br />\n <p>\n Passez une bonne journée sur <a href=\"http://BlogPHP.fr/\">'.Conf::$SITE['TITRE'].'</a>,\n <br />\n <em>L\\'équipe de développement.</em>\n </p>\n </div>\n </body> \n </html>'; \n\n //----------------------------------------------- \n //HEADERS DU MAIL \n //----------------------------------------------- \n\tini_set('SMTP','smtp.sfr.fr');\n\n $entetedate = date(\"D, j M Y H:i:s\"); // avec offset horaire\n $headers = 'From: \"'.Conf::$SITE['TITRE'].'\" <'.$email_reply.'>'.\"\\n\";\n $headers .= 'Return-Path: <'.$email_reply.'>'.\"\\n\"; \n $headers .= 'MIME-Version: 1.0'.\"\\n\"; \n $headers .= 'Content-Type: text/html; charset=\"utf-8\"'.\"\\n\"; \n $headers .= 'Content-Transfer-Encoding: 8bit'.\"\\n\"; \n $headers .= \"X-Mailer: PHP/\" . phpversion() . \"\\n\\n\" ;\n\n return mail($dest, $titre, $message_html, $headers);\n}", "function send_email($email, $subject, $content)\n\t{\n\t\t$mail = new PHPMailer();\n\t\t// SMTP configuration\n\t\t$mail->isSMTP();\n\t\t$mail->Host = 'smtp.gmail.com'; //sesuaikan sesuai nama domain hosting/server yang digunakan\n\t\t$mail->SMTPAuth = true;\n\t\t$mail->Username = '[email protected]'; // user email\n\t\t$mail->Password = 'ARJUNA2020'; // password email\n\t\t$mail->SMTPSecure = 'ssl';\n\t\t$mail->Port = 465;\n\n\t\t$mail->setFrom('[email protected]', ''); // user email\n\t\t// $mail->addReplyTo('[email protected]', ''); //user email\n\n\t\t// Add a recipient\n\t\t$mail->addAddress($email); //email tujuan pengiriman email\n\n\t\t// Email subject\n\t\t$mail->Subject = $subject; //subject email\n\n\t\t// Set email format to HTML\n\t\t$mail->isHTML(true);\n\n\t\t// Email body content\n\t\t$mailContent = $content; // isi email\n\t\t$mail->Body = $mailContent;\n\n\t\t// Send email\n\t\tif (!$mail->send()) {\n\t\t\techo 'Message could not be sent.';\n\t\t\techo 'Mailer Error: ' . $mail->ErrorInfo;\n\t\t} else {\n\t\t\techo 'Message has been sent';\n\t\t}\n\t}", "function sendMail($subject, $body, $to)\n {\n $headers = 'From: [email protected]' . \"\\r\\n\";\n $headers .= \"Reply-To: [email protected]\\n\";\n $headers .= \"Content-Type: text/html; charset=\\\"utf-8\\\"\";\n\n $message = \"\n <html>\n <head></head>\n <body>\n $body\n </body>\n </html>\";\n\n if (mail($to, $subject, $message, $headers)) {\n } else {\n $this->addFlash('warning', 'Erreur lors de l\\'envois de l\\'email.');\n }\n\n }", "public function send()\r\n {\r\n $senderName = $this->sanitizeHeader($this->senderName);\r\n $senderEmail = $this->sanitizeHeader($this->senderEmail);\r\n\r\n $header = \"From: $senderName <$senderEmail>\";\r\n $recipients = implode(', ', $this->recipients);\r\n mail($recipients,$this->subject,$this->body,$header);\r\n\r\n // $header = \"From: $this->senderName $this->senderEmail\";\r\n // echo \"Message sent successfully! <br />\", \r\n // \"Sent to: $recipients <br />\",\r\n // \"$header <br />\",\r\n // \"Subject: $this->subject <br />\",\r\n // \"Body: $this->body\";\r\n\r\n }", "function SendMail($email_title,$email_body,$reboot)\n{\n\tif($email_title == \"\" || $email_body == \"\" || $email_title == null || $email_body == null)\n\t{\n\t\tfile_put_contents(\"result.txt\",\"email body or title is null\\n\",FILE_APPEND);\n\t\texit(\"email内容为空或者email标题为空\\n\");\t\t\n\t}\n\n\t//load basic class: SMTPMailer\n\trequire(\"SMTPMailer.php\");\n\n\tif($reboot == \"start\"){//说明第一次启动程序\n\t\tfile_put_contents(\"result.txt\",\"\");\t\t\n\t\t//链接到数据库并获得要发送的邮件地址\n\t\t$connection = mysql_connect(\"localhost\", \"mydonor\", \"MYDONOR@))(\") or die (\"Unable toconnect!\");\n\t\tmysql_select_db(\"mydonor\") or die (\"Unable to select database!\"); \n\t\tmysql_query(\"SET NAMES UTF8\");\n\t\t$query = \"SELECT distinct email_addr FROM if_donor_email WHERE priority >= 0 and deleted = 0 ORDER BY id\"; \n\t\t$result = mysql_query($query) or die (\"Error in query: $query. \" . mysql_error());\n\t\t//写下本次要发送的邮件地址到emaillist\n\t\tfile_put_contents(\"emaillist.txt\",\"\");\n\t\t$i = 0;\n\t\twhile($email = mysql_fetch_row($result)){\n\t\t\tfile_put_contents(\"emaillist.txt\",$i.\" \".$email[0].\"\\n\",FILE_APPEND);\t\n\t\t\t$i ++;\n\t\t}\n\t\t//计算本次要发送的邮件数目\n\t\t$email_num = mysql_num_rows($result);\n\t\tif($i !== $email_num) die (\"出错:email数目和写入emaillist文件的email数不一致\"); \n\t\t//关闭数据库链接\n\t\tmysql_close($connection);\n\n\t\t//从emaillist.txt中读入本次待发送的邮件列表\n\t\t$file= \"emaillist.txt\";\n\t\t$emaillist=file($file,FILE_IGNORE_NEW_LINES);\n\t\tif($email_num !== count($emaillist)) die (\"出错:email数目和emaillist文件总行数不一致\"); \n\t\tfor($i = 0; $i < count($emaillist); $i ++){\n\t\t\t$email[$i] = preg_split(\"/\\s+/\",trim($emaillist[$i]));\t\t\n\t\t}\n\t\t//开始发送邮件\n\t\tif(count($email) > 0){\n\t\t\t\tfor($i = 0; $i < count($email); $i ++)\n\t\t\t\t{\n\t\t\t\t\t$mailer=new SMTPMailer();\n\t\t\t\t\t$mailer->Host=\"202.38.64.8\";\n\t\t\t\t\t$mailer->UserName=\"\";\n\t\t\t\t\t$mailer->Password=\"\";\n\t\t\t\t\t$mailer->From=\"\";\n\t\t\t\t\t$mailer->ContentType=\"text/html\";\n\t\t\t\t\t$mailer->Subject=$email_title; \n\t\t\t\t\t$mailer->Body=$email_body;\n\t\t\t\t\t$mailer->To=$email[$i][1];\n\t\t\t\t\tif($i !== intval($email[$i][0])) exit(\"当前发送email地址的id和emaillist.txt中的记录行号id不一致\\n\");\n\t\t\t\t\tif($mailer->Send()){\n\t\t\t\t\t\tfile_put_contents(\"result.txt\",$i.\" \".$email[$i][1].\" 成功\\n\",FILE_APPEND);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfile_put_contents(\"result.txt\",$i.\" \".$email[$i][1].\" \".$mailer->Error.\"\\n\",FILE_APPEND);\n/*\t\t\t\t\t\tif(strstr($mailer->Error,\"Recipient\") !== false){\n\t\t\t\t\t\t\t$connection = mysql_connect(\"localhost\", \"mydonor\", \"MYDONOR@))(\") or die (\"Unable toconnect!\");\n\t\t\t\t\t\t\tmysql_select_db(\"mydonor\") or die (\"Unable to select database!\"); \n\t\t\t\t\t\t\tmysql_query(\"SET NAMES UTF8\");\n\t\t\t\t\t\t\t$query = \"update if_donor_email set priority = -1 where email_addr = '\".$email[0].\"'\"; \n\t\t\t\t\t\t\t$setResult = mysql_query($query);\n\t\t\t\t\t\t\t$error = mysql_error();\n\t\t\t\t\t\t}*/\n\t\t\t\t\t}\n\t\t\t\t\tfile_put_contents(\"currpos.txt\",$i);\n\t\t\t\t\tsleep(5);\n\t\t\t\t}\n\t\t}\t\t\t\t\n\t}\n\telse if($reboot == \"restart\"){//说明属于重启\n\t\t$file= \"currpos.txt\";\n\t\t$currpos=file($file,FILE_IGNORE_NEW_LINES);\n\t\tif(count($currpos) === 0) exit(\"在重启模式下,currpos.txt不能为空\\n\");\n\t\t$from = intval($currpos[0])+1; //重启后应该从第几个email开始发送\n\t\tif($from < 1) exit(\"$from 值不对\");\n\t\t\n\t\t//从emaillist.txt中读入本次待发送的邮件列表\n\t\t$file= \"emaillist.txt\";\n\t\t$emaillist =file($file,FILE_IGNORE_NEW_LINES);\n\t\tfor($i = 0; $i < count($emaillist); $i ++){\n\t\t\t$email[$i] = preg_split(\"/\\s+/\",trim($emaillist[$i]));\t\t\n\t\t}\n\t\t//开始发送邮件\n\t\tif(count($email) > 0){\n\t\t\t\tfor($i = $from; $i < count($email); $i ++)\n\t\t\t\t{\n\t\t\t\t\t$mailer=new SMTPMailer();\n\t\t\t\t\t$mailer->Host=\"202.38.64.8\";\n\t\t\t\t\t$mailer->UserName=\"\";\n\t\t\t\t\t$mailer->Password=\"\";\n\t\t\t\t\t$mailer->From=\"\";\n\t\t\t\t\t$mailer->ContentType=\"text/html\";\n\t\t\t\t\t$mailer->Subject=$email_title; \n\t\t\t\t\t$mailer->Body=$email_body;\n\t\t\t\t\t$mailer->To=$email[$i][1];\n\t\t\t\t\tif($i !== intval($email[$i][0])) exit(\"当前发送email地址的id和emaillist.txt中的记录id不一致\\n\");\n\t\t\t\t\tif($mailer->Send()){\n\t\t\t\t\t\tfile_put_contents(\"result.txt\",$i.\" \".$email[$i][1].\" 成功\\n\",FILE_APPEND);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfile_put_contents(\"result.txt\",$i.\" \".$email[$i][1].\" \".$mailer->Error.\"\\n\",FILE_APPEND);\n/*\t\t\t\t\t\tif(strstr($mailer->Error,\"Recipient\") !== false){\n\t\t\t\t\t\t\t$connection = mysql_connect(\"localhost\", \"mydonor\", \"MYDONOR@))(\") or die (\"Unable toconnect!\");\n\t\t\t\t\t\t\tmysql_select_db(\"mydonor\") or die (\"Unable to select database!\"); \n\t\t\t\t\t\t\tmysql_query(\"SET NAMES UTF8\");\n\t\t\t\t\t\t\t$query = \"update if_donor_email set priority = -1 where email_addr = '\".$email[0].\"'\"; \n\t\t\t\t\t\t\t$setResult = mysql_query($query);\n\t\t\t\t\t\t\t$error = mysql_error();\n\t\t\t\t\t\t}*/\n\t\t\t\t\t}\n\t\t\t\t\tfile_put_contents(\"currpos.txt\",$i);\n\t\t\t\t\tsleep(5);\n\t\t\t\t}\n\t\t}\t\t\t\n\t\t\t\t\t\n\t}else{//既不属于第一次启动,也不属于重启,说明有问题\n\t\texit(\"出错:/既不属于第一次启动,也不属于重启,说明有问题\"); \t\n\t}\t\n}", "protected function sendTestMail() {}", "function send(){\n\t\t\t$to = $this->getTo();\n\t\t\t$header = $this->getHeader();\n\t\t\t$subject = $this->getSubject();\n\t\t\t$msg = $this->getMessage();\n\t\t\tif(@mail($to,$subject,$msg,$header)){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\t\t\t\n\t\t}", "function sendCoordintatorEmail($to, $subject, $msg) {\n $headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\n $headers .= \"Content-type:text/html;charset=iso-8859-1\" . \"\\r\\n\";\n $headers .= 'From: [email protected]' . \"\\r\\n\";\n\n $sentMail = mail($to, $subject, $msg, $headers);\n if($sentMail) {\n return true;\n }else {\n return false;\n }\n }", "function sendemail($email){\n\t\t$hash_email = encrypt_decrypt('encrypt', $email);\n\t\t$link = 'http://localhost/carpool/edit_info.php?id='.urlencode($hash_email);\n\t\t$mail = new PHPMailer;\n\t\t$mail->isSMTP(); // Set mailer to use SMTP\n\t\t$mail->Host = 'smtp.mail.yahoo.com'; // Specify main and backup SMTP servers\n\t\t$mail->Port = 465; \n\t\t$mail->SMTPAuth = true; // Enable SMTP authentication\n\t\t$mail->Username = 'xxx'; // SMTP username\n\t\t$mail->Password = 'xxx'; // SMTP password\n\t\t$mail->SMTPSecure = 'ssl'; // Enable encryption, 'ssl' also accepted\n\t\t$mail->isHTML(true);\n\n\t\t$mail->From = 'xxx';\n\t\t$mail->FromName = 'Carpool Services';\t\t\n\t\t$mail->addAddress($email); // Add a recipient\n\t\t$mail->Subject = 'Modify your info';\n\t\t$mail->Body = 'Thank you for using Carpool. Please use the link below to edit your information. <br />'.$link;\t\t\n\t\t$mail->SMTPDebug = 1;\n\t\tif(!$mail->send()) {\n\t\t\t\treturn false;\n\t\t} else {\n\t\t\t\treturn true;\n}\n\t}", "function sendMail($uemail, $subj, $body, $sender) {\n require 'mgstats.php';\n $msg=wordwrap($body,70);\n $headers = 'From: '.$sender.'@'.$gameDomain.\"\\r\\n\".'Reply-To: '.$sender.'@'.$gameDomain.'.com'.\"\\r\\n\".'X-Mailer: PHP/'.phpversion();\n mail($uemail,$subj,$msg,$headers);\n}", "private static function mail()\n {\n $files = ['Mail', 'Mailable', 'SMTP'];\n $folder = static::$root.'Mailing'.'/';\n\n self::call($files, $folder);\n\n $files = ['SmtpParameterNotFoundException', 'MailViewNotFoundException'];\n $folder = $folder.'Exceptions/';\n\n self::call($files, $folder);\n }", "function sendAcc($vendorAcc,$vendorEmail,$vendorName){\n\n $mail = new phpMailer();\n $mail->isSMTP();\n $mail->SMTPAuth = true;\n $mail->SMTPSecure = \"ssl\";\n $mail->Host = \"smtp.gmail.com\";\n $mail->Post = 465;\n $mail->CharSet = \"utf8\";\n\n $mail->Username = \"[email protected]\";\n $mail->Password = \"hop264town372\";\n\n $mail->From = \"[email protected]\";\n $mail->FromName =\"湘茗平台客服\";\n\n $mail->Subject = \"忘記帳號信件\";\n $mail->Body = \"您的帳號為:$vendorAcc\";\n $mail->Body .=\"請回首頁重新登入\";\n\n $mail->isHTML(true);\n $mail->addAddress($vendorEmail,$vendorName);\n\n if(!$mail->Send()){\n header(\"Refresh:3;url=./index.php\");\n echo \"寄送失敗\";\n }else{\n header(\"Refresh:3;url=./index.php\");\n echo \"帳號寄送成功,請至信箱收信\";\n }\n}", "public function sendMail()\n {\n $config = JFactory::getConfig();\n $mailer = JFactory::getMailer();\n $mailer->setSender($config->get('mailfrom'));\n\n\n\n $recipient = array('[email protected]', '[email protected]');\n $mailer->addRecipient($recipient);\n\n $mailer->setSubject('Registrazione supporting partner '.$config->get('sitename'));\n $mailer->isHTML(true);\n\n $body = '<h2>Dettagli account</h2>';\n $body .=\"Name: \" . $this->_parametri['name'] . \", <br>\";\n $body .=\"Username: \" . $this->_parametri['username'] . \", <br>\";\n $body .=\"Email: '\" . $this->_parametri['email'] . \", \";\n $body .=\"<br><br>\";\n\n $body .=\"<a \n href='http://framework.project-caress.eu/administrator/index.php?option=com_wizard' \n target='_blank'>Accedi al backend per abilitarlo</a>\";\n\n\n\n http://framework.project-caress.eu/administrator/index.php?option=com_wizard\n\n $mailer->setBody($body);\n\n if (!$mailer->Send())\n throw new RuntimeException('Error sending mail', E_USER_ERROR);\n\n }", "function smtpmailer($para, $de, $de_nome, $assunto, $corpo) { \n\tglobal $error;\n\t$mail = new PHPMailer();\n\t$mail->IsSMTP();\t\t// Ativar SMTP\n\t$mail->SMTPDebug = 1;\t\t// Debugar: 1 = erros e mensagens, 2 = mensagens apenas\n\t$mail->SMTPAuth = true;\t\t// Autenticação ativada\n\t$mail->SMTPSecure = 'ssl';\t// SSL REQUERIDO pelo GMail\n\t$mail->Host = 'smtp.gmail.com';\t// SMTP utilizado\n\t$mail->Port = 465; \t\t// A porta 587 deverá estar aberta em seu servidor\n\t$mail->Username = GUSER;\n\t$mail->Password = GPWD;\n\t$mail->SetFrom($de, $de_nome);\n\t$mail->Subject = $assunto;\n\t$mail->Body = $corpo;\n\t$mail->AddAddress($para);\n\tif(!$mail->Send()) {\n\t\t$error = 'Mail error: '.$mail->ErrorInfo; \n\t\treturn false;\n\t} else {\n\t\t$error = 'Mensagem enviada!';\n\t\treturn true;\n\t}\n}", "function send()\n\t{\n\t\t// $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n\t\t// $headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\n\n\t\t// // Additional headers\n\t\t// $headers .= 'To: Mary <[email protected]>, Kelly <[email protected]>' . \"\\r\\n\";\n\t\t// $headers .= 'From: Birthday Reminder <[email protected]>' . \"\\r\\n\";\n\t\t// $headers .= 'Cc: [email protected]' . \"\\r\\n\";\n\t\t// $headers .= 'Bcc: [email protected]' . \"\\r\\n\";\n\n\t\t// // Mail it\n\t\t// mail($this->to, $subject, $message, $headers);\n\t}", "function notify_register($email, $name) {\n\t$text = \"Hello $name,\\n\";\n\t$text .= \"\\nThanks for registering for an account with Ma-Maria. You will use this email address to login to your account.\\n\";\n\t$text .= \"\\nThanks,\\n\";\n\t$text .= \"The Ma-Maria team\";\n\n\tif(MAIL_ENABLED) {\n\t\tmail($email, 'Ma-Maria - Registration', $text);\n\t}\n}", "function sendEmail($email, $subject, $message) {\n\n $to = $email;\n\n $from = $this->config['admin_email'];\n\n $header = \"From: $from\" . \"\\r\\n\";\n\n // To send HTML mail, the Content-type header must be set\n\n $header .= 'MIME-Version: 1.0'\n . \"\\r\\n\";\n\n $header .= 'Content-type: text/html; charset=iso-8859-1'\n . \"\\r\\n\";\n\n\n\n return mail(trim($to), $subject, $message, $header);\n }", "public function email() {\n\t\trequire( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/email.php' );\n\t}", "function carton_mail( $to, $subject, $message, $headers = \"Content-Type: text/html\\r\\n\", $attachments = \"\" ) {\n\tglobal $carton;\n\n\t$mailer = $carton->mailer();\n\n\t$mailer->send( $to, $subject, $message, $headers, $attachments );\n}", "public function doemail() {\r\n \tif (isset($_SESSION['userid'])) {\n \t if (isset($_POST['useremail'])) {\n \t \tif ($this->model->putemail($_SESSION['userid'],$_POST['useremail'])) {\n \t \t $this->view->set('infomessage', \"Adres email został zmieniony.\"); \r\n \t \t $this->view->set('redirectto', \"?v=project&a=show\");\r\n \t \t $this->view->render('info_view');\n \t \t} else {\n \t \t $this->view->set('errormessage', \"Nieudana zmiana adresu email.\");\r\n \t $this->view->set('redirectto', \"?v=user&a=edit\");\r\n \t \t $this->view->render('error_view');\n \t \t}\n \t } else {\n \t \t$this->view->set('errormessage', \"Błędny adres email.\");\r\n \t \t$this->view->set('redirectto', \"?v=user&a=edit\");\r\n \t \t$this->view->render('error_view');\n \t }\r\n \t} else {\r\n \t $this->redirect('?v=index&a=show');\r\n \t}\r\n }", "public function send() : bool {\n $to = $this->email;\n $subject = $this->subject;\n $txt = $this->content;\n $headers = \"From: [email protected]\";\n $headers .= 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\n\n return (mail($to,$subject,$txt,$headers));\n }", "function smtpmailer($para, $de, $de_nome, $assunto, $corpo) { \r\n\tglobal $error;\r\n\t$mail = new PHPMailer();\r\n\t$mail->IsSMTP();\t\t// Ativar SMTP\r\n\t$mail->SMTPDebug = 0;\t\t// Debugar: 1 = erros e mensagens, 2 = mensagens apenas\r\n\t$mail->SMTPAuth = true;\t\t// Autenticação ativada\r\n\t$mail->SMTPSecure = 'tls';\t// SSL REQUERIDO pelo GMail\r\n\t$mail->Host = 'smtp.ufop.br';\t// SMTP utilizado\r\n\t$mail->Port = 25; \t\t// A porta 587 deverá estar aberta em seu servidor\r\n\t$mail->Username = GUSER;\r\n\t$mail->Password = GPWD;\r\n\t$mail->SetFrom($de, $de_nome);\r\n\t$mail->Subject = $assunto;\r\n\t$mail->Body = $corpo;\r\n\t$mail->AddAddress($para);\r\n\tif(!$mail->Send()) {\r\n\t\t$error = 'Mail error: '.$mail->ErrorInfo; \r\n\t\treturn false;\r\n\t} else {\r\n\t\t$error = 'Mensagem enviada!';\r\n\t\treturn true;\r\n\t}\r\n}", "private function send_system()\n\t{\n\t\t$to = $this->mail_to_name.' <'.$this->mail_to_email.'>';\n\n\t\t$headers = $this->getHeaders();\n\t\tmail($to, $this->mail_subject, $this->mail_message, $headers);\n\t}", "public function mail()\n\t{\n $this->load->model('mailsjabloon_model');\n $this->load->model('gebruiker_model');\n $data['titel'] = 'Send mails';\n $data['auteur'] = \"<u>Lorenzo M.</u>| Arne V.D.P. | Kim M. | Eloy B. | Sander J.\";\n $data['gebruiker'] = $this->authex->getGebruikerInfo();\n $data['link'] = 'admin/index';\n \n $data['sjablonen'] = $this->mailsjabloon_model->getSjablonen();\n \n $partials = array('hoofding' => 'main_header','menu' => 'main_menu', 'inhoud' => 'mails_versturen');\n $this->template->load('main_master', $partials, $data);\n\t}", "public function mail($recipient, $content)\r\n {\r\n echo \"Executing \" . __METHOD__. \"($recipient, $content)\\n\";\r\n }", "function sendEmail($to,$from,$subject,$body,$cc=''){\n\t\t$headers = 'From: '.$from . \"\\r\\n\" .\n\t\t'Cc: '.$cc. \"\\r\\n\".\n\t\t 'MIME-Version: 1.0' . \"\\r\\n\" .\n\t\t 'Content-type: text/html; charset=utf-8';\n\n\t\tif(mail($to, $subject, $body, $headers))\n\t\t return true;\n\t\telse\n\t\t return false;\n\t\texit;\n }", "function send_email($to,$subject,$message1){\n\t$host_address = $_SERVER['HTTP_HOST'];\n\tif(localhost())\n\t{\n\t\trequire_once(get_template_directory().'/lib/PHPMailer/PHPMailerAutoload.php');\n\t\t$message_body = $message1;\n\t\t$mail = new PHPMailer;\n\n\t\t$mail->IsSMTP();\n\t\t$mail->SMTPSecure = \"ssl\";\n\t\t$mail->Host = \"smtp.gmail.com\"; // SMTP server\n\t\t$mail->SMTPAuth = true;\n\t\t$mail->Port = 465;\n\t\t$mail->Username = \"[email protected]\";\n\t\t$mail->Password = \"NasirBro\";\n\t\t//$mail->addAddress('[email protected]');\n\t\t$mail->addAddress($to);\n\n\t\t$mail->isHTML(true);\n\t\t$mail->Subject = $subject;\n\t\t$mail->Body = $message_body;\n\t\t$mail->send();\n\n\t}\n\telse\n\t{\n\t\t$message = '<html><head><title></title></head><body>';\n\t\t$message .= $message1;\n\t\t$message .= '</body></html>';\n\t\t$headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n\t\t$headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\n\t\t$headers .= 'From: '.get_option('admin_email'). \"\\r\\n\";\n\n\t\tif(!mail($to,$subject,$message,$headers))\n\t\t{\n\t\t\treturn false;\n\t\t}else\n\t\t{\n\t\t\treturn true;\n\t\t};\n\t}\n}", "function viaggio_deliver_mail() {\n\tif ( isset( $_POST['cf-submitted'] ) ) {\n\n\t\t// sanitize form values\n\t\t$name = sanitize_text_field( $_POST[\"cf-name\"] );\n\t\t$email = sanitize_email( $_POST[\"cf-email\"] );\n\t\t$subject = sanitize_text_field( $_POST[\"cf-subject\"] );\n\t\t$message = esc_textarea( $_POST[\"cf-message\"] );\n\n\t\t// get the blog administrator's email address\n\t\t$to = get_option( 'admin_email' );\n\n\t\t$headers = \"From: $name <$email>\" . \"\\r\\n\";\n\n\t\t// If email has been process for sending, display a success message\n\t\tif ( wp_mail( $to, $subject, $message, $headers ) ) {\n\t\t\techo '<div>';\n\t\t\techo '<p>'.esc_html__('Thanks for contacting me, expect a response soon.' , 'viaggio').'</p>';\n\t\t\techo '</div>';\n\t\t} else {\n\t\t\techo esc_html__('An unexpected error occurred.' , 'viaggio');\n\t\t}\n\t}\n}", "public function send() {\n $to = Yii::app()->params['adminEmail'];\n $subject = $this->subject;\n $message = $this->body;\n @mail($to, $subject, $message);\n }", "function smtpmailer($para, $de, $de_nome, $assunto, $corpo) { \n\t\tglobal $error;\n\t\t$mail = new PHPMailer();\n\t\t$mail->IsSMTP();\t\t// Ativar SMTP\n\t\t$mail->SMTPDebug = 1;\t\t// Debugar: 1 = erros e mensagens, 2 = mensagens apenas\n\t\t$mail->SMTPAuth = true;\t\t// Autenticação ativada\n\t\t$mail->SMTPSecure = 'ssl';\t// SSL REQUERIDO pelo GMail\n\t\t$mail->Host = 'smtp.gmail.com';\t// SMTP utilizado\n\t\t$mail->Port = 465; \t\t// A porta 587 deverá estar aberta em seu servidor\n\t\t$mail->Username = GUSER;\n\t\t$mail->Password = GPWD;\n\t\t$mail->SetFrom($de, $de_nome);\n\t\t$mail->Subject = $assunto;\n\t\t$mail->Body = $corpo;\n\t\t$mail->AddAddress($para);\n\t\tif(!$mail->Send()) {\n\t\t\t$error = 'Mail error: '.$mail->ErrorInfo; \n\t\t\treturn false;\n\t\t} else {\n\t\t\t$error = 'Mensagem enviada!';\n\t\t\treturn true;\n\t\t}\n\t}", "function sendMail($email_to, $subject, $message) {\n\n $success = 1;\n\n $email_from = '[email protected]';\n\n $body = 'Subject: ' . $subject . \"\\n\\n\" . 'Message: ' . $message;\n\n if (@mail($email_to, $subject, $body, 'From: <' . $email_from . '>')) {\n $success = 0;\n } else {\n $success = 1;\n }\n }", "public function actionEmailTest() {\n Yii::$app->mailer->compose()\n ->setFrom([Yii::$app->params['supportEmail'] => Yii::$app->name])\n ->setTo(\"[email protected]\")\n ->setSubject(\"test subject\")\n ->setHtmlBody(\"test body\")\n ->send();\n return CommonApiHelper::return_success_response(\"success\", \"success\", []);\n }", "function send() \n {\n\n $mime = \"\";\n // parametres optionnels\n if (!empty($this->from)) $mime .= \"From: \".$this->from. \"\\n\";\n if (!empty($this->headers)) $mime .= $this->headers. \"\\n\";\n if (!empty($this->body)) $this->attach($this->body, \"\", \"text/plain\");\n // entete MIME\n $mime .= \"MIME-Version: 1.0\\n\".$this->build_multipart();\n // envoi du message\n mail($this->to, $this->subject, \"\", $mime);\n \n }", "function metamail($to,$subject,$body,$headers) {\r\n\r\n\tglobal $TESTMODE,$TESTEMAIL;\r\n\r\n\tif ($TESTMODE) {\r\n\t\r\n\t\t$header = \"To: $to\\r\\n$headers\\r\\n\\r\\n\";\r\n\t\t\r\n\t\tmail($TESTEMAIL,$subject,$header.$body);\r\n\t\r\n\t} else mail($to,$subject,$body,$headers);\r\n\t\t\r\n}", "function send_text_email($to, $from_name, $from_email, $subject, $body){\n\n \t$headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n\t\t$headers .= 'Content-type: text/plain; charset=iso-8859-1' . \"\\r\\n\";\n\t\t$headers .= 'From: ' . $from_name. ' <' . $from_email . \">\\r\\n\";\n\n\t\t$success = mail($to, $subject, $body, $headers);\n\t\tif(!$success){\n\t\t trigger_error(\"Failed to send email\");\n\t }\n\n }", "function reply($message) {\n echo $message;\n exit();\n }", "function mail_sender($from,$to, $subject, $message)\n\t{\n\n\t\t$headers = \"MIME-Version: 1.0\\r\\n\";\n\t\t$headers .= \"Content-type: text/html; charset=iso-8859-1\\r\\n\";\n\t\t$headers .= \"From:\" .$from. \"\\r\\n\";\n\t\t$headers .= \"Reply to \" .$from. \"\\r\\n\";\n\t\t//$headers .= \"X-Mailer: PHP/\" . phpversion();\n\n\t\t$responce = mail($to, $subject, $message, $headers);\n\t\treturn true; \n\t}", "public function mail()\n\t{\n\t\treturn $this->_mail;\n\t}", "function send_anon() {\n\n $input = $_POST['feedback'];\n $about = $_POST['about'];\n $relation = $_POST['relation'];\n\n\n\t\t$options = get_option('id_settings');\n $receiver = $options['id_anonymous_email_addresses_field'];\n\n\t\t$subject = 'Anonymous input form website';\n\n $body = \"<i>Sent using the contact form at \" . get_site_url() . \"</i>\" .\n \"<br><br>\" . esc_html($input) .\n \"<br><br>About: \" . esc_html($about) .\n \"<br><br>Relation: \" . esc_html($relation);\n\n\t\t$sender = \"Anonymous <[email protected]>\";\n\n\n\n return send_mail($receiver, $subject, $body, $sender);\n\n }", "function sendmail() {\r\n $this->load->library('email'); // load email library\r\n $this->email->from('[email protected]', 'Leo Naga');\r\n $this->email->to('[email protected]');\r\n\r\n $this->email->subject('Your Subject');\r\n $this->email->message('Your Message');\r\n\r\n if ($this->email->send())\r\n echo \"Mail Sent!\";\r\n else\r\n echo \"There is error in sending mail!\";\r\n }", "function notify_request_client($email) {\n\t$link = SITE_URL.'requests.php';\n\n\t$text = \"Hello,\\n\";\n\t$text .= \"\\nYou requested an appointment. You can manage your appointment below:\\n\";\n\t$text .= \"\\n<a href='$link'>Manage</a>\\n\";\n\t$text .= \"\\nThanks,\\n\";\n\t$text .= \"The Ma-Maria team\";\n\n\tif(MAIL_ENABLED) {\n\t\tmail($email, 'Ma-Maria - Request', $text);\n\t}\n}", "function sendMail($to,$subject,$message){\r\n $headers = 'From: uniCyclesPortsmouth.gmail.com' . \"\\r\\n\" .\r\n 'Reply-To: uniCyclesPortsmouth.gmail.com\\'' . \"\\r\\n\" .\r\n 'X-Mailer: PHP/' . phpversion();\r\n\r\n mail($to, $subject, $message, $headers);\r\n}", "function SentVerificationEmail($email,$username,$password){\n \t$to = $email;\n\t$subject = 'DoggieCare Forget Password';\n\t$message = 'Username ='.$username.' || Password='.$password;\n\t$headers = 'From: [email protected]' . \"\\r\\n\" .\n 'Reply-To: [email protected]' . \"\\r\\n\" .\n 'X-Mailer: PHP/' . phpversion();\n\nmail($to, $subject, $message, $headers);\n \n }" ]
[ "0.72432065", "0.7234289", "0.7224487", "0.70980513", "0.6775472", "0.6630516", "0.6558356", "0.65565693", "0.6542384", "0.6524156", "0.65235895", "0.65115315", "0.65075415", "0.65033907", "0.650003", "0.64514774", "0.6451145", "0.6443376", "0.6415766", "0.6407102", "0.63824034", "0.6370972", "0.6314107", "0.6279661", "0.6270962", "0.6262685", "0.62477136", "0.6239946", "0.6238606", "0.6222172", "0.62184155", "0.6200011", "0.6160142", "0.6157355", "0.614146", "0.6138161", "0.6124444", "0.6122527", "0.612021", "0.61083984", "0.6105139", "0.6090066", "0.60879934", "0.6085102", "0.60818493", "0.60783076", "0.6077591", "0.6076962", "0.60750043", "0.6071559", "0.6062873", "0.6062114", "0.60570335", "0.6055692", "0.60541046", "0.6048122", "0.60466534", "0.60426533", "0.60363173", "0.6035798", "0.60286987", "0.60224015", "0.60162896", "0.6013501", "0.60094154", "0.60093373", "0.6000446", "0.59984535", "0.5997136", "0.59878916", "0.5986869", "0.5984354", "0.5979068", "0.59729743", "0.59616953", "0.596062", "0.595719", "0.5947124", "0.59407604", "0.59404147", "0.59385425", "0.59376156", "0.5937228", "0.59293", "0.5928185", "0.59203345", "0.59088975", "0.5903708", "0.5901797", "0.5896766", "0.58944863", "0.5893816", "0.5889616", "0.5889494", "0.58821934", "0.58740723", "0.58717793", "0.5869601", "0.58673954", "0.5866416", "0.5866087" ]
0.0
-1
Display a listing of the resource.
public function index() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { Userpreference::where('person_id', $_POST['person_id'])->delete(); Userpreference::create($request->all()); // Userpreference::updateOrCreate( // ['person_id'=>$_POST['person_id']], // $request->all() // ); return redirect ('preferences/'. $_POST['uniqid'] .'?msg=ok'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($uniqid) { $person = \App\Person::where('uniqid',$uniqid)->first(); $person_id = $person->id; $userpreference = Userpreference::where('person_id', $person_id)->first(); return view ('userpreferences.show',Compact('userpreference','person')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show(Resena $resena)\n {\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function show()\n\t{\n\t\t\n\t}", "public function get_resource();", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "public function display() {\n echo $this->render();\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n {\n //\n $this->_show($id);\n }", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public abstract function display();", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "abstract public function resource($resource);", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8232636", "0.81890994", "0.68296117", "0.64987075", "0.649589", "0.64692974", "0.64633286", "0.63640857", "0.6307513", "0.6281809", "0.621944", "0.61926234", "0.61803305", "0.6173143", "0.61398774", "0.6119022", "0.61085826", "0.6106046", "0.60947937", "0.6078597", "0.6047151", "0.60409963", "0.6021287", "0.5989136", "0.5964405", "0.5962407", "0.59518087", "0.59309924", "0.5921466", "0.5908002", "0.5908002", "0.5908002", "0.59051657", "0.5894554", "0.5871459", "0.5870088", "0.586883", "0.5851384", "0.58168566", "0.58166975", "0.5815869", "0.58056176", "0.5799148", "0.5795126", "0.5791158", "0.57857597", "0.5783371", "0.5761351", "0.57592535", "0.57587147", "0.5746491", "0.57460666", "0.574066", "0.5739448", "0.5739448", "0.57295275", "0.57293373", "0.5729069", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57214445", "0.57149816", "0.5712036", "0.5710076", "0.57073003", "0.5707059", "0.5705454", "0.5705454", "0.5700382", "0.56997055", "0.5693362", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868" ]
0.0
-1
Show the form for editing the specified resource.
public function edit(Userpreference $userpreference) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Userpreference $userpreference) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Userpreference $userpreference) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
/ end of connection;
function array_iunique($array) { return array_intersect_key($array,array_unique( array_map(strtolower,$array))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function onConnectionClosed();", "abstract protected function closeConnection();", "protected function connectionDestruct()\t{}", "public function closeConnection()\n {\n }", "private function close_connection(){\n\t\t$this -> conn -> close();\n\t}", "private function close_connection() \n\t\t{\n\t\t\t$this->conn->close();\n\t\t}", "public function end() {}", "public function end() {}", "public function end() {}", "function end_amy_request()\n\t{\n\t\tDb::close_connection();\n\t}", "function conn_close() \n {\n\t\t\tmysql_close($this->conn);\n\t\t\tunset($this->conn);\n\t\t\t$this->connectionStatus = false;\n\t\t}", "function disconnect() ;", "function __destruct() {\r\n\t\tfputs ( $this->conn, 'QUIT' . $this->newline );\r\n\t\t$this->getServerResponse ();\r\n\t\tfclose ( $this->conn );\r\n\t}", "function DbDisconnect() { \n \t\t$this->close = @mysql_close($this->linkId) or die (\"Error in disconnecting to server: \".mysql_error()); \n\t}", "abstract public function disconnect();", "abstract public function disconnect();", "abstract public function disconnect();", "private function close_connection() {\n\t\t$this->conn->close();\n\t}", "function __destruct() {\n\t\tfputs($this->conn, 'QUIT' . $this->newline);\n\t\t$this->getServerResponse();\n\t\tfclose($this->conn);\n\t}", "public function end();", "public function end();", "public function end();", "public function end();", "protected function _close()\n\t{\n\t\t$this->connID->close();\n\t}", "public function closeConn(){\n $this->conn->close();\n }", "public function conn_close(){\n $this->conn = null;\n }", "public function end(): void\n {\n if ($this->conn->inTransaction()) {\n $this->conn->commit();\n }\n }", "function closeConnection() {\n\t\t$this->conn->close();\n\t}", "public function disconnect()\n\t{\n\t}", "public function closeConnection()\n \t{\n \t\t$this->connection = null;\n \t}", "public function finish( )\n {\n $this->clearDataBuffer();\n $this->free( );\n if ( underQL::$db_handle )\n @ mysql_close( underQL::$db_handle );\n }", "function close() {\r\n\t\t\tif ( $this->_conn != null ) {\r\n\t\t\t\t$this->_conn = null;\r\n\t\t\t\t@OCILogoff( $this->_conn );\r\n\t\t\t}\r\n\t\t}", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function close()\r\n\t{\r\n\t\t$this->conn->Close();\r\n\t}", "public function stream_eof() {}", "private function closeConnection(){\n\t\t\t$this->connessione->close();\n\t\t}", "function __destruct() \n {\n\t\t\t$this->conn_close();\n\t\t}", "function disconnect() {\n if ($this->isConntected()) {\n mysql_close($this->connectionId);\n }\n }", "public function closeConnection ()\n {\n $this->_connection = null;\n }", "public function end()\n {\n }", "public function __destruct() {\n $this->conn && $this->conn->close();\n }", "function TheEnd() {\r\n\r\n\t\t$this->connection = new Connection();\r\n\t\t$conn = $this->connection->openConnection();\r\n\t\ttry {\r\n\t\t\tif($conn){\r\n\t\t\t\t$deleteUser = $conn->prepare(\"DELETE from panier where proceed=1 AND etat=1 AND recu=1\");\r\n\t\t\t\t$deleteUser->execute();\r\n\t\t\t}\r\n\t\t} catch (PDOExecption $e) {\r\n\t\t\tprint \"Error!: \" . $e->getMessage() . \"</br>\";\r\n\t\t}\r\n\r\n\t\t$this->connection->closeConnection();\r\n\t}", "function disconnect()\r\n {\r\n if(!mysql_close($this->link))\r\n {\r\n $this->error_msg = \"Could not close the $this->db_name database\";\r\n return 0;\r\n }\r\n return 1;\r\n }", "public function __destruct() \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n {\r\n if( !$this->con->connect_errno )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tif no problem has occured\r\n {\r\n $this->con->close();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tclose the connection\r\n }\r\n }", "public function __destruct() {\n \t$this->_connection->close();\n\t}", "public function __destructor(){\n $this->connect->close();\n }", "function _close()\n\t{\n\t\tif (!$this->connection)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->_send_command('QUIT');\n\t}", "protected function disconnect()\r\n {\r\n $this->log( \"Closing connection and shutting down.\" );\r\n \r\n fclose( $this->_conn );\r\n exit;\r\n }", "private function _closeConnection() {\n\t\tif (is_resource($this->connection)) {\n\t\t\t// close connection\n\t\t\t@odbc_close($this->connection);\n\t\t}\n\t}", "public function releaseConnection();", "public function close(){\n\n $this->conn::close();\n\n }", "public function disconnect()\r\n {\r\n }", "function closeConnection() {\n return mysql_close();\n }", "public function closeConnection() {\n\t\t$this->conn = null;\n\t\tunset($this->conn);\n\t}", "public function closeConnection() {\n\t\t$this->conn = null;\n\t\tunset($this->conn);\n\t}", "function __destruct() {\n $this->closeConn();\n }", "public function eof() {}", "public function __destruct()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->connection->close();\r\n }\r\n }", "protected function disconnect()\n {\n $this->conn_queries = 0;\n @$this->dbh->close();\n }", "public function sapClose(){\n $this->conn->close();\n }", "public function disconnect() : void\r\n {\r\n fclose($this->connection);\r\n }", "function disconnect()\n {\n @mysql_close( $this->link_id() );\n }", "function close()\n\t{\n\t\t$this->connection->close();\n\t}", "function disconnect(){\n\t\t$this->dbconn = null;\n\t\t$this->logger->info('RECOLIN DB DB disconnected successfully');\n\t}", "public function end()\n\t{\n\t\tTwitchHelper::log(TwitchHelper::LOG_INFO, \"Stream end\");\n\t}", "protected function closeConn($conn) {\n }", "public function __destruct() {\n if ( !is_null( $this->_conn ) && true === $this->_is_connected ) {\n $this->_conn->close();\n }\n }", "function disconnect() {\n\t\tmysql_close();\n\t}", "abstract protected function dbDisconnect();", "abstract protected function doEnd();", "protected function _completeFlush() {\r\n\r\n }", "public function closeConnection(): bool;", "public function close()\n {\n // Does nothing, since connections are persistent\n }", "public function __destruct() {\n mysql_close($this->conn);\n }", "public function sendReplyEnd()\n {\n }", "public function close_connection() {\n mysql_close($this->link);\n }", "public function end(): void\n {\n if ($this->socket !== null) {\n // It seems like the server is closing this connection before responding, possibly?\n $ok = $this->writeCommand('END', '');\n\n if ($ok === 'OK') {\n $this->disconnect();\n }\n\n throw new FaktoryException('Unable to end connection');\n }\n }", "public function __destruct()\n\t\t{\n\t\t\t$this->connection->close();\n\t\t\t//echo 'Desconectado';\n\t\t}", "function onError(ConnectionInterface $conn, \\Exception $e)\n {\n echo \"$e\\n\";\n $conn->close();\n }", "public function EndBD(){\n pg_close($this->BDCon) or die(\"No se pudo CERRAR la conexion a la BD\");\n $this->BDCon = null;\n }", "public function closeConnection()\n {\n if ($this->connection) {\n $this->info(\"[closeConnection] - Close connection.\");\n @fclose($this->connection);\n }\n $this->connection = null;\n $this->status = false;\n }", "public function __destruct(){\n\t\t@mysql_close($this->conn);\n\t}", "public function streamClosed();", "public function __destruct() {\n $this->close_connection();\n }", "function fvls_db_close(){\n\t\tglobal $FLVS_db_link;\n\t\t$return = $FLVS_db_link->close();\t// Close the connection and store success status (boolean response)\n\t\tif( $return )\n\t\t\t$FLVS_db_link = NULL;\t// Closing the connectino doesn't change the variable resource type - so we need to manually alter it\n\n\t\treturn $return;\t// Kick back out the boolean status\n\t}", "function __destruct()\n {\n $this->close_connection();\n }", "function end() {\n\t\t\t$this->db->close();\n\t\t}", "public function close()\n {\n unset($this->conn);\n }", "public function model_close_conn(){\n $this->conn->close();\n }", "function Close() {\r\n if (!@mysql_close($this->link_id)) {\r\n $this->oops(\"Connection close failed.\");\r\n }\r\n }", "public function closeConn()\n {\n $this->conn->close();\n }", "public function __destruct()\n\t{\n\t\tif ($this->_connection)\n\t\t{\n\t\t\tfclose($this->_connection);\n\t\t}\n\t}", "public function __destruct() {\n $this->connection->close();\n }", "public function closeConnection(){\r\n $this->_connections[$this->_activeConnection] = null;\r\n\t\tunset($this->_connections[$this->_activeConnection]);\r\n }" ]
[ "0.724493", "0.7161869", "0.69937307", "0.6919006", "0.6882437", "0.6715584", "0.6700235", "0.6700235", "0.6700235", "0.66562307", "0.66006273", "0.65875256", "0.65844333", "0.6574307", "0.65278107", "0.65278107", "0.65278107", "0.6506683", "0.6495169", "0.6485497", "0.6485497", "0.6485497", "0.6485497", "0.6480163", "0.64269793", "0.6404883", "0.64006454", "0.6385502", "0.6350428", "0.63349134", "0.6307901", "0.6270025", "0.6266053", "0.6266053", "0.6266053", "0.6266053", "0.6266053", "0.6266053", "0.6266053", "0.6266053", "0.62595725", "0.62471205", "0.6243355", "0.6227869", "0.6214908", "0.62013406", "0.61962235", "0.619013", "0.6186892", "0.61850804", "0.61782527", "0.61719495", "0.61570215", "0.6132677", "0.6129233", "0.6125834", "0.61049706", "0.61022276", "0.6102151", "0.6099996", "0.6096269", "0.6096269", "0.6089654", "0.60868466", "0.6086687", "0.6077048", "0.60751903", "0.6069273", "0.60677755", "0.6066746", "0.6064753", "0.6063791", "0.6063093", "0.6060265", "0.6059765", "0.6045814", "0.6043911", "0.6040283", "0.60393167", "0.603493", "0.60234314", "0.6022828", "0.60160285", "0.60047287", "0.59944206", "0.59915", "0.5981367", "0.59761816", "0.5973789", "0.5973517", "0.597161", "0.59628946", "0.5959909", "0.59553725", "0.5949455", "0.5948367", "0.59478635", "0.59476864", "0.5937578", "0.59326565", "0.59307474" ]
0.0
-1
Display a listing of the resource.
public function index() { if(LaravelLocalization::getCurrentLocale() == 'ar'){ $name = 'name_ar'; }else{ $name = 'name_en'; } $cities = City::with(['country' => function($query) use($name){ $query->select('id', "$name as name"); }])->select('id', "$name as name", 'country_id')->get(); return view('backend.cities.index', compact('cities')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { if(LaravelLocalization::getCurrentLocale() == 'ar'){ $name = 'name_ar'; }else{ $name = 'name_en'; } $countries = Country::select('id', "$name as name")->get(); return view('backend.cities.create', compact('countries')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $request->validate([ 'name_ar' => 'required|string', 'name_en' => 'required|string', 'country_id' => 'required|integer|exists:countries,id', ]); City::create($request->only(['name_ar', 'name_en', 'country_id'])); return response('success'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show(City $city) { if(LaravelLocalization::getCurrentLocale() == 'ar'){ $name = 'name_ar'; }else{ $name = 'name_en'; } $countries = Country::select('id', "$name as name")->get(); return view('backend.cities.update', compact('countries', 'city')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show(Resena $resena)\n {\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function show()\n\t{\n\t\t\n\t}", "public function get_resource();", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "public function display() {\n echo $this->render();\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n {\n //\n $this->_show($id);\n }", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public abstract function display();", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "abstract public function resource($resource);", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8232636", "0.81890994", "0.68296117", "0.64987075", "0.649589", "0.64692974", "0.64633286", "0.63640857", "0.6307513", "0.6281809", "0.621944", "0.61926234", "0.61803305", "0.6173143", "0.61398774", "0.6119022", "0.61085826", "0.6106046", "0.60947937", "0.6078597", "0.6047151", "0.60409963", "0.6021287", "0.5989136", "0.5964405", "0.5962407", "0.59518087", "0.59309924", "0.5921466", "0.5908002", "0.5908002", "0.5908002", "0.59051657", "0.5894554", "0.5871459", "0.5870088", "0.586883", "0.5851384", "0.58168566", "0.58166975", "0.5815869", "0.58056176", "0.5799148", "0.5795126", "0.5791158", "0.57857597", "0.5783371", "0.5761351", "0.57592535", "0.57587147", "0.5746491", "0.57460666", "0.574066", "0.5739448", "0.5739448", "0.57295275", "0.57293373", "0.5729069", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57214445", "0.57149816", "0.5712036", "0.5710076", "0.57073003", "0.5707059", "0.5705454", "0.5705454", "0.5700382", "0.56997055", "0.5693362", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, City $city) { $request->validate([ 'name_ar' => 'required|string', 'name_en' => 'required|string', 'country_id' => 'required|integer|exists:countries,id', ]); $city->update($request->only(['name_ar', 'name_en', 'country_id'])); return response('success'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Display a listing of the resource.
public function index(Request $request) { //dd(QrCode::size(200)->generate(url('/menu?branch_id='.session()->get('branch')->id))); if ($request->ajax()) { $table = BranchTable::where('branch_id', session()->get('branch')->id)->first(); $elements = Element::where('branch_id', session()->get('branch')->id)->get(); return response()->json(["msg" => "", "data" => ["elements" => $elements, "table" => $table]]); } else { $branch = Branch::find(session()->get('branch')->id); return view('panel.tables.index', ["branch" => $branch]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72875285", "0.71454394", "0.71323526", "0.6639812", "0.6620611", "0.6568348", "0.6526527", "0.6509403", "0.64499927", "0.6375791", "0.63739914", "0.6365971", "0.6365971", "0.6365971", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667" ]
0.0
-1
Display the specified resource.
public function show($id) { $QrSetting = QrSetting::where('branch_id', session()->get('branch')->id)->first(); $hex = $QrSetting->color; [$r, $g, $b] = sscanf($hex, '#%02x%02x%02x'); $hex = $QrSetting->color2; [$r2, $g2, $b2] = sscanf($hex, '#%02x%02x%02x'); if ($QrSetting->gradiant == 1) { if ($QrSetting->logo == 1) { $qrCode = str_replace('<?xml version="1.0" encoding="UTF-8"?>', '', QrCode::size(200)->mergeString(Storage::disk('public')->url(session()->get('branch')->setting->logo), .3)->gradient($r, $g, $b, $r2, $g2, $b2, 'radial')->style($QrSetting->type ? $QrSetting->type : 'square')->eye($QrSetting->eye_style ? $QrSetting->eye_style : 'square')->generate(url('/menu?branch_id=' . session()->get('branch')->id.'&table='.$id))); } else { $qrCode = str_replace('<?xml version="1.0" encoding="UTF-8"?>', '', QrCode::size(200)->gradient($r, $g, $b, $r2, $g2, $b2, 'radial')->style($QrSetting->type ? $QrSetting->type : 'square')->eye($QrSetting->eye_style ? $QrSetting->eye_style : 'square')->generate(url('/menu?branch_id=' . session()->get('branch')->id.'&table='.$id))); } } else { if ($QrSetting->logo == 1) { $qrCode = str_replace('<?xml version="1.0" encoding="UTF-8"?>', '', QrCode::size(200)->mergeString(Storage::disk('public')->url(session()->get('branch')->setting->logo), .3)->color($r, $g, $b)->style($QrSetting->type ? $QrSetting->type : 'square')->eye($QrSetting->eye_style ? $QrSetting->eye_style : 'square')->generate(url('/menu?branch_id=' . session()->get('branch')->id.'&table='.$id))); } else { $qrCode = str_replace('<?xml version="1.0" encoding="UTF-8"?>', '', QrCode::size(200)->color($r, $g, $b)->style($QrSetting->type ? $QrSetting->type : 'square')->eye($QrSetting->eye_style ? $QrSetting->eye_style : 'square')->generate(url('/menu?branch_id=' . session()->get('branch')->id.'&table='.$id))); } } return response()->json(["qrCode" => $qrCode]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { if ($request->type == 'size') { $table = BranchTable::where('branch_id', session()->get('branch')->id)->first(); $table->width = $request->width; $table->height = $request->height; $table->save(); return response()->json(["msg" => "Elementos actualizados correctamente."], 200); } else { session()->get('branch')->elements()->delete(); foreach ($request->elements as $element) { $newElement = new Element(); $newElement->branch_id = session()->get('branch')->id; $newElement->width = $element["width"]; $newElement->height = $element["height"]; $newElement->type = $element["type"]; $newElement->number = in_array($element["type"], ["table", "circle", "triangle"]) ? $element["number"] : NULL; $newElement->left = $element["left"]; $newElement->top = $element["top"]; $newElement->scaleX = $element["scaleX"]; $newElement->scaleY = $element["scaleY"]; $newElement->save(); } return response()->json(["msg" => "Elementos actualizados correctamente."], 200); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Handle request yang masuk.
public function handle(Request $request, Closure $next);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function handle_request();", "function handleRequest() ;", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "public function handleRequest() {}", "protected abstract function handleRequest();", "function handleRequest() {\n // I. On récupère l'action demandée par l'utilisateur, avec retrocompatibilité\n // Controller et Entité\n $entityName = (isset($_GET['controller']) ? $_GET['controller'] : \"article\");\n // on retravaille le nom pour obtenir un nom de la forme \"Article\"\n $entityName = ucfirst(strtolower($entityName));\n\n // Action\n $actionName = (isset($_GET['action']) ? $_GET['action'] : \"index\");\n $actionName = strtolower($actionName);\n\n // II à IV sont maintenant dans loadDep\n $controller = $this->loadDependencies($entityName);\n\n // V. On regarde si l'action de controller existe, puis on la charge\n // on retravaille la var obtenue pour obtenir un nom de la forme \"indexAction\"\n $action = $actionName . \"Action\";\n\n // si la méthode demandée n'existe pas, remettre \"index\"\n if (!method_exists($controller, $action)) {\n $actionName = \"index\";\n $action = \"indexAction\";\n }\n\n // on stock le titre sous la forme \"Article - Index\"\n $this->title = $entityName . \" - \" . $actionName;\n\n // on appelle dynamiquement la méthode de controller\n $this->content = $controller->$action();\n }", "public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }", "public function processRequest() {\n $action = \"\";\n //retrieve action from client.\n if (filter_has_var(INPUT_GET, 'action')) {\n $action = filter_input(INPUT_GET, 'action');\n }\n\n switch ($action) {\n case 'login':\n $this->login(); \n break;\n case 'register':\n $this->register(); //list all articles\n break;\n case 'search':\n $this->search(); //show a form for an article\n break;\n case 'searchList':\n $this->searchList();\n break;\n case 'remove':\n $this->removeArticle();\n break;\n case 'modify':\n $this->modifyArticle();\n break;\n case 'listCategoryForm':\n $this->listCategoryForm();\n break;\n case 'listCategory':\n $this->listCategory();\n break;\n default :\n break;\n }\n }", "function handleRequest()\n\t\t\t{\n\t\t\t// isset() được dùng kiểm tra một biến nào đó được khởi tạo trong bộ nhớ của máy tính hay chưa, nếu đã khởi tạo thì sẽ trả về TRUE ngược lại FALSE.\n\t\t\t\t$action = isset($_GET['action'])?$_GET['action']:'home';\n\t\t\t\tswitch ($action) {\n\t\t\t\t\tcase 'add_user':\n\t\t\t\t\t\tif (!isset($_SESSION['login'])) {\n\t\t\t\t\t\t\theader(\"Location : login.php\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(isset($_POST['add_user'])) {\n\t\t\t\t\t\t\t$name = $_POST['name'];\n\t\t\t\t\t\t\t$username = $_POST['username'];\n\t\t\t\t\t\t\t$password = $_POST['password'];\n\t\t\t\t\t\t\t$userModel = new User();\n\t\t\t\t\t\t\t$userModel->InsertUser($name, $username, $password);\n\t\t\t\t\t\t\theader(\"Location: index.php?action=list_user\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinclude 'view/add_user.php';\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'list_user':\n\t\t\t\t\t\tif (!isset($_SESSION['login'])) {\n\t\t\t\t\t\t\theader(\"Location: login.php\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$userModel = new User();\n\t\t\t\t\t\t$listUser =$userModel->getListUser();\n\t\t\t\t\t\t\t//view du lieu\n\t\t\t\t\t\tinclude 'view/list_user.php';\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'delete_user':\n\t\t\t\t\t\tif (!isset($_SESSION['login'])) {\n\t\t\t\t\t\t\theader(\"Location : login.php\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$id = $_GET['id'];\n\t\t\t\t\t\t$userModel = new User();\n\t\t\t\t\t\t$userModel->deleteUser($id);\n\t\t\t\t\t\t\t//view du lieu\n\t\t\t\t\t\theader(\"Location: index.php?action=list_user\");\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'edit_user':\n\t\t\t\t\t\tif (!isset($_SESSION['login'])) {\n\t\t\t\t\t\t\theader(\"Location : login.php\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$id = $_GET['id'];\n\t\t\t\t\t\t$userModel = new User();\n\t\t\t\t\t\t$userEdit = $userModel -> getUserInfo($id);\n\t\t\t\t\t\t\t// FETCH_ASSOC: trả về dữ liệu arry với key là tên cột của bảng trong CSDL.\n\t\t\t\t\t\twhile ($row = $userEdit->fetch_assoc()) {\n\t\t\t\t\t\t\t$nameEdit = $row['name'];\n\t\t\t\t\t\t\t$usernameEdit = $row['username'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(isset($_POST['edit_user'])) {\n\t\t\t\t\t\t\t$name = $_POST['name'];\n\t\t\t\t\t\t\t$username = $_POST['username'];\n\t\t\t\t\t\t\t$userModel = new User();\n\t\t\t\t\t\t\t$userModel->EditUser($id, $name, $username);\n\t\t\t\t\t\t\theader(\"Location: index.php?action=list_user\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//view du lieu\n\t\t\t\t\t\tinclude 'view/edit_user.php';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'add_product':\n\t\t\t\t\t\tif (isset($_POST['add_product'])) {\n\t\t\t\t\t\t\t$productname = $_POST['productname'];\n\t\t\t\t\t\t\t$price = $_POST['price'];\n\t\t\t\t\t\t\t$image = $_POST['image'];\n\t\t\t\t\t\t\t$userModel = new Product();\n\t\t\t\t\t\t\t$userModel->InsertProduct($productname, $price, $image);\n\t\t\t\t\t\t\theader(\"Location: index.php?action=add_product\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinclude('view/add_product.php');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'list_product':\n\t\t\t\t\t\t$userModel = new Product();\n\t\t\t\t\t\t// listProduct lay tu bang list_product.php\n\t\t\t\t\t\t$listProduct =$userModel->getListProduct();\n\t\t\t\t\t\t//view du lieu\n\t\t\t\t\t\tinclude('view/list_product.php');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'delete_product':\n\t\t\t\t\t\t$id = $_GET['id'];\n\t\t\t\t\t\t$userModel = new Product();\n\t\t\t\t\t\t$userModel->deleteProduct($id);\n\t\t\t\t\t\t//view du lieu\n\t\t\t\t\t\theader(\"Location: index.php?action=list_product\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'edit_product':\n\t\t\t\t\t\t$id = $_GET['id'];\n\t\t\t\t\t\t$userModel = new Product();\n\t\t\t\t\t\t$productEdit = $userModel->getProductInfo($id);\n\t\t\t\t\t\t// FETCH_ASSOC: trả về dữ liệu array với key là tên cột của bảng trong CSDL.\n\t\t\t\t\t\twhile ($row = $productEdit->fetch_assoc()) {\n\t\t\t\t\t\t\t$productnameEdit = $row['productname'];\n\t\t\t\t\t\t\t$priceEdit = $row['price'];\n\t\t\t\t\t\t\t$imageEdit = $row['image'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(isset($_POST['edit_product'])) {\n\t\t\t\t\t\t\t$productname = $_POST['productname'];\n\t\t\t\t\t\t\t$price = $_POST['price'];\n\t\t\t\t\t\t\t$image = $_POST['image'];\n\t\t\t\t\t\t\t$userModel = new Product();\n\t\t\t\t\t\t\t$userModel->EditProduct($id, $productname, $price, $image);\n\t\t\t\t\t\t\theader(\"Location: index.php?action=list_product\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinclude 'view/edit_product.php';\n\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\n\t\t\t\t\tcase 'login':\n\t\t\t\t\t\t\t//view du lieu\n\t\t\t\t\t\tif (isset($_POST['login'])) {\n\t\t\t\t\t\t\t$username = $_POST['username'];\n\t\t\t\t\t\t\t$password = $_POST['password'];\n\t\t\t\t\t\t\t$userModel = new User();\n\t\t\t\t\t\t\t$checkLogin = $userModel->checkLogin($username, $password);\n\t\t\t\t\t\t\tif($checkLogin) {\n\t\t\t\t\t\t\t\t$_SESSION['login'] = $username;\n\t\t\t\t\t\t\t\theader(\"Location: index.php?action=list_user\");\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\theader(\"Location: login.php\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'logout':\n\t\t\t\t\t\tunset($_SESSION['login']);\n\t\t\t\t\t\theader(\"Location: login.php\");\n\t\t\t\t\t\t//view du lieu\n\t\t\t\t\t\tbreak;\t\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t# code...\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}", "abstract public function handleRequest($request);", "public function processRequest();", "abstract public function processRequest();", "public function handleRequest() {\n\t\t\n\t\tif (is_null($this->itemObj)) {\n\t\t\t$this->itemObj = MovieServices::getVcdByID($this->getParam('vcd_id'));\n\t\t}\n\t\t\n\t\t$action = $this->getParam('action');\n\t\t\n\t\tswitch ($action) {\n\t\t\tcase 'upload':\n\t\t\t\t$this->uploadImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fetch':\n\t\t\t\t$this->fetchImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\tredirect();\n\t\t\t\tbreak;\n\t\t}\n\t}", "abstract public function request();", "protected function handle_request() {\r\n global $wp;\r\n $film_query = $wp->query_vars['films'];\r\n \r\n if (!$film_query) { // send all films\r\n $raw_data = $this->get_all_films();\r\n }\r\n else if ($film_query == \"featured\") { // send featured films\r\n $raw_data = $this->get_featured_films();\r\n }\r\n else if (is_numeric($film_query)) { // send film of id\r\n $raw_data = $this->get_film_by_id($film_query);\r\n }\r\n else { // input error\r\n $this->send_response('Bad Input');\r\n }\r\n\r\n $all_data = $this->get_acf_data($raw_data);\r\n $this->send_response('200 OK', $all_data);\r\n }", "public function handleRequest() {\n $questions=$this->contactsService->getAllQuestions(\"date\");\n //load all the users\n $userList = User::loadUsers();\n //load all the topics\n \t\t$topics = $this->contactsService2->getAllTopics(\"name\");\n \t\t\n\t\t\t\trequire_once '../view/home.tpl';\n\t}", "public static function handleInput()\n {\n switch ($_REQUEST[\"cmd\"]) {\n //cancella il profilo del cliente \n case 'cancella':\n self::cancella();\n break;\n //modifica il profilo del cliente \n case 'back_home_page':\n case 'showrecensioni':\n self::showHomePage();\n break;\n //modifica il profilo personale\n case 'modifica_profilo_personale':\n self::modificaProfiloPersonale();\n break;\n //modifca il profilo dell'azienda\n case 'modifica_profilo_azienda':\n self::modificaProfiloAzienda();\n break;\n //modifica i servizi offerti\n case 'modifica_servizi':\n self::modificaServizi();\n break;\n //aggiorna profilo personale\n case 'update_profilo_personale':\n self::updateProfiloPersonale();\n break;\n //aggiorna profilo azienda\n case 'update_profilo_azienda':\n self::updateProfiloAzienda();\n break;\n //aggiorna servizi\n case 'update_servizi':\n self::updateServizi();\n break;\n }\n }", "public abstract function processRequest();", "public function serve_request()\n {\n }", "public static function process_http_request()\n {\n }", "public function handleRequest()\n {\n $route = $this->router->match();\n\n if ($route) {\n $controllerName = $route['target']['controllerName'];\n $methodName = $route['target']['methodName'];\n\n $controller = new $controllerName();\n\n $controller->$methodName($route['params']);\n } else {\n header(\"HTTP:1.0 404 not Found\");\n echo json_encode([\n \"error_code\" => 404,\n \"reason\" => \"page not found\"\n ]);\n }\n }", "abstract public function handleRequest(Request $request);", "private function handleCall() { //$this->request\n $err = FALSE;\n // route call to method\n $this->logToFile($this->request['action']);\n switch($this->request['action']) {\n // Edit form submitted\n case \"edit\":\n // TODO: improve error handling\n try {\n $this->logToFile(\"case: edit\");\n $this->edit($this->request['filename']);\n //$this->save();\n } catch (Exception $e) {\n $err = \"Something went wrong: \";\n $err .= $e.getMessage();\n }\n break;\n }\n // TODO: set error var in response in case of exception / error\n // send JSON response\n if($err !== FALSE) {\n $this->request['error_msg'] = $err;\n }\n $this->giveJSONResponse($this->request);\n }", "public function request();", "public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }", "public static function handleRequest()\n\t{\n\t\t// Load language strings\n\t\tself::loadLanguage();\n\n\t\t// Load the controller and let it run the show\n\t\trequire_once dirname(__FILE__).'/classes/controller.php';\n\t\t$controller = new LiveUpdateController();\n\t\t$controller->execute(JRequest::getCmd('task','overview'));\n\t\t$controller->redirect();\n\t}", "public function handleRequest() {\n // Make sure the action parameter exists\n $this->requireParam('action');\n\n // Call the correct handler based on the action\n switch($this->requestBody['action']) {\n\n case 'checkoutLocker':\n $this->handleCheckoutLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'remindLocker':\n $this->handleRemindLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'returnLocker':\n $this->handleReturnLocker();\n\t\t\t\tbreak;\n\n default:\n $this->respond(new Response(Response::BAD_REQUEST, 'Invalid action on Locker resource'));\n }\n }", "protected function processGetRequest()\n {\n $this->ajaxDie(json_encode([\n 'success' => true,\n 'operation' => 'get'\n ]));\n }", "function handlePOSTRequest() {\n if (connectToDB()) {\n if (array_key_exists('resetTablesRequest', $_POST)) {\n handleResetRequest();\n } else if (array_key_exists('updateQueryRequest', $_POST)) {\n handleUpdateRequest();\n } else if (array_key_exists('insertQueryRequest', $_POST)) {\n handleInsertRequest();\n } \n else if (array_key_exists('avgAgeQueryRequest', $_POST)) {\n //console_log(\"hello\");\n handleAvgAgeRequest();\n //echo \"Average age is 0\";\n } \n\n disconnectFromDB();\n }\n }", "public function processRequest()\n\t\t{\n\t\t\t$request_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t\tswitch ($request_method)\n\t\t\t{\n\t\t\t\tcase 'get':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request_parts = explode('/', $data);\n\t\t\t$controller = $request_parts[0];\n\t\t\tswitch ($controller)\n\t\t\t{\n\t\t\t\tcase 'ad':\n\t\t\t\t\tprocessAdRequest(substr($data, strlen('ad')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'category':\n\t\t\t\t\tprocessCategoryRequest(substr($data, strlen('category')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t\tprocessUserRequest(substr($data, strlen('user')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo \"Invalid Request!\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "public function handle($request);", "public function request()\n {\n }", "public function request()\n {\n }", "protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }", "public function handleRequest()\n {\n $router = new Router();\n $controllerClass = $router->resolve()->getController();\n $controllerAction = $router->getAction();\n\n \n\n if(!class_exists($controllerClass)\n || !method_exists($controllerClass,$controllerAction)\n ){\n header('Not found', true, 404);\n exit;\n }\n\n $controller = new $controllerClass();\n call_user_func([$controller, $controllerAction]);\n\n }", "public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}", "public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}", "public function processApi() {\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n if((int)method_exists($this, $func) > 0)\n $this->$func();\n else\n $this->response('',404);\n }", "public function handleRequest()\n\t{\n $response = array();\n switch ($this->get_server_var('REQUEST_METHOD')) \n {\n case 'OPTIONS':\n case 'HEAD':\n $response = $this->head();\n break;\n case 'GET':\n $response = $this->get();\n break;\n case 'PATCH':\n case 'PUT':\n case 'POST':\n $response = $this->post();\n break;\n case 'DELETE':\n $response = $this->delete();\n break;\n default:\n $this->header('HTTP/1.1 405 Method Not Allowed');\n }\n\t\treturn $response;\n }", "function handleGETRequest() {\n if (connectToDB()) {\n if (array_key_exists('countTuples', $_GET)) {\n handleCountRequest();\n } else if (array_key_exists('displayTuples', $_GET)) {\n\t\t handleDisplayRequest();\n\t\t} else if (array_key_exists('deleteTuple', $_GET)) {\n\t\t handleDeleteRequest();\n\t\t}\n\n disconnectFromDB();\n }\n }", "public function handleRequest(Zend_Controller_Request_Http $request)\n {\n \n }", "public function requests()\n\t{\n\t\t$this->checkRequest();\n\t\t$this->getResponse();\n\t}", "public function DispatchRequest ();", "public function showRequestPost();", "public function requestAction()\n {\n }", "public function handleAjaxRequest();", "public function request_handler(){\r\n\t\t$route = new Router;\r\n\t\t$session = new Session;\r\n\t\t$segments = $route->urlRoute();\r\n\t\t#check if controller/action exist\r\n\t\t#if not use default_controller / default_action\r\n\t\tif( count($segments) == 0 || count($segments) == 1 ){\r\n\t\t\tinclude_class_method( default_controller , default_action );\r\n\t\t}else{\r\n\t\t#if controller/action exist in the url\r\n\t\t#then check the controller if it's existed in the file\r\n\t\t\tif( file_exists( CONTROLLER_DIR . $segments[0] . CONT_EXT ) )\r\n\t\t\t{\r\n\t\t\t\t#check for segments[1] = actions\r\n\t\t\t\t#if segments[1] exist, logically segments[0] which is the controller is also exist!!\r\n\t\t\t\t//if( isset($segments[1]) ){\r\n\t\t\t\t\tinclude_class_method( $segments[0], $segments[1] . 'Action' );\r\n\t\t\t\t//}\r\n\t\t\t}else{\r\n\t\t\t\terrorHandler(CONTROLLER_DIR . $segments[0] . CONT_EXT);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n \n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t$this->hello($this->request->data);\n\t\t\t\tbreak;\n\t\t\tcase \"submit_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->submit_video($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"remove_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->remove_video($this->request);\n\t\t\t\tbreak;\n\t\t\tcase \"isSubmitted\":\n\t\t\t\t$this->isSubmitted($this->request);\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\n\t}", "public function handleGetRequest($id);", "protected function handle(Request $request) {}", "public function processApi(){\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['rquest'])));\n if((int)method_exists($this,$func) > 0)\n $this->$func();\n else\n $this->response('',404);\t\t\t\t// If the method not exist with in this class, response would be \"Page not found\".\n }", "public function processApi() {\n $func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['request'])));\n if ((int) method_exists($this, $func) > 0)\n $this->$func();\n else\n $this->response('', 404); // If the method not exist with in this class, response would be \"Page not found\".\n }", "protected function handleRequest() {\n\t\t// TODO: remove conditional when we have a dedicated error render\n\t\t// page and move addModule to Mustache#getResources\n\t\tif ( $this->adapter->getFormClass() === 'Gateway_Form_Mustache' ) {\n\t\t\t$modules = $this->adapter->getConfig( 'ui_modules' );\n\t\t\tif ( !empty( $modules['scripts'] ) ) {\n\t\t\t\t$this->getOutput()->addModules( $modules['scripts'] );\n\t\t\t}\n\t\t\tif ( $this->adapter->getGlobal( 'LogClientErrors' ) ) {\n\t\t\t\t$this->getOutput()->addModules( 'ext.donationInterface.errorLog' );\n\t\t\t}\n\t\t\tif ( !empty( $modules['styles'] ) ) {\n\t\t\t\t$this->getOutput()->addModuleStyles( $modules['styles'] );\n\t\t\t}\n\t\t}\n\t\t$this->handleDonationRequest();\n\t}", "function request()\n {\n }", "public function handleServiceRequest() {\n //\n // Create instance of SOAP server.\n //\n $SoapServer = new SoapServer($this->getWsdlFullPath()); \n $SoapServer->setClass(AblePolecat_Data::getDataTypeName($this)); \n $SoapServer->setPersistence(SOAP_PERSISTENCE_SESSION);\n $SoapServer->handle();\n }", "public function parseCurrentRequest()\n {\n // If 'action' is post, data will only be read from 'post'\n if ($action = $this->request->post('action')) {\n die('\"post\" method action handling not implemented');\n }\n \n $action = $this->request->get('action') ?: 'home';\n \n if ($response = $this->actionHandler->trigger($action, $this)) {\n $this->getResponder()->send($response);\n } else {\n die('404 not implemented');\n }\n }", "public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['rquest'])));\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->response('',404);\t\t\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t\t}", "abstract protected function process(Request $request);", "public function interpretRequest($request)\n {\n\n $this->updtv = $request->param('updtv',Validator::BOOLEAN);\n\n // startpunkt des pfades für die acls\n if ($aclRoot = $request->param('a_root', Validator::CKEY))\n $this->aclRoot = $aclRoot;\n\n // die id des Datensatzes von dem aus der Pfad gestartet wurde\n if ($aclRootId = $request->param('a_root_id', Validator::INT))\n $this->aclRootId = $aclRootId;\n\n // der key des knotens auf dem wir uns im pfad gerade befinden\n if ($aclKey = $request->param('a_key', Validator::CKEY))\n $this->aclKey = $aclKey;\n\n // der neue knoten\n if ($aclNode = $request->param('a_node', Validator::CKEY))\n $this->aclNode = $aclNode;\n\n // an welchem punkt des pfades befinden wir uns?\n if ($aclLevel = $request->param('a_level', Validator::INT))\n $this->aclLevel = $aclLevel;\n\n // request elemet type, bei back to top ist es relevant zu wissen woher der\n // aufruf kam (in diesem fall von einem input)\n // könnte bei referenzen auch interessant werden\n // values: inp | ref\n //if ($requestedBy = $request->param('rqtby', Validator::TEXT))\n // $this->requestedBy = $requestedBy;\n\n // sprungpunkt für back to top\n if ($maskRoot = $request->param('m_root', Validator::TEXT))\n $this->maskRoot = $maskRoot;\n\n // the publish type, like selectbox, tree, table..\n if ($publish = $request->param('publish', Validator::CNAME))\n $this->publish = $publish;\n\n // if of the target element, can be a table, a tree or whatever\n if ($targetId = $request->param('target_id', Validator::CKEY))\n $this->targetId = $targetId;\n\n // callback for a target function in thr browser\n if ($target = $request->param('target', Validator::CKEY))\n $this->target = $target;\n\n // target mask key\n if ($targetMask = $request->param('target_mask', Validator::CNAME))\n $this->targetMask = $targetMask;\n\n if ($parentMask = $request->param('pmsk', Validator::TEXT))\n $this->parentMask = $parentMask;\n\n\n\n // mask key\n if ($viewId = $request->param('view_id', Validator::CKEY))\n $this->viewId = $viewId;\n\n // mask key\n if ($viewType = $request->param('view', Validator::CNAME))\n $this->viewType = $viewType;\n\n // soll die maske neu geladen werden?\n //if ($reload = $request->param('reload', Validator::BOOLEAN))\n // $this->reload = $reload;\n\n // target mask key\n if ($refId = $request->param('refid', Validator::INT))\n $this->refId = $refId;\n\n // listing type\n if ($ltype = $request->param('ltype', Validator::CNAME))\n $this->ltype = $ltype;\n\n // context\n if ($context = $request->param('context', Validator::CNAME))\n $this->context = $context;\n\n // parameter zum fixieren des Contexts\n // wird verwendet um zwischen \"unterschiedliche\" Masken mit dem gleichen\n // viewnamen zu switchen\n if ($cntk = $request->param('cntk', Validator::CKEY))\n $this->contextKey = $cntk;\n\n // mask switcher key\n // wird nur in der view gesetzt wenn der mask switcher vorhanden ist\n if ($cntms = $request->param('cntms', Validator::CNAME))\n $this->contextMaskSwt = $cntms;\n\n\n // per default\n $this->categories = [];\n\n }", "protected function _request() {}", "public function processApi(){\n\t\t$words = explode(\"/\",$_REQUEST['rquest']);\n\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$words[0])));\n\t\t\n \t\tif(strcmp(\"services\",$func) == 0)\n\t\t\t$this->$func($words[1],$words[2]);\t// you can set as many levels as you want\n\t\telse\n\t\t\t$this->response('',404);\t// response would be \"Page not found\"\n\t}", "abstract function do_api_request();", "abstract function handle(Request $request, $parameters);", "public function processRequest()\n {\n $params = json_decode(file_get_contents('php://input'),true);\n\n if ( $_POST [ 'action' ] == 'setScreenVars' )\n {\n $this->setScreenVars();\n\n } \n elseif ( $_POST [ 'action' ] == 'loadHero' )\n\n {\n $this->loadHero();\n\n } \n elseif ( $_POST [ 'action' ] == 'loadThumb' )\n\n {\n $this->loadThumb();\n\n } \n elseif ( $_POST [ 'action' ] == 'setScreenVars' )\n\n {\n $this->setScreenVars();\n }\n //this one sent from angular, use $params\n elseif ( $params [ 'action' ] == 'getSiteData' )\n {\n $this->getSiteData();\n }\n elseif ( $_POST [ 'action' ] == 'contactFormSubmit' )\n {\n $this->contactFormSubmit();\n }\n else \n {\n\n if ( $_SESSION['user']['access'] == '2' ) {\n if ( $_POST [ 'action' ] == 'sortUpdate' )\n {\n $this->sortUpdate();\n }\n elseif ( $_POST [ 'action' ] == 'imgStatusUpdate' )\n {\n $this->imgStatusUpdate();\n }\n elseif ( $_POST [ 'action' ] == 'deleteImage' )\n {\n $this->deleteImage();\n }\n elseif ( $_POST [ 'action' ] == 'saveCaption' )\n {\n $this->saveCaption();\n }\n }\n else \n {\n //no action requested, just notifify this file being accessed\n echo ( 'ajax file' );\n } \n }\n\n }", "public function request1(): void\n {\n $this->etat->handle1();\n }", "public function processApi()\n {\n\n $func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['x'])));\n if ((int) method_exists($this, $func) > 0) {\n $this->$func();\n }\n else {\n $this->response('', 404);\n }\n }", "public function handleRequest(Request $request, Response $response);", "public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['value'])));\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->response('',404);\t\t\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t\t}", "public function handle(Request $request);", "function handlePOSTRequest() {\n if (connectToDB()) {\n if (array_key_exists('resetTablesRequest', $_POST)) {\n handleResetRequest();\n } else if (array_key_exists('updateQueryRequest', $_POST)) {\n handleUpdateRequest();\n } else if (array_key_exists('insertQueryRequest', $_POST)) {\n handleInsertRequest();\n }\n\n disconnectFromDB();\n }\n }", "public function processApi(){\n\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['rquest'])));\n\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t$this->$func();\n\t\telse\n\t\t\t$this->response('',404);\t// If the method not exist with in this class, response would be \"Page not found\".\n\t}", "public function handle(array $request = []);", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "private function processRequest()\n\t{\n\t\t\n\t\t$request = NEnvironment::getService('httpRequest');\n\t\t\n\t\tif ($request->isPost() && $request->isAjax() && $request->getHeader('x-callback-client')) { \n\t\t\t\n\t\t\t$data = json_decode(file_get_contents('php://input'), TRUE);\n\t\t\tif (count($data) > 0) {\n\t\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t\tif (isset($this->items[$key]) && isset($this->items[$key]['callback']) && $value === TRUE) {\n\t\t\t\t\t\t$this->items[$key]['callback']->invokeArgs($this->items[$key]['args']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tdie(json_encode(array('status' => \"OK\")));\n\t\t}\n\t\t\n\t}", "function mks_handle_request() {\n if (isset($_POST['mks_action'])) {\n switch ($_POST['mks_action']) {\n case 'api_settings';\n verify_api();\n break;\n }\n }\n}", "public function runRequest() {\n }", "public function handleRequest() {\n $this->loadErrorHandler();\n\n $this->sanitizeRequest();\n $this->modx->invokeEvent('OnHandleRequest');\n if (!$this->modx->checkSiteStatus()) {\n header('HTTP/1.1 503 Service Unavailable');\n if (!$this->modx->getOption('site_unavailable_page',null,1)) {\n $this->modx->resource = $this->modx->newObject('modDocument');\n $this->modx->resource->template = 0;\n $this->modx->resource->content = $this->modx->getOption('site_unavailable_message');\n } else {\n $this->modx->resourceMethod = \"id\";\n $this->modx->resourceIdentifier = $this->modx->getOption('site_unavailable_page',null,1);\n }\n } else {\n $this->checkPublishStatus();\n $this->modx->resourceMethod = $this->getResourceMethod();\n $this->modx->resourceIdentifier = $this->getResourceIdentifier($this->modx->resourceMethod);\n if ($this->modx->resourceMethod == 'id' && $this->modx->getOption('friendly_urls', null, false) && !$this->modx->getOption('request_method_strict', null, false)) {\n $uri = $this->modx->context->getResourceURI($this->modx->resourceIdentifier);\n if (!empty($uri)) {\n if ((integer) $this->modx->resourceIdentifier === (integer) $this->modx->getOption('site_start', null, 1)) {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL);\n } else {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL) . $uri;\n }\n $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n }\n }\n }\n if (empty ($this->modx->resourceMethod)) {\n $this->modx->resourceMethod = \"id\";\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $this->modx->resourceIdentifier = $this->_cleanResourceIdentifier($this->modx->resourceIdentifier);\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $found = $this->findResource($this->modx->resourceIdentifier);\n if ($found) {\n $this->modx->resourceIdentifier = $found;\n $this->modx->resourceMethod = 'id';\n } else {\n $this->modx->sendErrorPage();\n }\n }\n $this->modx->beforeRequest();\n $this->modx->invokeEvent(\"OnWebPageInit\");\n\n if (!is_object($this->modx->resource)) {\n if (!$this->modx->resource = $this->getResource($this->modx->resourceMethod, $this->modx->resourceIdentifier)) {\n $this->modx->sendErrorPage();\n return true;\n }\n }\n\n return $this->prepareResponse();\n }", "public function handle(array $request);", "protected function handleRequest() {\n\t\t// FIXME: is this necessary?\n\t\t$this->getOutput()->allowClickjacking();\n\t\tparent::handleRequest();\n\t}", "public function handleRequest($url){\r\n if(array_key_exists($url,$this->routes)){\r\n $controller = $this->routes[$url];\r\n $this->callController($controller);\r\n }else{\r\n $this->getErrorPage($url);\r\n }\r\n }", "public function handle() {\n $this->initDb(((!isset(self::$_config['db']['type'])) ? 'mysql' : self::$_config['db']['type']));\n $request = new corelib_request(self::$_config['routing'], self::$_config['reg_routing']);\n $path = parse_url($_SERVER['REQUEST_URI']);\n\n if (self::$_config['home'] == \"/\" || self::$_config['home'] == \"\") {\n $uri = ltrim($path['path'], '/');\n } else {\n $uri = str_replace(self::$_config['home'], '', $path['path']);\n }\n\n if (\"\" == $uri || \"/\" == $uri) {\n $uri = self::$_config['routing']['default']['controller'] . '/' . self::$_config['routing']['default']['action'];\n }\n self::$isAjax = $request->isAjax();\n self::$request = $request->route($uri);\n self::$request['uri'] = $uri;\n\n if (self::$request['action'] == \"\")\n self::$request['action'] = self::$_config['routing']['default']['action'];\n\n $this->_run( self::$request['params'] );\n }", "public function processApi() {\n\t\t$func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['rquest'])));\n\t\tif ((int) method_exists($this, $func) > 0)\n\t\t\t$this -> $func();\n\t\telse\n\t\t\t$this -> response('', 404);\n\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t}", "public function processApi() {\n\t\t$func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['rquest'])));\n\t\tif ((int) method_exists($this, $func) > 0)\n\t\t\t$this -> $func();\n\t\telse\n\t\t\t$this -> response('', 404);\n\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t}", "public function processApi()\n {\n $data = array('404'=>'requested method not available');\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['mode'])));\n if((int)method_exists($this,$func) > 0)\n $this->$func();\n else\n $this->response($this->json($data),'404');\n // If the method not exist with in this class, response would be \"Page not found\".\n }", "abstract public function response();", "public function handleRequest(){\n\t\t$SitemapCollection = SitemapActions::selectList();\n\t\t\n\t\t// Put them in a data field so they can be used on the view\n\t\t$this->getDataObject()->set('SitemapCollection',$SitemapCollection);\n\t}", "public function processApi()\n {\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['mode'])));\n if((int)method_exists($this,$func) > 0)\n {\n $this->$func();\n } \n else\n {\n $data = array('code' => \"404\", 'status' => \"failure\", \"msg\" => \"requested method not available\", \"data\" => array());\n $this->response($this->json($data)); \n }\n \n // If the method not exist with in this class, response would be \"Page not found\".\n }", "public function handlerNeedsRequest()\n {\n }", "function handleGETRequest() {\n if (connectToDB()) {\n if (array_key_exists('countTuples', $_GET)) {\n handleCountRequest();\n }\n\n disconnectFromDB();\n }\n }", "public function handleRequest()\n\t{\n\t\t$fp = $this->fromRequest();\n\t\treturn $fp->render();\n\t}", "public function onParseRequest()\r\n\t{\r\n\t\tif(!defined('REST_REQUEST'))\r\n\t\t\t$this->registerRoutes();\r\n\t}", "public function processApi() {\n\n $func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['rquest'])));\n\n if ((int) method_exists($this, $func) > 0) {\n $this->$func();\n } else {\n $this->response('Method not Found', 404); // If the method not exist with in this class, response would be \"Page not found\".*/\n\t}\n\n }", "abstract public function handler() : void;", "protected function handleGET() {\n /* ... Do the stuff ... */\n\n return $this->render('default.html', array());\n }", "public function handle($postData){\r\n\t\t\r\n\t}", "public function handleRequest(){\r\n\t\t\t$method = $_SERVER['REQUEST_METHOD'];\r\n\t\t\t//If the request is a GET for getting data out of the databse\r\n\t\t\tif ($method == 'GET'){\r\n\t\t\t\t$case = $_GET['var1'];\r\n\t\t\t\t/*switch to allow for multiple request to be handled from 1 JavaScript page*/\r\n\t\t\t\tswitch ($case) {\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t$reviewTitle = $_GET['var2'];\r\n\t\t\t\t\t\t//echo $case;\r\n\t\t\t\t\t\t//echo $reviewTitle;\r\n\t\t\t\t\t\t//echo '<script>console.log('+$reviewTitle+'); </script>';\r\n\t\t\t\t\t\t/*validating values sent by JavaScript*/\r\n\t\t\t\t\t\tif (isset($reviewTitle)) {\r\n\t\t\t\t\t\t\tif((strlen($reviewTitle) > 0 && strlen($reviewTitle) <= 512)){\r\n\t\t\t\t\t\t\t\t$this->getReviewData($reviewTitle);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t//If the imput is invalid for length or type\r\n\t\t\t\t\t\t\t\t$this->statuscode =400;\r\n\t\t\t\t\t\t\t\t//echo '<script>console.log(\"If the imput is invalid for length or type\"); </script>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t//If the required parameter has not been given\r\n\t\t\t\t\t\t\t$this->statuscode = 400;\r\n\t\t\t\t\t\t\t//echo '<script>console.log(\"If the required parameter has not been given\"); </script>';\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase '2':\r\n\t\t\t\t\t\t# code...\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t//echo '<script>console.log(\"switch not working\"); </script>';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t//If the request is a POST for setting data to the databse\r\n\t\t\t} elseif ($method == 'POST'){//post method closed\r\n\t\t\t\t$case = $_GET['var1'];\r\n\t\t\t\t//echo \"post: \";\r\n\t\t\t\t//echo $case;\r\n\t\t\t\t/*switch to allow for multiple request to be handled from 1 JavaScript page*/\r\n\t\t\t\tswitch ($case) {\r\n\t\t\t\t\t//set review\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t//echo \"writing: \";\r\n\t\t\t\t\t\t/*Setting values to variable to be checked and validated*/\r\n\t\t\t\t\t\t$username = $_POST['username'];\r\n\t\t\t\t\t\t$reviewTitle = $_POST['reviewTitle'];\r\n\t\t\t\t\t\t$platform = $_POST['platform'];\r\n\t\t\t\t\t\t$gameTitle = $_POST['gameTitle'];\r\n\t\t\t\t\t\t$rating = intval($_POST['rating']);\r\n\t\t\t\t\t\t$difficulty = intval($_POST['difficulty']);\r\n\t\t\t\t\t\t$hoursPlayed = intval($_POST['hoursPlayed']);\r\n\t\t\t\t\t\t$recommend = $_POST['recommend'];\r\n\t\t\t\t\t\t$tags = $_POST['tags'];\r\n\t\t\t\t\t\t$summary = $_POST['summary'];\r\n\t\t\t\t\t\t$review = $_POST['review'];\r\n\t\t\t\t\t\t/*if used to make sure the data is the correct type and length*/\r\n\t\t\t\t\t\tif(isset($username) && isset($reviewTitle) && isset($platform) && isset($gameTitle) && isset($rating) && is_int($rating) && isset($difficulty) && is_int($difficulty) && isset($hoursPlayed) && is_int($hoursPlayed) &&isset($recommend) && isset($tags) && isset($summary) && isset($review)){\r\n\t\t\t\t\t\t\t//echo \"is set: \";\r\n\t\t\t\t\t\t\t/*if used to sterilize the data*/\r\n\t\t\t\t\t\t\tif ((strlen($username) > 0 && strlen($username) <=64) && \r\n\t\t\t\t\t\t\t\t(strlen($reviewTitle) > 0 && strlen($reviewTitle) <=512) && \r\n\t\t\t\t\t\t\t\t(strlen($platform) > 0 && strlen($platform) <= 11) && \r\n\t\t\t\t\t\t\t\t(strlen($gameTitle) > 0 && strlen($gameTitle) <=32) &&\r\n\t\t\t\t\t\t\t\t(strlen((string)$rating) > 0 && strlen((string)$rating) <=11) &&\r\n\t\t\t\t\t\t\t\t(strlen((string)$difficulty) > 0 && strlen((string)$difficulty) <=11) &&\r\n\t\t\t\t\t\t\t\t(strlen((string)$hoursPlayed) > 0 && strlen((string)$hoursPlayed) <=11) &&\r\n\t\t\t\t\t\t\t\t(strlen($recommend) > 0 && strlen($recommend) <=32) &&\r\n\t\t\t\t\t\t\t\t(strlen($tags) > 0 && strlen($tags) <=128) &&\r\n\t\t\t\t\t\t\t\t(strlen($summary) > 0 && strlen($summary) <=2000) &&\r\n\t\t\t\t\t\t\t\t(strlen($review) > 0)){\r\n\t\t\t\t\t\t\t\t$username1 = $username;\r\n\t\t\t\t\t\t\t\t//echo \"username1: \";\r\n\t\t\t\t\t\t\t\t//echo $username1;\r\n\t\t\t\t\t\t\t\t//echo gettype($username1);\r\n\t\t\t\t\t\t\t\t/*used to get userID for the review so the user can comment on the review*/\r\n\t\t\t\t\t\t\t\t$result3 = $this->myDatabase->prepare(\"SELECT userID FROM users WHERE username LIKE '%\".$username1.\"%'\");\r\n\t\t\t\t\t\t\t\t//echo \"r3: \";\r\n\t\t\t\t\t\t\t\t//echo gettype($result3);\r\n\t\t\t\t\t\t\t\t$result3->bind_Param('s', $username1);\r\n\t\t\t\t\t\t\t\t$result3->execute();\r\n\t\t\t\t\t\t\t\t$result3 = $result3->get_result();\r\n\t\t\t\t\t\t\t\tif($result3){\r\n\t\t\t\t\t\t\t\t\tif($result3->num_rows > 0){\r\n\t\t\t\t\t\t\t\t\t\t$UserID = array();\r\n\t\t\t\t\t\t\t\t\t\tfor ($i=0; $i < $result3->num_rows; $i++) { \r\n\t\t\t\t\t\t\t\t\t\t\t$row = $result3->fetch_assoc();\r\n\t\t\t\t\t\t\t\t\t\t\t$row1 = array_values($row);\r\n\t\t\t\t\t\t\t\t\t\t\tarray_push($UserID, $row1[0]);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t$userID1 = $UserID[0];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$userID = $userID1;\r\n\t\t\t\t\t\t\t\t//echo $userID1;\r\n\t\t\t\t\t\t\t\t//echo gettype($userID1);\r\n\t\t\t\t\t\t\t\t/*used to set data to the database*/\r\n\t\t\t\t\t\t\t\t$this->setReviewData($userID,$username,$reviewTitle,$platform,$gameTitle,$rating,$difficulty,$hoursPlayed,$recommend,$tags,$summary,$review);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t//If one or more imput(s) is invalid for length or type\r\n\t\t\t\t\t\t\t\t$this->statuscode= 400;\r\n\t\t\t\t\t\t\t\t//used to see which issues i was having with the post method\r\n\t\t\t\t\t\t\t\t//echo \"invalid input\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t//If one or more parameter(s) have not been given\r\n\t\t\t\t\t\t\t$this->statuscode= 400;\r\n\t\t\t\t\t\t\t//used to see which issues i was having with the post method\r\n\t\t\t\t\t\t\t//echo \"parameter not set\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/*for the login function*/\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\t/*setting data to variables to validate */\r\n\t\t\t\t\t\t$username = $_POST['username'];\r\n\t\t\t\t\t\t$password = $_POST['password'];\r\n\t\t\t\t\t\tif(isset($username) && isset($password)){\r\n\t\t\t\t\t\t\tif ((strlen($username) > 0 && strlen($username) <=64) && \r\n\t\t\t\t\t\t\t\t(strlen($reviewTitle) > 0 && strlen($reviewTitle) <=60)) {\r\n\t\t\t\t\t\t\t\t$this->getLoggedIn($username,$password);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t//If one or more imput(s) is invalid for length or type\r\n\t\t\t\t\t\t\t\t$this->statuscode= 400;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t//If one or more parameter(s) have not been given\r\n\t\t\t\t\t\t\t$this->statuscode= 400;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tcase 3:\r\n\t\t\t\t\t//sign up \r\n\t\t\t\t\t/*used to upload comments to their corresponding reviews*/\r\n\t\t\t\t\tcase 4:\r\n\t\t\t\t\t//comments\r\n\t\t\t\t\t$reviewID = intval($_POST['reviewID']);\r\n\t\t\t\t\t$username = $_POST['username'];\r\n\t\t\t\t\t$comment = $_POST['comment'];\r\n\t\t\t\t\tif(isset($reviewID) && is_int($reviewID) && isset($username) && isset($comment)){\r\n\t\t\t\t\t\tif ((strlen((string)$reviewID) > 0 && strlen((string)$reviewID) <=11) && \r\n\t\t\t\t\t\t\t\t(strlen($username) > 0 && strlen($username) <=64) && \r\n\t\t\t\t\t\t\t\t(strlen($comment) > 0 && strlen($comment) <=5000)) {\r\n\t\t\t\t\t\t\t$this->setCommentData($reviewID,$username,$comment);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t//If one or more imput(s) is invalid for length or type\r\n\t\t\t\t\t\t\t\t$this->statuscode= 400;\r\n\t\t\t\t\t\t\t\t//used to see which issues i was having with the post method\r\n\t\t\t\t\t\t\t\t//echo \"invalid input\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t//If one or more parameter(s) have not been given\r\n\t\t\t\t\t\t\t$this->statuscode= 400;\r\n\t\t\t\t\t\t\t//used to see which issues i was having with the post method\r\n\t\t\t\t\t\t\t//echo \"parameter not set\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t//If the request is not a GET or POST or PUT\r\n\t\t\t\t$this->statuscode = 400;\r\n\t\t\t\techo '<script>console.log(\"If the request is not a GET or POST or PUT\"); </script>';\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t//Used to show the appropriate http status code\r\n\t\t\thttp_response_code($this->statuscode);\r\n\t\t}", "public function RouteRequest ();", "function processRequest(){\n\tglobal $muse; // App settings & database\n\tglobal $HTTP_RAW_POST_DATA;\n\t\n\t// Get the user's posted action\n\t$muse['actionRequestRaw'] = $HTTP_RAW_POST_DATA;\n\t$muse['actionRequest'] = $muse['db']->real_escape_string(trim($HTTP_RAW_POST_DATA));\n\t// First word of action request will be the action keyword.\n\t$muse['actionKeyword'] = strtolower(substr( $muse['actionRequest'], 0, strpos( $muse['actionRequest'], \" \" ) ) );\n\t\n\t// If it's only one word, through it back in. Capatlization issues?\n\tif ($muse['actionKeyword']==false) {\n\t\t$muse['actionKeyword'] = $muse['actionRequest'];\n\t}\n}", "public function handleRouting(){\n\t\t$request = ControllerRequest::getInstance();\n\t\t$soapRawRequest = $request->getRawBody();\n\t\t$domDocument = new DOMDocument();\n\t\t$xmlValidation = @$domDocument->loadXML($soapRawRequest);\n\t\tif($xmlValidation==false){\n\t\t\t$soapException = new SoapException('SOAP Envelope mal formado. '.$php_errormsg);\n\t\t\t$soapException->setFaultCode('Sender');\n\t\t\tthrow $soapException;\n\t\t}\n\n\t\tif(isset($_SERVER['HTTP_SOAPACTION'])){\n\t\t\t$soapAction = str_replace(\"\\\"\", \"\", $_SERVER['HTTP_SOAPACTION']);\n\t\t} else {\n\t\t\tif(isset($_SERVER['CONTENT_TYPE'])){\n\t\t\t\tif(preg_match('/action=\"(.+)\"/', $_SERVER['CONTENT_TYPE'], $matches)){\n\t\t\t\t\t$soapAction = $matches[1];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new SoapException('No se indicó la acción SOAP a ejecutar');\n\t\t\t}\n\t\t}\n\n\t\t$soapAction = explode('#', $soapAction);\n\t\tforeach($domDocument->getElementsByTagNameNS($soapAction[0], $soapAction[1]) as $domElement){\n\t\t\t$parameters = array();\n\t\t\tforeach($domElement->childNodes as $actionParam){\n\t\t\t\tif($actionParam->nodeType==1){\n\t\t\t\t\t$paramType = $actionParam->getAttributeNS($this->_xmlSchemaNamespace, 'type');\n\t\t\t\t\tif($paramType=='ns2:Map'){\n\t\t\t\t\t\t$parameters[] = $this->_getXSIMap($actionParam);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif($paramType=='SOAP-ENC:Array'||$paramType=='enc:Array'){\n\t\t\t\t\t\t\t$parameters[] = $this->_decodeSoapArray($actionParam);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$parameters[] = $this->_decodeXSDType($paramType, $actionParam->nodeValue);\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\tRouter::setAction($soapAction[1]);\n\t\t\tRouter::setParameters($parameters);\n\t\t}\n\t}" ]
[ "0.79725784", "0.78659445", "0.7760349", "0.7760349", "0.7760349", "0.7655138", "0.7613487", "0.7090827", "0.7006855", "0.70034647", "0.70024645", "0.6966011", "0.68782115", "0.67687017", "0.6761424", "0.6759892", "0.6754558", "0.6748933", "0.6729073", "0.6675144", "0.6671741", "0.66331524", "0.65857774", "0.65801734", "0.6544081", "0.6532131", "0.6504615", "0.6503669", "0.6459091", "0.64522505", "0.64396495", "0.6433063", "0.63868874", "0.63826853", "0.63826853", "0.6366476", "0.63619334", "0.63614047", "0.6360216", "0.6350567", "0.6349817", "0.6336365", "0.6329731", "0.63204855", "0.63089", "0.63082755", "0.6305576", "0.6304593", "0.6297744", "0.6272924", "0.6251099", "0.6246974", "0.62390476", "0.62180203", "0.6215186", "0.61954725", "0.61906755", "0.6188371", "0.61851954", "0.6181894", "0.6179998", "0.61790735", "0.6147937", "0.61451495", "0.6141072", "0.6135762", "0.6134147", "0.6128176", "0.6126429", "0.61186826", "0.6115654", "0.6109536", "0.6108965", "0.6105087", "0.6085678", "0.6081881", "0.6068121", "0.6063021", "0.6056365", "0.6044251", "0.6036211", "0.6027663", "0.6002374", "0.6001593", "0.6001593", "0.5998715", "0.5978808", "0.5974225", "0.5973312", "0.59653723", "0.596273", "0.5962361", "0.59547055", "0.5953177", "0.59461254", "0.59451455", "0.59448844", "0.594345", "0.5941083", "0.5940489", "0.5937155" ]
0.0
-1
Traverse the configured route if it exists.
public function route() { $file = $this->app_directory . '/controllers/' . $this->controller . '.php'; if(\mfw\helpers\FileHelper::fileExists($file)) { include $this->app_directory . '/controllers/' . $this->controller . '.php'; $controller = new $this->controller($this->controller, $this->app_directory); call_user_func_array(array($controller, $this->method), $this->arguments); } else { if(defined('DOC_ROOT')) { include DOC_ROOT . '/404.php'; } else { throw new \Exception("404 Page not found"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function route(): void\n {\n $url = $this->getUrlAsArray();\n $size = \\sizeof($url);\n $section = $this->section;\n\n for ($i = 0; $i < $size; $i++) {\n if ($i < ($size - 1)) {\n $section = $section->searchInSections($url[$i]);\n if ($section instanceof Section) {\n }\n } else {\n $route = $section->searchInRoutes($url[$i]);\n // TODO: Show view and use models\n if ($route instanceof Route) {\n\n }\n }\n }\n }", "public function route()\n {\n $path = Url::getPath();\n\n // If no routes exist, set 404\n if (count($this->routes) == 0)\n {\n return;\n }\n\n // Check if exact match (cheap)\n if ((isset($this->routes[$path]))\n && (!$this->routes[$path]['is_regex']))\n {\n $this->dispatch($this->routes[$path]);\n exit;\n }\n\n // Loop through all routes and attempt to find a match. (expensive)\n foreach ($this->routes as $i => $route)\n {\n $matches = null;\n\n // If route found\n if (($route['is_regex'])\n && (preg_match($route['match'], $path, $matches)))\n {\n // Remove full match from array list\n array_shift($matches);\n\n $this->dispatch($route, $matches);\n exit;\n }\n }\n }", "private static function traverseRoutes() {\r\n\r\n\r\n\t\t$method = $_SERVER['REQUEST_METHOD'];\r\n\t\t$requested = $_SERVER['REQUEST_URI'];\r\n\t\t$path = $requested; // set our path to our request\r\n\t\t$path = explode('?',$path)[0]; // check for a query string. At zero index\r\n\t\t$path = strlen($path) > 1 ? rtrim($path,'/') : $path; //strip the slash at the end of the string (if its there). rtrim will take care of this automatically\r\n\t\t$parts = explode('/',$path);\r\n\t\t$parameters = array(); // Start traversal process. These are the parameters that we will pass\r\n\t\t$level = &self::$routes[$method]; // same as when we are registering. Grab a reference to our trunk\r\n\t\t\r\n\t\t// traverse the tree and determine if we have a valid route\r\n\t\treset($parts);\r\n\t\twhile(($part = current($parts)) !== false) {\r\n\r\n\t\t\tif(isset($level[$part])) { // found, now we move down one more level\r\n\t\t\t\t$level = &$level[$part];\r\n\t\t\t} elseif(isset($level['@'])) { // didn't find a defined, but we have a wild card. Go down this level\r\n\t\t\t\t$level = &$level['@'];\r\n\t\t\t\t$parameters[$level['name']] = urldecode($part);\r\n\t\t\t} else {\r\n\t\t\t\tthrow new RouteException($requested.' route not found');\r\n\t\t\t}\r\n\r\n\t\t\tnext($parts);\r\n\t\t}\r\n\r\n\t\t// we have reached the final level. Extract the required information and dig in \r\n\t\t$callback = $level['*'];\r\n\t\tif(is_callable($callback)) {\r\n\t\t\t$callback($parameters);\r\n\t\t} else {\r\n\t\t\t$callbackParts = explode('@', $callback);\r\n\t\t\t$class = 'App\\Controllers\\\\'.$callbackParts[0];\r\n\t\t\t$function = $callbackParts[1];\r\n\t\t\t$controller = new $class();\r\n\t\t\treturn $controller->{$function}($parameters);\r\n\t\t}\r\n\r\n\t}", "public function next() \n {\n $node = next($this->dispatchables);\n return ($node !== false ? $node['route'] : false);\n }", "protected function checkRoute()\n {\n if (Router::current() === null) {\n return $this->error(404);\n }\n }", "protected function _findRoute()\n {\n $result = false;\n \n if ('/' == $this->_uri || '' == $this->_uri)\n {\n $result = $this->_routingTable['/'];\n }\n else\n {\n foreach ($this->_routingTable as $route => $settings)\n {\n if (preg_match(\":^/?$route/?$:\", $this->_uri, $a)) {\n $result = array();\n $result['controller'] = $settings['controller'];\n $result['params'] = array_merge($settings['params'], $a);\n break;\n }\n }\n }\n return $result;\n }", "abstract public function getRoute();", "private function getRoute(){\n\t}", "public function handle_routing( $continue ) {\n\n\t\t// Get the request path / URI.\n\t\t$request_path = $_SERVER['REQUEST_URI'] ?? '';\n\t\t$request_path = trim( $request_path, '/' ); // Remove leading/trailing slashes.\n\t\t$request_path = strtok( $request_path, '?' ); // Remove query string args.\n\n\t\t// Root sitemap.\n\t\tif ( preg_match( '{^sitemap_index.xml$}', $request_path ) ) {\n\t\t\t$this->handle_route_sitemap_root();\n\t\t}\n\n\t\t// Sitemap XSL which doesn't work otherwise for some reason.\n\t\tif ( preg_match( '{^main-sitemap.xsl$}', $request_path ) ) {\n\t\t\t$this->handle_route_sitemap_xsl();\n\t\t}\n\n\t\treturn $continue;\n\n\t}", "public function hasRoute(): bool;", "private function load_routes() {\n\n // 1. plugins routes\n foreach($this->context->plugins() as $plugin) {\n \n if(false === $plugin->is_type('IRoutesPlugin')) continue;\n\n foreach($plugin->routes() as $route_value) {\n $this->routes[]= $route_value;\n }\n }\n\n // 2. config.xml routes\n $config_routes= $this->context->config()->routes();\n // XXX: review, maybe Route[] should be returned by configurator?\n foreach( $config_routes as $r ) {\n // xxx. requirements\n $this->routes[]= new Route( \n (string)trim($r['name']), // name\n (string)trim($r['value']), // definition\n $this->context->config()->route_defaults($r) // array with defaults\n );\n }\n\n // Medick::dump($this->routes);\n\n // xxx: throw exception if 0 routes?\n }", "private function runRoute()\n {\n if ( !isset($this->routes[$_SERVER['REQUEST_METHOD']]) ) {\n throw new RouterException('No route for this REQUEST_METHOD');\n }\n\n /**\n * @var Route $route\n */\n foreach ( $this->routes[$_SERVER['REQUEST_METHOD']] as $route ) {\n if ( $route->match($this->url) ) {\n return $route->call();\n }\n }\n\n throw new RouterException('No route found');\n }", "public function checkRoute()\n\t{\n\t\tif(!self::$load):\n\t\t\thttp_response_code(404);\n\t\t\tdie('No route found');\n\t\tendif;\n\t}", "public function get_matched_route()\n {\n }", "public function get_route()\n {\n }", "public function getRoute()\n {\n }", "abstract protected function getRoute($destination);", "public function testRouteRetrieval() {\n\t\t$expected = Router::connect('/hello', ['controller' => 'posts', 'action' => 'index']);\n\t\t$result = Router::get(0, true);\n\t\t$this->assertIdentical($expected, $result);\n\n\t\tlist($result) = Router::get(null, true);\n\t\t$this->assertIdentical($expected, $result);\n\t}", "public function start()\n {\n foreach ($this->routes as $route) {\n if ($route->match()) {\n $this->applyRoute($route); \n }\n\n if (!$route->continue) {\n break;\n }\n }\n }", "public function hasRoute(): bool\n {\n return isset($this->route);\n }", "function findRoute($route = '') {\n $route = $route ? $route : FIRE_DEFAULT_ROUTE;\n return $this->_routes->get($route);\n }", "public function getRoute();", "function _parse_routes()\n {\n // Do we even have any custom routing to deal with?\n // There is a default scaffolding trigger, so we'll look just for 1\n if (count($this->routes) == 1)\n {\n $this->_set_request($this->uri->segments);\n return;\n }\n\n // Turn the segment array into a URI string\n $uri = implode('/', $this->uri->segments);\n\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri]))\n {\n $this->_set_request(explode('/', $this->routes[$uri]));\n return;\n }\n\n //Art\n $i = $this->_search_by_key($this->routes, self::MAIN, $uri);\n if ($i !== FALSE)\n {\n $this->_set_request(explode('/', $this->routes[$i][self::ROUTE]));\n return;\n }\n\n // Loop through the route array looking for wild-cards\n foreach ($this->routes as $key => $val)\n {\n if(is_int($key))\n {\n $key = $val[self::MAIN];\n $val = $val[self::ROUTE];\n }\n // Convert wild-cards to RegEx\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri))\n {\n // Do we have a back-reference?\n if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE)\n {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request($this->uri->segments);\n }", "public function route() {\n\n try {\n \n $obj = APIFactory::init($this->parsed_path[0]);\n echo $this->getAction($obj, $this->parsed_path);\n \n } catch(UndefinedActionException $e) { \n\n echo $e->getMessage();\n\n } catch(Exception $e) {\n\n echo $e->getMessage();\n\n }\n }", "abstract public function getRouteMatch();", "public function getNodeRoute();", "function match_against_router() {\n\n require_once APP_PATH . '/config/routing.php';\n\n if (isset($routes)) {\n $base_url = $this->get_base_url();\n\n foreach ($routes as $key => $val) {\n if ($key == $base_url) {\n return $val;\n }\n }\n }\n return false;\n }", "public function parseRoutes()\n {\n $this->cacheRoutes();\n\n $request_uri = $this->prepareUrl($_SERVER['REQUEST_URI']);\n\n foreach (static::$routes as $uri => $data) {\n static::$uri = $uri;\n static::$routingType = $data['routingType'];\n\n if ($this->compareMethods($data['methods'], $data['routingType']) === false)\n continue;\n\n if ($this->parseUri($uri, $request_uri) === false)\n if (static::$urlCatcher === false)\n continue;\n\n if ($this->parseMiddleware($data['middleware']) === false)\n break;\n\n $this->parseServices($data['services']);\n\n if ($data['locale'] !== null)\n App::setLocale($data['locale']);\n\n // Execute\n $this->executeRoute($uri, $data);\n\n RouterStatus::increase();\n break;\n }\n\n if (RouterStatus::get() === 0) {\n static::$uri = null;\n abort(404);\n\n return;\n }\n }", "private function searchRoute()\r\n {\r\n $currentUrl = self::cleanUrl(self::getCurentUrl());\r\n $activeMethod = self::getActiveMethod();\r\n\r\n foreach (array_reverse($this->routes) as $route) {\r\n if (preg_match('/^'.$route['regex'].'$/', $currentUrl) && $activeMethod === $route['method']) {\r\n $route['active'] = $currentUrl;\r\n return $route;\r\n }\r\n }\r\n }", "public function get_route($request_route) {\n\n\n if (array_key_exists($request_route[\"_method\"], $this->_routes)) {\n\n if (array_key_exists($request_route[\"_rule\"], $this->_routes[$request_route[\"_method\"]])) {\n return $this->_routes[$request_route[\"_method\"]][$request_route[\"_rule\"]];\n } else { // search for match routes\n\n foreach ($this->_routes[$request_route[\"_method\"]] as $_route) {\n\n if ($_route->_match) {\n\n $request_rule = explode(\"/\", trim($request_route[\"_rule\"], \"/\"));\n $permit_rule = explode(\"/\", trim($_route->_rule, \"/\"));\n\n if (count($request_rule) == count($permit_rule)) {\n $match = true;\n foreach ($request_rule as $index => $value) {\n\n if (($request_rule[$index] != $permit_rule[$index]) and ($permit_rule[$index] != ApplicationRoute::dynamical_segment)) {\n $match = false;\n break;\n }\n }\n if ($match) {\n\n $permit_match_rule = explode(\"/\", trim($_route->_match_rule, \"/\"));\n preg_match_all('@:([\\w]+)@', $_route->_match_rule, $segments, PREG_PATTERN_ORDER);\n $segments = $segments[0];\n\n // get methodları için locals'a yükle : değişkenler\n foreach ($segments as $segment) {\n if ($index = array_search($segment, $permit_match_rule)) {\n $_route->_locals[substr($segment, 1)] = $request_rule[$index];\n }\n }\n\n return $_route;\n }\n }\n }\n }\n }\n return null;\n //throw new ConfigurationException(\"Böyle bir yönlendirme mevcut değil\", $request_route[\"_method\"] . \":\" . $request_route[\"_rule\"]);\n }\n throw new ConfigurationException(\"Uzay çağında bizim henüz desteklemediğimiz bir method\", $request_route[\"_method\"]);\n }", "private static function loadRoutes()\n {\n $route_found = false;\n foreach (\n sf_conf('routes') as $path => $route_data\n ) {\n $route_found = true;\n self::$routes[$path] = Route::buildRoute($path, $route_data);\n }\n\n if (! $route_found) {\n trigger_error(\n 'No routes have been configured. Check routes.yaml.',\n E_USER_ERROR\n );\n\n exit;\n }\n }", "private static function performStandardRouting(){\n if(!isset($_GET['controller'])) {\n return self::executeController(self::$notSpecifiedFallbackController, $_GET);\n } else if(empty($_GET['controller'])) {\n return false;\n }\n\n return self::executeController($_GET['controller'], $_GET);\n }", "private function parseRoutes()\n {\n // Turn the segment array into a URI string\n $uri = implode('/', $this->uri->getSegments());\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri])) {\n return $this->setRequest(explode('/', $this->routes[$uri]));\n }\n\n // Loop through the route array looking for wild-cards\n foreach ($this->routes as $key => $val) {\n // Convert wild-cards to RegEx\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri)) {\n // Do we have a back-reference?\n if (strpos($val, '$') !== false && strpos($key, '(') !== false) {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n\n return $this->setRequest(explode('/', $val));\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->setRequest($this->uri->getSegments());\n }", "private function uri_reroute()\n {\n $match = false;\n\n $uri = parse_url($_SERVER['REQUEST_URI']);\n if (isset($uri['path']) && $uri['path'] !== \"/\") {\n $_ = preg_split(\"|/|\", $uri['path'], -1, PREG_SPLIT_NO_EMPTY);\n\n $i = 0;\n $route = null;\n $router = null;\n // while ($match === false) {\n // $path = $_[$i];\n\n // if (isset($this->configuration['ROUTES']['/' . $path])) {\n // $match = true;\n // $route = \"/$path\";\n // $router = $this->configuration['ROUTES']['/' . $path];\n // $this->route_map = $route;\n // }\n\n // if (isset($this->configuration['ROUTES'][$path])) {\n // $match = true;\n // $route = \"$path\";\n // $router = $this->configuration['ROUTES'][$path];\n // $this->route_map = $route;\n // }\n\n // ++$i;\n // }\n\n // unset($_);\n // unset($i);\n // unset($uri);\n // unset($path);\n\n if (isset($_) && is_array($_) && count($_) > 0) {\n $path = \"\";\n foreach ($_ as $k => $v) {\n $path .= \"/\" . $v;\n\n if (isset($this->configuration['ROUTES'][$path])) {\n $match = true;\n $route = \"$path\";\n $router = $this->configuration['ROUTES'][$path];\n $this->route_map = $route;\n\n // if(is_array($router['params'])){\n\n // }elseif($router['params'] == \"*\"){\n // break;\n // }\n\n break;\n }\n }\n }\n\n if (isset($router['controller'])) {\n $this->controller = $router['controller'];\n } else {\n $this->controller = \"main\";\n }\n\n if (isset($router['method'])) {\n $this->method = $router['method'];\n } else {\n $this->method = \"index\";\n }\n\n if (isset($router['action']) && isset($this->http)) {\n if (trim(strtolower($router['action'])) != strtolower($this->http->action)) {\n $this->http->http_error(403);\n }\n }\n \n if (isset($router['type']) && isset($router['type'])){\n if (trim(strtolower($router['type'])) == \"json\" && $this->http->type != \"json\"){\n $this->http->http_error(406, \"Form \" . $this->http->action . \" data is not json\");\n }\n }\n\n if (isset($router['params'])) {\n if (is_array($router['params'])) {\n $uri = preg_split(\"|/|\", str_replace($route, \"\", $_SERVER['REQUEST_URI']), -1, PREG_SPLIT_NO_EMPTY);\n\n if (is_array($router['params'])) {\n $_ = $router['params'];\n unset($router['params']);\n\n $router['params'][] = $_;\n unset($_);\n }\n\n $nums_params = count($router['params'][0]);\n\n if ($nums_params > 0) {\n foreach ($router['params'][0] as $k => $v) {\n $this->params[$v] = trim(urldecode($uri[$k]));\n }\n }\n\n $i = 0;\n $x = 0;\n while ($nums_params < $i) {\n if (isset($uri[$x]) && is_value($uri[$x])) {\n $this->params[$router['params'][$i]] = trim(urldecode($uri[$x]));\n ++$i;\n }\n ++$x;\n }\n\n } elseif ($router['params'] != \"*\") {\n return $this->http->http_error(404);\n }\n } else {\n $uri = preg_split(\"|/|\", str_replace($route, \"\", $_SERVER['REQUEST_URI']), -1, PREG_SPLIT_NO_EMPTY);\n\n if (count($uri) > 0) {\n return $this->http->http_error(404);\n }\n }\n\n unset($uri);\n unset($i);\n unset($x);\n unset($route);\n unset($router);\n }\n\n return $match;\n }", "public function beforeLoadRoutes() {\n if ($this->beforeConfig) {\n $this->createRoutes($this->m->Routing->routes);\n $current = $this->m->Routing->route;\n if (is_array($current) and isset($current['priority'])) {\n if ($current['priority'] > $this->priority)\n return;\n }\n if ($this->checkPath($this->request->path)) {\n \n }\n }\n }", "public function findFirstMatchingRoute($alternative=false) {\n// \t\tdebug('$this', $this);\n// \t\tdebug('Routes', $this->getRoutes());\n\t\tforeach( $this->getRoutes() as $methodRoutes ) {\n\t\t\tif( !isset($methodRoutes[$this->method]) ) { continue; }\n\t\t\t/* @var $route HTTPRoute */\n\t\t\t$route\t= $methodRoutes[$this->method];\n\t\t\tif( $route->isMatchingRequest($this, $values, $alternative) ) {\n\t\t\t\t$this->pathValues\t= (object) $values;\n\t\t\t\treturn $route;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private function findRoute()\n {\n // we need to start the session, because we check userLogin over the session\n session_start();\n\n if (!isset($_GET['cmd'])) {\n // if user is not logged in, we send hem to register page, so he can register or go to login from there\n if (!isset($_SESSION['userName'])) {\n $this->cmd = 'register';\n } else {\n $this->cmd = 'overview';\n }\n } elseif (!isset($_SESSION['userName']) && $_GET['cmd'] != 'login' && $_GET['cmd'] != 'register') {\n $this->cmd = 'overview';\n } else {\n $this->cmd = $_GET['cmd'];\n }\n\n // if we need to send data over json, the cmd in POST must be json, so we can go to json handler\n if(isset($_POST['cmd']) && $_POST['cmd'] == 'json'){\n $this->cmd = 'json';\n }\n }", "private function checkRoute()\n\t{\n\t $route = GlobalSystem::routeType();\n\t\tif(key_exists($route, RequestRoute::$routes)){\n\t\t\t$this->trigger = RequestRoute::$routes[$route][GlobalSystem::ExpRouteKeyTrigger];\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "abstract function readRoute(string $step) : ?self;", "public function route()\n\t{\n\t\t/* [http|https]/[Ajax|]/[Get|Post|Delete|Put]/uri */\n\t\t$this->route = $this->route_raw = ($this->c->Request->is_https ? 'https' : 'http').'/'.($this->c->Request->is_ajax ? 'Ajax' : '').'/'.$this->c->Request->request.'/'.$this->c->Request->uri;\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->preRouter();\n\n\t\t/* rewrite dispatch route */\n\t\tforeach ($this->c->router['routes'] as $regexpath => $switchto) {\n\t\t\tif (preg_match($regexpath, $this->route)) {\n\t\t\t\t/* we got a match */\n\t\t\t\t$this->route = preg_replace($regexpath, $switchto, $this->route);\n\t\t\t\t$this->route_matched = $regexpath;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->postRouter();\n\n\t}", "public function checkingRoute()\n {\n\n global $route;\n $request = new Request;\n $requested_url = $request->server('QUERY_STRING');\n //!TEST\n // echo $requested_url;\n // echo '<br />';\n $requested_method = $request->server('REQUEST_METHOD');\n //! TEST\n // echo $requested_method;\n /* \n // $server_all = $request->serverAll();\n // echo '<pre>';\n // print_r($server_all);\n // echo '</pre>' ;\n // $route_object = new Route;\n */\n $all_routes = $route->getRoutingTable();\n\n // NOTE\n /*\n ! ezzay ana shayf Class Web and Route min 3'eer use key word \n ? routes/web.php & Core/Route.php\n */\n //!TEST\n // echo '<pre>';\n // print_r($all_routes);\n // echo '</pre>';\n\n foreach ($all_routes as $url => $info) {\n\n /* !//? to test $url returns\n echo '<pre>';\n print_r($url);\n echo '</pre>' ;\n */\n // // if ($requested_url == $url){\n if (preg_match($url,$requested_url , $matches )){\n if( $requested_method == strtolower($info['method'])) {\n $this->controller = $info['controller'];\n $this->action = $info['action'];\n $this->params = array_slice($matches , 1);\n return true ;\n }else{\n die(\"405 method does not exist\");\n }\n /* //!deprecated if statement (wrong else statement)\n // if ($requested_url != $single_route) {\n // die('404 url not found');\n // }\n // elseif ($requested_method != $info['method']) {\n // die('405 method not allowed');\n // }\n // else {\n // $this->controller = $info['controller'];\n // $this->method = $info['method'];\n // }\n */\n }\n // echo $this->controller;\n // echo '<br />';\n // echo $this->action ;\n // echo '<br />';\n }\n die(\"404 not found\");\n }", "private static function xml_route(){\n\t\t\n\t\t$xml_routes=new Parser();\n\t\t$xml_routes->load_from_file('routes.xml');\n\t\t$request=(isset($_GET['request']))?$_GET['request']:'/index';\n\t\t$route_found=false;\n\t\t\n\t\t$routes=$xml_routes->getElementsByAttributeValue('method', Request::get_request_type());\n\t\t\n\t\t$str_routes=\"\";\n\t\t$found_route=null;\n\t\tforeach ($routes as $item){\n\t\t\t\n\t\t\tif($item->nodeType==XML_ELEMENT_NODE){\n\t\t\t\tforeach($item->childNodes as $attr){\n\t\t\t\t\t\n\t\t \tif($attr->nodeType==XML_ELEMENT_NODE){\n\t\t \n\t\t \t\tif($attr->tagName==\"request\"){\n\t\t \t\t\tif($item->getAttribute('method')==$_SERVER['REQUEST_METHOD']){\n\t\t \t\t\t\t$match_route=$item->cloneNode(true);\n\t\t \t\t\t\t//print \"{$match_route->getElementsByTagName('request')->item(0)->nodeValue}\\n\";\n\t\t \t\t\t\t\n\t\t \t\t\t\t$controller=$match_route->getElementsByTagName('controller')->item(0)->nodeValue;\n\t\t \t\t\t\t$action=$match_route->getElementsByTagName('action')->item(0)->nodeValue;\n\t\t \t\t\t\t\n\t\t \t\t\t\t$match=str_ireplace('/','\\\\/',$match_route->getElementsByTagName('request')->item(0)->nodeValue);\n\t\t \t\t\t\t//$match.=\"(\\\\/(.*))?\";\n\t\t \t\t\t\t$match='/^'.$match.'$/';\n\t\t \t\t\t\t$replace=\"/$controller/$action\";\n\t\t \t\t\t\tif($match_route->getAttribute('args')==true){\n\t\t \t\t\t\t\t$number_args=($match_route->getAttribute('argsnum')!==null)?$match_route->getAttribute('argsnum'):1;\n\t\t \t\t\t\t\tfor($i=1;$i<=$number_args;$i++)\n\t\t \t\t\t\t\t$replace.=\"/$\".$i;\n\t\t \t\t\t\t}\n\t\t \t\t\t\tif(preg_match($match, $request)){\n\t\t \t\t\t\t\t$request=preg_replace($match,$replace,$request);\n\t\t \t\t\t\t\t$found_route=$item->cloneNode(true);\n\t\t \t\t\t\t\t\n\t\t \t\t\t\t\t//print \"Found\\n\";\n\t\t \t\t\t\t\tbreak;\n\t\t \t\t\t\t}\n\t\t \t\t\t}\n\t\t \t\t}\n\t\t \t}\n\t\t\t\t}\n\t\t }\n\t\t if($found_route!==null){\n\t\t \tbreak;\n\t\t }\n\t\t}\n\t\t\n\t\treturn $request;\n\t}", "public function run()\n {\n $column = array_column($this->routes[GlobalHelper::method()], 'path');\n $url = $this->url;\n if (str_contains($url, '?')) {\n $this->query = explode(\"?\", $url);\n $url = $this->query[0];\n }\n $validPath = array_filter($column, function ($path) use ($url) {\n $regex = $this->compileRoute($path);\n $ok = preg_match($regex, $url, $match);\n return $ok === 1 ? $path : false;\n });\n if (!empty($validPath) || $url === \"\") {\n foreach ($this->routes[GlobalHelper::method()] as $route) {\n $regex = $this->compileRoute($route->path);\n if ($route->matches($this->url, $regex)) {\n $route->execute($this);\n }\n }\n } elseif (empty($validPath)) {\n print_r(call_user_func([new \\App\\Controllers\\Error404Controller(), \"index\"], $this));\n }\n }", "public function callRouteHook()\n {\n if (!empty($this->matchedRoute)) {\n\n if (is_callable($this->matchedRoute->getCallable())) {\n call_user_func_array($this->matchedRoute->getCallable(), $this->matchedRouteParams);\n }\n }\n }", "function route_match() {\n global $route;\n global $html;\n global $config;\n global $matched_route;\n\n $url = explode('index.php', $_SERVER['REQUEST_URI']);\n $url = @str_replace('.', '', substr($url[1], 1));\n if(strpos($url, '?') !== false) {\n $url = explode('?', $url);\n $url = $url[0];\n }\n\n if(!$url) {\n $matched_route = 'ROOT';\n require_once __DIR__ . '/app/' . $route['ROOT'];\n return true;\n }\n\n if(substr($url, -1) == '/') {\n $url = substr($url, 0, -1);\n }\n\n // Check for simple route match\n if(array_key_exists($url, $route)) {\n $matched_route = $url;\n require_once __DIR__ . '/app/' . $route[$url];\n return true;\n }\n\n // Check for regex\n foreach($route as $r => $page) {\n $matches = array();\n\n if(preg_match('#' . $r . '$#', $url, $matches)) {\n array_shift($matches);\n\n $_GET['custom_arguments'] = $matches;\n\n $matched_route = $r;\n require_once __DIR__ . '/app/' . $page;\n return true;\n }\n }\n\n return false;\n}", "private static function rerouteCheck()\n {\n if ( ! Session::isValid()) {\n if (Session::hasTrainer()) {\n // we have a trainer but not a student\n self::computeImpliedRoute();\n } else {\n (new LoginTemplate())->display();\n }\n }\n }", "public function isOnRoute(): bool\n {\n $lang = $this->grav['language']->getActive();\n\n $path = $this->grav['uri']->rootUrl() ?: '/';\n $routes = $this->config->get('plugins.' . $this->name . '.routes');\n\n foreach ($routes as $route) {\n ['blog' => $blog, 'items' => $items] = $route;\n if ($path === $blog || str_starts_with($path, $items)) {\n if ($lang) {\n $route['blog'] = '/' . $lang . $route['blog'];\n $route['items'] = '/' . $lang . $route['items'];\n }\n $this->routes = $route;\n\n return true;\n }\n }\n\n return false;\n }", "public function getRoute(): Route;", "private function _getRoute()\n {\n $route = str_replace($this->_registry->rootPath, '', $_SERVER['REQUEST_URI']);\n $routeParts = explode('/', $route);\n if ($routeParts[0]=='public') {\n $this->_registry->route = false;\n return true;\n }\n if (!empty($routeParts)) {\n $this->controller = $routeParts[0];\n if (!empty($routeParts[1])) {\n $this->action = strtolower($routeParts[1]);\n }\n }\n if (empty($this->controller)) {\n $this->controller = 'index';\n }\n if (empty($this->action)) {\n $this->action = 'index';\n }\n $this->_registry->route = $routeParts;\n // split to arguments;\n unset($routeParts[0], $routeParts[1]);\n if (empty($routeParts)) {\n $routeParts = array();\n }\n $arguments = array();\n foreach ($routeParts as $part) {\n $arguments[] = $part;\n }\n $this->_registry->args = $arguments;\n \n return true;\n }", "public function route() {\n\t\t// Start the profiler\n\t\tProfiler::register('Core', 'Router');\n\n\t\t// First, let's look at the URL the user supplied\n\t\t$requestUrl = array_values(array_filter(explode('/', Request::getUrl())));\n\t\t$requestRoute = null;\n\n\t\t// Loop over each route and test to see if they are valid\n\t\tforeach (self::$_routes as $route) {\n\t\t\tif ($this->routeTest($requestUrl, $route)) {\n\t\t\t\t$requestRoute = $route;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// We have completed the route matching\n\t\t// Finish the setup of the request object\n\t\tProfiler::register('Core', 'Request');\n\t\tif ($requestRoute) {\n\t\t\t$_GET['controller'] = $route->endpoint['controller'];\n\t\t\t$_GET['action'] = $route->endpoint['action'];\n\t\t\tRequest::setUrlFragments(str_replace($this->_routePath, '', Request::getUrl()));\n\t\t} else {\n\t\t\tRequest::setUrlFragments(Request::getUrl(), true);\n\t\t}\n\t\tProfiler::deregister('Core', 'Request');\n\n\t\t// Inform the event listener a request has been initialised\n\t\tEvent::trigger(\n\t\t\t'initRequest',\n\t\t\tarray(\n\t\t\t\t'controller' => Request::get('controller'),\n\t\t\t\t'action' => Request::get('action')\n\t\t\t)\n\t\t);\n\n\t\t// And stop the profiler\n\t\tProfiler::deregister('Core', 'Router');\n\t\tProfiler::deregister('Core', 'Front');\n\n\t\t// And dispatch\n\t\tDispatcher::loadController(\n\t\t\tRequest::get('controller'),\n\t\t\tRequest::get('action')\n\t\t);\n\t}", "public static function route_exists($route){\n $route_parts = explode('/', trim($route, '/'));\n $total_size = count($route_parts);\n\n $possible_routes = array_filter(Router::$routes[$_SERVER['REQUEST_METHOD']], function ($route, $key) use ($total_size) {\n return $route['total_size'] === $total_size;\n }, ARRAY_FILTER_USE_BOTH);\n\n asort($possible_routes);\n\n foreach( $possible_routes as $key => $possible_route ){\n $new_key = explode('/', $key);\n $new_key = array_slice($new_key, 0 , $possible_route['total_size']-$possible_route['params_number']);\n\n $new_route = explode('/', $route);\n $new_route = array_slice($new_route, 0 , $possible_route['total_size']-$possible_route['params_number']);\n\n if( $new_key === $new_route ){\n if( $possible_route['params_number'] > 0 ){\n $possible_route['params'] = array_slice($route_parts, - $possible_route['params_number'] );\n } else {\n $possible_route['params'] = [];\n }\n return $possible_route;\n }\n }\n return false;\n }", "public function getRoute($name){ }", "private function init_route(){\n if(array_key_exists ( $this->uri_request , $this->web )){\n /*\n * check controller folder exist\n */\n if(is_dir(_CONTROLLER)){\n\n if(is_file(_CONTROLLER.\"/\".$this->web[$this->uri_request]['controller'])){\n $this->controller_path = _CONTROLLER.\"/\".$this->web[$this->uri_request]['controller'];\n $this->controller = basename(explode(\".\",$this->controller_path)[0]);\n $this->method = $this->web[$this->uri_request]['method'];\n }\n else{\n $ERROR = \"Controller not found!\";\n }\n\n }\n else{\n $ERROR = \"Controller path not set properly!\";\n }\n\n\n }\n else{\n $ERROR = \"route not found!\";\n }\n\n // echo $controller;\n\n }", "protected function _route()\r\n\t\t{\r\n\t\t\t((!is_object($this->_route)) ? $this->_route = init_class(ROUTE_NAME) : '');\r\n\t\t}", "public function fetch_route()\n\t{\n\t\treturn $this->route_stack;\n\t}", "public function route()\n {\n $this->dashboardRouting($this->relativeCmsUri);\n $this->logOffRouting($this->request, $this->relativeCmsUri);\n $this->apiRouting($this->relativeCmsUri);\n $this->documentRouting($this->userRights, $this->relativeCmsUri);\n $this->valuelistsRouting($this->userRights, $this->relativeCmsUri);\n $this->sitemapRouting($this->userRights, $this->relativeCmsUri);\n $this->redirectRouting($this->userRights, $this->relativeCmsUri);\n $this->imageRouting($this->userRights, $this->relativeCmsUri);\n $this->filesRouting($this->userRights, $this->relativeCmsUri);\n $this->configurationRouting($this->userRights, $this->relativeCmsUri);\n $this->searchRouting($this->relativeCmsUri);\n }", "public function afterLoadRoutes() {\n if (!$this->beforeConfig) {\n $this->createRoutes($this->m->Routing->routes);\n $current = $this->m->Routing->route;\n if (is_array($current) and isset($current['priority'])) {\n if ($current['priority'] > $this->priority)\n return;\n }\n if ($this->checkPath($this->request->path)) {\n \n }\n }\n }", "public function run(): void\n {\n $this->currentRoute = null;\n\n if (array_key_exists($currentRoute = $this->resolveRouterUri($this->currentUri), $this->routes[\"REDIRECT\"])) {\n $route = $this->routes[\"REDIRECT\"][$currentRoute];\n $redirectRoute = $this->getByName($route[\"redirect\"]);\n\n $this->redirectRoute(\n [$redirectRoute, $route],\n $route[\"permanent\"]\n );\n }\n\n $this->resolveRequestMethod();\n\n foreach ($this->routes[$this->requestMethod] as $route) {\n if (preg_match(\"~^\" . $route->getRoute() . \"$~\", $this->currentUri)) {\n $this->currentRoute = $route;\n }\n }\n\n $this->dispatchRoute();\n }", "protected function preReRouting()\n {\n\n }", "public function current() \n {\n $node = current($this->dispatchables);\n return ($node !== false ? $node['route'] : false);\n }", "public function findRoute(MvcEvent $e)\n {\n $router = $e->getRouter();\n $filter = new UnderscoreToCamelCase();\n $children = null;\n if (null!==$this->routes) {\n foreach ($this->routes as $rd) {\n // create each route.\n $route = Segment::factory(\n array(\n 'route' => $rd->getRoute(),\n 'defaults' => array(\n 'module' => $rd->getModule(),\n 'controller' => $filter->filter($rd->getController()),\n 'action' => $rd->getAction(),\n 'scenario' => $rd->getScenarioName(),\n 'submodule' => $rd->getSubmodule(),\n 'uid'=>'0',\n 'route_uid' => $rd->getUid(),\n ),\n 'constraints' => array(\n $rd->getConstraints()\n ),\n 'may_terminate' => true,\n )\n );\n $router->addRoute($rd->getName(), $route);\n }\n }\n\n return;\n }", "public function find_route( Request $request ) {\n $this->context->logger()->debug( 'processing Request ' . $request );\n\n if(empty($this->routes)) $this->load_routes();\n\n foreach($this->routes as $route) {\n if($route->match($request)) {\n $this->context->logger()->debug( 'matched to Route ' . $route );\n return $route;\n }\n }\n throw new Exception(sprintf('Couldn\\'t find a route to match your request: %s', $request));\n }", "protected function _parse_routes()\n\t{\n\t\t$uri = implode('/', $this->uri->segments);\n\n\t\t// Get HTTP verb\n\t\t$http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n\t\t// Loop through the route array looking for wildcards\n\t\tforeach ($this->routes as $key => $val)\n\t\t{\n\t\t\t// Check if route format is using HTTP verbs\n\t\t\tif (is_array($val))\n\t\t\t{\n\t\t\t\t$val = array_change_key_case($val, CASE_LOWER);\n\t\t\t\tif (isset($val[$http_verb]))\n\t\t\t\t{\n\t\t\t\t\t$val = $val[$http_verb];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Convert wildcards to RegEx\n\t\t\t$key = str_replace(array(':any', ':num',':all'), array('[^/]+', '[0-9]+','(?!(Techsystem|techsystem|Vindex\\/tech5sManagerControl).*$).*'), $key);\n\t\t\t// $key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n\t\t\t// Does the RegEx match?\n\t\t\tif (preg_match('#^'.$key.'$#', $uri, $matches))\n\t\t\t{\n\t\t\t\t// Are we using callbacks to process back-references?\n\t\t\t\tif ( ! is_string($val) && is_callable($val))\n\t\t\t\t{\n\t\t\t\t\t// Remove the original string from the matches array.\n\t\t\t\t\tarray_shift($matches);\n\n\t\t\t\t\t// Execute the callback using the values in matches as its parameters.\n\t\t\t\t\t$val = call_user_func_array($val, $matches);\n\t\t\t\t}\n\t\t\t\t// Are we using the default routing method for back-references?\n\t\t\t\telseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$val = preg_replace('#^'.$key.'$#', $val, $uri);\n\t\t\t\t}\n\n\t\t\t\t$this->_set_request(explode('/', $val));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\n\t\t// If we got this far it means we didn't encounter a\n\t\t// matching route so we'll set the site default route\n\t\t$this->_set_request(array_values($this->uri->segments));\n\t}", "public function run()\n {\n $requested_url = explode('/', $this->requestUrl);\n\n if (!empty($this->definedRoutes[$this->requestMethod])) {\n foreach ($this->definedRoutes[$this->requestMethod] as $route => $action) {\n $route = explode('/', $route);\n $route_depth = count($route);\n\n // Check for defined route parameters\n for( $i = 0; $i < $route_depth; $i++) {\n if (preg_match('/\\{([\\w?]+?)\\}/',$route[$i])) {\n if (isset($requested_url[$i])) {\n array_push($this->requestParameters, $requested_url[$i]);\n // replace defined route parameters with peer request url parameter for final comparison\n $route[$i] = $requested_url[$i];\n }\n }\n }\n\n // Check for unreplaced route parameters and delete them if are optional parameters (for final comparison)\n for ($j = 0; $j < $route_depth; $j++) {\n if (preg_match('/\\{([\\w]+?)\\?}/', $route[$j])) {\n unset($route[$j]);\n }\n }\n\n $route = implode('/', $route);\n\n // Final comparision. Check requested url is equal to current checking route\n if ($route == $this->requestUrl) {\n $this->matched = true;\n\n if ($action instanceof Closure) {\n return call_user_func_array($action, $this->requestParameters);\n } else if($this->isController($action)) {\n return $this->loadController($action);\n } else {\n throw new Exception('Invalid action for route');\n }\n break; // Route found, stop the operations\n } else {\n $this->reset();\n }\n }\n }\n\n if ($this->matched === false) {\n return $this->exception->notFound();\n }\n }", "function route($path=''){\r\n try {\r\n parent::route($path != '' ? $path : self::getEndPoint());\r\n } catch (Exception $e) {\r\n parent::route('help');\r\n }\r\n }", "function ci_use_route(){\n\t\t$c_uri=$this->uri->segments;\n\t\t$c_ruri=$this->uri->rsegments;\n\n\t\t//--- we re-introduice the directori in RURI\n\t\tif($this->router->directory!=''){\n\t\t\tarray_unshift($c_ruri , trim($this->router->directory,'/'));\n\t\t\t$i = 1;\n\t\t\tforeach ($c_ruri as $val) $c_ruri[$i++] = $val;\n\t\t\tunset($c_ruri[0]);\n\t\t}\n\n\t\tif(count($c_uri) > count($c_ruri))return true;\n\t\t//--- Now if URI == RURI => there is no used route.\n\t\tif(count($c_uri) == count($c_ruri)) return (implode('/',$c_uri)==implode('/',$c_ruri))? false:true;\n\n\t\tfor($i=1;$i <= count($c_uri);$i++) {\n\t\t\tif($c_uri[$i]!=$c_ruri[$i]) return true;\n\t\t}\n\t\treturn false;\n\t}", "public function __construct(){\n $this->findRoute();\n }", "private function checkRoute(string $url, string $method): ?iterable {\n foreach ($this->routes[$method] as $route_path => $route) {\n\n if (strpos($url, $route_path) === 0) {\n $route = $this->decodeControler($route);\n $namespace = 'App\\Controllers\\\\';\n $route['controller'] = $namespace . $route['controller'];\n $this->routePath = $route_path;\n return $route;\n }\n }\n return NULL;\n }", "public function dispatch()\r\n {\r\n $route = $this->searchRoute();\r\n\r\n $this->filterRoute();\r\n\r\n if (count($route) === 0) {\r\n $this->run404();\r\n }\r\n\r\n $this->runCallback($route);\r\n }", "function goToRoute() {\n\t\tinclude(CONTROLLERPATH.$this->routes[$this->route]);\n\n\t\t// Load\n\t\t$controller = $this->route.\"controller\";\n\t\t$controller = new $controller;\n\n\t\t$action = $this->action;\n\t\tif(is_null($this->action))\n\t\t\t$controller->index();\n\t\telse\n\t\t\t$controller->$action();\n\t}", "public function getRoutes() {}", "public function matchRoute() {\n\t\tforeach($this->routes as $pattern => $callback) {\n\t\t\tif (preg_match('{^' . $pattern . '$}', $this->url) === 1) {\n\t\t\t\tif(!isset($_SESSION)){ session_start(); }\n\t\t\t\t// Parameters\n\t\t\t\t$params = array();\n\t\t\t\tif (isset($callback['params'])) {\n\t\t\t\t\t$url = explode('/', $this->url);\n\t\t\t\t\t$url = array_slice($url, -1 * count($callback['params']));\n\t\t\t\t\t$params = array_combine(array_keys($callback['params']), $url);\n\t\t\t\t}\n\t\t\t\t// Secured (Backend)\n\t\t\t\tif (isset($callback['secured'])) {\n\t\t\t\t\tif (isset($_SESSION['auth']) && $_SESSION['auth'] === true) {\n\t\t\t\t\t\t$this->dispatch($callback['controller'], $callback['action'], $params);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->url = 'http://' . $_SERVER['SERVER_NAME'] . '/login';\n\t\t\t\t\t\theader('location:' . $this->url);\n\t\t\t\t\t}\n\t\t\t\t// Secured (Frontend)\n\t\t\t\t} elseif (isset($callback['clientsecured'])) {\n\t\t\t\t\tif (isset($_SESSION['fauth']) && $_SESSION['fauth'] === true) {\n\t\t\t\t\t\t$this->dispatch($callback['controller'], $callback['action'], $params);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->url = 'home/login';\n\t\t\t\t\t\theader('location:' . $this->url);\n\t\t\t\t\t}\n\t\t\t\t// Simple\n\t\t\t\t} else {\n\t\t\t\t\t$this->dispatch($callback['controller'], $callback['action'], $params);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// No match\n\t\t$this->dispatch('Default', 'error', array('code' => 404));\n\t\treturn;\n\t}", "public function route() {\n\t\t$route = $this->sets[':default']->route();\n\t\tif (!$route&&sizeof($this->route_extra)==0) return false;\n\t\tif (!$route) $route = new CMS_Navigation3_LinkSet();\n\t\t$n = $route->count();\n\t\tforeach($this->route_extra as $r) {\n\t\t\t$item = $r[1];\n\t\t\t$item['id'] = $n;\n\t\t\t$n++;\n\t\t\t$route->add($r[0],$item);\n\t\t}\t\n\t\treturn $route;\n\t}", "private function route() {\n\n// if (!in_array($_GET['page'], $pages)) {\n// echo \"bad\";\n// exit;\n// }\n\n if (!empty($_GET['page']) && file_exists( __ROOT__.'controller/'.$_GET['page'].'.php')) {\n include __ROOT__.'controller/'.$_GET['page'].'.php';\n } else {\n include __ROOT__.'controller/home.php';\n }\n include __ROOT__.'public/footer.html';\n }", "public static function route();", "public function getSystemRoutes();", "public function run() : bool\n {\n $uri = $this->getURI();\n \n $result = $this->setRouting($uri, $this->routerEntity->getRoutes());\n \n if ($result){\n return true;\n }else{\n return false;\n }\n }", "protected function routes()\n {\n if ($this->app->routesAreCached()) {\n return;\n }\n\n\n /**\n * Porteiro; Routes\n */\n $this->loadRoutesForRiCa(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'routes');\n }", "public function run()\n\t{\n\t\t// Fetch routes and URL path\n\t\t$routes = $this->config()->get('app.routes');\n\t\t$path = $this->request()->getPath();\n\n\t\t$match = false;\n\n\t\t// Loop through the routes to find a match\n\t\tforeach ($routes as $route => $action) {\n\t\t\tif ($path == $route) {\n\t\t\t\t// Check for exact match of route\n\t\t\t\t$match = array('route' => $route, 'action' => $action);\n\t\t\t} else {\n\t\t\t\t// Perform pattern matching of routes against path\n\t\t\t\t$routeMatches = array();\n\t\t\t\tpreg_match_all('/:(?P<params>[a-z]+)(\\/|\\z)/', $route, $routeMatches);\n\t\t\t\t\n\t\t\t\t// Create route regex\n\t\t\t\t$regexRoute = str_replace('/', '\\/', $route);\n\t\t\t\tforeach ($routeMatches['params'] as $param) {\n\t\t\t\t\t$regexRoute = str_replace(':' . $param, '(?P<values>[a-zA-Z0-9\\-_.]+)', $regexRoute);\n\t\t\t\t}\n\t\t\t\t$regexRoute = '/^' . $regexRoute . '$/';\n\t\t\t\t\n\t\t\t\t$regexPath = array();\n\t\t\t\t// Check for match\n\t\t\t\tif (preg_match_all($regexRoute, $path, $regexPath)) {\n\t\t\t\t\t$match = array('route' => $route, 'action' => $action, 'params' => array_combine($routeMatches['params'], $regexPath['values']));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($match !== false) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ($match === false) {\n\t\t\tthrow new \\Exception(\"No matching route found.\");\n\t\t} else {\n\t\t\t$match['action']($match['params']);\n\t\t}\n\t}", "public static function init($path)\n {\n $path = ($path == '/')?'/':rtrim($path,\"/\"); // Remove slash at the end\n $desired_route = null;\n $pnf = false; // page not found\n\n foreach (self::$routes as $route) {\n $pattern = $route->path;\n $pattern = str_replace('/', '\\/', $pattern);\n\n $pattern = '/^' . $pattern . '$/i';\n $pattern = preg_replace('/{[A-Za-z0-9]+}/', '([A-Za-z0-9-_\\s=]+)', $pattern);\n \n if (preg_match($pattern, $path, $match) && $route->method == strtolower($_SERVER['REQUEST_METHOD'])) {\n $pnf = true;\n $desired_route = $route;\n break;\n }\n }\n\n if($pnf){\n $url_parts = explode('/', $path);\n self::$current = url(ltrim($path, \"\\/\"), true);\n $route_parts = explode('/', $desired_route->path);\n \n foreach ($route_parts as $key => $value) {\n if (!empty($value)) {\n $value = str_replace('{', '', $value, $count1);\n $value = str_replace('}', '', $value, $count2);\n \n if ($count1 == 1 && $count2 == 1) {\n Params::set($value, $url_parts[$key]);\n }\n }\n } \n }\n \n if ($desired_route) {\n if ($desired_route->method != strtolower($_SERVER['REQUEST_METHOD'])) {\n return self::terminate(405);\n } else {\n\n if($desired_route->method == 'post'){\n if (!Utill::validateCsrf()) {\n return self::terminate(419);\n }\n }\n $proceed = true;\n if($desired_route->ajax){\n $proceed = request()->ajax();\n }\n\n if($proceed){\n if(!is_object($desired_route->action)){\n // TO CONTROLLER\n $actions = explode('@', $desired_route->action);\n \n $class = '\\\\App\\\\Controllers\\\\' . $actions[0];\n \n $obj = new $class();\n \n if($desired_route->middleware != null && !false){\n $middleware = '\\\\App\\\\Middleware\\\\' . $desired_route->middleware;\n $middleware = new $middleware();\n if(call_user_func(array($middleware, 'after'))){\n print_r(\n call_user_func_array(\n array($obj, $actions[1]), \n Params::get()\n )\n );\n }else{\n return self::terminate(419);\n }\n }else{\n print_r(\n call_user_func_array(\n array($obj, $actions[1]), \n Params::get()\n )\n );\n }\n }else{\n // CLOSURE OBJECT\n $closure = $desired_route->action;\n print_r($closure());\n }\n }else{\n return self::terminate(404);\n }\n }\n\n } else {\n return self::terminate(404);\n }\n }", "public function hasRoute(string $name): bool;", "private function loadRoute()\n\t{\n\t\t/*\n\t\t* Se o controller nao for passado por GET,\n\t\t* assume-se como padrão o controller 'IndexController';\n\t\t*/\n\t\t$this->st_controller = isset($_REQUEST['controle']) ? $_REQUEST['controle'] : 'index';\n\t\t\n\t\t/*\n\t\t* Se a action nao for passada por GET,\n\t\t* assume-se como padrão a action 'IndexAction';\n\t\t*/\n\t\t$this->st_action = isset($_REQUEST['acao']) ? $_REQUEST['acao'] : 'index';\n\t}", "protected function _parse_routes()\n {\n $uri = implode('/', $this->uri->segments);\n\n // Get HTTP verb\n $http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri])) {\n // Check default routes format\n if (is_string($this->routes[$uri])) {\n $this->_set_request(explode('/', $this->routes[$uri]));\n return;\n }\n // Is there a matching http verb?\n elseif (is_array($this->routes[$uri]) && isset($this->routes[$uri][$http_verb])) {\n $this->_set_request(explode('/', $this->routes[$uri][$http_verb]));\n return;\n }\n }\n\n // decryption of module/controller/function name in admin\n if ($this->config->item('is_admin') == 1) {\n if ($this->config->item('ADMIN_URL_ENCRYPTION') == 'Y') {\n $uri_t = str_replace('admin/', '', $uri);\n if ($uri_t != \"\") {\n require_once(APPPATH . '/libraries/Ci_encrypt.php');\n $CI_Enc = new Ci_encrypt();\n $uri_t_decode = $CI_Enc->decrypt($uri_t, true);\n $CI_Enc->convertEncryptedVars();\n }\n $uri = 'admin/' . $uri_t_decode;\n }\n }\n // Loop through the route array looking for wildcards\n foreach ($this->routes as $key => $val) {\n // Check if route format is using http verb\n if (is_array($val)) {\n if (isset($val[$http_verb])) {\n $val = $val[$http_verb];\n } else {\n continue;\n }\n }\n\n // Convert wildcards to RegEx\n #$key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // Does the RegEx match?\n if (preg_match('#^' . $key . '$#', $uri, $matches)) {\n // Are we using callbacks to process back-references?\n if (!is_string($val) && is_callable($val)) {\n // Remove the original string from the matches array.\n array_shift($matches);\n\n // Execute the callback using the values in matches as its parameters.\n $val = call_user_func_array($val, $matches);\n }\n // Are we using the default routing method for back-references?\n elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE) {\n $val = preg_replace('#^' . $key . '$#', $val, $uri);\n }\n\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request(array_values($this->uri->segments));\n }", "public static function routes(): void\n {\n //\n }", "private function route($path='')\n\t{\n\t\tif ( !$this->is_routed && self::check_path($path) )\n\t\t{\n\t\t\t$this->is_routed = 1;\n\t\t\t$this->path = $path;\n\t\t\t$fpath = $path;\n \n // We go through each path, starting by the longest until it's empty\n\t\t\twhile ( strlen($fpath) > 0 ){\n\t\t\t\tif ( $this->get_controller($fpath) ){\n\t\t\t\t\tif ( strlen($fpath) < strlen($this->path) ){\n $this->arguments = [];\n $args = explode('/', substr($this->path, strlen($fpath)));\n foreach ( $args as $a ){\n if ( \\bbn\\str\\text::is_number($a) ){\n $a = (int)$a;\n }\n array_push($this->arguments, $a);\n }\n\t\t\t\t\t\t// Trimming the array\n\t\t\t\t\t\twhile ( empty($this->arguments[0]) ){\n\t\t\t\t\t\t\tarray_shift($this->arguments);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$t = end($this->arguments);\n\t\t\t\t\t\twhile ( empty($t) ){\n\t\t\t\t\t\t\tarray_pop($this->arguments);\n\t\t\t\t\t\t\t$t = end($this->arguments);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$fpath = strpos($fpath,'/') === false ? '' : substr($this->path,0,strrpos($fpath,'/'));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( !$this->controller ){\n\t\t\t\t$this->get_controller('default');\n\t\t\t}\n\t\t}\n\t\treturn $this;\n\t}", "public static function route()\n {\n return self::$route;\n }", "function scanner(){\n if(strlen(trim(rtrim($_REQUEST[$this->routeParam])))>0){\n $this->resource = explode(\"/\", rtrim($_REQUEST[$this->routeParam]));\n $route = '/'.$this->resource[0];\n unset($this->resource[0]);\n $this->resource = implode('/',array_values($this->resource));\n if(in_array($route, $this->routeList)){\n $this->route = $route;\n }else{\n $this->route ='/404';\n }\n }else{\n $this->route='/';\n }\n }", "public function initRoutes()\r\n {\r\n $route = new Route();\r\n\r\n $routesConf = include __DIR__ . '/../../config/routes.inc.php';\r\n\r\n foreach ($routesConf as $routeConf) {\r\n\r\n $uri = $routeConf['uri'];\r\n\r\n if (preg_match_all('/\\$(.*?(?=\\/)|.*?$)/', $routeConf['uri'], $matches)) {\r\n $uri = preg_replace('/\\$(.*?(?=\\/)|.*?$)/', '.*', $routeConf['uri']);\r\n }\r\n\r\n $route->add($uri, $routeConf, $matches[1], function($params) {\r\n $this->config->route = $params['config'];\r\n\r\n $args = [];\r\n if (isset($params['arguments'])) {\r\n $args = $params['arguments'];\r\n }\r\n\r\n $controller = new $params['config']['controller']($this->config, $this->db, $args);\r\n\r\n $controller->indexAction();\r\n });\r\n }\r\n\r\n $findUrl = $route->submit();\r\n\r\n if (!$findUrl) {\r\n header('HTTP/1.0 404 Not Found');\r\n include_once __DIR__ . '/../../../src/Views/errors/404_de.html';\r\n }\r\n }", "public function dispatch(){\n //Execute the fn, pass in the content of placeholders in order\n $matches = array();\n foreach ($this->routes as $regex => $callback){\n if (preg_match($regex, $this->request, $matches) == 0) continue;\n array_shift($matches); //The first match is the full request\n call_user_func_array($callback, $matches);\n return true;\n }\n throw new \\Exception(\"Page not found\", 404);\n }", "public function getRouteMatch();", "public function testFindAllByRoute()\n {\n $this->markTestIncomplete('WebTestCases are not implemented yet.');\n }", "public function addRoute()\n {\n if (!$this->route->isFulfilled()) {\n return $this->route->dispatch(func_get_args());\n }\n\n return true;\n }", "public static function performRouting(){\n // When patterns are defined, try to parse friendly URLs at first\n if(is_array(self::$urlPatterns)){\n if(self::performFriendlyRouting()){\n return;\n }\n }\n\n // Use standard routing method\n if(self::performStandardRouting()){\n return;\n }\n\n // Execute controller set as a fallback\n if(!self::executeController(self::$notFoundFallbackController)){\n die(\"Dispatcher: Failed to execute fallback controller\");\n }\n }", "private function _getRoute($path)\n {\n if (strpos($this->request->getPath(), '/api') === 0) {\n $routes = $this->config->get('routes:rest');\n } else {\n $routes = $this->config->get('routes');\n }\n\n foreach ($routes as $name => $data) {\n\n if ($target = $this->_getDirectMatch($path, $data)) {\n return $target;\n } else if ($target = $this->_getVariableMatch($path, $data)) {\n return $target;\n }\n\n }\n\n throw new MethodNotFoundException('No matching route for path \"' . $path . '\" found');\n }", "public function testNoRouteFound() {\n\n\t\t$router = new Nether\\Avenue\\Router(static::$RequestData['TestDeep']);\n\t\t$router->AddRoute('{@}//index','herp::derp');\n\t\t(new Verify(\n\t\t\t'no routes found return null',\n\t\t\t$router->GetRoute()\n\t\t))->equals(null);\n\n\t\treturn;\n\t}", "function _route()\n\t{\n\t\t// if the user login redirect to base\n\t\tif(\\lib\\permission::access('enter:another:session'))\n\t\t{\n\t\t\t// the admin can login by another session\n\t\t\t// never redirect to main\n\t\t}\n\t\telse\n\t\t{\n\t\t\tparent::if_login_not_route();\n\t\t}\n\n\t\t// check remeber me is set\n\t\t// if remeber me is set: login!\n\t\tparent::check_remember_me();\n\n\t\t// save all param-* | param_* in $_GET | $_POST\n\t\t$this->save_param();\n\n\t\tif(self::get_request_method() === 'get')\n\t\t{\n\t\t\t$this->get(false, 'enter')->ALL();\n\t\t}\n\t\telseif(self::get_request_method() === 'post')\n\t\t{\n\t\t\t$this->post('enter')->ALL();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tself::error_method('home');\n\t\t}\n\t}", "public function test_route_override() {\n\t\tregister_rest_route(\n\t\t\t'test-ns',\n\t\t\t'/test',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET' ),\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t'should_exist' => false,\n\t\t\t)\n\t\t);\n\t\tregister_rest_route(\n\t\t\t'test-ns',\n\t\t\t'/test',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'POST' ),\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t'should_exist' => true,\n\t\t\t),\n\t\t\ttrue\n\t\t);\n\n\t\t// Check we only have one route.\n\t\t$endpoints = $GLOBALS['wp_rest_server']->get_routes();\n\t\t$endpoint = $endpoints['/test-ns/test'];\n\t\t$this->assertCount( 1, $endpoint );\n\n\t\t// Check it's the right one.\n\t\t$this->assertArrayHasKey( 'should_exist', $endpoint[0] );\n\t\t$this->assertTrue( $endpoint[0]['should_exist'] );\n\t}", "public static function getRoute() {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__);\n\n\t\t$route = (isset(self::$route_options['route'])) ? self::$route_options['route'] : null;\n\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $route);\n\t\t$route = self::_applyFilter(get_class(), __FUNCTION__, $route, array('event' => 'return'));\n\n\t\treturn $route;\n\t}", "public function path(): RoutePathInterface;", "public function run(){\n if(!isset($this->routes[$_SERVER['REQUEST_METHOD']])){\n throw new \\Exception('REQUEST_METHOD does not exist');\n }\n foreach($this->routes[$_SERVER['REQUEST_METHOD']] as $route){\n if($route->match($this->url)){\n return $route->call();\n }\n }\n throw new \\Exception(\"e404\");\n }", "public function getFullRoute();" ]
[ "0.65946484", "0.64926034", "0.6487607", "0.6281742", "0.62562615", "0.6230622", "0.61826414", "0.6122974", "0.6121335", "0.6084998", "0.5966015", "0.5943828", "0.59267294", "0.58867705", "0.58679634", "0.58229125", "0.58109015", "0.58077353", "0.58067566", "0.5719957", "0.57145613", "0.5709806", "0.5687855", "0.5679877", "0.5670385", "0.56672204", "0.56419337", "0.56412417", "0.56300116", "0.5629465", "0.56164366", "0.5591422", "0.559067", "0.5589525", "0.5588145", "0.5581238", "0.5573385", "0.557271", "0.55688256", "0.55596507", "0.5553388", "0.55346644", "0.5518553", "0.5512556", "0.55096185", "0.5506594", "0.54976475", "0.5493768", "0.549228", "0.5485655", "0.54728305", "0.5461677", "0.54429674", "0.54397494", "0.5436357", "0.5434959", "0.54324186", "0.54261523", "0.541277", "0.54058135", "0.53860754", "0.53793585", "0.53791004", "0.53748894", "0.5373117", "0.5371718", "0.5364953", "0.5356515", "0.53554094", "0.53538495", "0.53521", "0.5343172", "0.534075", "0.5339087", "0.5338242", "0.53362346", "0.53182566", "0.53063184", "0.5305938", "0.5293315", "0.52932173", "0.52909493", "0.52821416", "0.5277038", "0.52697617", "0.5269266", "0.5264738", "0.52519655", "0.5241418", "0.524052", "0.5237737", "0.52377266", "0.52359957", "0.52186495", "0.52007145", "0.5195935", "0.51955104", "0.5195074", "0.5184131", "0.5182385", "0.5158978" ]
0.0
-1
Time to live in minutes
public function setTtl($ttl = 60) { $this->ttl = $ttl; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTimeInMinutes();", "function getLifeTime();", "public function timeToLive($value = null) {\n\t\tif (func_num_args() > 0) {\n\t\t\t$this->timeToLive = $value;\n\t\t} else {\n\t\t\treturn $this->timeToLive;\n\t\t}\n\t}", "public static function getTimeToRun();", "public function activityTime();", "public function howLongToCacheInSeconds(){\n return(1200); //twenty minutes by default\n }", "public function howLongToCacheInSeconds(){\n return(12000); //200 minutes\n }", "public function uptime() : int;", "public function getTtl(): int\n {\n return 10;\n }", "public function howLongToCacheInSeconds(){\n return(120); //two minutes by default\n }", "public static function get_expire_time_otp()\n {\n return apply_filters('wordpress_acl_otp_time_expire', (MINUTE_IN_SECONDS * 5));\n }", "public function getUseTime() \n \t{\n \t\treturn $this->use_time;\n \t}", "public function time()\n\t{\n\t\treturn $this->endTimer-$this->startTimer;\n\t}", "public function decayMinutes(): int\n {\n return 1;\n }", "public function getCacheTimeToLive() {\n return $this->cacheTtl;\n }", "public function time() {\n return $this->info['total_time'];\n }", "private function getExpiration()\n {\n return (self::EXPIRATION_IN_MINUTES * 60);\n }", "public function getTotalTime()\n {\n return 0; //@todo\n }", "public function currentTime();", "public function getTotalTime()\n {\n return $this->info->total_time * 1000;\n }", "function timeOut()\r\n {\r\n //Get Offline to user that are 600 second out\r\n $users = self::getAllUsers('id', -1);\r\n\r\n foreach ($users as $singleUser)\r\n {\r\n if (time() - intval($singleUser->getLastActivityTime()) > 600)\r\n {\r\n $singleUser->setOffline(1);\r\n self::updateUser($singleUser);\r\n }\r\n }\r\n \r\n if (isset($_SESSION[\"user_id\"]) && $_SESSION[\"user_id\"] !== NULL)\r\n {\r\n //Put the new time activity\r\n $userOnline = self::getCurrentUser();\r\n $userOnline->setLastActivityTime(time());\r\n self::updateUser($userOnline);\r\n LanguageSupport::changeLanguage($userOnline->getLanguage());\r\n }\r\n }", "public function getLifeTime() {\n\t\treturn parent::getLifeTime();\n\t}", "function gmt_time() {\r\n\t\t$now = time ();\r\n\t\t$tz = $this->gmt_timezone ();\r\n\t\t$seconds = 3600 * $tz;\r\n\t\treturn $now - $seconds;\r\n\t}", "private function _upTime() \n {\n return microtime(true) - $this->_startTime;\n }", "private static function time_exec()\n {\n $current = self::time();\n self::$time_exec = $current-self::$time_start;\n }", "public function cacheFor()\n {\n return now()->addMinutes(1440);\n }", "public function iN_UpdateLiveStreamingTime($liveID) {\n\t\t$time = time();\n\t\tmysqli_query($this->db, \"UPDATE i_live SET finish_time = '$time' WHERE live_id = '$liveID'\") or die(mysqli_error($this->db));\n\t}", "public function getTotalTime(){\n return $this->totalTime;\n }", "public function getTimeTaken(){\r\n return round($this->getEndTime() - $this->getStartTime(), 6);\r\n }", "private function ncc_v2_twitter_tweets_cache_to_seconds()\n {\n if ( get_option( NCC_V2_TWITTER_OPTION_GROUP ) )\n {\n $options = get_option( NCC_V2_TWITTER_OPTION_GROUP );\n $cache_minutes = $options['ncc_v2_twitter_admin_options_cache_duration'];\n } else\n {\n $cache_minutes = 0;\n }\n\n $cache_minutes = $cache_minutes * 60;\n\n return $cache_minutes;\n }", "public function expiration($minutes)\n {\n return time() + ($minutes * 60);\n }", "public function getUserIdleSeconds()\n {\n try\n {\n $luats = $this->getInstanceUserActionTimestamp();\n $now = time();\n $diff = $now - $luats;\n return $diff;\n } catch (\\Exception $ex) {\n throw $ex;\n }\n }", "function setLifeTime($time);", "public function getTempCacheTimeToLive() {\n return $this->temporaryCacheTtl;\n }", "function getTimeProccess(){\n\t\treturn round($this->timeProccess,5);\n\t}", "public function aim_onlinetime()\r\n\t{\r\n\t\t$s = time() - $this->core->user['timer'];\r\n\t\t$d = intval($s / 86400);\r\n\t\t$s -= $d * 86400;\r\n\t\t$h = intval($s / 3600);\r\n\t\t$s -= $h * 3600;\r\n\t\t$m = intval($s / 60);\r\n\t\t$s -= $m * 60;\r\n\t\treturn array('days' => $d, 'hours' => $h, 'mins' => $m, 'secs' => $s);\r\n\t}", "public function getTimeTo()\n {\n return $this->timeTo;\n }", "public function getAvailableTime()\n {\n return $this->available_time;\n }", "public function getExecutionTime()\n {\n return $this->took;\n }", "public function allTime() {\n\t\tif(!$this->allTime) {\n\t\t\t$this->allTime = $this->getNikePlusFile('http://nikeplus.nike.com/plus/activity/running/'.rawurlencode($this->userId).'/lifetime/activities?indexStart=999999&indexEnd=1000000');\n\t\t}\n\t\treturn $this->allTime;\n\t}", "function VerifyTime() {\r\n $current = time();\r\n // check if the session has expired\r\n $this->err_level = 16;\r\n $this->err = \"Verify expire. LastUsed: \" . (string)$this->sessdata[\"lastused\"] . \" ExpireTime: \" . (string)$this->expire_time . \" Current: \" . (string)$current ;\r\n $this->err_no = 0;\r\n $this->DbgAddSqlLog();\r\n if ($this->sessdata[\"lastused\"]+$this->expire_time<$current) {\r\n return 0;\r\n }\r\n return 1;\r\n }", "public function getTime();", "public function getTime();", "protected function calculateTime()\n {\n return $this->start->diffInHours($this->end) +\n round(\n ($this->start->diffInMinutes($this->end) - ($this->start->diffInHours($this->end) * 60)) / 60,\n 1\n );\n }", "public function setLiveTime($time = 300) {\n\t\t$this->clientLiveTime = $time;\n\t}", "protected function lockoutTime()\n {\n return Arr::get(static::$config, 'locked_for', 60);\n }", "function getTimeDuration();", "protected function expirationTime()\n {\n $ttl = $this->getOptions()->getTtl();\n if ($ttl > 2592000) {\n return time() + $ttl;\n }\n return $ttl;\n }", "public static function getReloadTimeout() {\r\n return 60 * 10; // 10 minutes\r\n }", "public function cache_lifetime_callback()\n {\n $this->view('params/lifetime', [\n 'dim' => __('minutes', 'sepw'),\n 'lifetime' => isset($this->options['cache_lifetime']) ? esc_attr($this->options['cache_lifetime']) : 30,\n ]);\n }", "public function testTimeToLiveFire() {\n $config = new APNsConfig();\n $fcmTest = new FCMTest();\n try {\n $config -> setTimeToLive(1);\n } catch (\\Exception $e) {\n }\n $result = $fcmTest -> fireWithConfig($config);\n\n $this -> assertTrue($result);\n }", "protected static function _timeToStopwatch()\n {\n return self::$_startupTime - $_SERVER['REQUEST_TIME_FLOAT'];\n }", "public function checktime($diff)\n {\n //$diffe = str_replace(\"T\", \" \", $temp[0]);\n $time = strtotime($diff); //prod server time\n $this->test = date(\"F j, Y, g:i a\", $time);\n $now = time();\n $minutes = ($time - $now) / 60;\n\n return $minutes;\n }", "final public function get_idle_time(/* ... */)\n {\n return $this->_idle_time;\n }", "public function is_game_live()\n {\n return $this->status === 'live' ? true : false;\n }", "function timer()\n {\n return hrtime(true);\n }", "protected function expiration($minutes)\n\t{\n\t\tif ($minutes === 0)\n\t\t{\n\t\t\treturn 9999999999;\n\t\t}\n\n\t\treturn time() + ($minutes * 60);\n\t}", "public function getElapsedTime();", "public function getDurationTime()\n {\n return $this->duration * 60 * 60;\n }", "public function getServerUptime() {\n\t\treturn 0;\n\t}", "public function getSessionTime(){\n return $this->_session->get('time');\n }", "public function test_time_ago() {\n\t\t$time = current_time( 'timestamp' );\n\t\t$time_ago = locomotive_time_ago( $time );\n\n\t\t$this->assertEquals( '1 min ago', $time_ago );\n\t}", "private function getCurrentTime()\n {\n return microtime(true);\n }", "public function lifetime($sec=null){\n if($sec!=null){\n $this->_timelife = $sec;\n }\n return $this->_timelife;\n }", "public function getTime()\n {\n $time = 0;\n foreach ($this->data['views'] as $view) {\n $time += (float) $view['time'];\n }\n\n return $time;\n }", "function wprss_feed_cache_lifetime( $seconds ) {\n return 1; // one second\n }", "public function getTimeoutMinutes()\n {\n return $this->timeout_minutes;\n }", "public function sessionAge()\n {\n if (!isset($_SESSION[PMF_SESSION_ID_TIMESTAMP])) {\n return 0;\n }\n\n return ($_SERVER['REQUEST_TIME'] - $_SESSION[PMF_SESSION_ID_TIMESTAMP]) / 60;\n }", "public function timeLeftEdit()\n {\n return ceil((ARGUMENT_EDIT_INTERVAL - time() + $this->dateAdded()) / 60);\n }", "protected function getTime()\n {\n return time();\n }", "public function getTtl(): int\n {\n return $this->ttl;\n }", "static public function getSessionTime(){\n if (!isset($_SESSION['start_time'])){\n return 0;\n } else {\n return time() - $_SESSION['start_time'];\n }\n }", "protected function getTime() {\n return microtime(true);\n }", "public function updatePinTime()\n {\n /*Redis::command(\"sadd\", [PinHelper::REDIS_PINS_TO_UPDATE_TIME, 2,5,6, \"j\", \"aaa\"]);\n $x = Redis::command('spop', [PinHelper::REDIS_PINS_TO_UPDATE_TIME, 100]);*/\n $pin_id = [];\n $result = PinTimeUpdate::limit(100)->get();\n foreach ($result as $value) {\n $pin_id[] = CacheHelper::getCache(\"user_pin_id\", [\"user_id\" => $value->user_id]);\n $value->delete();\n }\n\n Pin::whereIn(\"id\", $pin_id)->update(['updated_at' => DB::raw('DATE_ADD(updated_at,INTERVAL 10 MINUTE)')]);\n }", "public function get_total_time() {\n\t\t\treturn $this->total_time;\n\t\t}", "function getCurrentTime()\n\t\t{\n\t\t\t$time = date('h:i:s a');\n\t\t\treturn $time;\n\t\t}", "private function getCurrentTime() {\n return microtime( true );\n }", "public function getTime(): int {\n return $this->time;\n }", "public function get_duration();", "public function getActualTime()\n {\n return $this->actual_time;\n }", "public function lookuptime() {\n return $this->info['namelookup_time'];\n }", "protected function getTime()\n {\n return microtime(true);\n }", "public function uptime() : int\n {\n return $this->uptime;\n }", "protected function serverUptime()\n {\n $uptimestring = file_get_contents('/proc/uptime');\n $ticks = explode(\" \", $uptimestring);\n $min = $ticks[0]/60;\n $hours = $min/60;\n $this->uptimedays = floor($hours/24);\n $this->uptimehours = floor($hours-($days*24));\n $this->uptimeminutes = floor($min-($days*60*24)-($hours*60));\n }", "public function getTtl()\n {\n return $this->ttl;\n }", "public function time() {\n return date('j F Y, H:i', $this->time_changed); // 12 October 2010, 09:14\n // return date('j F Y, h:ia', $this->time_changed); // 12 October 2010, 09:14am\n }", "public function elapsedtime() {\n return fmod(floatval($this->servertime()),$this->waitingtime());\n\t}", "public function now();", "function time_now() {\n return date(\"H:i:s\");\n}", "public function getEndTime();", "public function getEndTime();", "public function getEndTime();", "public function getTotalTime() {\n return (float) $this->profile->userTotals->totalDuration;\n }", "public static function uptime() {\n return sprintf ( '%.6f', microtime ( true ) - microtime(true) );\n }", "public function getExecutionTime() {}", "public function is_live()\n {\n return in_array($this->status, self::$LIVE_STATUSES);\n }", "public function pausetimeAction()\n {\n $user_params=$this->_request->getParams();\n $ftvrequest_obj = new Ep_Ftv_FtvRequests();\n $ftvcontacts_obj = new Ep_Ftv_FtvContacts();\n $ftvtime_obj = new Ep_Ftv_FtvPauseTime();\n if($user_params['type'] == 'pause')\n {\n ////for goroup Id in users table////\n $ftvtime_obj->ftvrequest_id=$user_params['requestId'];\n $ftvtime_obj->pause_at=date('Y-m-d H:i:s') ;\n $ftvtime_obj->resume_at=null;\n $ftvtime_obj->insert();\n }\n else\n {\n $data = array(\"resume_at\"=>date('Y-m-d H:i:s'));////////updating\n $query = \"ftvrequest_id= '\".$user_params['requestId'].\"' AND resume_at is null\";\n $ftvtime_obj->updateFtvPauseTime($data,$query);\n }\n }", "public function get_time() {\n return $this->_time;\n }", "public function getExpirationTime(): int\n {\n return $this->expirationTime;\n }", "public function getTime(): int {\n\t\treturn $this->time;\n\t}", "private function calculateTime()\n {\n $slowest = 1000000;\n for($i=1; $i<=12; $i++){\n if($_GET['Tr'.$i] > 0 && $slowest > $this->troopCostsProperties['Tr'.$i][5] ){\n $slowest = $this->troopCostsProperties['Tr'.$i][5];\n }\n }\n $time = $this->distance/($slowest*SERVER_SPEED_RATE);\n return $time;\n }" ]
[ "0.69382447", "0.6494767", "0.6428171", "0.63389665", "0.6300368", "0.6181017", "0.6144704", "0.6135144", "0.6129771", "0.61203045", "0.60181534", "0.601468", "0.6010354", "0.59780407", "0.59738326", "0.59405667", "0.59137034", "0.58339185", "0.5828018", "0.581391", "0.57733244", "0.5760901", "0.5760653", "0.5758342", "0.57579404", "0.57418424", "0.5738522", "0.57207775", "0.57115483", "0.5696847", "0.56954825", "0.56935287", "0.56921554", "0.56907725", "0.56803393", "0.56766653", "0.56764674", "0.5658551", "0.5653587", "0.565124", "0.564892", "0.5648889", "0.5648889", "0.56440365", "0.5630494", "0.5613925", "0.5609688", "0.5606656", "0.55962056", "0.5591133", "0.5589947", "0.5571049", "0.5566404", "0.5549148", "0.5548958", "0.5548672", "0.5534525", "0.5529304", "0.55267316", "0.5516427", "0.55113417", "0.5509607", "0.5506818", "0.55011404", "0.5499555", "0.549874", "0.54964167", "0.5495894", "0.5486795", "0.5485956", "0.5482179", "0.5480431", "0.54790246", "0.54786134", "0.54771006", "0.5474959", "0.5474302", "0.547312", "0.5471166", "0.5463513", "0.54556465", "0.5447406", "0.54447156", "0.54404926", "0.5430394", "0.54300475", "0.5428473", "0.5427427", "0.54221886", "0.541668", "0.541668", "0.541668", "0.54126084", "0.54061854", "0.5404641", "0.5398949", "0.5390093", "0.5386962", "0.5382861", "0.5382813", "0.5378334" ]
0.0
-1
Seed the application's database.
public function run() { $this->call(CiudadTableSeeder::class); $this->call(PaisTableSeeder::class); $this->call(CarreraTableSeeder::class); $this->call(UserTableSeeder::class); $this->call(TallerTableSeeder::class); $this->call(HorarioTableSeeder::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function dbSeed(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Turn foreign key checks off\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0;');// <- USE WITH CAUTION!\n\t\t\t//Seed tables\n\t\t\tArtisan::call('db:seed');\n\t\t\t//Turn foreign key checks on\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=1;');// <- SHOULD RESET ANYWAY BUT JUST TO MAKE SURE!\n\t\t}\n\t}", "protected function seedDB()\n {\n $ans = $this->ask('Seed your database?: ', 'y');\n\n // Check if the answer is true\n if (preg_match('/^y/', $ans))\n {\n $this->call('db:seed');\n $this->comment('');\n $this->comment('Database successfully seeded.');\n $this->comment('=====================================');\n echo \"Your app is now ready!\";\n }\n }", "protected function seedDatabase(): void\n {\n $this->seedProductCategories();\n $this->seedProducts();\n }", "public function setupDatabase()\n {\n Artisan::call('migrate:refresh');\n Artisan::call('db:seed');\n\n self::$setupDatabase = false;\n }", "public function run()\n {\n $this->seed('FormsMenuItemsTableSeeder');\n $this->seed('FormsDataTypesTableSeeder');\n $this->seed('FormsDataRowsTableSeeder');\n $this->seed('FormsPermissionsTableSeeder');\n $this->seed('FormsSettingsTableSeeder');\n $this->seed('FormsTableSeeder');\n }", "public function run()\n {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"\\n--- Seeding ---\\n\", TRUE));\n\n if (App::environment('production')) {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- ERROR: Seeding in Production is prohibited ---\\n\", TRUE));\n return;\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(ConfigsTableSeeder::class);\n $this->call(ConfigContentsTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n if (defined('STDERR')) fwrite(STDERR, print_r(\"Set FOREIGN_KEY_CHECKS=1 --- DONE\\n\", TRUE));\n\n // \\Artisan::call('command:regenerate-user-feeds');\n\n \\Cache::flush();\n\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- End Seeding ---\\n\\n\", TRUE));\n }", "protected function setupDatabase()\n {\n $this->call('migrate');\n $this->call('db:seed');\n\n $this->info('Database migrated and seeded.');\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function seedDatabase(): void\n {\n echo \"Running seeds\";\n\n // Folder where all the seeds are.\n $folder = __DIR__ . '/../seeds/';\n\n // Scan all files/folders inside database.\n $files = \\scandir($folder);\n\n $seeders = [];\n foreach ($files as $key => $file) {\n\n // All files that don't start with a dot.\n if ($file[0] !== '.') {\n\n // Load the file.\n require_once $folder . $file;\n\n // We have to call the migrations after because\n // some seeds are dependant from other seeds.\n $seeders[] = explode('.', $file)[0];\n }\n }\n\n // Run all seeds.\n foreach ($seeders as $seeder) {\n (new $seeder)->run();\n }\n }", "protected function seedDatabase()\n {\n //$this->app->make('db')->table(static::TABLE_NAME)->delete();\n\n TestExtendedModel::create([\n 'unique_field' => '999',\n 'second_field' => null,\n 'name' => 'unchanged',\n 'active' => true,\n 'hidden' => 'invisible',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1234567',\n 'second_field' => '434',\n 'name' => 'random name',\n 'active' => false,\n 'hidden' => 'cannot see me',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1337',\n 'second_field' => '12345',\n 'name' => 'special name',\n 'active' => true,\n 'hidden' => 'where has it gone?',\n ]);\n }", "public function initDatabase()\n {\n $this->call('migrate');\n\n $userModel = config('admin.database.users_model');\n\n if ($userModel::count() == 0) {\n $this->call('db:seed', ['--class' => AdminSeeder::class]);\n }\n }", "public function run ()\n {\n if (App::environment() === 'production') {\n exit('Seed should be run only in development/debug environment.');\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('role_user')->truncate();\n\n // Root user\n $user = User::find(1);\n $user->assignRole('owner');\n\n $user = User::find(2);\n $user->assignRole('admin');\n\n $user = User::find(3);\n $user->assignRole('admin');\n\n $user = User::find(4);\n $user->assignRole('moderator');\n\n $user = User::find(5);\n $user->assignRole('moderator');\n \n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n Model::unguard();\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(EntrustTableSeeder::class);\n\n $this->call(AccounttypeSeeder::class);\n $this->call(AppUserTableSeeder::class);\n $this->call(AppEmailUserTableSeeder::class);\n\n\n $this->call(CountryTableSeeder::class);\n $this->call(CityTableSeeder::class);\n\n\n $this->call(PostTypeTableSeeder::class);\n $this->call(PostSubTypeTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(AppPostSolvedTableSeeder::class);\n\n\n $this->call(AppCommentTypeTableSeeder::class);\n // $this->call(AppCommentTableSeeder::class);\n // $this->call(AppSubCommentTableSeeder::class);\n\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }\n\n Model::reguard();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('users')->truncate();\n DB::table('password_resets')->truncate();\n DB::table('domains')->truncate();\n DB::table('folders')->truncate();\n DB::table('bookmarks')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n $this->seedUserAccount('[email protected]');\n $this->seedUserAccount('[email protected]');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n // $this->call(UsersTableSeeder::class);\n /* Schema::dropIfExists('employees');\n Schema::dropIfExists('users');\n Schema::dropIfExists('requests');\n Schema::dropIfExists('requeststatus');*/\n User::truncate();\n InstallRequest::truncate();\n RequestStatus::truncate();\n\n $cantidadEmployyes = 20;\n $cantidadUsers = 20;\n $cantidadRequestStatus = 3;\n $cantidadRequests = 200;\n\n factory(User::class, $cantidadUsers)->create();\n factory(RequestStatus::class, $cantidadRequestStatus)->create();\n factory(InstallRequest::class, $cantidadRequests)->create();\n }", "public function run()\n {\n Model::unguard();\n foreach (glob(__DIR__ . '/seeds/*.php') as $filename) {\n require_once($filename);\n }\n // $this->call(UserTableSeeder::class);\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n// $this->call('CustomerTableSeeder');\n $this->call('PhotoTableSeeder');\n// $this->call('ProductTableSeeder');\n// $this->call('StaffTableSeeder');\n// $this->call('PasswordResetsTableSeeder');\n// $this->call('UsersTableSeeder');\n $this->call('CustomersTableSeeder');\n $this->call('EmployeesTableSeeder');\n $this->call('InventoryTransactionTypesTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrderDetailsStatusTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('InvoicesTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrdersStatusTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n\n $this->call('OrdersTaxStatusTableSeeder');\n $this->call('PrivilegesTableSeeder');\n $this->call('EmployeePrivilegesTableSeeder');\n $this->call('ProductsTableSeeder');\n $this->call('InventoryTransactionsTableSeeder');\n $this->call('PurchaseOrderDetailsTableSeeder');\n\n $this->call('PurchaseOrderStatusTableSeeder');\n $this->call('PurchaseOrdersTableSeeder');\n $this->call('SalesReportsTableSeeder');\n $this->call('ShippersTableSeeder');\n $this->call('StringsTableSeeder');\n $this->call('SuppliersTableSeeder');\n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n Model::reguard();\n }", "public function run()\n\t{\n $this->cleanDatabase();\n\n Eloquent::unguard();\n\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('CartsTableSeeder');\n $this->call('StoreTableSeeder');\n $this->call('AdvertisementsTableSeeder');\n \n\t}", "public function run()\n {\n \tDB::table('seeds')->truncate();\n\n $seeds = array(\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_18_2013',\n ),\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_20_2013',\n ),\n );\n\n // Uncomment the below to run the seeder\n DB::table('seeds')->insert($seeds);\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "protected function setUp(): void\n {\n $db = new DB;\n\n $db->addConnection([\n 'driver' => 'sqlite',\n 'database' => ':memory:',\n ]);\n\n $db->bootEloquent();\n $db->setAsGlobal();\n\n $this->createSchema();\n }", "public function run()\n {\n //$this->call('UserTableSeeder');\n //$this->call('ProjectTableSeeder');\n //$this->call('TaskTableSeeder');\n\n /**\n * Prepare seeding\n */\n $faker = Faker::create();\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Model::unguard();\n\n /**\n * Seeding user table\n */\n App\\User::truncate();\n factory(App\\User::class)->create([\n 'name' => 'KCK',\n 'email' => '[email protected]',\n 'password' => bcrypt('password')\n ]);\n\n /*factory(App\\User::class, 9)->create();\n $this->command->info('users table seeded');*/\n\n /**\n * Seeding roles table\n */\n Spatie\\Permission\\Models\\Role::truncate();\n DB::table('model_has_roles')->truncate();\n $superAdminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '최고 관리자'\n ]);\n $adminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '관리자'\n ]);\n $regularRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '정회원'\n ]);\n $associateRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '준회원'\n ]);\n\n App\\User::where('email', '!=', '[email protected]')->get()->map(function ($user) use ($regularRole) {\n $user->assignRole($regularRole);\n });\n\n App\\User::whereEmail('[email protected]')->get()->map(function ($user) use ($superAdminRole) {\n $user->assignRole($superAdminRole);\n });\n $this->command->info('roles table seeded');\n\n /**\n * Seeding articles table\n */\n App\\Article::truncate();\n $users = App\\User::all();\n\n $users->each(function ($user) use ($faker) {\n $user->articles()->save(\n factory(App\\Article::class)->make()\n );\n });\n $this->command->info('articles table seeded');\n\n /**\n * Seeding comments table\n */\n App\\Comment::truncate();\n $articles = App\\Article::all();\n\n $articles->each(function ($article) use ($faker, $users) {\n for ($i = 0; $i < 10; $i++) {\n $article->comments()->save(\n factory(App\\Comment::class)->make([\n 'author_id' => $faker->randomElement($users->pluck('id')->toArray()),\n //'parent_id' => $article->id\n ])\n );\n };\n });\n $this->command->info('comments table seeded');\n\n /**\n * Seeding tags table\n */\n App\\Tag::truncate();\n DB::table('article_tag')->truncate();\n $articles->each(function ($article) use ($faker) {\n $article->tags()->save(\n factory(App\\Tag::class)->make()\n );\n });\n $this->command->info('tags table seeded');\n\n /**\n * Seeding attachments table\n */\n App\\Attachment::truncate();\n if (!File::isDirectory(attachment_path())) {\n File::deleteDirectory(attachment_path(), true);\n }\n\n $articles->each(function ($article) use ($faker) {\n $article->attachments()->save(\n factory(App\\Attachment::class)->make()\n );\n });\n\n //$files = App\\Attachment::pluck('name');\n\n if (!File::isDirectory(attachment_path())) {\n File::makeDirectory(attachment_path(), 777, true);\n }\n\n /*\n foreach ($files as $file) {\n File::put(attachment_path($file), '');\n }\n */\n\n $this->command->info('attachments table seeded');\n\n /**\n * Close seeding\n */\n Model::reguard();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(CountriesTableSeeder::class);\n $this->call(StatesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n\n factory(Group::class)->create();\n factory(Contact::class, 5000)->create();\n }", "public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t// $this->call('AdminTableSeeder');\n\t\t// $this->call('UserTableSeeder');\n\t\t// $this->call('MenuTableSeeder');\n\t\t// $this->call('ProductTableSeeder');\n\t\t// $this->call('CategoryTableSeeder');\n\t\t// $this->call('OptionTableSeeder');\n\t\t// $this->call('OptionGroupTableSeeder');\n\t\t// $this->call('TypeTableSeeder');\n\t\t// $this->call('LayoutTableSeeder');\n\t\t// $this->call('LayoutDetailTableSeeder');\n\t\t// $this->call('BannerTableSeeder');\n\t\t// $this->call('ConfigureTableSeeder');\n\t\t// $this->call('PageTableSeeder');\n\t\t// $this->call('ImageTableSeeder');\n\t\t// $this->call('ImageableTableSeeder');\n\t\t// ======== new Seed =======\n\t\t$this->call('AdminsTableSeeder');\n\t\t$this->call('BannersTableSeeder');\n\t\t$this->call('CategoriesTableSeeder');\n\t\t$this->call('ConfiguresTableSeeder');\n\t\t$this->call('ImageablesTableSeeder');\n\t\t$this->call('ImagesTableSeeder');\n\t\t$this->call('LayoutsTableSeeder');\n\t\t$this->call('LayoutDetailsTableSeeder');\n\t\t$this->call('MenusTableSeeder');\n\t\t$this->call('OptionablesTableSeeder');\n\t\t$this->call('OptionsTableSeeder');\n\t\t$this->call('OptionGroupsTableSeeder');\n\t\t$this->call('PagesTableSeeder');\n\t\t$this->call('PriceBreaksTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('ProductsCategoriesTableSeeder');\n\t\t$this->call('SizeListsTableSeeder');\n\t\t$this->call('TypesTableSeeder');\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ContactsTableSeeder');\n\t\t$this->call('RolesTableSeeder');\n\t\t$this->call('PermissionsTableSeeder');\n\t\t$this->call('PermissionRoleTableSeeder');\n\t\t$this->call('AssignedRolesTableSeeder');\n\t\t$this->call('OrdersTableSeeder');\n\t\t$this->call('OrderDetailsTableSeeder');\n\t\tCache::flush();\n\t\t// BackgroundProcess::copyFromVI();\n\t}", "public function run()\n {\n Model::unguard();\n\n User::create([\n 'email' => '[email protected]',\n 'name' => 'admin',\n 'password' => Hash::make('1234'),\n 'email_verified_at' => Carbon::now()\n ]);\n\n factory(User::class, 200)->create();\n\n // $this->call(\"OthersTableSeeder\");\n }", "public function run()\n {\n $this->seedRegularUsers();\n $this->seedAdminUser();\n }", "public function run()\n {\n if (\\App::environment() === 'local') {\n\n // Delete existing data\n\n\n Eloquent::unguard();\n\n //disable foreign key check for this connection before running seeders\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // Truncate all tables, except migrations\n $tables = array_except(DB::select('SHOW TABLES'), ['migrations']);\n foreach ($tables as $table) {\n $tables_in_database = \"Tables_in_\" . Config::get('database.connections.mysql.database');\n DB::table($table->$tables_in_database)->truncate();\n }\n\n // supposed to only apply to a single connection and reset it's self\n // but I like to explicitly undo what I've done for clarity\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n //get roles\n $this->call('AccountSeeder');\n $this->call('CountrySeeder');\n $this->call('StateSeeder');\n $this->call('CitySeeder');\n $this->call('OptionSeeder');\n $this->call('TagSeeder');\n $this->call('PrintTemplateSeeder');\n $this->call('SettingsSeeder');\n\n\n\n if(empty($web_installer)) {\n $admin = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"admin\",\n 'first_name' => 'Admin',\n 'last_name' => 'Doe',\n ));\n $admin->user_id = $admin->id;\n $admin->save();\n\n $adminRole = Sentinel::findRoleById(1);\n $adminRole->users()->attach($admin);\n }\n else {\n $admin = Sentinel::findById(1);\n }\n\n //add dummy staff and customer\n $staff = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"staff\",\n 'first_name' => 'Staff',\n 'last_name' => 'Doe',\n ));\n $admin->users()->save($staff);\n\n foreach ($this->getPermissions() as $permission) {\n $staff->addPermission($permission);\n }\n $staff->save();\n\n $customer = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"customer\",\n 'first_name' => 'Customer',\n 'last_name' => 'Doe',\n ));\n Customer::create(array('user_id' => $customer->id, 'belong_user_id' => $staff->id));\n $staff->users()->save($customer);\n\n //add respective roles\n\n $staffRole = Sentinel::findRoleById(2);\n $staffRole->users()->attach($staff);\n $customerRole = Sentinel::findRoleById(3);\n $customerRole->users()->attach($customer);\n\n\n\n DB::table('sales_teams')->truncate();\n DB::table('opportunities')->truncate();\n\n //Delete existing seeded users except the first 4 users\n User::where('id', '>', 3)->get()->each(function ($user) {\n $user->forceDelete();\n });\n\n //Get the default ADMIN\n $user = User::find(1);\n $staffRole = Sentinel::getRoleRepository()->findByName('staff');\n $customerRole = Sentinel::getRoleRepository()->findByName('customer');\n\n //Seed Sales teams for default ADMIN\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($user->id, $j, $user);\n $this->createOpportunity($user, $user->id, $j);\n }\n\n\n //Get the default STAFF\n $staff = User::find(2);\n $this->createSalesTeam($staff->id, 1, $staff);\n $this->createSalesTeam($staff->id, 2, $staff);\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $staff->id, $j);\n }\n\n foreach (range(1, 3) as $i) {\n $staff = $this->createStaff($i);\n $user->users()->save($staff);\n $staffRole->users()->attach($staff);\n\n $customer = $this->createCustomer($i);\n $staff->users()->save($customer);\n $customerRole->users()->attach($customer);\n $customer->customer()->save(factory(\\App\\Models\\Customer::class)->make());\n\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 5) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $i, $j);\n }\n\n }\n\n //finally call it installation is finished\n file_put_contents(storage_path('installed'), 'Welcome to LCRM');\n }\n }", "public function run()\n {\n if (env('DB_DATABASE') == 'connection') {\n Connection::create([\n \"ruc\" => \"12312312312\",\n \"basedata\" => \"nbdata2018_1\",\n ]);\n \n Connection::create([\n \"ruc\" => \"12312312315\",\n \"basedata\" => \"nbdata2018_2\",\n ]);\n \n $this->call(ConnectionTableSeeder::class);\n } else {\n $this->call(AppSeeder::class);\n }\n }", "public function setupDatabase()\n {\n exec('rm ' . storage_path() . '/testdb.sqlite');\n exec('cp ' . 'database/database.sqlite ' . storage_path() . '/testdb.sqlite');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n # truncates tables before seeding\n foreach ($this->toTruncate as $table) {\n DB::table($table)->delete();\n }\n\n factory(App\\Models\\Product::class, 25)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Post::truncate();\n Comment::truncate();\n // CommentReply::truncate();\n \n\n\n factory(User::class,10)->create();\n factory(Post::class,20)->create();\n factory(Comment::class,30)->create();\n // factory(CommentReply::class,30)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n\t{\n \n Eloquent::unguard();\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\t\t$this->call('UserTableSeeder');\n\t $this->call('LayerTableSeeder');\n $this->call('UserLevelTableSeeder');\n $this->call('RoleUserTableSeeder');\n $this->call('RoleLayerTableSeeder');\n $this->call('BookmarkTableSeeder');\n \n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\t}", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n DB::statement('SET foreign_key_checks = 0');\n DB::table('topics')->truncate();\n\n factory(\\App\\Topic::class, 100)->create();\n // ->each(function($topic) {\n\n // // Seed para a relação com group\n // $topic->group()->save(factory(App\\Group::class)->make());\n\n // // Seed para a relação com topicMessages\n // $topic->topicMessages()->save(factory(App\\TopicMessage::class)->make());\n\n // // Seed para a relação com user\n // $topic->user()->save(factory(App\\User::class)->make());\n // });\n \n DB::statement('SET foreign_key_checks = 1');\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n Categoria::truncate();\n Atractivo::truncate();\n Galeria::truncate();\n User::truncate();\n\n $this->call(CategoriasTableSeeder::class);\n $this->call(AtractivosTableSeeder::class);\n $this->call(GaleriasTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n }", "public function run(Faker $faker)\n {\n Schema::disableForeignKeyConstraints();\n DB::table('users')->insert([\n 'name' => $faker->name(),\n 'email' => '[email protected]',\n 'password' => Hash::make('12345678'),\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n\t $this->call(CategoryTableSeed::class);\n\t $this->call(ProductTableSeed::class);\n\t $this->call(UserTableSeed::class);\n }", "public function run()\n {\n \t// DB::table('webapps')->delete();\n\n $webapps = array(\n\n );\n\n // Uncomment the below to run the seeder\n // DB::table('webapps')->insert($webapps);\n }", "public function run()\n {\n $this->cleanDatabase();\n\n factory(User::class, 50)->create();\n factory(Document::class, 30)->create();\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $tables = array(\n 'users',\n 'companies',\n 'stands',\n 'events',\n 'visitors',\n 'api_keys'\n );\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n }\n\n foreach ($tables as $table) {\n DB::table($table)->truncate();\n }\n\n $this->call(UsersTableSeeder::class);\n $this->call(EventsTableSeeder::class);\n $this->call(CompaniesTableSeeder::class);\n $this->call(StandsTableSeeder::class);\n $this->call(VisitorsTableSeeder::class);\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n $clear = $this->command->confirm('Wil je de database leegmaken? (Dit haalt alle DATA weg)');\n\n if ($clear):\n $this->command->callSilent('migrate:refresh');\n $this->command->info('Database Cleared, starting seeding');\n endif;\n\n $this->call([\n SeedSeeder::class,\n RoleSeeder::class,\n UserSeeder::class,\n // BoardgameSeeder::class,\n BoardgamesTableSeeder::class,\n StatusSeeder::class,\n TournamentSeeder::class,\n AchievementsSeeder::class,\n TournamentUsersSeeder::class,\n ]);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n $this->call(PaisSeeder::class);\n $this->call(DepartamentoSeeder::class);\n $this->call(MunicipioSeeder::class);\n $this->call(PersonaSeeder::class);\n }", "public function run()\n {\n //\n if (App::environment() === 'production') {\n exit('Do not seed in production environment');\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // disable foreign key constraints\n\n DB::table('events')->truncate();\n \n Event::create([\n 'id' => 1,\n 'name' => 'Spot Registration For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n Event::create([\n 'id' => 2,\n 'name' => 'Spot Screening For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'screen',\n 'formId'\t\t=> 1,\n ]);\n \n Event::create([\n 'id' => 3,\n 'name' => 'Spot Registration For Skin Cancer',\n 'cancerId' => 2,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n\n Event::create([\n 'id' => 3,\n 'name' => 'Registration cum Screening camp for Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addWeeks(1),\n 'eventType'\t\t=> 'register_screen',\n 'formId'\t\t=> 1,\n ]);\n \n DB::statement('SET FOREIGN_KEY_CHECKS = 1'); // enable foreign key constraints\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // Para que no verifique el control de claves foráneas al hacer el truncate haremos:\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n\t\t// Primero hacemos un truncate de las tablas para que no se estén agregando datos\n\t\t// cada vez que ejecutamos el seeder.\n\t\t//Foto::truncate();\n\t\t//Album::truncate();\n\t\t//Usuario::truncate();\n DB::table('users')->delete();\n DB::table('ciudades')->delete();\n DB::table('tiendas')->delete();\n DB::table('ofertas')->delete();\n DB::table('ventas')->delete();\n\n\n\t\t// Es importante el orden de llamada.\n\t\t$this->call('UserSeeder');\n $this->call('CiudadSeeder');\n\t\t$this->call('TiendaSeeder');\n $this->call('OfertaSeeder');\n $this->call('VentaSeeder');\n }", "public function run()\n {\n $this->call(\\Database\\Seeders\\GroupByRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\SingleIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\MultiIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\JoinFiveTablesSeeder::class);\n\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// // 試しに一回流す\n// $data = $this->makeData(0, 'userFactory', 1);\n// DB::table('users')->insert($data);\n// $data = $this->makeData(0, 'userDetailFactory', 1);\n// DB::table('user_details')->insert($data);\n//\n// // $this->call(UsersTableSeeder::class);\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userFactory', 2500);\n// DB::table('users')->insert($data);\n// }\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userDetailFactory', 2500);\n// DB::table('user_details')->insert($data);\n// }\n }", "public function run()\n {\n $this->truncateTables([\n 'users',\n 'categories',\n 'types',\n 'courses',\n 'classrooms',\n 'contents',\n 'companies',\n ]);\n\n $this->call(CompanyTableSeeder::class);\n $this->call(TypeTableSeeder::class);\n $this->call(RoleTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(CoursesTableSeeder::class);\n $this->call(PermissionTableSeeder::class);\n $this->call(ContentTableSeeder::class);\n $this->call(UserTableSeeder::class);\n $this->call(ClassroomTableSeeder::class);\n $this->call(TestTableSeeder::class);\n $this->call(BankTableSeeder::class);\n\n\n // factory(\\App\\User::class, 50)\n // ->create()\n // ->each(function ($user) {\n // // $user->companies()->save();\n // $company = \\App\\Company::inRandomOrder()->first();\n // $user->companies()->attach($company->id);\n // $user->assignRole(['participante']);\n // });\n /*\n factory(\\App\\User::class, 50)\n ->create()\n ->each(function ($user) {\n $user->assignRole(['participante']);\n });*/\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n User::truncate();\n Question::truncate();\n Option::truncate();\n// Answer::truncate();\n Quiz::truncate();\n QuizQuestion::truncate();\n\n //for admin\n $admin = factory(User::class)->create([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'is_admin' => 1,\n ]);\n\n //for user\n $user = factory(User::class)->create([\n 'name' => 'User',\n 'email' => '[email protected]',\n ]);\n\n factory(Question::class, 100)->create()->each(function ($question) {\n factory(Option::class, mt_rand(2, 4))->create([\n 'question_id' => $question->id,\n ]);\n });\n\n factory(Quiz::class, 10)->create()->each(function ($quiz) {\n\n factory(QuizQuestion::class, mt_rand(5, 10))->create();\n });\n\n\n }", "public function run()\n {\n $this->call([\n SiteSettingsSeeder::class,\n LaratrustSeeder::class,\n CountrySeeder::class,\n GovernorateSeeder::class,\n FaqSeeder::class,\n SitePageSeeder::class,\n UsersSeeder::class,\n ]);\n\n Country::whereiso(\"EG\")->update(['enable_shipping' => true]);\n\n factory(User::class, 400)->create();\n\n Category::create([\n 'en' => [\n 'name' => \"cake tools\"\n ]\n ]);\n\n Category::create([\n 'en' => [\n 'name' => \"Party Supplies\"\n ]\n ]);\n\n $this->call([\n ProductCategorySeeder::class,\n ProductSeeder::class\n ]);\n }", "public function run()\n {\n $this->call(PermissionsTableSeeder::class);\n\n if (App::environment('local')) {\n $this->call(FakeUsersTableSeeder::class);\n $this->call(FakeArticlesTableSeeder::class);\n $this->call(FakeEventsTableSeeder::class);\n }\n }", "public function run()\n {\n Model::unguard();\n\n $this->call(CategoryTypesTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(AccountTypesTableSeeder::class);\n $this->call(TransactionTypesTableSeeder::class);\n\n if (App::environment() !== 'production') {\n $this->call(UserTableSeeder::class);\n $this->call(AccountBudgetTableSeeder::class);\n $this->call(TransactionTableSeeder::class);\n }\n\n Model::reguard();\n }", "public function run()\n {\n User::truncate();\n Product::truncate();\n User::forceCreate([\n 'name' => 'foo',\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n ]);\n factory(User::class, 5)->create();\n factory(Product::class, 5)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n {\n $this->call([UsersTableSeeder::class]);\n $this->call([ContratosTableSeeder::class]);\n $this->call([UsuariosTableSeeder::class]);\n $this->call([UnidadesTableSeeder::class]);\n $this->call([AtestadosTableSeeder::class]);\n }", "public function run()\n {\n Model::unguard();\n\n // $this->call(\"OthersTableSeeder\");\n\n // DB::table('locations')->insert([\n // 'id' => 1,\n // 'name' => 'Default',\n // 'name' => 'district',\n // 'district_id' => 1,\n // 'province_id' => 1,\n // ]);\n }", "public function run()\n {\n $data = include env('DATA_SEED');\n\n \\Illuminate\\Support\\Facades\\DB::table('endpoints')->insert((array)$data);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('admins')->truncate();\n\n for ($i = 0; $i < 10; $i++)\n {\n $faker = Factory::create('en_US');\n $values = [\n 'name' => $faker->userName,\n 'email' => $faker->freeEmail,\n 'password' => bcrypt($faker->password),\n 'phone' => $faker->phoneNumber,\n 'status' => random_int(0,1)\n ];\n admin::create($values);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n \\DB::table('provinces')->delete();\n \\DB::table('cities')->delete();\n \\DB::table('districts')->delete();\n // import provinces and cities from sql file\n $sqlFile = app_path() . '/../database/raw/administrative_indonesia_without_districts.sql';\n DB::unprepared(file_get_contents($sqlFile));\n $this->command->info('Successfully seed Provinces and Cities!');\n\n // import districts with latitude and longitude from csv file\n $csvFile = app_path() . '/../database/raw/administrative_indonesia_districts_with_lat_lng.csv';\n $districts = $this->csvToArray($csvFile);\n // check if lat lng exists\n foreach ($districts as $i => $d) {\n if ($d['latitude'] == '') $districts[$i]['latitude'] = 0;\n if ($d['longitude'] == '') $districts[$i]['longitude'] = 0;\n }\n // insert it\n $insert = District::insert($districts);\n if ($insert) $this->command->info('Successfully seed Districts!');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n DB::beginTransaction();\n// $this->seed();\n DB::commit();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n User::create([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n ]);\n\n User::create([\n 'name' => 'Leonardo',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789')\n ]);\n\n // seed sin model\n /* DB::table('users')->insert([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s')\n ]); */\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(RegionsTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(SubDistrictsTableSeeder::class);\n $this->call(PostcodesTableSeeder::class);\n\n if (env('APP_ENV') !== 'production') {\n // Wipe up 5 churches, and each church has 5 cells, and each cell has 20 members associated with.\n // In other word, we wipe up 500 church members.\n for ($i = 0; $i < 2; $i++) {\n $church = factory(\\App\\Models\\Church::class)->create();\n\n $church->areas()->saveMany(factory(\\App\\Models\\Area::class, 2)->create([\n 'church_id' => $church->id\n ])->each(function($area) {\n $area->cells()->saveMany(factory(\\App\\Models\\Cell::class, 2)->create([\n 'area_id' => $area->id\n ])->each(function($cell) {\n $cell->members()->saveMany(factory(App\\Models\\Member::class, 10)->create([\n 'cell_id' => $cell\n ]));\n }));\n }));\n }\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n $this->environmentPath = env('APP_ENV') === 'production' ||\n env('APP_ENV') === 'qa' ||\n env('APP_ENV') === 'integration' ?\n 'Production':\n 'local';\n //disable FK\n Model::unguard();\n DB::statement(\"SET session_replication_role = 'replica';\");\n\n // $this->call(HrEmployeeTableSeeder::class);\n $this->call(\"Modules\\HR\\Database\\Seeders\\\\$this->environmentPath\\HrEmployeePosTableSeeder\");\n // $this->call(HrEmployeePresetsDiscountTableSeeder::class);\n\n // Enable FK\n DB::statement(\"SET session_replication_role = 'origin';\");\n Model::reguard();\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "protected static function seed()\n {\n foreach (self::fetch('database/seeds', false) as $file) {\n Bus::need($file);\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n $faker = F::create('App\\Proovedores');\n for($i=0; $i < 10; $i++){\n DB::table('users')->insert([\n 'usuario' => $i,\n 'password' => $i,\n 'email' => $faker->email,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Delete all records.\n DB::table('users')->delete();\n // Reset AUTO_INCREMENT.\n DB::table('users')->truncate();\n\n // Dev user.\n App\\Models\\User::create([\n 'email' => '[email protected]',\n 'password' => '$2y$10$t6q81nz.XrMrh20NHDvxUu/szwHBwgzPd.01e8uuP0qVy0mPa6H/e',\n 'first_name' => 'L5',\n 'last_name' => 'App',\n 'username' => 'l5-app',\n 'is_email_verified' => 1,\n ]);\n\n // Dummy users.\n TestDummy::times(10)->create('App\\Models\\User');\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n User::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // We did this for test purposes. Shouldn't be doing this for production\n $password = Hash::make('123456');\n\n User::create([\n 'name' => 'Administrator',\n 'email' => '[email protected]',\n 'password' => $password,\n ]);\n }", "public function run()\n {\n Model::unguard();\n \n factory('App\\User','admin')->create();\n factory('App\\Evento',100)->create();\n //factory('App\\User','miembro',10)->create();\n factory('App\\Telefono',13)->create();\n factory('App\\Notificacion',10)->create();\n factory('App\\Rubro',10)->create();\n factory('App\\Tecnologia',10)->create();\n factory('App\\Cultivo',10)->create();\n factory('App\\Etapa',10)->create();\n factory('App\\Variedad',10)->create();\n factory('App\\Caracteristica',10)->create();\n factory('App\\Practica',30)->create();\n factory('App\\Tag',15)->create();\n // $this->call(PracticaTableSeeder::class);\n $this->call(TrTableSeeder::class);\n $this->call(MesTableSeeder::class);\n $this->call(SemanasTableSeeder::class);\n $this->call(PsTableSeeder::class);\n $this->call(MsTableSeeder::class);\n $this->call(CeTableSeeder::class);\n $this->call(CvTableSeeder::class);\n $this->call(PtSeeder::class);\n \n\n Model::unguard();\n }", "public function run() {\n $this->call(UserSeeder::class);\n $this->call(PermissionSeeder::class);\n $this->call(CreateAdminUserSeeder::class);\n // $this->call(PhoneSeeder::class);\n // $this->call(AddressSeeder::class);\n\n $this->call(ContactFormSeeder::class);\n //$this->call(ContactSeeder::class);\n\n User::factory()->count(20)->create()->each(function ($user) {\n // Seed the relation with one address\n $address = Address::factory()->make();\n $user->address()->save($address);\n\n // Seed the relation with one phone\n $phone = Phone::factory()->make();\n $user->phone()->save($phone);\n\n // Seed the relation with 15 contacts\n $contact = Contact::factory()->count(25)->make();\n $user->contacts()->saveMany($contact);\n });\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Activity::truncate();\n User::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n $this->call(UserTableSeeder::class);\n $this->call(ActivityTableSeeder::class);\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n \\App\\User::truncate();\n \\App\\Category::truncate();\n \\App\\Product::truncate();\n \\App\\Transaction::truncate();\n DB::table('category_product')->truncate();\n\n \\App\\User::flushEventListeners();\n \\App\\Category::flushEventListeners();\n \\App\\Product::flushEventListeners();\n \\App\\Transaction::flushEventListeners();\n\n\n $usersQuentity = 1000;\n $categoriesQuentity = 30;\n $productsQuentity = 1000;\n $transactionsQuentity = 1000;\n\n factory(\\App\\User::class, $usersQuentity)->create();\n factory(\\App\\Category::class, $categoriesQuentity)->create();\n factory(\\App\\Product::class, $productsQuentity)->create()->each(\n function ($product){\n $categories = \\App\\Category::all()->random(mt_rand(1, 5))->pluck('id');\n\n $product->categories()->attach($categories);\n }\n );\n factory(\\App\\Transaction::class, $transactionsQuentity)->create();\n\n }", "public static function setUpBeforeClass()\n {\n parent::setUpBeforeClass();\n $app = require __DIR__ . '/../../bootstrap/app.php';\n /** @var \\Pterodactyl\\Console\\Kernel $kernel */\n $kernel = $app->make(Kernel::class);\n $kernel->bootstrap();\n $kernel->call('migrate:fresh');\n\n \\Artisan::call('db:seed');\n }", "public function run()\n {\n Eloquent::unguard();\n \n $this->call('AdminMemberTableSeeder');\n $this->call('BankInfoTableSeeder');\n $this->call('LocationLookUpTableSeeder');\n $this->call('OrderStatusTableSeeder');\n $this->call('AdminRoleTableSeeder');\n\n }", "public function run()\n {\n Model::unguard();\n\n if( !User::where('email', '[email protected]')->count() ) {\n User::create([\n 'nombre'=>'Nick'\n ,'apellidos'=>'Palomino'\n ,'email'=>'[email protected]'\n ,'password'=> Hash::make('1234567u')\n ,'celular'=>'966463589'\n ]);\n }\n\n $this->call('CategoriaTableSeeder');\n $this->call('WhateverSeeder');\n $this->call('ProductTableSeeder');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n Model::unguard();\n\n $this->command->info('seed start!');\n\n // 省市县\n $this->call('RegionTableSeeder');\n // 用户、角色\n $this->call('UserTableSeeder');\n // 权限\n $this->call('PurviewTableSeeder');\n // 博文分类\n $this->call('CategoryTableSeeder');\n // 博文、评论、标签\n $this->call('ArticleTableSeeder');\n // 心情\n $this->call('MoodTableSeeder');\n // 留言\n $this->call('MessageTableSeeder');\n // 文件\n $this->call('StorageTableSeeder');\n\n $this->command->info('seed end!');\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n {\n $this->call(RolesDatabaseSeeder::class);\n $this->call(UsersDatabaseSeeder::class);\n $this->call(LocalesDatabaseSeeder::class);\n $this->call(MainDatabaseSeeder::class);\n }", "public function run()\n {\n // DB::table('users')->insert([\n // ['id'=>1, 'email'=>'nhat','password'=>bcrypt(1234), 'lever'=>0]\n // ]);\n // $this->call(UsersTableSeeder::class);\n // $this->call(CatTableSeeder::class);\n // $this->call(TypeTableSeeder::class);\n // $this->call(AppTableSeeder::class);\n // $this->call(GameTableSeeder::class);\n \n \n }", "public function run()\n {\n\n Schema::disableForeignKeyConstraints(); //in order to execute truncate before seeding\n\n $this->call(UsersTableSeeder::class);\n $this->call(PostCategoriesSeeder::class);\n $this->call(TagsSeeder::class);\n $this->call(PostsSeeder::class);\n\n Schema::enableForeignKeyConstraints();\n\n\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n $this->seedUsers();\n $this->seedAdmins();\n $this->seedMeals();\n\n $this->seedOrder();\n $this->seedOrderlist();\n\n $this->seedReload();\n }", "public function run()\n\t{\n\t\t//composer require fzaninotto/faker\n\t\t\n\t\t$this->call(populateAllSeeder::class);\n\t\t\n\t}", "public function run()\n {\n Model::unguard();\n\n $faker =Faker\\Factory::create();\n\n // $this->call(UserTableSeeder::class);\n\n $this->seedTasks($faker);\n $this->seedTags($faker);\n\n Model::reguard($faker);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n\n $this->call([\n CountriesSeeder::class,\n ProvincesSeeder::class,\n SettingsSeeder::class,\n AdminsTableSeeder::class,\n ]);\n }" ]
[ "0.8065584", "0.7848217", "0.76748335", "0.7244791", "0.7217673", "0.7133266", "0.70984626", "0.70752525", "0.7050456", "0.69926506", "0.6988436", "0.6985116", "0.69669306", "0.68992233", "0.68682885", "0.6847507", "0.6831097", "0.68208444", "0.68041754", "0.68041754", "0.68032914", "0.6790816", "0.67898446", "0.6787946", "0.678716", "0.6777025", "0.6775358", "0.67726433", "0.67660606", "0.67634314", "0.6758109", "0.673368", "0.67331403", "0.6729675", "0.67294586", "0.67255825", "0.67230934", "0.6722171", "0.67213213", "0.6715509", "0.67079365", "0.67062575", "0.6703651", "0.670358", "0.6702433", "0.6702257", "0.66971296", "0.66941136", "0.6686706", "0.6684891", "0.6678387", "0.66765666", "0.66730577", "0.66660666", "0.66496396", "0.6641152", "0.66396993", "0.66393507", "0.66372746", "0.6633904", "0.6630109", "0.66281164", "0.66259885", "0.6617708", "0.66098803", "0.6602503", "0.66002655", "0.659939", "0.6597011", "0.6596365", "0.6592976", "0.65928084", "0.6592367", "0.6589387", "0.6581892", "0.6581305", "0.65805703", "0.6579974", "0.6576225", "0.65749776", "0.6574433", "0.6571225", "0.6569767", "0.6568897", "0.65635324", "0.65631485", "0.6559915", "0.6558022", "0.6556394", "0.65548515", "0.6551606", "0.6548489", "0.6548293", "0.65458405", "0.6545289", "0.6544641", "0.6543904", "0.6543258", "0.65430623", "0.6542044", "0.6539481" ]
0.0
-1
Contructor Creates an object representing an Element.
final public function __construct(CtkView $view, $name, $data = array(), $options = array()) { parent::__construct(); $this->_view = $view; $this->_name = (string) $name; $this->_data = $data; $this->_options = $options; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function getElementInstance(string $element): Element\n {\n switch ($element) {\n case \"0\":\n case \"Fire\":\n return new Fire();\n case \"1\":\n case \"Water\":\n return new Water();\n case \"2\":\n case \"Corruption\":\n return new Corruption();\n case \"3\":\n case \"Earth\":\n return new Earth();\n case \"4\":\n case \"Wind\":\n return new Wind();\n case \"5\":\n case \"Physical\":\n return new Physical();\n default:\n echo \"invalid element\";\n die;\n }\n }", "public function __construct(Element $model)\n {\n $this->model = $model;\n }", "public static function factory($element)\n {\n // If class is the same as object being `factory'ised`, just return it.\n if (is_object($element) && get_class($element) == get_called_class()) {\n return $element;\n }\n \n $object = new static();\n if (is_array($element) || $element instanceof \\stdClass) {\n self::setObjectProperties($object, $element);\n }\n\n return $object;\n }", "public function __construct($element = null) { \r\n\t\t\r\n\t if (isset($element)) {\r\n\t\t\t\r\n\t\t\tif (@get_class($element) === 'DOMElement') {\r\n\t\t\t\t$this->add($element);\r\n\t\t\t} elseif (is_array($element)) {\r\n\t\t\t\tforeach ($element as $node) {\r\n\t\t\t\t\tif (is_object($node) AND get_class($node) === 'DOMElement') {\r\n\t\t\t\t\t\t$this->add($node);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function buildElement() {\n\n // Set the element type\n $this->addType('example');\n\n // Add the element attributes\n $this->addAttributes(array(\n // Some attributes\n ));\n\n // Example if we need to add child object\n // to this element\n $object = new VTCore_Form_Base();\n $object->addType('example_child');\n $object->addAttributes(array(\n // Some Attributes\n ));\n\n // Adding a plaing text as child of subchild\n $object->addText('some text');\n\n // Inject the child and subchild back to parent\n $this->addChildren($object);\n\n // No need to echo or print anything, all the\n // actual rendering will be performed by\n // VTCore_Form_Base() when user is invoking\n // the render or __toString method.\n }", "public function asElement() {\n //public Element asElement()\n return $element;\n }", "public function __construct(Element $element, int $language = self::LANG_HTML5)\n\t{\n\t\t$this->element = $element;\n\t\t$this->language = $language;\n\t}", "public function create_element_structure() {\n\n\t\t\t// Add name of the class to deserialize it again when the element is sent back to the server from the web page\n\t\t\t$this->config['php_class'] = get_class( $this );\n\t\t\t// element id\n\t\t\t$this->config['id'] = 'woo_shortcodes';\n\t\t\t// element name\n\t\t\t$this->config['name'] = __( 'Woo Shortcodes', 'oxo-core' );\n\t\t\t// element icon\n\t\t\t$this->config['icon_url'] = \"icons/sc-text_block.png\";\n\t\t\t// css class related to this element\n\t\t\t$this->config['css_class'] = \"oxo_element_box\";\n\t\t\t// element icon class\n\t\t\t$this->config['icon_class'] = 'oxo-icon builder-options-icon oxoa-shopping-cart';\n\t\t\t// tooltip that will be displyed upon mouse over the element\n\t\t\t//$this->config['tool_tip'] \t\t= 'Creates a Woo Featured Element';\n\t\t\t// any special html data attribute (i.e. data-width) needs to be passed\n\t\t\t// drop_level: elements with higher drop level can be dropped in elements with lower drop_level, \n\t\t\t// i.e. element with drop_level = 2 can be dropped in element with drop_level = 0 or 1 only.\n\t\t\t$this->config['data'] = array( \"drop_level\" => \"4\" );\n\t\t}", "public function __construct() {\n $this->html = new HtmlElm( \"html\" );\n $head = new HtmlElm( \"head\" );\n $meta = new EmptyHtmlElm( \"meta\" );\n $this->head = $head->append( $meta->attr( \"http-equiv\", \"Content-Type\" )->attr( \"content\", \"text/html;charset=utf-8\" ) );\n $this->body = new HtmlElm( \"body\" );\n }", "public function create_element_structure() {\n\n\t\t\t// Add name of the class to deserialize it again when the element is sent back to the server from the web page\n\t\t\t$this->config['php_class'] = get_class( $this );\n\t\t\t// element id\n\t\t\t$this->config['id'] = 'events';\n\t\t\t// element shortcode base\n\t\t\t$this->config['base'] = 'oxo_events';\n\t\t\t// element name\n\t\t\t$this->config['name'] = __( 'Events', 'oxo-core' );\n\t\t\t// element icon\n\t\t\t$this->config['icon_url'] = \"icons/sc-text_block.png\";\n\t\t\t// css class related to this element\n\t\t\t$this->config['css_class'] = \"oxo_element_box\";\n\t\t\t// element icon class\n\t\t\t$this->config['icon_class'] = 'oxo-icon builder-options-icon oxoa-calendar-plus-o';\n\t\t\t// tooltip that will be displyed upon mouse over the element\n\t\t\t//$this->config['tool_tip'] \t\t= 'Creates a Woo Slider';\n\t\t\t// any special html data attribute (i.e. data-width) needs to be passed\n\t\t\t// drop_level: elements with higher drop level can be dropped in elements with lower drop_level, \n\t\t\t// i.e. element with drop_level = 2 can be dropped in element with drop_level = 0 or 1 only.\n\t\t\t$this->config['data'] = array( \"drop_level\" => \"4\" );\n\t\t}", "function __construct() {\n\t\treturn $this->Content_Elements_ft();\n\t}", "public function __construct($elementBaseClass = 'ElementBase')\n\t{\n\t\tparent::__construct();\n\t\t$this->_elementBaseClass = $elementBaseClass;\n\t}", "public function element() {\n\t\t$element = parent::element();\n\t\t$element->data('field', self::$fieldname);\n\t\treturn $element;\n\t}", "public function __construct($type=\"div\",$content=\"\",$attr=array(),$unique_id=False,$self_closing=false){#constructor method for any element\n\t\t$this->type=$type;#tag type\n\t\t$this->attr=$attr;# attributes for the tag\n\t\t$this->content=array((string)$content);#content (can be raw text)\n\t\t$this->self_closing=$self_closing;\n\t\tif (isset(debug_backtrace()[1]['object'])){\t\n\t\t\t$this->master=debug_backtrace()[1]['object'];\n\t\t}\n\t\telse{\n\t\t\t$this->master=\"None\";\n\t\t}\n\t\tif ($unique_id){\n\t\t\t$this->attr=array_merge($this->attr, array(\"id\"=>self::get_unique_id()));\n\t\t}\n\t}", "public function __construct(\\SimpleXMLElement $element) {\n\t\t$this->values = $this->simplexml2array($element);\n\t}", "public function __construct()\n {\n // create XML DOM object\n $this->xmldoc = new DOMDocument('1.0', 'utf-8');\n }", "function customcert_get_element_instance($element) {\n global $CFG;\n\n $classfile = \"$CFG->dirroot/mod/customcert/element/{$element->element}/lib.php\";\n // Ensure this necessary file exists.\n if (file_exists($classfile)) {\n require_once($classfile);\n $classname = \"customcert_element_{$element->element}\";\n return new $classname($element);\n }\n\n return false;\n}", "public static function init( $element_id )\n {\n static $instance = null;\n if ( is_null( $instance ) ) {\n $instance = new self( $element_id );\n }\n\n return $instance;\n }", "protected function createElement($element)\n {\n if (is_string($element)) {\n $element = new FormElement($element);\n }\n\n return $element;\n }", "protected function _createElement($element, $args)\n\t{\n\t\tstatic $__file = 0;\n\t\t$inputs = array('text', 'password', 'checkbox', 'submit', 'reset', 'file');\n\t\t$valued = array('hidden', 'textarea', 'button');\n\n\t\t$element = strtolower($element);\n\t\tif(in_array($element, $inputs))\n\t\t{\n\t\t\t//Get parameters\n\t\t\t$id = $args[0];\n\t\t\t$attribs = (!(array_key_exists(1, $args))? array() : $args[1]);\n\t\t\t$class = \"\\\\Framework\\\\Form\\\\Elements\\\\C\" . ucwords($element) . \"FormElement\";\n\n\t\t\t//Create element and return\n\t\t\treturn new $class($this->_convertToID($id), $this->_getValue($id, $attribs), $attribs);\n\t\t}\n\t\telseif(in_array($element, $valued))\n\t\t{\n\t\t\t//Get parameters\n\t\t\t$id = $args[0];\n\t\t\t$value = (!(array_key_exists(1, $args))? NULL : $args[1]);\n\t\t\t$attribs = (!(array_key_exists(2, $args))? array() : $args[2]);\n\t\t\t$class = \"\\\\Framework\\\\Form\\\\Elements\\\\C\" . ucwords($element) . \"FormElement\";\n\n\t\t\treturn new $class($this->_convertToID($id), $this->_getValue($id, $attribs, $value), $attribs);\n\t\t}\n\t\telseif($element === \"select\")\n\t\t{\n\t\t\t//Get parameters\n\t\t\t$id = $args[0];\n\t\t\t$options = (!(array_key_exists(1, $args))? array() : $args[1]);\n\t\t\t$attribs = (!(array_key_exists(2, $args))? array() : $args[2]);\n\t\t\t$selected = (!(array_key_exists(3, $args))? NULL : $args[3]);\n\n\t\t\t//Create element and return\n\t\t\treturn new \\Framework\\Form\\Elements\\CSelectFormElement($this->_convertToID($id), $options, $attribs, $this->_getValue($id, $attribs, $selected));\n\t\t}\n\t\telseif(array_key_exists(strtolower($element), self::$_CUSTOM))\n\t\t{\n\t\t\t$id = ((!empty($args[0]))? $args[0] : \"\");\n\t\t\t$args = array_slice($args, 1);\n\t\t\t$class = self::$_CUSTOM[strtolower($element)];\n\n\t\t\t//Create element and return\n\t\t\treturn new $class($this->_convertToID($id), $this->_getValue($id), $args);\n\t\t}\n\t\t\n\t\techo \"<pre>\", print_r($element);\n\t\tdie();\n\t\tthrow new \\Framework\\Exceptions\\EFormException(\"Unknown element '$element'.\");\n\t}", "public function __construct()\n {\n parent::__construct();\n\n $this->buildElements();\n }", "public function __construct (DomDocument $doc) {}", "static function cria($elName, ElementMaker $parent = null) {//coberto\n return new ElementMaker($elName, $parent);\n }", "function __construct($elementstorage)\n\t{\t\n\t\t$this->elements = unserialize($elementstorage);\n\t\t$this->objectname = $this->elements->get_objectname();\n\t\t$this->deffile = $this->elements->get_filename();\n\t}", "public function element($tag,$content = false)\r\n {\r\n $element = new Element($this,$tag,$content);\r\n\r\n if($this->nestElement instanceof Element)\r\n {\r\n $this->nestElement->child($element);\r\n }\r\n\r\n return $element;\r\n }", "public function create(string $name, $native=null): Element\n {\n $this->needsToBeUnlocked();\n\n $element = new $this->elementClass($name, $native ?: $name);\n $this->set($element);\n\n return $element;\n }", "public function __construct($uri = null, $element = null)\n {\n if (!($element instanceof DOMElement)) {\n if ($element) {\n // Load the feed as an XML DOMDocument object\n $doc = new DOMDocument();\n $doc = @Zend_Xml_Security::scan($element, $doc);\n\n if (!$doc) {\n $err = error_get_last();\n $phpErrormsg = isset($err) ? $err['message'] : null;\n // prevent the class to generate an undefined variable notice (ZF-2590)\n if (!isset($phpErrormsg)) {\n if (function_exists('xdebug_is_enabled')) {\n $phpErrormsg = '(error message not available, when XDebug is running)';\n } else {\n $phpErrormsg = '(error message not available)';\n }\n }\n\n /**\n * @see Zend_Feed_Exception\n */\n require_once 'Zend/Feed/Exception.php';\n throw new Zend_Feed_Exception(\"DOMDocument cannot parse XML: $phpErrormsg\");\n }\n\n $element = $doc->getElementsByTagName($this->_rootElement)->item(0);\n if (!$element) {\n /**\n * @see Zend_Feed_Exception\n */\n require_once 'Zend/Feed/Exception.php';\n throw new Zend_Feed_Exception('No root <' . $this->_rootElement . '> element found, cannot parse feed.');\n }\n } else {\n $doc = new DOMDocument('1.0', 'utf-8');\n if ($this->_rootNamespace !== null) {\n $element = $doc->createElementNS(Zend_Feed::lookupNamespace($this->_rootNamespace), $this->_rootElement);\n } else {\n $element = $doc->createElement($this->_rootElement);\n }\n }\n }\n\n parent::__construct($element);\n }", "public function __construct()\n\t{\n\t\t$this->parser = xml_parser_create('UTF-8');\n\t\txml_set_object($this->parser,$this);\n\t\txml_set_element_handler($this->parser, 'tag_open', 'tag_close');\n\t\txml_set_character_data_handler($this->parser, 'cdata');\n\t\txml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, false);\n\t\t\n\t\t$this->removeTags(\n\t\t\t'applet','base','basefont','body','center','dir','font',\n\t\t\t'frame','frameset','head','html','isindex',\n\t\t\t'link','menu','meta','noframes','script','style'\n\t\t);\n\t\t\n\t\t$this->removeAttributes(\n\t\t\t'onclick','ondblclick','onfocus','onkeydown','onkeypress',\n\t\t\t'onkeyup','onload','onmousedown','onmousemove','onmouseout',\n\t\t\t'onmouseover','onmouseup','onreset','onselect','onsubmit',\n\t\t\t'onunload'\n\t\t);\n\t}", "public function __construct($element, $decorator = null);", "public function setElement($element)\n\t{\n\t\tif (is_string($element)) {\n\t\t\t$this->_element = $element;\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public static function fromArray(array $src): Element\n {\n $cl = 'YeTii\\HtmlElement\\Elements\\Html' . ucfirst($src['name']);\n\n $element = new $cl();\n \n $element->set($src['attributes']);\n\n if (!empty($src['nodes'])) {\n $children = [];\n\n foreach ($src['nodes'] as $node) {\n $children[] = self::fromArray($node);\n }\n \n $element->addChildren($children);\n }\n\n return $element;\n }", "public static function createElement($tag = '')\n {\n self::$instance = new static($tag);\n return self::$instance;\n }", "function __construct( $Attributes = null, $InnerHTML = null , $displayOnConstruct = false) {\n\n\t\t// set the parent element name\n\t\t$this->ElementName = 'div';\n\t\t\n\t\tparent::__construct($Attributes, $InnerHTML, $displayOnConstruct);\t\n\t}", "public function __construct (DOMDocument $doc) {}", "public function __construct(\\Fewlines\\Core\\Xml\\Tree\\Element $config = null) {\n // Set dom relevant flags\n $this->setDomStr(self::FORM_STR);\n $this->setDomTag(self::FORM_TAG);\n\n // Create result to store all validations\n $this->result = new Result;\n\n // Add config by xml\n if (true == ($config instanceof \\Fewlines\\Core\\Xml\\Tree\\Element)) {\n $this->config = $config;\n\n // Add own attributes (of the form element)\n $this->setFormAttributesByConfig();\n\n // Add global validation for all inputs (if exists)\n $validation = $this->config->getChildByName('validation', false);\n if ($validation instanceof \\Fewlines\\Core\\Xml\\Tree\\Element) {\n $this->validation = new Validation($validation->getChildByName('errors', false));\n }\n\n // Get form items defined in the xml config\n $elements = $this->config->getChildren();\n\n // Add the form elements from the config as element\n if (false != $elements && $elements > 0) {\n $this->addElementsByXmlConfig($elements);\n }\n }\n }", "public function __construct($name) {\n // define el nombre del elemento\n $this->name = $name;\n }", "protected function setUp()\n {\n $this->object = new Element('test_element');\n\n $this->doc = new \\DOMDocument;\n $this->doc->appendChild($this->object);\n }", "public function __construct() {\n $this->attributes = array();\n $this->nodeValue = '';\n }", "function addElement( $element )\r\n\t\t{\r\n\t\t\t$id = NULL;\r\n\t\t\t$class = NULL;\r\n\t\t\t$eValue = NULL;\r\n\t\t\t$caption = NULL;\r\n\t\t\t$label = NULL;\r\n\t\t\t$placeholder = NULL;\r\n\t\t\t$value = NULL;\r\n\t\t\t$type = NULL;\r\n\t\t\t$name = NULL;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tforeach( $element as $attribute => $eValue ) \r\n\t\t\t{\r\n\t\t\t\t# ELEMENT ATTRIBUTES\r\n\t\t\t\tswitch ( $attribute ) \r\n\t\t\t\t{\r\n\t\t\t\t\tcase 'type':\r\n\t\t\t\t\t\tswitch ( $eValue ) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcase 'button': // Defines a clickable button\r\n\t\t\t\t\t\t\tcase 'btn': // Defines a clickable button\r\n\t\t\t\t\t\t\t\t$type = 'button';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'checkbox': // Defines a checkbox\r\n\t\t\t\t\t\t\t\t$type = 'checkbox';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'color': // Defines a color picker\r\n\t\t\t\t\t\t\t\t$type = 'color';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'date': // Defines a date control (year, month and day (no time))\r\n\t\t\t\t\t\t\t\t$type = 'date';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'datetime': // Defines a date and time control (year, month, day, hour, minute, second, and fraction of a second, based on UTC time zone)\r\n\t\t\t\t\t\t\t\t$type = 'datetime';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'datetime-local': // Defines a date and time control (year, month, day, hour, minute, second, and fraction of a second (no time zone)\r\n\t\t\t\t\t\t\t\t$type = 'datetime-local';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'email': // Defines a field for an e-mail address\r\n\t\t\t\t\t\t\t\t$type = 'email';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'file': // Defines a file-select field and a \"Browse...\" button (for file uploads)\r\n\t\t\t\t\t\t\t\t$type = 'file';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'hidden': // Defines a hidden input field\r\n\t\t\t\t\t\t\t\t$type = 'hidden';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'image': // Defines an image as the submit button\r\n\t\t\t\t\t\t\t\t$type = 'image';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'month': // Defines a month and year control (no time zone)\r\n\t\t\t\t\t\t\t\t$type = 'month';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'number': // Defines a field for entering a number\r\n\t\t\t\t\t\t\t\t$type = 'number';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'password': // Defines a password field (characters are masked)\r\n\t\t\t\t\t\t\tcase 'pass': // Defines a password field (characters are masked)\r\n\t\t\t\t\t\t\t\t$type = 'password';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'radio': // Defines a radio button\r\n\t\t\t\t\t\t\t\t$type = 'radio';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'range': // Defines a control for entering a number whose exact value is not important (like a slider control)\r\n\t\t\t\t\t\t\t\t$type = 'range';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'reset': // Defines a reset button (resets all form values to default values)\r\n\t\t\t\t\t\t\t\t$type = 'reset';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'search': // Defines a text field for entering a search string\r\n\t\t\t\t\t\t\t\t$type = 'search';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'submit': // Defines a submit button\r\n\t\t\t\t\t\t\t\t$type = 'submit';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'tel': // Defines a field for entering a telephone number\r\n\t\t\t\t\t\t\t\t$type = 'tel';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'text': // Default. Defines a single-line text field (default width is 20 characters)\r\n\t\t\t\t\t\t\tcase 'textbox':\r\n\t\t\t\t\t\t\t\t$type = 'text';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'textarea': // Defines a nulti-line text field\r\n\t\t\t\t\t\t\t\t$type = 'textarea';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'time': // Defines a control for entering a time (no time zone)\r\n\t\t\t\t\t\t\t\t$type = 'time';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'url': // Defines a field for entering a URL\r\n\t\t\t\t\t\t\t\t$type = 'url';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase 'week': // Defines a week and year control (no time zone)\r\n\t\t\t\t\t\t\t\t$type = 'week';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tthrow new Exception( 'Invalid attribute with new Element Class. Please check your form. Please use one of the following as defined in W3 Attribute Values. <a href=\"http://www.w3schools.com/tags/att_input_type.asp\" target=\"_blank\">Valid Attribute Values</a>' );\r\n\t\t\t\t\t\t\t\tbreak 2;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t} // end switch ( $eValue ) type\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'name':\r\n\t\t\t\t\t\t\tif( $eValue != '' && $eValue != NULL && $eValue != FALSE )\r\n\t\t\t\t\t\t\t\t$name = $this->form_id . '-'. preg_replace( '/[^A-Za-z-_]/', \"\", $eValue );\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tthrow new Exception( 'Please set a name for your form element.' );\r\n\t\t\t\t\t\t\t\tbreak 2;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} // end else\t\t\t\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'class':\r\n\t\t\t\t\t\tcase 'classes':\r\n\t\t\t\t\t\t\t$class = $eValue;\t\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'id':\r\n\t\t\t\t\t\tcase 'ids':\r\n\t\t\t\t\t\t\t$id = $eValue;\t\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'placeholder':\r\n\t\t\t\t\t\t\t$placeholder = $eValue;\t\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'label':\r\n\t\t\t\t\t\t\t$label = $eValue;\t\r\n\t\t\t\t\t\t\tbreak;\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'caption':\r\n\t\t\t\t\t\tcase 'captions':\r\n\t\t\t\t\t\t\t$caption = $eValue;\t\r\n\t\t\t\t\t\t\tbreak;\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'value':\r\n\t\t\t\t\t\t\t$value = $eValue;\t\r\n\t\t\t\t\t\t\tbreak;\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t} // end switch ( $rule ) \r\n\t\t\t\t\r\n\t\t\t} // end foreach( $element as $attribute => $eValue ) \r\n\t\t\t\r\n\t\t\t$errors = array();\r\n\t\t\t\r\n\t\t\t# VALIDATION\r\n\r\n\t\t\tif( $this->isSubmitted() )\r\n\t\t\t{\r\n\t\t\t\tforeach( $element as $rule => $msg ) \r\n\t\t\t\t{\r\n\t\t\t\t\tswitch ( $rule ) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcase 'val_req':\r\n\t\t\t\t\t\tcase 'val_required':\r\n\t\t\t\t\t\t\tif( empty( $_POST[$name] ) )\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif( !empty( $msg ) ) $errors[$name] = $msg;\r\n\t\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t\t\t$errors[$name] = 'This field is required. Please enter a value.';\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tbreak 2;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'val_email':\r\n\t\t\t\t\t\t\tif( $this->vEmail( $_POST[$name] ) )\r\n\t\t\t\t\t\t\t\t$this->_cleanQuery( $this->sEmail( $_POST[$name] ) );\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif( !empty( $msg ) ) $errors[$name] = $msg;\r\n\t\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t\t\t$errors[$name] = ERR_INVALID_NEW_EMAIL;\r\n\t\t\t\t\t\t\t\t\tbreak 2;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'val_name':\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif( $this->vName( $_POST[$name] ) == 1 )\r\n\t\t\t\t\t\t\t\t$this->_cleanQuery( $_POST[$name] );\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif( !empty( $msg ) ) $errors[$name] = $msg;\r\n\t\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t\t\t$errors[$name] = ERR_INVALID_NAME;\r\n\t\t\t\t\t\t\t\t\tbreak 2;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'val_alpha':\r\n\t\t\t\t\t\t\tif( $this->vAlpha( $_POST[$name] ) )\r\n\t\t\t\t\t\t\t\t$this->_cleanQuery( $_POST[$name] );\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif( !empty( $msg ) ) $errors[$name] = $msg;\r\n\t\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t\t\t$errors[$name] = ERR_INVALID_ALPHA;\r\n\t\t\t\t\t\t\t\t\tbreak 2;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'val_alphanumeric':\r\n\t\t\t\t\t\t\tif( $this->vAlphanumeric( $_POST[$name] ) )\r\n\t\t\t\t\t\t\t\t$this->_cleanQuery( $_POST[$name] );\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif( !empty( $msg ) ) $errors[$name] = $msg;\r\n\t\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t\t\t$errors[$name] = ERR_INVALID_ALPHANUMERIC;\r\n\t\t\t\t\t\t\t\t\tbreak 2;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'val_int':\r\n\t\t\t\t\t\t\tif( $this->vInt( $_POST[$name] ) )\r\n\t\t\t\t\t\t\t\t$this->_cleanQuery( $_POST[$name] );\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif( !empty( $msg ) ) $errors[$name] = $msg;\r\n\t\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t\t\t$errors[$name] = ERR_INVALID_INT;\r\n\t\t\t\t\t\t\t\t\tbreak 2;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'val_number':\r\n\t\t\t\t\t\t\tif( $this->vNumber( $_POST[$name] ) )\r\n\t\t\t\t\t\t\t\t$this->_cleanQuery( $_POST[$name] );\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif( !empty( $msg ) ) $errors[$name] = $msg;\r\n\t\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t\t\t$errors[$name] = ERR_INVALID_NUMBER;\r\n\t\t\t\t\t\t\t\t\tbreak 2;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'val_pass':\r\n\t\t\t\t\t\tcase 'val_password':\r\n\t\t\t\t\t\t\tif( $this->vPassword( $_POST[$name] ) == 1 )\r\n\t\t\t\t\t\t\t\t$this->_cleanQuery( $_POST[$name] );\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif( !empty( $msg ) ) $errors[$name] = $msg;\r\n\t\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t\t\t$errors[$name] = ERR_INVALID_PASS;\r\n\t\t\t\t\t\t\t\t\tbreak 2;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'val_match':\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif( $_POST[$name] == $msg['match'] )\r\n\t\t\t\t\t\t\t\t$this->_cleanQuery( $_POST[$name] );\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif( !array_key_exists('message', $msg ) )\r\n\t\t\t\t\t\t\t\t\t$errors[$name] = ERR_MM_VALUE;\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t$errors[$name] = $msg['message'];\r\n\t\t\t\t\t\t\t\t\tbreak 2;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t/* ----------- SANITIZE DATA ------------*/\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 's_query':\r\n\t\t\t\t\t\t\t$this->_cleanQuery( $_POST[$name] );\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t} // end switch ( $rule ) \r\n\t\t\t\t\t\r\n\t\t\t\t} // end foreach( $element as $attribute => $eValue ) \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/* ############## ELEMENT ################ */\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/* ################# */\r\n\t\t\t/* ##### LABEL ##### */\r\n\t\t\t\r\n\t\t\t# Add label if there is one\r\n\t\t\tif( !empty( $label ) )\t\r\n\t\t\t\techo \"<label>$label</label>\";\r\n\t\t\t\r\n\t\t\t/* ##### LABEL ##### */\r\n\t\t\t/* ################# */\r\n\t\t\t\r\n\t\t\t/* ######################## */\r\n\t\t\t/* ##### ELEMENT TYPE ##### */\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t/* -------------------- Text, Textbox, or Password -------------------- */\r\n\t\t\t\t\r\n\t\t\t\tif( $type == 'text' || $type == 'textbox' || $type == 'password' || $type == 'email' )\r\n\t\t\t\t{\r\n\t\t\t\t\t# Begin creating the input\r\n\t\t\t\t\t$element = \"<input type='$type' name='$name' id='$name' placeholder='$placeholder' value='\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t# Set value of $name if it's set ( using $_POST , $_GET or $value\r\n\r\n\t\t\t\t\tif( isset( $_POST[$name] ) ) $element .= $_POST[$name];\r\n\t\t\t\t\telseif( isset( $_GET[$name] ) ) $element .= $_GET[$name]; \r\n\t\t\t\t\telseif( !isset( $_POST[$name] ) && !isset( $_GET[$name] ) && isset( $value ) ) $element .= $value;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t# Set the class\r\n\t\t\t\t\t$element .= \"' class='$name $class\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t# Add appropriate spacing if there's a caption\r\n\t\t\t\t\tif( !empty( $caption ) ) $element .= \" mbt \";\r\n\t\t\t\t\t\r\n\t\t\t\t\t# Check for errors, # Set Error class and display error underneath input\r\n\t\t\t\t\tif( array_key_exists( $name, $errors ) ) $element .= \" error \";\r\n\t\t\t\t\t\r\n\t\t\t\t\t# Close text tag\t\r\n\t\t\t\t\t$element .= \"' />\";\r\n\t\t\t\t\t\r\n\t\t\t\t} // end if( $type == 'text' || $type == 'textbox' || $type == 'password' )\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t/* -------------------- Textarea -------------------- */\r\n\t\t\t\t\r\n\t\t\t\tif( $type == 'textarea' )\r\n\t\t\t\t{\r\n\t\t\t\t\t# Begin creating the input\r\n\t\t\t\t\t$element = \"<textarea type='$type' name='$name' id='$name' placeholder='$placeholder\"; \r\n\t\t\t\t\r\n\t\t\t\t\t# Set the class\r\n\t\t\t\t\t$element .= \"' class='$name $class \";\r\n\t\t\t\t\t\r\n\t\t\t\t\t# Add appropriate spacing if there's a caption\r\n\t\t\t\t\tif( !empty( $caption ) ) $element .= \" mbt \";\r\n\t\t\t\t\t\r\n\t\t\t\t\t# Check for errors, # Set Error class and display error underneath input\r\n\t\t\t\t\tif( array_key_exists( $name, $errors ) ) $element .= \" error \";\r\n\t\t\t\t\t\r\n\t\t\t\t\t# Close tag\t\r\n\t\t\t\t\t$element .= \"' >\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t# Set value of $name if it's set ( using $_POST , $_GET or $value\r\n\t\t\t\t\tif( isset( $_POST[$name] ) ) $element .= $_POST[$name];\r\n\t\t\t\t\telseif( isset( $_GET[$name] ) ) $element .= $_GET[$name]; \r\n\t\t\t\t\telseif( !isset( $_POST[$name] ) && !isset( $_GET[$name] ) && isset( $value ) ) $element .= $value;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$element .= '</textarea>';\r\n\t\t\t\t\t\r\n\t\t\t\t} // end if( $type == 'textarea' )\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t/* -------------------- Submit -------------------- */\r\n\t\t\t\t\r\n\t\t\t\tif( $type == 'submit' || $type == 'button' || $type == 'btn' )\r\n\t\t\t\t{\r\n\t\t\t\t\t# Begin creating the input\r\n\t\t\t\t\t$element = \"<input type='$type' name='$name' id='$name' value='\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t# Set value of $name if it's set ( using $_POST , $_GET or $value\r\n\t\t\t\t\tif( $value != '' || $value != FALSE || $value != NULL ) $element .= $value;\r\n\t\t\t\t\telse $element .= 'Submit';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t# Set the class\r\n\t\t\t\t\t$element .= \"' class='$name btn btn-default $class \";\r\n\t\t\t\t\t\r\n\t\t\t\t\t# Add appropriate spacing if there's a caption\r\n\t\t\t\t\tif( !empty( $caption ) ) $element .= \" mbt \";\r\n\t\t\t\t\t\r\n\t\t\t\t\t# Check for errors, # Set Error class and display error underneath input\r\n\t\t\t\t\tif( array_key_exists( $name, $errors ) ) $element .= \" error \";\r\n\t\t\t\t\t\r\n\t\t\t\t\t# Close text tag\t\r\n\t\t\t\t\t$element .= \"' />\";\r\n\t\t\t\t\t\r\n\t\t\t\t} // end if( $type == 'textarea' )\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/* ##### ELEMENT TYPE ##### */\r\n\t\t\t/* ######################## */\r\n\t\t\t\r\n\t\t\t/* ################### */\r\n\t\t\t/* ##### ERRORS ###### */\r\n\t\t\t\r\n\t\t\t# Check for errors\r\n\t\t\t$error_msg = NULL;\r\n\t\t\tif( array_key_exists( $name, $errors ) )\t\r\n\t\t\t\t$error_msg = \"<small class='error'>$errors[$name]</small>\";\r\n\t\t\t\t\r\n\t\t\t/* ##### ERRORS ###### */\r\n\t\t\t/* ################### */\r\n\t\t\t\r\n\t\t\t/* ################### */\r\n\t\t\t/* ##### CAPTION ##### */\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif( !empty( $caption ) )\t\r\n\t\t\t\t$error_msg .= \"<div class='caption mbs'>&uarr; $caption</div>\";\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t/* ##### CAPTION ##### */\r\n\t\t\t/* ################### */\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t/* ############## ELEMENT ################ */\r\n\t\t\t/* ####################################### */\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif( isset( $_POST[$name] ) )\r\n\t\t\t{\r\n\t\t\t\t$output = $_POST[$name];\r\n\t\t\t\t$error_field = \"<style>input.$name, textarea.$name{ border-color: #c60f13; background-color:rgba(198,15,19,0.1);}</style>\".$element;\r\n\t\t\t\tif( empty( $errors ) )\r\n\t\t\t\t\t$valid = TRUE;\r\n\t\t\t\t\t\r\n\t\t\t\telse\r\n\t\t\t\t\t$valid = FALSE;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$output = FALSE;\r\n\t\t\t\t$valid = FALSE;\r\n\t\t\t\t$error_msg = FALSE;\r\n\t\t\t\t$error_field = FALSE;\r\n\t\t\t\t\r\n\t\t\t}\t\t\t\t\t \r\n\t\t\t\t\r\n\t\t\treturn array( 'element' => $element.$error_msg,\r\n\t\t\t\t\t\t 'e' => $element.$error_msg,\r\n\t\t\t\t\t\t 'field' => $element,\r\n\t\t\t\t\t\t 'f' => $element,\r\n\t\t\t\t\t\t 'error_field' => $error_field,\r\n\t\t\t\t\t\t 'ef' => $error_field,\r\n\t\t\t\t\t\t 'error_msg' => $error_msg,\r\n\t\t\t\t\t\t 'em' => $error_msg,\r\n\t\t\t\t\t\t 'output' => $output,\r\n\t\t\t\t\t\t 'o' => $output,\r\n\t\t\t\t\t\t 'valid' => $valid, \r\n\t\t\t\t\t\t 'v' => $valid,\r\n\t\t\t\t\t\t 'name' => $name,\r\n\t\t\t\t\t\t 'n' => $name );\r\n\t\t\t\r\n\t\t}", "protected function setElement()\n {\n $this->result[$this->attribute]['element'] = $this->field['element'];\n return $this;\n }", "function __construct(DOMNode $el)\n {\n if ($el instanceof DOMDocument) $this->start = $el->documentElement;\n else if ($el instanceof DOMElement) $this->start = $el;\n else throw new InvalidArgumentException(\"Invalid arguments, expected DOMElement or DOMDocument\");\n }", "protected function initHtmlElements()\n {\n $this->htmlElement = new Html_Element('input');\n $this->htmlElementLabel = new Html_Element('label');\n $this->htmlElementValidaionLabel = clone $this->containerElement;\n $this->htmlElementSubLabel = clone $this->containerElement;\n }", "public function __construct(\\DOMElement $xml = null)\n {\n if ($xml === null) {\n return;\n }\n\n $this->element = $xml;\n\n if ($xml->hasAttribute('NameQualifier')) {\n $this->NameQualifier = $xml->getAttribute('NameQualifier');\n }\n\n if ($xml->hasAttribute('SPNameQualifier')) {\n $this->SPNameQualifier = $xml->getAttribute('SPNameQualifier');\n }\n }", "public function __construct(array $elements) {\n\n $this->elements = $elements;\n }", "public function __construct () {\n\t\t$this->url =\t\t!ee()->TMPL->fetch_param('url') ? $this->url : ee()->TMPL->fetch_param('url');\n\t\t$this->pageId = \t!ee()->TMPL->fetch_param('page_id') ? $this->pageId : ee()->TMPL->fetch_param('page_id');\n\t\t$this->element =\t!ee()->TMPL->fetch_param('element') ? $this->element : ee()->TMPL->fetch_param('element');\n\t\t$this->elementClass =\t!ee()->TMPL->fetch_param('element_class') ? $this->elementClass : ee()->TMPL->fetch_param('element_class');\n\t\t\t\t\n\t\t$this->return_data = '<' . $this->element . ' class=\"' . $this->elementClass . '\" data-confluenceurl=\"' . $this->url . '\" data-confluencepageid=\"' . $this->pageId . '\"></' . $this->element . '>';\t\t\n\t}", "public function __construct( $element, $tokens = [] )\n\t{\n\t\tparent::__construct( $element, 'rel', $tokens );\n\t}", "public static function tag($tagname, $children = array(), $attributes = array())\n {\n return new Element($tagname, $children, $attributes);\n }", "public function element(Element $element)\r\n {\r\n $this->elements[] = $element;\r\n\r\n return $this;\r\n }", "public function __construct(Dom|DOMDocument $dom, array|DOMElement|DomEl|DOMNodeList $elArray = array()) {\n\t$this->_dom = $dom;\n\n\tif(!is_array($elArray)) {\n\t\t// Possible to only pass a single DOMElement or DomEl object as param.\n\t\tif($elArray instanceof DOMElement) {\n\t\t\t$elArray = array($dom->create($elArray));\n\t\t}\n\t\telse if($elArray instanceof DomEl) {\n\t\t\t$elArray = array($elArray);\n\t\t}\n\t\telse if($elArray instanceof DOMNodeList) {\n\t\t\t$list = $elArray;\n\t\t\t$listLength = $elArray->length;\n\n\t\t\t$elArray = array();\n\t\t\tfor($i = 0; $i < $listLength; $i++) {\n\t\t\t\t$elArray[] = new DomEl($dom, $list->item($i));\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new Exception(\"Error creating DomElCollection.\");\n\t\t}\n\t}\n\n\t$this->_elArray = $elArray;\n\t$this->_index = 0;\n}", "public static function make(\n string $name,\n $data = [],\n array $options = []\n ): Element {\n if (!$resource = static::resolveResource($name)) {\n MiravelFacade::exception(ElementNotFoundException::class, compact('name'), __FILE__, __LINE__);\n }\n\n return static::makeFromResource($name, $resource, $data, $options);\n }", "public function __construct(ElementInterface $root, bool $beautified = false)\n {\n $this->root = $root;\n $this->beautified = $beautified;\n }", "function __construct()\n\t{\n\t\t// Load the XML Helper\n\t\tee()->load->helper('xml');\n\t}", "public function __construct(DOMElement $dom)\n {\n $xpath = new DOMXPath($dom->ownerDocument);\n $xpath->registerNamespace('az', 'http://webservices.amazon.com/AWSECommerceService/' . ProductAdvertising::getVersion());\n\n $this->Url = Uri\\UriFactory::factory($xpath->query('./az:URL/text()', $dom)->item(0)->data);\n $this->Height = (int) $xpath->query('./az:Height/text()', $dom)->item(0)->data;\n $this->Width = (int) $xpath->query('./az:Width/text()', $dom)->item(0)->data;\n }", "public function getElement();", "public function getElement();", "public function setElement(BaseElementModel $element);", "public function element( ) : \\DOMElement\n {\n $item = parent::element( );\n\n if ( $this->limit ) {\n $item->appendChild( $this->createElement(\n 'spotify:limit',\n '',\n [\n 'recentCount' => $this->limit,\n ]\n ) );\n }\n\n if ( $this->countryOfOrigin ) {\n $item->appendChild( $this->createElement(\n 'spotify:countryOfOrigin',\n implode( ',', $this->countryOfOrigin )\n ) );\n }\n\n return $item;\n }", "public function newElement($type) {\n\t\treturn new Html($type);\n\t}", "public function element( ) : \\DOMElement\n {\n $item = $this->createElement( 'textInput' );\n\n $this->addTitleElement( $item );\n\n $this->addDescriptionElement( $item );\n\n $this->addLinkElement( $item );\n\n if ( $this->name ) {\n $item->appendChild( $this->createElement( 'name', $this->name ) );\n }\n\n $this->addDublinCoreTags( $item );\n\n return $item;\n }", "public function buildObject() {\n $this->convertVCGrid = !get_theme_support('bootstrap');\n\n $this->object = new VTCore_History_Element_HsElement($this->atts);\n $this->object->addChildren(do_shortcode($this->content));\n }", "public function __construct(array $elements)\n {\n $this->elements = $elements;\n }", "public function __construct() {\n\n $this->sizeField['width'] = '500';\n $this->sizeField['height'] = '500';\n \n $this->gridObject = new SimpleXMLElement('<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.0//EN\" \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"500px\" height=\"500px\"></svg>');\n }", "public static function create(array $elements = [])\n {\n return new static($elements);\n }", "public function createElement($qualifiedName, $content = NULL, array $attributes = NULL): Element {\n [$prefix, $localName] = QualifiedName::split($qualifiedName);\n $namespaceURI = '';\n if ($prefix !== FALSE) {\n if (empty($prefix)) {\n $qualifiedName = $localName;\n } else {\n if ($this->namespaces()->isReservedPrefix($prefix)) {\n throw new \\LogicException(\n \\sprintf('Can not use reserved namespace prefix \"%s\" in element name.', $prefix)\n );\n }\n $namespaceURI = (string)$this->namespaces()->resolveNamespace($prefix);\n }\n } else {\n $namespaceURI = (string)$this->namespaces()->resolveNamespace('#default');\n }\n if ($namespaceURI !== '') {\n $node = $this->createElementNS($namespaceURI, $qualifiedName);\n } elseif (isset($this->_namespaces['#default'])) {\n $node = $this->createElementNS('', $qualifiedName);\n } else {\n $node = parent::createElement($qualifiedName);\n }\n $this->appendAttributes($node, $content, $attributes);\n $this->appendContent($node, $content);\n return $node;\n }", "public function create()\n {\n return view('Element.make-elements');\n }", "public function __construct()\n\t{\n\t\t$this->html = new HtmlBuilder;\n\t}", "public function __construct($elements, $table, $properties)\n {\n\n $this->elements = $elements;\n $this->table = $table;\n $this->properties = $properties;\n\n }", "public static function create ($domObject) {\r\n if ($className = get_class($domObject)) {\r\n $simpleDOMObjectName = \"Simple{$className}\";\r\n return new $simpleDOMObjectName ($domObject);\r\n } else {\r\n throw new Exception('SimpleDOMFactory: Could not find an object-name');\r\n }\r\n }", "public function __construct(ElementRepository $elements)\n {\n $this->elements = $elements;\n }", "public function __construct(DOMElement $dom)\n {\n $xpath = new DOMXPath($dom->ownerDocument);\n $xpath->registerNamespace('az', 'http://webservices.amazon.com/AWSECommerceService/' . Amazon::getVersion());\n\n $map = array(\n 'SwatchImage' => './az:SwatchImage',\n 'SmallImage' => './az:SmallImage',\n 'ThumbnailImage' => './az:ThumbnailImage',\n 'TinyImage' => './az:TinyImage',\n 'MediumImage' => './az:MediumImage',\n 'LargeImage' => './az:LargeImage',\n );\n\n $a = $dom->ownerDocument->saveXml($dom);\n\n foreach ($map as $paramName => $xquery) {\n $queryResult = $xpath->query($xquery, $dom);\n if ($queryResult->length <= 0) {\n continue;\n }\n $item = $queryResult->item(0);\n\n $this->$paramName = new Image($item);\n }\n }", "public function __construct($tag) {\n\t\t\t$this->tag = $tag;\n\t\t\t$this->inner = \"\";\n\t\t\t$this->children = [];\n\t\t\t$this->attributes = [];\n\n\t\t\treturn $this;\n\t\t}", "public static function fromDOMElement(DOMElement $node) {\n\t\t$o=new Representacions();\n\t\t$o->assignByHash(self::domNodeToHash($node, self::$FIELD_NAMES, self::$DEFAULT_VALUES, self::$FIELD_TYPES));\n\t\treturn $o;\n\t}", "function __construct()\n {\n $this->content = \"\";\n $this->title = \"\";\n $this->size = \"\";\n $this->panelID = DOM_id::getID();\n $this->bodyID = DOM_id::getID();\n $this->headID = DOM_id::getID();\n $this->buttonID = DOM_id::getID();\n }", "public function __construct($element = null)\n {\n $this->registerAllNamespaces(Zend_Gdata_Gapps::$namespaces);\n parent::__construct($element);\n }", "public function __construct($element = null)\n {\n $this->registerAllNamespaces(Zend_Gdata_Gapps::$namespaces);\n parent::__construct($element);\n }", "public function __construct($label, $value, $selected, $elementCriteria)\n\t{\n\t\t$element = $elementCriteria->first();\n\t\t$this->label = craft()->templates->renderObjectTemplate($label, $element);\n\t\t$this->value = craft()->templates->renderObjectTemplate($value, $element);\n\t\t$this->element = $elementCriteria;\n\t\t$this->selected = $selected;\n\t}", "public function __construct($element)\n\t{\n\t\t$f = __METHOD__; //InfoBoxCommand::getShortClass().\"(\".static::getShortClass().\")->__construct()\";\n\t\tif ($element instanceof Element) {\n\t\t\t$element->setSubcommandCollector($this);\n\t\t}\n\t\tparent::__construct($element);\n\t}", "function __construct($tagType, $tagAttributes, $tagContent) {\n//if (! empty($tagType) || !empty($tagAttributes) || !empty($tagContent))\n//{\n $this->type = $tagType;\n $this->attributes = $tagAttributes;\n $this->content = $tagContent;\n\n $this->set_tag($tagType, $tagAttributes, $tagContent);\n//}\n }", "public static function getInstance($element_id)\n {\n $ownclass = get_called_class();\n if (is_object($element_id) && get_class($element_id) === $ownclass)\n return $element_id;\n if (!is_scalar($element_id))\n throw new Exception(\"Element-ID must be a scalar\");\n\n if (!isset(self::$database[$ownclass][$element_id]))\n {\n if ($element_id === static::$root)\n self::$database[$ownclass][static::$root] = new $ownclass(static::$root);\n else\n throw new Exception(\"Element-ID {$element_id} is unknown for {$ownclass}\");\n }\n\n return self::$database[$ownclass][$element_id];\n }", "public function construct()\n\t\t{\n\t\t}", "public function __construct( $element_id, $chart = ChartTypes::LINE )\n {\n $this->element = $element_id;\n $this->__chart_type = $chart;\n }", "protected function setUp()\n {\n //$this->object = new Element;\n\n }", "public static function createElement(\r\n $type, $name = null, $attributes = null, array $data = array()\r\n ) {\r\n $type = strtolower($type);\r\n if (!isset(self::$elementTypes[$type])) {\r\n throw new HTML_QuickForm2_InvalidArgumentException(\"Element type '$type' is not known\");\r\n }\r\n list($className, $includeFile) = self::$elementTypes[$type];\r\n HTML_QuickForm2_Loader::loadClass($className, $includeFile);\r\n return new $className($name, $attributes, $data);\r\n }", "function __construct($URL = \"\")\n {\n // Initializations\n $this->URL = $URL;\n $this->XML = new XMLNode(\"[root]\");\n }", "public function __construct(array $elements, NestableElement $nestableElementDummy)\n {\n foreach ($elements as $element) {\n if (!$element instanceof Element) {\n throw new \\InvalidArgumentException('This collection accepts only Element type');\n }\n\n $this->add($element);\n }\n\n $this->nestableElementDummy = $nestableElementDummy;\n }", "public function __construct()\n\t{\n\t\t$this->type = 'html';\n\t\t\n\t\t$docTitle = 'PHP RUN-TEST RESULTS';\n\t\t\n\t\t// dom\n\t\t$imp = new DOMImplementation();\n\t\t$dtd = $imp->createDocumentType(\"html\", \"-//W3C//DTD XHTML 1.0 Transitional//EN\", \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\");\n \t$this->dom = $imp->createDocument(\"\", \"\", $dtd);\n\n \t// html\n \t$htmlNode = $this->dom->createElement('html');\n \t$this->dom->appendChild($htmlNode);\n \t\n \t// head\n \t$headNode = $this->dom->createElement('head');\n \t$htmlNode->appendChild($headNode);\n \t$headNode->appendChild($this->dom->createElement('title', $docTitle));\n \t\n \t// body\n \t$bodyNode = $this->dom->createElement('body');\n \t$htmlNode->appendChild($bodyNode);\n \t\n \t// stage\n \t$this->stage = $this->dom->createElement('div');\n \t$this->stage->setAttribute('id', 'stage');\n \t$bodyNode->appendChild($this->stage);\n \t\n \t$this->stage->appendChild($this->dom->createElement('h1', $docTitle));\n\t}", "protected function setUp()\n\t{\n\t\t$elements = array(\n\t\t\tnew DomElement('option', 'foo'),\n\t\t\tnew DomElement('option', 'bar'),\n\t\t\tnew DomElement('rdf:metaData', new DomElement('rdf:name', 'Simon')),\n\t\t);\n\n\t\t$this->instance = new DomElements($elements);\n\t}", "public function __construct( \\SimpleXMLElement $xml_definition ) {\n\t\t$this->xml_definition = $xml_definition;\n\t}", "public static function createFrom(array $elements)\n {\n return new static($elements);\n }", "private function __construct(){\r\n $this->dom = new DOMDocument();\r\n $this->xslt = new XSLTProcessor();\r\n }", "public function __construct( $tag, $content = \"\" ) {\n if ( $content instanceof AbstractHTMLElement ) {\n $content = $content->asHTML();\n }\n $type = gettype( $content );\n if ( $type != \"string\" ) {\n $this->constructorError( $type, $content );\n }\n\n $this->tag_name = $tag;\n $this->content = $content;\n }", "public function element()\n {\n return $this->belongsTo('App\\Element');\n }", "function createNode ($a_parent, $a_elementname, $a_attr_list = NULL, $a_text = NULL)\n\t{\n\t\t// create new element node\n\t\t$node = $this->createElement($a_elementname);\n\t\t\n\t\t// set attributes\n\t\tif (is_array($a_attr_list)) {\n\t\t\tforeach ($a_attr_list as $attr => $value) {\n\t\t\t\t$node->set_attribute($attr, $value);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// create and add a text node to the new element node\n\t\tif (is_string($a_text)) {\n\t\t\t$node_text = $this->doc->create_text_node($a_text);\n\t\t\t$node_text = $node->append_child($node_text);\n\t\t}\n\t\t\n\t\t// add element node at at the end of the children of the parent\n\t\t$node = $a_parent->append_child($node);\n\t\t\n\t\treturn $node;\n\t}", "function __construct($id = null, $collection = null) {\n\t\tif(!is_null($id)) {\n\n\t\t\t$this->get_object($collection, $id);\n\t\t}\n\n\t\t$this->description->tag->tagtype = 'span';\n\t\t$this->image->tag->tagtype = 'img';\n\t\t$this->url->tag->tagtype = 'a';\n\t\t$this->name->tag->tagtype = 'span';\n\t\t$this->description->form->fieldtype = 'text';\n\t\t$this->image->form->fieldtype = 'text';\n\t\t$this->url->form->fieldtype = 'text';\n\t\t$this->name->form->fieldtype = 'text';\n\t\t$this->name->tag->attributes['class'] = get_class($this) . ' tag ';\n\t\t$this->name->tag->attributes['itemprop'] = 'tag';\n\t\t$this->url->tag->attributes['class'] = get_class($this) . ' url ';\n\t\t$this->url->tag->attributes['itemprop'] = 'url';\n\t\t$this->image->tag->attributes['class'] = get_class($this) . ' image ';\n\t\t$this->image->tag->attributes['itemprop'] = 'image';\n\t\t$this->description->tag->attributes['class'] = get_class($this) . ' description ';\n\t\t$this->description->tag->attributes['itemprop'] = 'description';\n\t\t\n\t\t//print_r($this);\n\n\t}", "function __construct()\n {\n parent::__construct();\n\n // Set our page category and name\n $this->pageCategory('default');\n $this->pageName('The object you called did not properly extend the fRESTApplication Object');\n\n // We're going to output XML\n $this->fOutput->setMimeType('text/xml');\n\n // No caching output\n //$this->fOutput->noCache = true;\n\n // Don't use the theme or try and merge them\n $this->fTheme->useTheme(false);\n\n // Setup our default DOM document\n $this->dom = new DOMDocument('1.0', 'UTF-8');\n $this->dom->formatOutput = true;\n\n // Create the root node and result subnode\n $this->parentNode = $this->dom->createElement(get_class($this));\n $this->dom->appendChild($this->parentNode);\n $this->result = $this->dom->createElement('result');\n $this->parentNode->appendChild($this->result);\n\n // Append the hostname for debugging\n $hostname = new tHostname();\n $this->parentNode->appendChild($this->dom->createElement('host', $hostname->get()));\n\n // Append the request time\n $this->parentNode->appendChild($this->dom->createElement('requestTime', strftime('%x %X')));\n }", "function _construct(){ }", "protected function parseElement()\n {\n $c = $this->parseCombinator();\n\n $e = $this->match(array(\n '/\\\\G(?:\\d+\\.\\d+|\\d+)%/',\n //'/\\\\G(?:[.#]?|:*)(?:[\\w-]|[^\\x00-\\x9f]|\\\\\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/',\n // http://stackoverflow.com/questions/3665962/regular-expression-error-no-ending-delimiter\n '/\\\\G(?:[.#]?|:*)(?:[\\w-]|[^\\\\x{00}-\\\\x{9f}]|\\\\\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/',\n '*',\n '&',\n 'parseAttribute',\n '/\\\\G\\([^()@]+\\)/',\n '/\\\\G[\\.#](?=@)/',\n 'parseEntitiesVariableCurly'\n ));\n\n if (!$e) {\n if ($this->matchChar('(')) {\n if (($v = $this->parseSelector()) && $this->matchChar(')')) {\n $e = new ILess_Node_Paren($v);\n }\n }\n }\n\n if ($e) {\n return new ILess_Node_Element($c, $e, $this->position, $this->env->currentFileInfo);\n }\n }", "protected function createVirtualElement()\n {\n $id = uniqid();\n\n $depth = $this->reader->depth;\n\n $parent = isset($this->parents[$depth - 1]) ? $this->parents[$depth - 1] : null;\n\n $attributes = [\n '@id' => $id,\n '@parent' => $parent,\n '@element' => $this->reader->name,\n ];\n\n $element = new Collection($attributes);\n\n $this->parents[$depth] = $id;\n\n $this->references[$id] = $element;\n\n return $element;\n }", "final public function getName() {\n\t\treturn 'Element';\n\t}", "public function create()\r\n {\r\n // Load only root elements.\r\n $this->loadRoots($this->elements, $this->roots);\r\n\r\n // Make sure that first element isn't child. If child then throw a exception about that.\r\n if ($this->elements[0]->isChild())\r\n TypeRegression::cantBe('child', 'First');\r\n\r\n // Set elements compiled field with relations\r\n $this->makeRelationsToCompiled($this->elements);\r\n \r\n // After append process by root-child then compile all stuffs into 'page' field.\r\n foreach ($this->roots as $key => $element) {\r\n \r\n $this->page .= $element->compiled;\r\n }\r\n }", "public function __construct($name, $attrs, $inner_blocks, $inner_html, $inner_content)\n {\n }" ]
[ "0.6877082", "0.68266314", "0.67332226", "0.6644454", "0.6600208", "0.6570985", "0.6399482", "0.6378918", "0.63742787", "0.6342441", "0.624203", "0.6232333", "0.6195526", "0.616579", "0.6127352", "0.6120941", "0.61048234", "0.6094329", "0.608333", "0.6078004", "0.6075986", "0.606712", "0.6036748", "0.59451324", "0.5909001", "0.5904778", "0.58825165", "0.58580464", "0.58416265", "0.5836143", "0.58139175", "0.5804085", "0.58000153", "0.57936877", "0.57325715", "0.5706677", "0.57063836", "0.5706153", "0.5699224", "0.56948483", "0.56899434", "0.5679803", "0.56692976", "0.5652912", "0.5649567", "0.5634997", "0.56284654", "0.5612315", "0.5590693", "0.55650693", "0.55588317", "0.5554884", "0.5543291", "0.55410033", "0.55410033", "0.5525104", "0.5524448", "0.5509535", "0.5508534", "0.55020094", "0.5493607", "0.5480522", "0.5467442", "0.5464591", "0.54447556", "0.54381084", "0.5437687", "0.5437178", "0.5428289", "0.54219246", "0.5406816", "0.538922", "0.53889966", "0.53889525", "0.53889525", "0.5375703", "0.5374526", "0.53473055", "0.5335584", "0.53345877", "0.5327024", "0.53246546", "0.5319536", "0.5313066", "0.5292512", "0.5277698", "0.52704024", "0.5269369", "0.5263864", "0.5261321", "0.52610004", "0.52507865", "0.5236693", "0.52340794", "0.52324176", "0.5230735", "0.5220608", "0.52113765", "0.5209733", "0.5204853", "0.51869774" ]
0.0
-1
Renders the node if called as a string.
final public function __toString() { try { return $this->render(); } catch(Exception $e) { trigger_error($e->getMessage(), E_USER_ERROR); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function render() {\n\t\t\n\t\tif(!$this->line_number)\n\t\t\t$this->parse();\n\t\t\n\t\t$result = $this->root->render();\n\t\t\n\t\tob_start();\n\t\t\n\t\tStringStream::add_string('result', $result);\n\t\textract($this->variables);\n\t\t$__options = $this->options;\n\t\t$__render_attributes = function($attributes) use ($__options) {\n\t\t nodes\\Tag::render_attributes_html($__options['format'], $__options['attr_wrapper'], $attributes);\n\t\t};\n\t\tinclude 'StringStream://result';\n\t\tStringStream::clear('result');\n\t\t\n\t\treturn rtrim(ob_get_clean());\n\t\t\n\t}", "public function render(): string\n {\n if ($this instanceof IsTextNode) {\n $html = implode('', $this->children);\n\n if ($this->escapeHtml) {\n $html = htmlspecialchars($html);\n }\n\n return $html;\n }\n\n $html = [\n '<'.$this->getName(),\n ];\n\n foreach ($this->attributes as $key => $value) {\n if (in_array($key, $this->booleanAttributes)) {\n if (! $value) {\n continue;\n }\n\n $html[] = ' '.$key;\n continue;\n }\n\n if ($value === null) {\n $html[] = ' '.$key;\n continue;\n }\n\n $value = htmlspecialchars((string) $value);\n\n $html[] = <<<EOL\n {$key}=\"{$value}\"\nEOL;\n }\n\n if ($this instanceof IsSingleton) {\n $html[] = ' />';\n } else {\n $html[] = '>';\n\n $html[] = $this->renderChildren();\n\n $html[] = '</'.$this->getName().'>';\n }\n\n $html = implode('', $html);\n\n return $html;\n }", "abstract public function render(): string;", "abstract public function render(): string;", "abstract public function render(): string;", "abstract public function render(): string;", "public function render(): string;", "public function render(): string;", "public function render(): string;", "abstract public function render();", "abstract public function render();", "abstract public function render();", "abstract public function render();", "abstract public function render();", "abstract public function render();", "function render() {}", "abstract public function render() ;", "public abstract function render();", "public abstract function render();", "abstract function render();", "protected function renderAsXML() {}", "public function render() {\n if ($this->shouldRender) {\n $this->rendered = true;\n\n return $this->renderElement();\n }\n\n return \"\";\n }", "abstract public function render(): mixed;", "protected function renderAsPlain() {}", "function render() ;", "function render()\n\t{\n\t}", "public function render()\r\n\t{\r\n\t\t$content = \"\";\r\n\t\t\r\n\t\tif (!empty($this->id)) \r\n\t\t{\r\n\t\t\t$content .= \"id='\" . $this->id . \"' \";\r\n\t\t}\r\n\t\t\r\n\t\tif (!empty($this->name)) \r\n\t\t{\r\n\t\t\t$content .= \"name='\" . $this->name . \"' \";\r\n\t\t}\r\n\t\t\r\n\t\tif (!empty($this->className)) \r\n\t\t{\r\n\t\t\t$content .= \"class='\" . $this->className . \"' \";\r\n\t\t}\r\n\t\t\r\n\t\treturn $content;\r\n\t}", "public function Render(): string\r\n {\r\n $callback = fn (?string $k, ?string $v): string => $k.'=\"'.\\htmlentities($v ?? '').'\"';\r\n $attributes = array_map($callback, \\array_keys($this->Attributes), \\array_values($this->Attributes));\r\n\r\n $children = '';\r\n if (count($this->Children) > 0) {\r\n $this->IsContainer = true;\r\n $children = implode('', $this->Children);\r\n }\r\n\r\n return '<'.strtolower($this->TagName).' '.implode(' ', $attributes).($this->IsContainer ? '' : '/').'>'.$children.($this->IsContainer ? '</'.\\strtolower($this->TagName).'>' : '');\r\n }", "public static function renderText();", "public function render(): string\n {\n $message = new TextNode($this->notSupportedMessege);\n\n return $this->open() . $this->renderChildren() . $message . $this->close();\n }", "protected function render() {}", "protected function render() {}", "protected function render() {}", "public function render()\n {\n echo $this->__toString();\n\n }", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "function render(){\n\t\t\n\t}", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();" ]
[ "0.6574533", "0.6432814", "0.6417186", "0.6417186", "0.6417186", "0.6417186", "0.6323785", "0.6323785", "0.6323785", "0.6283732", "0.6283732", "0.6283732", "0.6283732", "0.6283732", "0.6283732", "0.62682235", "0.62408125", "0.62312305", "0.62312305", "0.6222271", "0.6133049", "0.60877913", "0.60388166", "0.6024878", "0.6019727", "0.60099137", "0.5995081", "0.5989321", "0.5986346", "0.5969086", "0.59651923", "0.59640306", "0.59640306", "0.59616244", "0.59380674", "0.59380674", "0.59380674", "0.59380674", "0.59380674", "0.59380674", "0.59380674", "0.59380674", "0.59380674", "0.59380674", "0.59380674", "0.59380674", "0.59380674", "0.59380674", "0.59380674", "0.59380674", "0.59380674", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5937506", "0.5935609", "0.59340763", "0.59340763", "0.59340763", "0.59340763", "0.59340763", "0.59340763", "0.59340763", "0.59340763", "0.59340763", "0.59340763", "0.59340763", "0.59340763", "0.59340763", "0.59340763" ]
0.0
-1
Returns the name of the object.
final public function getName() { return 'Element'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_object_name() : string ;", "function get_object_name()\n {\n return $this->_object_name;\n }", "public function objectAsName($object);", "function name()\n {\n \n return new StringWrapper(get_class($this->object).'#'.$this->id());\n \n }", "public function getName() {\n $path = explode('\\\\', get_class($this->object[\"data\"]));\n return array_pop($path);\n }", "public function getObjectTypeName() \n\t{\n\t\treturn self::$object_type[$this->object_type];\n\t}", "public function getName()\n\t{\n\t\treturn isset($this->_name) ? $this->_name : spl_object_hash($this);\n\t}", "public function getName()\n {\n $class = get_class($this);\n\n return str_replace($this->getObjectType(), '',\n str_replace(CADRE_appNameSpace.$this->getObjectTypePlural().'\\\\', '', $class));\n }", "public function getObjectName($object){\n\t\t$parts = explode('\\\\', get_class($object));\n\t\treturn strtolower(array_pop($parts));\n\t}", "public function getName(): string\n {\n return $this->getIdentifier()->getName();\n }", "function getJsObjectName() {\n\t\t\treturn $this->getId( ) . 'JsObject';\n\t\t}", "public function getName()\n {\n return $this->__get(\"name\");\n }", "public function getName()\n {\n return $this->__get(\"name\");\n }", "public function name()\n\t{\n\t\treturn $this->_name;\n\t}", "public function name()\n {\n return $this->getName();\n }", "public function name()\n {\n return $this->getName();\n }", "public function getName() {\n return $this->__name;\n }", "public function name() {\n\t\treturn $this->name;\n\t}", "public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "public function get_name() {\n return $this->_name;\n }", "function getName() {\n return $this->instance->getName();\n }", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();" ]
[ "0.8829165", "0.870608", "0.8227463", "0.8184838", "0.8125817", "0.80594957", "0.79293984", "0.7611413", "0.75948834", "0.74643624", "0.7453147", "0.7438825", "0.7438825", "0.74306315", "0.7417954", "0.7417954", "0.73918205", "0.73667884", "0.73519856", "0.73507905", "0.73507905", "0.73507905", "0.7334047", "0.73210484", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703", "0.7301703" ]
0.0
-1
Returns the name of the factory which created the node.
final public function getFactory() { return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFactory()\n\t{\n\t\treturn empty($this->factory) ? 'new '.$this->getClass() : $this->factory;\n\t}", "public function getDataFactoryName()\n {\n return $this->dataFactory->getName();\n }", "public function getActiveFactoryName()\n {\n return $this->activeFactoryName;\n }", "public function getNodeFactory();", "public function getFactoryClassName($class) {\n\t\treturn $this->getNamespace() . \"\\\\{$class}\";\n\t}", "public function getFQN()\n {\n return $this->namespace.$this->name;\n }", "private static function getFactoryName(string $modelName): string\n {\n try {\n $modelShortName = (new ReflectionClass($modelName))->getShortName();\n } catch (ReflectionException $e) {\n echo '⚠️Cannot get factory name. ' . $e->getMessage();\n die();\n }\n\n return self::$namespace . $modelShortName . 'Factory';\n }", "public function name() : string\n {\n return call_user_func([get_called_class(), 'resolveName']);\n }", "function getFactory(){\n\treturn $_SESSION[ SESSION_NAME_SPACE ][ 'factory' ];\n}", "public function getName() {\n\t\treturn NodePaths::getNodeNameFromPath($this->path);\n\t}", "public static function name()\n {\n return 'create';\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactoryNamespace();", "public function getNodeTypeName() {}", "function getName($filter=null)\n {\n return $this->factory->getName($filter);\n }", "public function getNodename();", "protected function createFactory()\n {\n $factory = Str::studly(class_basename($this->argument('name')));\n\n $this->call('make:factory', [\n 'name' => \"{$factory}Factory\",\n '--model' => $this->qualifyClass($this->getNameInput()),\n ]);\n }", "public function getNodename(): string\n {\n return $this->nodename;\n }", "public static function getFactory()\r\n\t{\r\n\t\treturn self::$factory;\r\n\t}", "public function getFactoryPostfix();", "public function getFactory()\n {\n return $this->_factory;\n }", "public function getFactory() {}", "public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }", "function name()\n {\n \n return new StringWrapper(get_class($this->object).'#'.$this->id());\n \n }", "public function name() {\r\n return $this->node->nodeName;\r\n }", "protected function createFactory()\n {\n $factory = Str::studly($this->argument('name'));\n\n $this->call(FactoryMakeCommand::class, [\n 'name' => \"{$factory}Factory\",\n '--model' => $this->qualifyClass($this->getNameInput()),\n ]);\n }", "function getNodeTypeName() ;", "public function getFQN(): string\n {\n return DomainLocator::concatFQN($this->name, $this->parent);\n }", "public function getName()\n {\n return 'createrecipe';\n }", "public function getName(): string\n {\n return $this->getIdentifier()->getName();\n }", "public function getName()\n\t{\n\t\treturn isset($this->_name) ? $this->_name : spl_object_hash($this);\n\t}", "public function getName() {\n return get_class($this);\n }", "public function getName() {\n return get_class($this);\n }", "public function getNodeName();", "public function getName() {\n $path = explode('\\\\', get_class($this->object[\"data\"]));\n return array_pop($path);\n }", "protected function generateMachineName() {\n $class_name = get_class($this);\n return self::machineFromClass($class_name);\n }", "public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}", "public function getName(){\n\t\treturn get_class($this);\n\t}", "function getName()\n {\n return get_class($this);\n }", "function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}", "public function getName() \n { \n return $this->getType().\"_\".substr(md5(implode($this->getParameters())), 0, 20);\n }", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "protected function name()\n\t{\n\t\treturn 'flyer';\n\t}", "public function getName()\n {\n return $this->__call(__FUNCTION__, func_get_args());\n }", "abstract protected function getNodeName();", "public function name()\n {\n return Formatter::format(\n $this->identifierParts,\n $this->getOutputFormat()\n );\n }", "protected function name() {\n\t\treturn strtolower(str_replace('\\\\', '_', get_class($this)));\n\t}", "protected static function _getName()\n {\n return isset(static::$_name) ? static::$_name : get_called_class();\n }", "public function getName(): string\n {\n return __CLASS__;\n }", "public function getName(): string\n {\n return $this->node->props[$this->positionInNode]->name->name;\n }", "public static function getName();", "protected static function getNode() {\r\n if (!$namespace = static::getNamespace()) {\r\n return static::$node;\r\n }\r\n return camelTo_(substr(get_called_class(), strlen($namespace) + 1));\r\n }", "function getName(): string;", "function getName(): string;", "public function getName()\n {\n return __CLASS__;\n }", "public function getFactory(): Factory;", "static public function getName();", "public function getCreatorName()\n {\n return $this->creator->getName();\n }", "public function getName(): string\n {\n return static::class;\n }", "public function getName(): string\n {\n if ($this->_name === null) {\n $endpoint = namespaceSplit(static::class);\n $endpoint = substr(end($endpoint), 0, -8);\n\n $inflectMethod = $this->getInflectionMethod();\n $this->_name = Inflector::{$inflectMethod}($endpoint);\n }\n\n return $this->_name;\n }", "public function getMarkerFactoryClassStr();", "public function getNodeName()\n {\n if (array_key_exists('ai.internal.nodeName', $this->_data)) { return $this->_data['ai.internal.nodeName']; }\n return NULL;\n }", "public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}", "public function get_name();", "public function get_name();", "public function get_name();", "function getName() ;", "function getName() ;", "function getName() ;", "function getName() ;", "public function getName() {\n\t\t\n\t\t// cut last part of class name\n\t\treturn substr( get_class( $this ), 0, -11 );\n\t\t\n\t}", "public static function getName()\n {\n }", "public static function get_name() : string ;", "public static function get_name() : string ;", "public function getName()\n {\n switch ($this->queriedContext) {\n case $this->i8n('context-keyword'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-keyword') . ' : ' . $this->getInput('q');\n break;\n case $this->i8n('context-group'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-group') . ' : ' . $this->getKey('group');\n break;\n case $this->i8n('context-talk'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-talk') . ' : ' . $this->getTalkTitle();\n break;\n default: // Return default value\n return static::NAME;\n }\n }", "public function get_name() {\n\t\treturn 'MV Create';\n\t}", "public function getName()\n {\n return 'drafterbit_system';\n }", "abstract protected function generateName();", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}" ]
[ "0.7683385", "0.74644196", "0.7233918", "0.6568206", "0.6500953", "0.6476344", "0.6378232", "0.6359979", "0.6324381", "0.62927884", "0.6263692", "0.62582153", "0.62582153", "0.62582153", "0.62582153", "0.62582153", "0.62582153", "0.62582153", "0.62582153", "0.62542415", "0.623205", "0.6217055", "0.62154835", "0.62135327", "0.6190224", "0.6165755", "0.61197764", "0.6090157", "0.6076035", "0.6072878", "0.6062663", "0.6056486", "0.60513437", "0.6048188", "0.6047335", "0.59785825", "0.59767157", "0.5951559", "0.59503734", "0.59503734", "0.59415644", "0.5935537", "0.5922628", "0.59107405", "0.5896953", "0.5889147", "0.58800864", "0.58753425", "0.5863915", "0.5863915", "0.5839248", "0.5819231", "0.5817245", "0.5813095", "0.57944566", "0.57818145", "0.57740235", "0.5772256", "0.5770171", "0.5765864", "0.5760443", "0.5760443", "0.57590675", "0.5737543", "0.5736999", "0.57349956", "0.57191503", "0.57067895", "0.5701904", "0.5679138", "0.5673095", "0.5666154", "0.5666154", "0.5666154", "0.5658489", "0.5658489", "0.5658489", "0.5658489", "0.565672", "0.5643613", "0.56422395", "0.56422395", "0.56192404", "0.5607412", "0.56053984", "0.5603554", "0.55934066", "0.55934066", "0.55934066", "0.55934066", "0.55934066", "0.55934066", "0.55934066", "0.55934066", "0.55934066", "0.55934066", "0.55934066", "0.55934066", "0.55934066", "0.55934066" ]
0.71559995
3
Returns the name of the template for the node.
final public function getTemplate() { return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTemplateName()\n {\n return $this->templateName;\n }", "function getTemplateName() {\n\t\treturn $this->templateName;\n\t}", "public function getTemplateName()\n {\n return $this->_sThisTemplate;\n }", "public function getTemplateName() {\n\t\treturn 'uitypes/Tree.tpl';\n\t}", "public function get_utemplate_name() {\n $fs = get_file_storage();\n $xmlfile = $fs->get_file_by_id($this->utemplateid);\n\n return $xmlfile->get_filename();\n }", "public function getTemplateName()\n {\n // TODO: Implement getTemplateName() method.\n return 'Tem';\n }", "public function getInspectTemplateName()\n {\n return $this->inspect_template_name;\n }", "public function get_template_name(){\n\n return str_replace(\"_\",\"\",str_replace(\"_page\", \"\", get_class($this))) . \".tpl\";\n }", "protected function _getTemplateName()\n {\n $tag = $this->getTemplateTag();\n $lang = app()->getLocale();\n $fallbackLang = config('app.fallback_locale');\n\n $name = \"mail_{$tag}_{$lang}\";\n\n if (empty(setting($name))) return \"mail_{$tag}_{$fallbackLang}\";\n\n return $name;\n }", "public function getTemplateName()\n {\n return isset($this->TemplateName) ? $this->TemplateName : null;\n }", "function get_template_name($instance) {\n return 'template';\n }", "public function getReidentifyTemplateName()\n {\n return $this->reidentify_template_name;\n }", "public function render()\n {\n return $this->getTemplateName();\n }", "public function forTemplate() {\n\t\treturn $this->ActionName;\n\t}", "public function getName() {\n\t\treturn NodePaths::getNodeNameFromPath($this->path);\n\t}", "public function getTemplateName(): string;", "protected function template_name() {\r\n return 'transportation/route_planner';\r\n }", "public function name() {\r\n return $this->node->nodeName;\r\n }", "public function getTemplateName()\n {\n }", "public function template()\n {\n if ($this->template === null) {\n return 'charcoal/app/handler/layout';\n }\n\n return $this->template;\n }", "abstract public function getTemplateName();", "public function getTemplateName()\n\t{\n\t\treturn 'uitypes/Modules.tpl';\n\t}", "public function getNodeTypeName() {}", "public function template() {\n\n // check for a cached template name\n if(isset($this->cache['template'])) return $this->cache['template'];\n\n // get the template name\n $templateName = $this->intendedTemplate();\n\n if($this->kirby->registry->get('template', $templateName)) {\n return $this->cache['template'] = $templateName; \n } else {\n return $this->cache['template'] = 'default';\n }\n\n }", "protected function GetTemplate()\n\t{\n\t\tif ($this->Plain())\n\t\t\treturn 'blobplain.tpl';\n\t\treturn 'blob.tpl';\n\t}", "public function intendedTemplate() {\n if(isset($this->cache['intendedTemplate'])) return $this->cache['intendedTemplate'];\n return $this->cache['intendedTemplate'] = $this->content()->exists() ? $this->content()->name() : 'default';\n }", "public function getTemplateName()\n\t{\n\t\treturn 'Edit/Field/Number.tpl';\n\t}", "public function getTemplatePathname() : string {\n\t\treturn $this->templateBasePath . '/linklist-group.mustache';\n\t}", "protected function _getTplName()\n {\n // assign template name\n $sTplName = oxRegistry::getConfig()->getRequestParameter('tpl');\n\n if ($sTplName) {\n // security fix so that you cant access files from outside template dir\n $sTplName = basename($sTplName);\n\n //checking if it is template name, not content id\n if (!getStr()->preg_match(\"/\\.tpl$/\", $sTplName)) {\n $sTplName = null;\n } else {\n $sTplName = 'message/' . $sTplName;\n }\n }\n\n return $sTplName;\n }", "function get_template_name( $instance ) {\n\t\t\treturn isset($instance['template']) ? $instance['template'] : 'base';\n\t\t}", "public function getTemplateNode($fieldName) {}", "private function getTemplate(): string\n {\n $sTemplate = $this->getViewPath() . static::TEMPLATE . static::TEMPLATE_EXT;\n if (!is_file($sTemplate)) {\n $sTemplate = $this->getViewRootDirectory();\n $sTemplate .= $this->getCurrentClassName() . DIRECTORY_SEPARATOR;\n $sTemplate .= static::TEMPLATE . static::TEMPLATE_EXT;\n if (!is_file($sTemplate)) {\n $sTemplate = $this->getViewRootDirectory();\n $sTemplate .= static::TEMPLATE . static::TEMPLATE_EXT;\n }\n }\n\n return $sTemplate;\n }", "public function getName(): string\n {\n return $this->node->props[$this->positionInNode]->name->name;\n }", "public function getJsTemplateName()\n {\n return addcslashes($this->getModel()->getTemplateCode(), \"\\\"\\r\\n\\\\\");\n }", "public function getFullName(){\n\t\treturn $this->templateSet->getFullName() . '/' . $this->name . $this->suffix;\n\t}", "public function getControlTemplateUID()\n {\n return $this->name.'_TPL_UID';\n }", "public function getNewTemplateName()\n {\n return isset($this->NewTemplateName) ? $this->NewTemplateName : null;\n }", "public function getName()\r\n\t{\r\n\t\treturn GeekPoint_AdminDAVi_Directory_Root::ADMIN_TEMPLATES;\r\n\t}", "function get_current_template_name() {\n\tglobal $wp_query;\n \n // Page\n\n if(is_page()) {\n return basename(get_page_template(), \".php\");\n }\n\n // Single post\n\n elseif (is_single()) {\n $post_id = $wp_query->get_queried_object_id();\n\t\t$post = $wp_query->get_queried_object();\n\t\t$post_type = $post->post_type;\n\n if ( isset( $post->post_type ) ) {\n // If a regular/default post then assign the name as single.\n if($post->post_type === 'post') {\n return 'single';\n }\n // Else use the post type name.\n else {\n return 'single-' . sanitize_html_class( $post->post_type );\n }\n }\n }\n\n // Search\n\n elseif ( is_search() ) {\n\t\treturn 'search';\n\t}\n}", "protected function getTemplateFilename() {\n if (isset($this->extra['template-file'])) {\n return $this->extra['template-file'];\n }\n return 'settings.local.php.twig';\n }", "public function getTemplateName (string $type, string $name) : string\n {\n return $this->registry->getComponent($type, $name)->getTemplatePath();\n }", "public function templatePrefix()\n\t{\n\t\treturn '';\n\t}", "public function getTemplateAttribute(): string\n {\n return $this->meta->_wp_page_template ?: '';\n ;\n }", "public function getTemplate(): string;", "public function getTemplate(): string;", "public function getTemplate(): string;", "public function getTemplate(): string;", "protected function get_template() {\n\t\treturn 'post';\n\t}", "public function getTemplate()\n {\n $corePath = $this->modx->getOption('minirte.core_path', null, $this->modx->getOption('core_path') . 'components/minirte/');\n return $corePath . 'elements/tv/input/tpl/minirte.render.tpl';\n }", "public function getTemplate()\n\t{\n\t\treturn $this->template;\n\t}", "public function getTemplate()\n\t{\n\t\treturn $this->template;\n\t}", "function getTemplateFilename($t)\n{\n\treturn ARC_TEMPLATE_FS . $t . '.php';\n}", "private function getNodeName(Node $node)\n {\n $string = $this->source->getNodeString($node);\n if ($node instanceof Property) {\n preg_match('/\\$([^=\\s]+)/', $string, $matches);\n return $matches[1];\n } elseif ($node instanceof ClassMethod) {\n preg_match('/function\\s+([^\\(\\s]+)/', $string, $matches);\n return $matches[1];\n } elseif ($node instanceof Name) {\n return $node->getLast();\n }\n return $node->getName();\n }", "function getTemplateType() {\n\t\tif (!$this->templateType) {\n\t\t\treturn 'inherit';\n\t\t} else {\n\t\t\treturn $this->templateType;\n\t\t}\n\t}", "public function template($var = null): string\n {\n return $this->loadHeaderProperty(\n 'template',\n $var,\n function ($value) {\n return trim($value ?? (($this->isModule() ? 'modular/' : '') . str_replace($this->extension(), '', $this->name())));\n }\n );\n }", "public function getExportLayoutName(){\n\t\t\n\t\t$this->validateInited();\n\t\t\n\t\t$parentID = $this->post->post_parent;\n\t\t\n\t\t$prefix = \"template\";\n\t\t\n\t\t$layoutName = $prefix;\n\t\tif(!empty($parentID))\n\t\t\t$layoutName .= \"_\". $this->getPostBaseName($parentID);\n\t\t\n\t\t$layoutName .= \"_\".$this->getPostBaseName($this->id);\n\t\t\n\t\t$layoutName = HelperUC::convertTitleToHandle($layoutName);\n\n\t\treturn($layoutName);\n\t}", "public function getTemplate()\r\n {\r\n return $this->_customTemplate;\r\n }", "function dt_get_template_name( $post_id = 0, $force_in_loop = false ) {\n\tglobal $post;\n\n\t// work in admin\n\tif ( is_admin() && !$force_in_loop ) {\n\n\t\tif ( isset($_GET['post']) ) {\n\n\t\t\t$post_id = $_GET['post'];\n\t\t} elseif( isset($_POST['post_ID']) ) {\n\n\t\t\t$post_id = $_POST['post_ID'];\n\t\t}\n\t}\n\n\t// work in the loop\n\tif ( !$post_id && isset($post->ID) ) {\n\t\t$post_id = $post->ID;\n\t}\n\n\treturn get_post_meta( absint($post_id), '_wp_page_template', true );\n}", "public function getTemplate()\n {\n return $this->template;\n }", "public function getTemplate()\n {\n return $this->template;\n }", "public function getTemplate()\n {\n return $this->template;\n }", "public function getTemplate()\n {\n return $this->template;\n }", "public function getTemplate()\n {\n return $this->template;\n }", "public function getTemplate()\n {\n return $this->template;\n }", "public function getTemplate()\n {\n return $this->template;\n }", "public function getTemplate()\n {\n return $this->template;\n }", "public function getTemplate()\n {\n return $this->template;\n }", "public function getTemplate()\n {\n return $this->template;\n }", "public function getTemplate()\n {\n return $this->template;\n }", "public function getTemplate()\n {\n return $this->template;\n }", "public function getTemplate()\n {\n return $this->template;\n }", "function get_template_name( $instance ) {\n\t\treturn $instance['tpl'] ? $instance['tpl'] : 'base';\n\t}", "function getNodeTypeName() ;", "public function getName()\n {\n return $this->view;\n }", "public function getName()\n {\n return $this->view;\n }", "protected function getName()\n {\n return $this->getRequest()->args('name') ?: $this->profile->code . '_' . $this->tpl['name'];\n }", "abstract public function getLayoutTemplateClassName();", "public static function label()\n {\n return __('Templates');\n }", "public function getTemplateId() : string {\n return $this->templateId;\n }", "public function getTemplate(){\n\t\treturn $this->CustomTemplate ? $this->CustomTemplate : $this->config()->get('default_template');\n\t}", "public function getTemplate () {\r\n\t\treturn $this->_template;\r\n\t}", "public function getTemplate() {\n return $this->template;\n }", "public function getTemplate()\n\t{\n\t\treturn $this->_template;\n\t}", "public function get_template() {\n return $this->_template;\n }", "protected function template() {\n\t\treturn '';\n\t}", "public function getTemplate() {\n\t\t\treturn $this->template;\n\t\t}", "public function getTemplate(){\n\t\treturn $this->template;\n\t}", "function get_template_name( $instance ) {\n\n\t\tswitch ( $instance['box_style'] ) {\n\t\t\tcase 'simple':\n\t\t\t\t$template = 'simple';\n\t\t\t\tbreak;\n\t\t\tcase 'iconbox':\n\t\t\t\t$template = 'iconbox';\n\t\t\t\tbreak;\n\t\t\tcase 'image':\n\t\t\t\t$template = 'image';\n\t\t\t\tbreak;\n\t\t\tcase 'list':\n\t\t\t\t$template = 'list';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$template = 'base';\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $template;\n\t}", "function get_template_name( $instance ) {\n if ( !empty( $instance['layout'] ) ) {\n return $instance['layout'];\n } else {\n return 'base';\n }\n }", "function get_template_name( $instance ) {\n\t\treturn 'base';\n\t}", "function get_template_name( $instance ) {\n\t\treturn 'base';\n\t}", "public static function singularLabel()\n {\n return __('Template');\n }", "public function getTypeName()\n\t{\n\t\tif( isset( $this->values[$this->prefix . 'typename'] ) ) {\n\t\t\treturn (string) $this->values[$this->prefix . 'typename'];\n\t\t}\n\t}", "function getTemplateType() {\n\t\t\t\t\treturn $this->templateType;\n\t\t\t\t}", "public static function getTemplate() {\n $settings = self::getSettings();\n \n return $settings->template;\n }", "protected function GetTemplate()\n\t{\n\t\treturn 'heads.tpl';\n\t}", "public function get_chosen_template_name($template) {\n\t\treturn self::$template = $template;\n\t}", "public function path()\n {\n try {\n return ($this->engine->getResolveTemplatePath())($this->name);\n } catch (TemplateNotFound $e) {\n return $e->paths()[0];\n }\n }", "public function getTemplate()\n {\n\n if ( ! $this->template) {\n $this->setDefaultTemplate();\n }\n\n if (is_string($this->template)) {\n $this->template = $this->createTemplate($this->template);\n }\n\n return $this->template;\n }", "function get_template()\n {\n }" ]
[ "0.7775373", "0.7743881", "0.75473285", "0.73741245", "0.72695297", "0.7260627", "0.7215766", "0.70725423", "0.7071507", "0.7039025", "0.7035399", "0.6954474", "0.6917212", "0.6862439", "0.6848056", "0.68408495", "0.68129146", "0.6800569", "0.6795225", "0.6691858", "0.6678995", "0.6640004", "0.66379327", "0.66129804", "0.6611823", "0.6602446", "0.6599286", "0.65918803", "0.65911543", "0.6588693", "0.65339047", "0.6514447", "0.6505862", "0.6462724", "0.6456012", "0.6448099", "0.64420426", "0.6429474", "0.6421369", "0.6414671", "0.6413301", "0.63691056", "0.6358079", "0.63572955", "0.63572955", "0.63572955", "0.63572955", "0.6356056", "0.63205755", "0.63092035", "0.63092035", "0.6301972", "0.6300638", "0.63002455", "0.62831265", "0.6276394", "0.62751794", "0.6269266", "0.6268135", "0.6268135", "0.6268135", "0.6268135", "0.6268135", "0.6268135", "0.6268135", "0.6268135", "0.6268135", "0.6268135", "0.6268135", "0.6268135", "0.6268135", "0.62677467", "0.62638605", "0.6262033", "0.6262033", "0.6252601", "0.6243211", "0.623738", "0.62258273", "0.6216826", "0.6192508", "0.61891973", "0.61640036", "0.61460876", "0.61391", "0.6137907", "0.61312914", "0.61288995", "0.61199117", "0.61182714", "0.61182714", "0.60992455", "0.60835004", "0.60749197", "0.6067472", "0.605219", "0.60268164", "0.601913", "0.6010922", "0.60075927" ]
0.6840022
16
Determines if the node allows a parent node.
final public function allowsParent() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function is_for_parent_node(Jquarry_Node $parent);", "public function isParent();", "public function hasParent(BaseObject $node)\n {\n return (bool)$node->getParentIdValue();\n }", "public function hasParent();", "public function hasParent();", "public function hasParent();", "public function hasParent() {}", "function hasParent() {\n\t\treturn (bool) ($this->parentID);\n\t}", "public function isParent() {\n\t\treturn $this->isParent;\n\t}", "public static function currentUserisParent()\n {\n return (check_user_role('parent')) ? true : false;\n }", "private function is_parent()\n\t{\n\t\treturn is_null($this->category_id);\n\t}", "public function hasParent()\n {\n }", "public function hasParent() {\n return isset($this->_parent);\n }", "public function hasParent()\n\t{\n\t\treturn !empty($this->parent);\n\t}", "public function getIsParent() {\n\t\treturn $this->isParent;\n\t}", "public function hasParent()\n {\n return $this->currentParent !== null;\n }", "final public function hasParent() {\n\t\treturn ($this->_parentNode !== null);\n\t}", "public function getParentNode()\r\n {\r\n return $this->_parentNode ? $this->_parentNode : false;\r\n }", "function is_parent($parent_node, $child_node)\r\n\t{\r\n\t\t$p_root_id = $parent_node['root_id'];\r\n\t\t$p_l = $parent_node['l'];\r\n\t\t$p_r = $parent_node['r'];\r\n\r\n\t\t$c_root_id = $child_node['root_id'];\r\n\t\t$c_l = $child_node['l'];\r\n\t\t$c_r = $child_node['r'];\r\n\r\n\t\tif (($p_root_id == $c_root_id) && ($p_l < $c_l && $p_r > $c_r))\r\n\t\t\treturn true;\r\n\r\n\t\treturn false;\r\n\t}", "private function is_can_parent_node($local_root) {\n if ($local_root !== null) {\n return !($local_root->type == qtype_preg_node::TYPE_NODE_ALT);\n }\n return true;\n }", "public function get_isTableWiTreeParentField()\n {\n if ( empty( $this->arr_tablesWiTreeparentfield ) )\n {\n return false;\n }\n\n return true;\n }", "public function hasParentId(){\n return $this->_has(3);\n }", "public function hasParent() {\n\t\treturn $this->parent()->count() == 1;\n\t}", "public function is_parent_available() {\n\t\t$parent = get_posts( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'name' => $this->theme->get_template(),\n\t\t\t'posts_per_page' => 1,\n\t\t\t'post_type' => 'repopackage',\n\t\t\t'orderby' => 'ID',\n\t\t\t'suppress_filters' => false,\n\t\t) );\n\t\t$this->theme->post_parent = current( $parent );\n\n\t\treturn ! empty( $parent );\n\t}", "public function isParentOf(AbstractNode $node) :bool {\n return $node->hasParent()&&$node->parent->isSameNode($this);\n }", "public function hasParentInTrustChain()\n {\n return (! $this->getParentCertificateURL() == '');\n }", "public function hasParentInTrustChain()\n {\n return (! $this->getParentCertificateURL() == '');\n }", "public function parentIsNode($model = false)\n {\n $model = ($model ? $model : $this);\n\n $class = new ReflectionClass($model);\n $parent = $class->getParentClass();\n $parentName = $parent->getShortName();\n\n if($parentName == 'Node')\n {\n return true;\n }\n\n return false;\n }", "function has_post_parent($post = \\null)\n {\n }", "protected function hasParentMenuItem() {}", "public function validator()\n {\n if (!$this->getElement(self::PARENT_ID_KEY)->getValue() && !$this->skinsetModel->getTemplateConfigByKey($this->getRecord()->template)->getAllowedOnRoot()) {\n $this->getElement(self::PARENT_ID_KEY)->addError('form.categoryMove.parentId.error');\n return false;\n }\n return true;\n }", "public function hasParentMessage(): bool {\n return isset($this->parentMessageId);\n }", "public function getParentNode() {}", "public function isChildOnly();", "public function getIsChildAttribute(){\n return $this->parent_id != NULL;\n }", "public function hasChildren($parent) {\n\t\t// If the left and right are x and x+1, then there is no kids\n\t\tif ($parent['Aco']['rght'] == $parent['Aco']['lft'] +1 ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function getParentnode()\n {\n return $this->__parentnode__;\n }", "protected function hasParentMenuItemKey() {}", "public function isParentOf($path)\n\t{\n\t\t$path = $this->resolve($path);\n\n\t\tif ($path === $this->root) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn 0 === \\strpos($path, $this->root);\n\t}", "public function canApply()\n {\n $parent = $this->getSiblingNode()->findParentNode();\n $nodeType = $this->getSubject()->getNodeType();\n\n return NodeInfoHelper::isNodeTypeAllowedAsChildNode($parent, $nodeType);\n }", "protected function validateParentCanHaveChildren(Node $parent = null)\n {\n if ($parent && $parent->sterile)\n {\n abort(500, 'Node is sterile.');\n }\n }", "public function hasParentChildFilter() {\n return $this->_has(4);\n }", "final public function allowsChildren() {\n\t\treturn false;\n\t}", "public function hasHasRemoteParent(){\n return $this->_has(11);\n }", "public function isChild() {\n\t\treturn $this->_parent !== null;\n\t}", "function is_child($parent) {\n\tglobal $wp_query;\n\tif ($wp_query->post->post_parent == $parent) { $return = true; } else { $return = false; }\n\treturn $return;\n}", "public function isChild(): bool\n {\n return false;\n }", "public function isChild(): bool;", "public function hasParentRelayCount()\n {\n return $this->parent_relay_count !== null;\n }", "public function isParentOf($page) {\n if(!is_a($page, 'Page')) $page = page($page);\n\n return $this->is($page) ? false : $page->parent->is($this);\n }", "public function is_parent($target)\n {\n if ( ! ($target instanceof $this))\n $target = $this->factory_item($target);\n elseif ( !$target->loaded )\n $target->reload();\n\n return ((int) $this->primary_key === (int) $target->parent_key);\n }", "public static function isParent($parent, $child) {\r\n $parent_version = new Version($parent);\r\n $child_version = new Version($child);\r\n $parent_support_condition = $parent_version->N == $child_version->N \r\n && $parent_version->isSupportBranch() \r\n && ($child_version->isReleaseBranch() || $child_version->isBuild());\r\n $parent_release_condition = $parent_version->N == $child_version->N \r\n && $parent_version->M == $child_version->M \r\n && $parent_version->isReleaseBranch() \r\n && $child_version->isRelease();\r\n return ($parent_support_condition || $parent_release_condition);\r\n }", "public function canApply(): bool\n {\n if (is_null($this->subject)) {\n return false;\n }\n $parent = $this->getParentNode();\n $nodeType = $this->subject->getNodeType();\n\n return $parent && $this->isNodeTypeAllowedAsChildNode($parent, $nodeType);\n }", "function is_parent()\n{ \n global $post;\n\n if ( is_page() && $post->post_parent ) {\n // This is a subpage\n return;\n\n } else {\n // This is not a subpage\n return true;\n }\n \n}", "Public function getParentPageId() {\n\t\tif(!empty($this->parent_pageid))\n\t\t\treturn $this->parent_pageid;\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isCurrentChild(): bool;", "public function isChild()\n {\n if (false === $this->parent_category) {\n return false;\n }\n\n return true;\n\n }", "public function useConfigurableParent()\r\n\t{\r\n\t\tif (1 === (int ) Mage::getStoreConfig('ec/preferences/use_child'))\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public function canHaveChildren() {}", "function salmon_parent_is($atom, $parent, $breadcrumbs) {\n\treturn ($breadcrumbs[$atom['level'] - 1] == $parent); \n}", "public static function is_parent($id)\n {\n if ('parent_service' == BA_Lib::get_product_type($id)) {\n return true;\n }\n return false;\n }", "public function isChild()\n {\n return $this->parentId != null;\n }", "public function setParent ($value) {\n\t\n\t\t// validation\n\t\tif ($this->pageID) {\n\t\t\n\t\t\t// check IDs aren't identical\n\t\t\tif ($this->pageID == $value) {\n\t\t\t\t$this->setMessage(strFirst(LANG_INVALID.\" \".LANG_PARENT));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// check this parent isn't a child of this page\n\t\t\t$pagesModel = new PagesModel();\n\t\t\t$ids = $pagesModel->getChildrenAsArray($this->pageID);\n\t\t\t\n\t\t\tif (in_array($value, $ids)) {\n\t\t\t\t$this->setMessage(strFirst(LANG_INVALID.\" \".LANG_PARENT));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t$this->setData(\"pageParent\", intval($value));\n\t\treturn true;\n\t\n\t}", "function test_get_parent()\r\n\t{\r\n\t\t$rnc = 1;\r\n\t\t$depth = 2;\r\n\t\t$npl = 3; \r\n\t\t// Create a new tree\r\n\t\t$relation_tree = $this->_create_sub_node($rnc, $depth, $npl);\r\n\t\t$allnodes = $this->_tree->get_all_nodes(); \r\n\t\t// Walk trough all nodes and compare it's relations whith the one provided\r\n\t\t// by the relation tree\r\n\t\tforeach($allnodes AS $nid => $node)\r\n\t\t{\r\n\t\t\t$parent = $this->_tree->get_parent($nid, true);\r\n\t\t\tif (!isset($relation_tree[$nid]['parent_id']))\r\n\t\t\t{\r\n\t\t\t\t$this->assertFalse($parent, 'A rootnode returned a parent');\r\n\t\t\t\tcontinue;\r\n\t\t\t} \r\n\t\t\t$this->assertEqual($relation_tree[$nid]['parent_id'], $parent['id'], 'Relation tree parent doesn\\'t match method return');\r\n\t\t} \r\n\t\treturn true;\r\n\t}", "public function setParent($parent)\n {\n if($this->_parent === null)\n {\n $this->_parent = $parent;\n return true;\n }\n\n throw new \\Exception('Storage interface already has parent. Cannot set again.');\n }", "public function isSelf(){\n\t\t$db = new DB_WE();\n\n\t\tif($this->ID){\n\t\t\t$count = 0;\n\t\t\t$parentid = $this->ParentID;\n\t\t\twhile($parentid != 0){\n\t\t\t\tif($parentid == $this->ID){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t$parentid = f('SELECT ParentID FROM ' . escape_sql_query($this->_table) . ' WHERE ID=' . intval($parentid), '', $db);\n\t\t\t\t$count++;\n\t\t\t\tif($count == 9999){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function parentDir() {\n if ($this->getActive()) {\n // Move up!\n if (ftp_cdup($this->_connection)) {\n return true;\n } else {\n return false;\n }\n } else {\n throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.');\n }\n }", "public function WantsChildren() {\r\n return false;\r\n }", "public function get_parent();", "function _check_parent_id($value)\n {\n if (!$value) {\n return TRUE;\n }\n\n $where = array();\n $where['id'] = $value;\n $id = model('comment')->get_id($where);\n if (!$id) {\n $this->form_validation->set_message(__FUNCTION__, lang('notice_value_invalid'));\n return FALSE;\n }\n\n return TRUE;\n }", "function get_parent()\r\n {\r\n return $this->parent;\r\n }", "function get_parent()\r\n {\r\n return $this->parent;\r\n }", "protected function get_parent()\r\n {\r\n return $this->parent;\r\n }", "public function isNavbarClickableparent()\r\n\t{\r\n\t\treturn $this->navbarClickableparent;\r\n\t}", "public function no_location_and_parent_match($parent_id)\n\t{\n\t\t$data = $this->find_one_array(array($this->_tables['fuel_navigation'].'.id' => $parent_id));\n\t\tif (!empty($data))\n\t\t{\n\t\t\tif ($data['id'] == $data['parent_id']) return FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "function is_root() {\n\t\treturn $this->_parent === NULL;\n\t}", "public function canCopy()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn ( !$this->parent() and static::canAddRoot() ) or ( $this->parent() and $this->parent()->canAdd() );\n\t}", "public function isRoot()\n {\n return empty($this->parent_id);\n }", "function is_property_parent($entity_type, $name) {\n $controller = entity_toolbox_controller($entity_type);\n $helper = $controller->getPropsHelper();\n\n return $helper->propIsParent($name);\n}", "public function isAncestor()\n {\n $model_ticket_forwarded_to = self::find()->andWhere(['forwarded_from_id' => $this->id])->one();\n\n return !is_null($model_ticket_forwarded_to);\n }", "public function authorize()\n {\n if ($this->user()->parent_id == NULL) { //Solo si es Cacique puede agregar indios. Sino, 403!\n return true;\n } else {\n return false;\n }\n }", "protected function parentRole()\n {\n return !empty($this->parentRole) ? $this->parentRole : $this->parent->recordRole();\n }", "public function isAncestorOf(AbstractNode $node) :bool {\n if ($this->hasChild()===false || $node->hasParent()===false || $this->isSameNode($node)) {\n return false;\n }\n\t\twhile ($node instanceof AbstractNode) {\n\t\t\tif ($this->isParentOf($node)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t$node = $node->parent;\n\t\t}\n\t\treturn false;\n }", "public function isRoot(): bool\n {\n return $this->parent === null;\n }", "public function isParent($dir)\n {\n return 0 === strpos($this->referencePath, realpath($dir));\n }", "public function parentOf($parent){\n\t\t/*$parents = func_get_args();\n\t\tforeach($parents as $parent){\n\t\t\tif(!in_array($parent, $this->_parentOf)){\n\t\t\t\t$this->_parentOf[] = $parent;\n\t\t\t}\n\t\t}*/\n\t}", "public function getRenderParents(): bool;", "function getParent();", "function L_catHasParent($catid) {\n\t\t\n\t\t$category = get_category($catid);\n\t\tif ($category->category_parent > 0) {\n\t\t\t\n\t\t\treturn true;\n\t\t\t\n\t\t}\n\t\t\n\t\treturn false;\n\t\n\t}", "function _haveValidParent(&$cat) {\n\t\t$parentCat = $this->get($cat->getVar('cat_pid'));\n\t\treturn !$this->_isAlbum($parentCat);\n\t}", "public function parentKey()\n\t{\n\t\t$explode = explode('/', $this->getField('key'));\n\t\tif(isset($explode[1])) {\n\t\t\treturn $explode[0];\n\t\t}\n\n\t\treturn false;\n\t}", "function file_allow_as_child($node) {\n\t\treturn false;\n\t}", "abstract public function parent();", "public function setParent(PhpcrNodeInterface $parentNode);", "function is_property_self_parent($entity_type, $name) {\n $controller = entity_toolbox_controller($entity_type);\n $helper = $controller->getPropsHelper();\n\n return $helper->propIsSelfParent($name);\n}", "abstract public function isNode ( );", "public function hasParentFieldDescription(): bool;", "public function hasLeftChild()\n\t{\n\t\treturn isset($this->leftChild);\n\t}", "private function getNodeParents(&$node)\n\t{\n\t\t// It is already checked in the caller whether this $node is a context with Practices\n\t\t// pointing to it, that is not the case since this function is called.\n\t\n\t\t// Is $node an IE with Part-of, skosembroader or Context prop?\n\t\t$query = \"[[Category:Intentional Element]][[{$node->getName()}]]|?\".PARTOFPROPERTY.\"|?\".SKOSEMBROADERPROPERTY.\"|?\".CONTEXTPROPERTY;\n\t\t//FIXME: SKOSEMBROADER should be SKOSBROADER, but will not work in printout section, use page selection part, possibly reversed query for the prop? prop::thispage?\n\t\t$result = $this->askAPI->ask($query);\n\t\tif(count($result['query']['results']) > 0){\n\t\t\t$result = $result['query']['results'][$node->getName()]['printouts'];\n\t\t\t\n\t\t\t/* EXPERIMENTAL! JIRA EMT-276 Background: if there are contexts (of this IE $node), they \n\t\t\t * should be prefered (before taking partofs and skosembroaders into account) \n\t\t\t * TODO WME: discuss with HdB*/\n\t\t\t$parents = $this->getNodesFromQueryResult($result[CONTEXTPROPERTY]);\n\t\t\t\n\t\t\tif(count($parents) == 0){\t\n\t\t\t\t$parents = $this->getNodesFromQueryResult($result[PARTOFPROPERTY]);\n\t\t\t}\n\t\t\tif(count($parents) == 0){\n\t\t\t\t$parents = $this->getNodesFromQueryResult($result[SKOSEMBROADERPROPERTY]);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t//not an IE and no practices pointing to it, is it a context which has a supercontext?\n\t\t\t$query = \"[[Category:Context]][[{$node->getName()}]]|?\".SUPERCONTEXTPROPERTY;\n\t\t\t$result = $this->askAPI->ask($query);\n\t\t\tif(count($result['query']['results']) > 0){\n\t\t\t\t$result = $result['query']['results'][$node->getName()]['printouts'];\n\t\t\t\t$parents = $this->getNodesFromQueryResult($result[SUPERCONTEXTPROPERTY]);\n\t\t\t}\n\t\t\telse{\t//no: is it a practice which has a part-of?\n\t\t\t\t//NB add contextproperty for breadcrumb fixing, see below\n\t\t\t\t$query = \"[[Category:Practice]][[{$node->getName()}]]|?\".PARTOFPROPERTY.\"|?\".CONTEXTPROPERTY;\n\t\t\t\t$result = $this->askAPI->ask($query);\n\t\t\t\tif(count($result['query']['results']) > 0){\n\t\t\t\t\t$result = $result['query']['results'][$node->getName()]['printouts'];\n\t\t\t\t\t//breadcrumb fixing: if this node has breadcrumb value \"practice\" then replace it by a list \n\t\t\t\t\t//of Context property values (there may be more than one Context value, isn't it?)\n\t\t\t\t\tif($node->getBreadCrumb() == \"practice\")\n\t\t\t\t\t\t$node->setBreadCrumb($this->getNodesFromQueryResult($result[CONTEXTPROPERTY]));\n\t\t\t\t\t$parents = $this->getNodesFromQueryResult($result[PARTOFPROPERTY], \"practice\");\n\t\t\t\t}\n\t\t\t\t// else: NO PARENTS FOUND\n\t\t\t}\n\t\t}\n\t\treturn $parents;\t//return array with parent elements found\n\t}", "function is_primary_parent($p_id){\n\t\t//$this->firephp->log(\"Par id= \".$p_id);\n\t\t$this->db->where('parentPrimary_uacc_id',$p_id);\n\t\t$this->db->or_where('parentAlt_uacc_id',$p_id);\n\t\t$this->db->select('parentPrimary_uacc_id');\n\t\t$res=$this->db->get(TWELL_FAM_PROF_TBL);\n\t\tif ($res->num_rows()==1) {\n\t\t\t$fam_profile=$res->row();\n\t\t\tIf (intval($fam_profile->parentPrimary_uacc_id)==intval($p_id)) {\n\t\t\t\t//$this->firephp->log(\"Primary parent!\");\n\t\t\t\treturn 1;\n\t\t\t} else {\n\t\t\t\t//$this->firephp->log(\"Alt parent!\");\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->firephp->log(\"Not able to determine primary/alt parent status for uid\".$p_id);\n\t\t\treturn 0;\n\t\t}\n\t}" ]
[ "0.77847123", "0.7613103", "0.7498584", "0.7463138", "0.7463138", "0.7463138", "0.7421399", "0.734292", "0.73293597", "0.7315476", "0.7274375", "0.7221334", "0.7178115", "0.714417", "0.71127516", "0.7076997", "0.7028497", "0.7007704", "0.681925", "0.6754446", "0.66959333", "0.66767555", "0.66759145", "0.6648538", "0.66435665", "0.6613794", "0.6613794", "0.6603198", "0.6462157", "0.64577", "0.64571923", "0.63812685", "0.6324589", "0.6322319", "0.62415636", "0.6230853", "0.61727226", "0.61643577", "0.6148886", "0.6100615", "0.60832876", "0.60755813", "0.60371906", "0.603712", "0.60284317", "0.6018984", "0.6015421", "0.6008731", "0.60038096", "0.5985095", "0.5984263", "0.5982055", "0.5971744", "0.5937244", "0.5929494", "0.5896092", "0.58952284", "0.58933675", "0.58863807", "0.5878396", "0.5872792", "0.58426744", "0.5837957", "0.58369464", "0.5833053", "0.5830263", "0.5821866", "0.58069575", "0.5792898", "0.57923925", "0.5788477", "0.5788477", "0.57758534", "0.5746014", "0.5735727", "0.57138884", "0.5711001", "0.570952", "0.56834763", "0.5672086", "0.5666035", "0.56523275", "0.56369346", "0.5611411", "0.5608337", "0.56068164", "0.56066287", "0.56032956", "0.56024414", "0.5597424", "0.5596126", "0.5593824", "0.55883706", "0.55616665", "0.55490035", "0.55367094", "0.5513748", "0.5470389", "0.5465072", "0.54640853" ]
0.7977174
0
Determines if the node has a parent node.
final public function hasParent() { return ($this->_parentNode !== null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasParent(BaseObject $node)\n {\n return (bool)$node->getParentIdValue();\n }", "public function hasParent()\n {\n return $this->currentParent !== null;\n }", "public function hasParent()\n\t{\n\t\treturn !empty($this->parent);\n\t}", "public function hasParent() {\n return isset($this->_parent);\n }", "function hasParent() {\n\t\treturn (bool) ($this->parentID);\n\t}", "public function hasParent();", "public function hasParent();", "public function hasParent();", "abstract public function is_for_parent_node(Jquarry_Node $parent);", "public function hasParent() {}", "public function hasParent() {\n\t\treturn $this->parent()->count() == 1;\n\t}", "public function getParentNode()\r\n {\r\n return $this->_parentNode ? $this->_parentNode : false;\r\n }", "private function is_parent()\n\t{\n\t\treturn is_null($this->category_id);\n\t}", "public function isParent() {\n\t\treturn $this->isParent;\n\t}", "public function hasParent()\n {\n }", "public function isParent();", "public function getIsParent() {\n\t\treturn $this->isParent;\n\t}", "function is_parent($parent_node, $child_node)\r\n\t{\r\n\t\t$p_root_id = $parent_node['root_id'];\r\n\t\t$p_l = $parent_node['l'];\r\n\t\t$p_r = $parent_node['r'];\r\n\r\n\t\t$c_root_id = $child_node['root_id'];\r\n\t\t$c_l = $child_node['l'];\r\n\t\t$c_r = $child_node['r'];\r\n\r\n\t\tif (($p_root_id == $c_root_id) && ($p_l < $c_l && $p_r > $c_r))\r\n\t\t\treturn true;\r\n\r\n\t\treturn false;\r\n\t}", "public function hasParentId(){\n return $this->_has(3);\n }", "public function isParentOf(AbstractNode $node) :bool {\n return $node->hasParent()&&$node->parent->isSameNode($this);\n }", "public function get_isTableWiTreeParentField()\n {\n if ( empty( $this->arr_tablesWiTreeparentfield ) )\n {\n return false;\n }\n\n return true;\n }", "public function hasParentMessage(): bool {\n return isset($this->parentMessageId);\n }", "public function isParentOf($path)\n\t{\n\t\t$path = $this->resolve($path);\n\n\t\tif ($path === $this->root) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn 0 === \\strpos($path, $this->root);\n\t}", "public static function currentUserisParent()\n {\n return (check_user_role('parent')) ? true : false;\n }", "function has_post_parent($post = \\null)\n {\n }", "public function parentIsNode($model = false)\n {\n $model = ($model ? $model : $this);\n\n $class = new ReflectionClass($model);\n $parent = $class->getParentClass();\n $parentName = $parent->getShortName();\n\n if($parentName == 'Node')\n {\n return true;\n }\n\n return false;\n }", "public function is_parent_available() {\n\t\t$parent = get_posts( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'name' => $this->theme->get_template(),\n\t\t\t'posts_per_page' => 1,\n\t\t\t'post_type' => 'repopackage',\n\t\t\t'orderby' => 'ID',\n\t\t\t'suppress_filters' => false,\n\t\t) );\n\t\t$this->theme->post_parent = current( $parent );\n\n\t\treturn ! empty( $parent );\n\t}", "public function getParentNode() {}", "public function getParentnode()\n {\n return $this->__parentnode__;\n }", "public function hasChildren($parent) {\n\t\t// If the left and right are x and x+1, then there is no kids\n\t\tif ($parent['Aco']['rght'] == $parent['Aco']['lft'] +1 ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function isRoot()\n {\n return empty($this->parent_id);\n }", "public function hasParentRelayCount()\n {\n return $this->parent_relay_count !== null;\n }", "public function hasLeftChild()\n\t{\n\t\treturn isset($this->leftChild);\n\t}", "public function isRoot(): bool\n {\n return $this->parent === null;\n }", "function test_get_parent()\r\n\t{\r\n\t\t$rnc = 1;\r\n\t\t$depth = 2;\r\n\t\t$npl = 3; \r\n\t\t// Create a new tree\r\n\t\t$relation_tree = $this->_create_sub_node($rnc, $depth, $npl);\r\n\t\t$allnodes = $this->_tree->get_all_nodes(); \r\n\t\t// Walk trough all nodes and compare it's relations whith the one provided\r\n\t\t// by the relation tree\r\n\t\tforeach($allnodes AS $nid => $node)\r\n\t\t{\r\n\t\t\t$parent = $this->_tree->get_parent($nid, true);\r\n\t\t\tif (!isset($relation_tree[$nid]['parent_id']))\r\n\t\t\t{\r\n\t\t\t\t$this->assertFalse($parent, 'A rootnode returned a parent');\r\n\t\t\t\tcontinue;\r\n\t\t\t} \r\n\t\t\t$this->assertEqual($relation_tree[$nid]['parent_id'], $parent['id'], 'Relation tree parent doesn\\'t match method return');\r\n\t\t} \r\n\t\treturn true;\r\n\t}", "public function isChild() {\n\t\treturn $this->_parent !== null;\n\t}", "public function hasPrevSibling(BaseObject $node)\n {\n return (bool)$node->retrievePrevSibling();\n }", "public static function is_parent($id)\n {\n if ('parent_service' == BA_Lib::get_product_type($id)) {\n return true;\n }\n return false;\n }", "public function isChild()\n {\n return $this->parentId != null;\n }", "function is_root() {\n\t\treturn $this->_parent === NULL;\n\t}", "public function hasParentInTrustChain()\n {\n return (! $this->getParentCertificateURL() == '');\n }", "public function hasParentInTrustChain()\n {\n return (! $this->getParentCertificateURL() == '');\n }", "private function is_can_parent_node($local_root) {\n if ($local_root !== null) {\n return !($local_root->type == qtype_preg_node::TYPE_NODE_ALT);\n }\n return true;\n }", "function salmon_parent_is($atom, $parent, $breadcrumbs) {\n\treturn ($breadcrumbs[$atom['level'] - 1] == $parent); \n}", "public function isParentOf($page) {\n if(!is_a($page, 'Page')) $page = page($page);\n\n return $this->is($page) ? false : $page->parent->is($this);\n }", "public function getIsChildAttribute(){\n return $this->parent_id != NULL;\n }", "protected function hasParentMenuItem() {}", "public function is_parent($target)\n {\n if ( ! ($target instanceof $this))\n $target = $this->factory_item($target);\n elseif ( !$target->loaded )\n $target->reload();\n\n return ((int) $this->primary_key === (int) $target->parent_key);\n }", "public function hasHasRemoteParent(){\n return $this->_has(11);\n }", "public function isChild()\n {\n if (false === $this->parent_category) {\n return false;\n }\n\n return true;\n\n }", "final public function allowsParent() {\n\t\treturn true;\n\t}", "function is_child($parent) {\n\tglobal $wp_query;\n\tif ($wp_query->post->post_parent == $parent) { $return = true; } else { $return = false; }\n\treturn $return;\n}", "function L_catHasParent($catid) {\n\t\t\n\t\t$category = get_category($catid);\n\t\tif ($category->category_parent > 0) {\n\t\t\t\n\t\t\treturn true;\n\t\t\t\n\t\t}\n\t\t\n\t\treturn false;\n\t\n\t}", "protected function hasEdgeParent(Edge $edge)\n {\n return $this->containsNode($edge->getParent());\n }", "Public function getParentPageId() {\n\t\tif(!empty($this->parent_pageid))\n\t\t\treturn $this->parent_pageid;\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "final public function hasChild(CtkBuildable $node) {\n\t\treturn false;\n\t}", "public function isParent($dir)\n {\n return 0 === strpos($this->referencePath, realpath($dir));\n }", "public function hasChain(/* ... */)\n {\n return (null !== $this->_parent);\n }", "public function isSelf(){\n\t\t$db = new DB_WE();\n\n\t\tif($this->ID){\n\t\t\t$count = 0;\n\t\t\t$parentid = $this->ParentID;\n\t\t\twhile($parentid != 0){\n\t\t\t\tif($parentid == $this->ID){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t$parentid = f('SELECT ParentID FROM ' . escape_sql_query($this->_table) . ' WHERE ID=' . intval($parentid), '', $db);\n\t\t\t\t$count++;\n\t\t\t\tif($count == 9999){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isCurrentChild(): bool;", "public function parentNode()\n {\n return null;\n }", "public function getParent() {\n\t\tif ($this->path === '/') {\n\t\t\treturn NULL;\n\t\t}\n\t\treturn $this->nodeDataRepository->findOneByPath($this->parentPath, $this->workspace);\n\t}", "public function no_location_and_parent_match($parent_id)\n\t{\n\t\t$data = $this->find_one_array(array($this->_tables['fuel_navigation'].'.id' => $parent_id));\n\t\tif (!empty($data))\n\t\t{\n\t\t\tif ($data['id'] == $data['parent_id']) return FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "public function isChildOnly();", "public function isAncestorOf(AbstractNode $node) :bool {\n if ($this->hasChild()===false || $node->hasParent()===false || $this->isSameNode($node)) {\n return false;\n }\n\t\twhile ($node instanceof AbstractNode) {\n\t\t\tif ($this->isParentOf($node)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t$node = $node->parent;\n\t\t}\n\t\treturn false;\n }", "public function retrieveParent(BaseObject $node, $peer_method = 'doSelectOne')\n {\n if ($node->isRoot())\n {\n return false;\n }\n\n // Trick to get proper criteria\n $clone = clone $node;\n $clone->setId($node->getParentIdValue());\n $c = $clone->buildPKeyCriteria();\n\n return call_user_func(array(get_class($node->getPeer()), $peer_method), $c);\n }", "function is_parent()\n{ \n global $post;\n\n if ( is_page() && $post->post_parent ) {\n // This is a subpage\n return;\n\n } else {\n // This is not a subpage\n return true;\n }\n \n}", "public function hasParents($product)\n {\n return !empty($product->getTypeInstance()->getParentIdsByChild($product->getId()));\n }", "public static function isParent($parent, $child) {\r\n $parent_version = new Version($parent);\r\n $child_version = new Version($child);\r\n $parent_support_condition = $parent_version->N == $child_version->N \r\n && $parent_version->isSupportBranch() \r\n && ($child_version->isReleaseBranch() || $child_version->isBuild());\r\n $parent_release_condition = $parent_version->N == $child_version->N \r\n && $parent_version->M == $child_version->M \r\n && $parent_version->isReleaseBranch() \r\n && $child_version->isRelease();\r\n return ($parent_support_condition || $parent_release_condition);\r\n }", "function is_property_parent($entity_type, $name) {\n $controller = entity_toolbox_controller($entity_type);\n $helper = $controller->getPropsHelper();\n\n return $helper->propIsParent($name);\n}", "public function hasChildNodes() {}", "public function validator()\n {\n if (!$this->getElement(self::PARENT_ID_KEY)->getValue() && !$this->skinsetModel->getTemplateConfigByKey($this->getRecord()->template)->getAllowedOnRoot()) {\n $this->getElement(self::PARENT_ID_KEY)->addError('form.categoryMove.parentId.error');\n return false;\n }\n return true;\n }", "protected function get_parent()\r\n {\r\n return $this->parent;\r\n }", "public function hasChildren(): bool;", "public function parent()\n {\n if ( !$this->loaded )\n $this->reload();\n\n if ($this->is_root())\n return NULL;\n\n if ( ! in_array('parent', $this->_objects) )\n {\n $sql = \"SELECT * FROM $this->_table_name\n WHERE \n $this->primary_column = $this->parent_key\n ORDER BY \". $this->_sorting[0] .\" \". $this->_sorting[1] .\"\n \";\n\n $result = $this->_db->query($sql);\n\n $this->_objects['parent'] = $this->factory_set($result)[0];\n }\n\n return $this->_objects['parent'];\n }", "public function isChild(): bool;", "function detectParentIncludes( $id )\n\t{\n\t\tif ( $id == 0 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/* get parent */\n\t\t$parent = $this -> fetch(array('Parent_ID', 'Add_sub', 'Add'), array('ID' => $id), null, 1, 'categories', 'row');\n\t\t\n\t\tif (!empty($parent))\n\t\t{\n\t\t\t/* check relations */\n\t\t\tif ( $parent['Add_sub'] == '1' )\n\t\t\t{\n\t\t\t\treturn $parent['Add'];\n\t\t\t}\n\t\t\treturn $this -> detectParentIncludes($parent['Parent_ID']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function isAncestor()\n {\n $model_ticket_forwarded_to = self::find()->andWhere(['forwarded_from_id' => $this->id])->one();\n\n return !is_null($model_ticket_forwarded_to);\n }", "public function getParent($level = 1)\n\t{\n\t\tif (!empty($this->parent)) {\n\t\t\tif ($level > 1)\n\t\t\t\treturn $this->parent->getParent($level - 1);\n\t\t\telse\n\t\t\t\treturn $this->parent;\n\t\t}\n\t\treturn false;\n\t}", "public function moveToParentNode(): bool\n {\n $moved = FALSE;\n $node = $this->currentNode->parentNode;\n \n if ($node instanceof \\DOMNode) {\n $this->currentNode = $node;\n $moved = TRUE;\n }\n \n return $moved;\n }", "public function isRoot()\n {\n // return (empty($this->{$this->getTreeColumn('parent')})) ? true : false;\n return $this->{$this->getTreeColumn('path')} === $this->getKey() . '/'\n && $this->{$this->getTreeColumn('level')} === 0;\n }", "public function getParent() {\r\n\t\tif ($this->pzkParentId) {\r\n\t\t\treturn pzk_store_element($this->pzkParentId);\r\n\t\t}\r\n\t\treturn NULL;\r\n\t}", "public function isAncestor ($Item)\r\n {\r\n \tif ($this->path == '')\r\n \t\treturn false;\r\n \telse\r\n \t{\r\n \t\t$return = (strpos($Item->path,$this->path)===0);\r\n\r\n \t\treturn $return;\r\n \t}\r\n }", "public function tree_get_parent($id = false) {\n global $db;\n if (!$id) {\n // Root-ID ermitteln\n if (!isset($this->id_root))\n $this->id_root = $db->fetch_atom(\"SELECT ID_KAT FROM `\".$this->table.\"` WHERE ROOT=\".$this->root.\" AND PARENT=0\");\n return $this->id_root;\n } else {\n // Parent eines Elements ermitteln\n return $db->fetch_atom(\"SELECT PARENT FROM `\".$this->table.\"` WHERE ROOT=\".$this->root.\" AND ID_KAT=\".$id);\n }\n }", "public function hasChildren();", "public function hasChildren();", "public function hasChildren();", "public function hasChildren();", "protected function hasParentMenuItemKey() {}", "public function isChild(): bool\n {\n return false;\n }", "public function hasChildren()\n {\n $query = 'SELECT category_id FROM '. \\rex::getTablePrefix() .'d2u_machinery_categories '\n .'WHERE parent_category_id = '. $this->category_id;\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n\n if ($result->getRows() > 0) {\n return true;\n }\n\n return false;\n\n }", "public static function isParentStoreSelected() {\n $storeId = self::getSelectedSubStoreId();\n $subStoreModel = new \\App\\SubStoreDetails();\n $storeSubStores = $subStoreModel->getStoreSubStores($storeId, FALSE);\n if (!empty($storeSubStores)) {\n return true;\n }\n return false;\n }", "#[\\ReturnTypeWillChange]\n public function hasChildren()\n {\n return $this->current()->hasChildNodes();\n }", "public function hasParentChildFilter() {\n return $this->_has(4);\n }", "function get_parent()\r\n {\r\n return $this->parent;\r\n }", "function get_parent()\r\n {\r\n return $this->parent;\r\n }", "public function getRenderParents(): bool;", "public function isRootNode()\n {\n return true;\n }", "public function isOrphan(){\n\t\treturn is_null( $this->father );\n\t}", "private function getNodeParents(&$node)\n\t{\n\t\t// It is already checked in the caller whether this $node is a context with Practices\n\t\t// pointing to it, that is not the case since this function is called.\n\t\n\t\t// Is $node an IE with Part-of, skosembroader or Context prop?\n\t\t$query = \"[[Category:Intentional Element]][[{$node->getName()}]]|?\".PARTOFPROPERTY.\"|?\".SKOSEMBROADERPROPERTY.\"|?\".CONTEXTPROPERTY;\n\t\t//FIXME: SKOSEMBROADER should be SKOSBROADER, but will not work in printout section, use page selection part, possibly reversed query for the prop? prop::thispage?\n\t\t$result = $this->askAPI->ask($query);\n\t\tif(count($result['query']['results']) > 0){\n\t\t\t$result = $result['query']['results'][$node->getName()]['printouts'];\n\t\t\t\n\t\t\t/* EXPERIMENTAL! JIRA EMT-276 Background: if there are contexts (of this IE $node), they \n\t\t\t * should be prefered (before taking partofs and skosembroaders into account) \n\t\t\t * TODO WME: discuss with HdB*/\n\t\t\t$parents = $this->getNodesFromQueryResult($result[CONTEXTPROPERTY]);\n\t\t\t\n\t\t\tif(count($parents) == 0){\t\n\t\t\t\t$parents = $this->getNodesFromQueryResult($result[PARTOFPROPERTY]);\n\t\t\t}\n\t\t\tif(count($parents) == 0){\n\t\t\t\t$parents = $this->getNodesFromQueryResult($result[SKOSEMBROADERPROPERTY]);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t//not an IE and no practices pointing to it, is it a context which has a supercontext?\n\t\t\t$query = \"[[Category:Context]][[{$node->getName()}]]|?\".SUPERCONTEXTPROPERTY;\n\t\t\t$result = $this->askAPI->ask($query);\n\t\t\tif(count($result['query']['results']) > 0){\n\t\t\t\t$result = $result['query']['results'][$node->getName()]['printouts'];\n\t\t\t\t$parents = $this->getNodesFromQueryResult($result[SUPERCONTEXTPROPERTY]);\n\t\t\t}\n\t\t\telse{\t//no: is it a practice which has a part-of?\n\t\t\t\t//NB add contextproperty for breadcrumb fixing, see below\n\t\t\t\t$query = \"[[Category:Practice]][[{$node->getName()}]]|?\".PARTOFPROPERTY.\"|?\".CONTEXTPROPERTY;\n\t\t\t\t$result = $this->askAPI->ask($query);\n\t\t\t\tif(count($result['query']['results']) > 0){\n\t\t\t\t\t$result = $result['query']['results'][$node->getName()]['printouts'];\n\t\t\t\t\t//breadcrumb fixing: if this node has breadcrumb value \"practice\" then replace it by a list \n\t\t\t\t\t//of Context property values (there may be more than one Context value, isn't it?)\n\t\t\t\t\tif($node->getBreadCrumb() == \"practice\")\n\t\t\t\t\t\t$node->setBreadCrumb($this->getNodesFromQueryResult($result[CONTEXTPROPERTY]));\n\t\t\t\t\t$parents = $this->getNodesFromQueryResult($result[PARTOFPROPERTY], \"practice\");\n\t\t\t\t}\n\t\t\t\t// else: NO PARENTS FOUND\n\t\t\t}\n\t\t}\n\t\treturn $parents;\t//return array with parent elements found\n\t}" ]
[ "0.8103629", "0.80385506", "0.7996985", "0.79281795", "0.78594285", "0.7759335", "0.7759335", "0.7759335", "0.7632996", "0.76225877", "0.7453177", "0.7414269", "0.7411043", "0.73730993", "0.7371341", "0.7369907", "0.7111826", "0.7086192", "0.7049188", "0.70080405", "0.6909298", "0.68855214", "0.67828304", "0.6735673", "0.67350036", "0.6710811", "0.66382027", "0.6548589", "0.6508436", "0.64392143", "0.6438256", "0.6403631", "0.6387329", "0.63836855", "0.637678", "0.6368226", "0.6296719", "0.62900597", "0.62802994", "0.6264094", "0.6218484", "0.6218484", "0.6184161", "0.6130706", "0.6128526", "0.611279", "0.6108436", "0.61005545", "0.607193", "0.60657173", "0.60538006", "0.6044985", "0.6005898", "0.60021544", "0.5965415", "0.5944124", "0.59401304", "0.59154135", "0.5912845", "0.59061176", "0.5904376", "0.58825296", "0.58662844", "0.58584154", "0.58514726", "0.5811613", "0.5804663", "0.57847273", "0.57801265", "0.5770423", "0.5769963", "0.5767845", "0.5767386", "0.57626605", "0.5760244", "0.57589746", "0.5757334", "0.57506454", "0.5746149", "0.57334876", "0.5719397", "0.5697733", "0.5695052", "0.5669745", "0.5665288", "0.5665288", "0.5665288", "0.5665288", "0.5665195", "0.5647251", "0.5644692", "0.5642388", "0.56385064", "0.56328017", "0.5631276", "0.5631276", "0.5621123", "0.5587928", "0.55784976", "0.5575502" ]
0.8085965
1
Returns the parent node of this node.
final public function getParent() { return $this->_parentNode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getParentnode()\n {\n return $this->__parentnode__;\n }", "public function getParentNode() {}", "public function getParentNode()\r\n {\r\n return $this->_parentNode ? $this->_parentNode : false;\r\n }", "public function get_parent() {\n\t\treturn $this->parent();\n\t}", "public function getParent() {\r\n\t\tif ($this->pzkParentId) {\r\n\t\t\treturn pzk_store_element($this->pzkParentId);\r\n\t\t}\r\n\t\treturn NULL;\r\n\t}", "protected function get_parent()\r\n {\r\n return $this->parent;\r\n }", "public function getParent() {\n\t\tif ($this->path === '/') {\n\t\t\treturn NULL;\n\t\t}\n\t\treturn $this->nodeDataRepository->findOneByPath($this->parentPath, $this->workspace);\n\t}", "final public function getParent()\n\t{\n\t\treturn $this->parent;\n\t}", "public function getParent() {\n\t\t\treturn $this->parent;\n\t\t}", "public function getParent() {\n return $this->__parent;\n }", "public function parentNode()\n {\n return null;\n }", "public function getParent() {\n return $this->parent;\n }", "public function getParent() {\n\t\treturn $this->parent;\n\t}", "public function getParent() {\n\t\treturn $this->parent;\n\t}", "public function getParent()\n\t{\n\t\treturn $this->parent;\n\t}", "public function getParent()\n\t{\n\t\treturn $this->parent;\n\t}", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent() {\n\t\treturn $this->_parent;\n\t}", "public function parent()\r\n\t{\r\n\t\treturn $this->parent;\r\n\t}", "function getParent () {\r\n\t\treturn $this->_parent;\r\n\t}", "function getParent () {\r\n\t\treturn $this->_parent;\r\n\t}", "public function parent() {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->Root->parentOfSection($this->URLSegment);\n }", "public function getParent()\n {\n if (! $this->parentrecord) {\n list($this->parentrecord, $unused) = self::getParentAndChild($this->flatpath);\n }\n return $this->parentrecord;\n }", "function get_parent()\r\n {\r\n return $this->parent;\r\n }", "function get_parent()\r\n {\r\n return $this->parent;\r\n }", "public function parentNode()\n {\n return new Element($this->node->parentNode);\n }", "public function parent()\n {\n if ( !$this->loaded )\n $this->reload();\n\n if ($this->is_root())\n return NULL;\n\n if ( ! in_array('parent', $this->_objects) )\n {\n $sql = \"SELECT * FROM $this->_table_name\n WHERE \n $this->primary_column = $this->parent_key\n ORDER BY \". $this->_sorting[0] .\" \". $this->_sorting[1] .\"\n \";\n\n $result = $this->_db->query($sql);\n\n $this->_objects['parent'] = $this->factory_set($result)[0];\n }\n\n return $this->_objects['parent'];\n }", "public function getParentID()\n {\n return $this->parent_id;\n }", "public function getParent()\n {\n return $this->parent;\n\n }", "public function getTreeParent(){\n return $this->treeParentRow;\n }", "function get_parent() {\n return $this->get_mapped_property('parent');\n }", "public function getParentIdentifier()\n {\n return $this->parent;\n }", "public function getParent(){\n return $this->_parent;\n }", "public function getParent_id() {\n\t\treturn $this->parent_id;\n\t}", "public function getParentId()\n {\n return $this->parent_id;\n }", "public function getParentId()\n {\n return $this->parent_id;\n }", "public function parent()\n\t{\n\t\tif( static::$databaseColumnParent !== NULL )\n\t\t{\n\t\t\t$parentColumn = static::$databaseColumnParent;\n\t\t\tif( $this->$parentColumn !== static::$databaseColumnParentRootValue )\n\t\t\t{\n\t\t\t\treturn static::load( $this->$parentColumn );\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( isset( static::$parentNodeClass ) )\n\t\t{\n\t\t\t$parentNodeClass = static::$parentNodeClass;\n\t\t\t$parentColumn = static::$parentNodeColumnId;\n\t\t\tif( $this->$parentColumn )\n\t\t\t{\n\t\t\t\treturn $parentNodeClass::load( $this->$parentColumn );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn NULL;\n\t}", "public function getParentId()\n\t{\n\t\treturn $this->parent_id;\n\t}", "public function getParent()\n {\n if (array_key_exists(\"parent\", $this->_propDict)) {\n if (is_a($this->_propDict[\"parent\"], \"\\Beta\\Microsoft\\Graph\\Model\\ParentLabelDetails\") || is_null($this->_propDict[\"parent\"])) {\n return $this->_propDict[\"parent\"];\n } else {\n $this->_propDict[\"parent\"] = new ParentLabelDetails($this->_propDict[\"parent\"]);\n return $this->_propDict[\"parent\"];\n }\n }\n return null;\n }", "public function getParent() {\n return $this->mediator_->getContainerForName($this->get('parentName'), $this->getType());\n }", "public function get_parent_id() {\n\t\treturn $this->post->post_parent;\n\t}", "public function getParentItem() {\n return $this->parentItem;\n }", "public function parent(){\n return $this->where('id', $this->parent_id)->first();\n }", "public function parent() { return $this->post->post_parent; }", "public function getIdParent()\n {\n return $this->id_parent;\n }", "public function getParent(){\n\t\treturn $this->father;\n\t}", "public function getParentId()\n {\n return $this->parentId;\n }", "public function getParentId()\n {\n return $this->parentId;\n }", "public function getParent(): ?self\n {\n if ($this->parent === $this) {\n return null;\n }\n\n return $this->parent;\n }", "public function getParentItem() {\n return $this->item->getParentItem();\n }", "public function get_parent_id()\n {\n return $this->get_default_property(self::PROPERTY_PARENT_ID);\n }", "public function get_parent_id()\n {\n return $this->get_default_property(self::PROPERTY_PARENT_ID);\n }", "public function getParent()\n\t{\n\t\tif (!is_object($this->_item)) {\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\treturn $this->_parent;\n\t}", "public function getParent()\n\t{\n\t\tif (!is_object($this->_item))\n\t\t{\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\treturn $this->_parent;\n\t}", "public function parent( $parent = null ) {\n\t\tif( $parent !== null ) {\n\t\t\t$this->parent = $parent;\n\t\t}\n\n\t\treturn $this->parent;\n\t}", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function get_parent();", "public function getParentPath() {\n\t\treturn $this->parentPath;\n\t}", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getParent()\n {\n // TODO: Implement getParent() method.\n }", "public function parentRecord()\r\n {\r\n return $this->_parent;\r\n }", "public function parent()\n\t{\n\t\tif ($this->parent_id) {\n\t\t\tif (is_null($this->parent)) {\n\t\t\t\t$parent = \\PagesRepository::retrieve($this->parent_id);\n\t\t\t\t$this->parent = \\App::make('Monal\\Pages\\Models\\FrontendPage', $parent);\n\t\t\t}\n\t\t}\n\t\treturn $this->parent;\n\t}" ]
[ "0.8736719", "0.8143647", "0.8125172", "0.8109064", "0.8107589", "0.8100206", "0.8060032", "0.7985446", "0.79760116", "0.7964146", "0.79399323", "0.7919951", "0.79183215", "0.79183215", "0.791358", "0.791358", "0.79123634", "0.79123634", "0.79123634", "0.79123634", "0.79123634", "0.79123634", "0.79123634", "0.79123634", "0.79123634", "0.79123634", "0.79123634", "0.79123634", "0.79123634", "0.79123634", "0.79123634", "0.79123634", "0.79123634", "0.79123634", "0.79123634", "0.79123634", "0.79123634", "0.79123634", "0.79123634", "0.7886983", "0.78149647", "0.7743013", "0.7743013", "0.76684695", "0.7603583", "0.75967497", "0.7574269", "0.7574269", "0.7571621", "0.7568548", "0.75677884", "0.7541531", "0.75266284", "0.75239635", "0.7496256", "0.7487097", "0.74759007", "0.7455825", "0.7455825", "0.7445011", "0.74266654", "0.7419369", "0.7417275", "0.7384042", "0.7336482", "0.73189926", "0.73059595", "0.7289231", "0.7283813", "0.72822773", "0.72822773", "0.7267645", "0.7249495", "0.72023255", "0.72023255", "0.7196026", "0.7188812", "0.71522975", "0.71475923", "0.71475923", "0.71475923", "0.71475923", "0.71475923", "0.71475923", "0.71475923", "0.71475923", "0.71475923", "0.71475923", "0.71434253", "0.71166074", "0.7097137", "0.7097137", "0.7097137", "0.7097137", "0.7097137", "0.7097137", "0.7097137", "0.70723426", "0.7054399", "0.704099" ]
0.83716
1
Sets the parent node for this node.
final public function setParent(CtkBuildable $node = null) { $this->_parentNode = $node; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setParent(Node $parent)\n {\n $this->parent = $parent;\n }", "public function setParent(Module_Node_Model $parent = null);", "public function setParent(PhpcrNodeInterface $parentNode);", "public function setParent(self $parent)\n {\n $this->_parent = $parent;\n }", "public function setParent(Node $node)\n {\n $this->parent = $node;\n\n return $this;\n\n }", "public function setParent($parent) {\n\t\t$this->parent = $parent;\n\t}", "public function setParent($parent)\n {\n $this->parent = $parent;\n }", "public function setParent($parent)\n {\n $this->parent = $parent;\n }", "protected function setParent(MenuNode $node)\n {\n $this->parent = $node;\n }", "function SetParent(&$ParentNode)\n {\n $this->ParentNode = &$ParentNode;\n $this->Level = $this->ParentNode->Level + 1;\n }", "public function setParent($parent)\n\t{\n\t\t$this->parent = $parent;\n\t}", "function set_parent($parent)\r\n {\r\n $this->parent = $parent;\r\n }", "public function setTreeParent($row){\n $this->treeParentRow = $row;\n return;\n }", "public function setParent(CategoryTreeNodeInterface $parent);", "public function set_parent_id($parent)\n {\n $this->set_default_property(self::PROPERTY_PARENT_ID, $parent);\n }", "public function setParent($oParent = null)\n {\n $this->_oParent = $oParent;\n }", "public function set_parent(SBBCodeParser_ContainerNode $parent=null)\r\n\t{\r\n\t\t$this->parent = $parent;\r\n\t\t\r\n\t\tif($parent instanceof SBBCodeParser_Document)\r\n\t\t\t$this->root = $parent;\r\n\t\telse\r\n\t\t\t$this->root = $parent->root();\r\n\t}", "public function setParent($record)\n {\n $this->parent = $record;\n }", "private function setParent(Folder $parent): void\n {\n $this->parent = $parent;\n }", "function set_parent($value) {\n $this->set_mapped_property('parent', $value);\n }", "public function set_parent_id( $value ) {\n\t\t// Update the parent in the database\n\t\twp_update_post( array(\n\t\t\t'ID' => $this->id,\n\t\t\t'post_parent' => $value,\n\t\t) );\n\n\t\t// And update the parent in memory\n\t\t$this->post->post_parent = $value;\n\t\t$this->order = null;\n\t}", "public function setParentNode($parentNode)\r\n {\r\n $this->_parentNode = $parentNode;\r\n }", "public function setParent(\\ObjectiveLessCss\\Block $parent)\n\t{\n\t\tif ($this->parent != $parent) {\n\t\t\t$oldParent = $this->parent;\n\t\t\t$this->parent = null; // do not remove or endless recursion will happen!\n\t\t\tif ($oldParent) {\n\t\t\t\t$oldParent->removeRule($this);\n\t\t\t}\n\t\t\t$this->parent = $parent;\n\t\t}\n\t}", "public function setParent($val)\n {\n $this->_propDict[\"parent\"] = $val;\n return $this;\n }", "function setParent($parent) {\n parent::setParent($parent);\n $this->component = $parent->getComponent();\n $suffix = '/' . $this->id;\n if ($parent instanceof ChtNodeCategory) {\n $suffix = '/' . $this->component .':'. $this->id;\n // instead of pseudopath, insert component into first rofpath component\n }\n $this->path = $parent->getPath() . $suffix;\n $this->absolutePath = $parent->getAbsolutePath() . $suffix;\n return $this;\n }", "public function setParent($value)\n {\n $this->setItemValue('parent', ['id' => (int)$value]);\n }", "public function setParent_id( $parent_id ) {\n\t\t$this->parent_id = $parent_id;\n\t}", "public function setParent($value)\n {\n return $this->set('Parent', $value);\n }", "public function makeParent(): void\n {\n $this->parent = null;\n }", "public function setParent(&$element)\n {\n $this->parent = $element;\n\n return $this;\n }", "public function setParentIdValue(BaseObject $node, $value)\n {\n $setter = self::forgeMethodName($node, 'set', 'parent');\n return $node->$setter($value);\n }", "public function set_parent_id($parent_id)\n {\n $this->set_default_property(self::PROPERTY_PARENT_ID, $parent_id);\n }", "public function setParent($var)\n {\n GPBUtil::checkString($var, True);\n $this->parent = $var;\n\n return $this;\n }", "public function setParent($var)\n {\n GPBUtil::checkString($var, True);\n $this->parent = $var;\n\n return $this;\n }", "public function setParent($var)\n {\n GPBUtil::checkString($var, True);\n $this->parent = $var;\n\n return $this;\n }", "public function setParent($parent) {\n $this->parent = $parent;\n return $this;\n }", "function setParent($txn_id) {\n $this->checkChange();\n\n $this->parent_txn_id = $txn_id;\n return $this;\n }", "public function setParentKey(string $parentKey): void\n {\n $this->parentKey = $parentKey;\n }", "public function SetParent($item, $parent)\n {\n $item->SetParent($parent);\n }", "public function SetParent($item, $parent)\n {\n $item->SetParent($parent);\n }", "public function setParent($parent)\n {\n $this->parent = $parent;\n return $this;\n }", "public function setParentnode($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->__parentnode__ !== $v) {\n $this->__parentnode__ = $v;\n $this->modifiedColumns[IssuesTableMap::COL___PARENTNODE__] = true;\n }\n\n return $this;\n }", "public function setParent(Verb $parent)\n {\n $this->parent = $parent;\n }", "public function setParent(self $parent)\n {\n $this->parent = $parent;\n\n return $this;\n }", "public function setParentKey($parentKey)\n {\n $this->parentKey = $parentKey;\n }", "public function setParentObject($object) {\n $this->_parent_object = $object;\n }", "public function setParent($parent)\n {\n $this->parent = $parent;\n\n return $this;\n }", "public function setParent($parent)\n {\n $this->parent = $parent;\n\n return $this;\n }", "function setParent(IBabylonModel $parent);", "public function setParent(Role $parent)\n {\n $this->parent = $parent;\n }", "public function setParentInput(AbstractJson $parent = null): void\n {\n $this->parent = $parent;\n }", "public function setParentID($value)\n {\n return $this->set('ParentID', $value);\n }", "public function setParentID($value)\n {\n return $this->set('ParentID', $value);\n }", "public function setParentID($value)\n {\n return $this->set('ParentID', $value);\n }", "public function setParentId(?string $value) : Page\n {\n\n // As this column is a foreign key, empty values should be considered null.\n if (empty($value)) {\n $value = null;\n }\n\n\n if ($this->data['parent_id'] !== $value) {\n $this->data['parent_id'] = $value;\n $this->setModified('parent_id');\n }\n\n return $this;\n }", "public function setParent(?self $parent): self\n {\n if ($parent === $this) {\n $this->hasParentEqualToItself = true;\n\n return $this;\n }\n\n if (in_array($parent, $this->getChildrenRecursively())) {\n $this->hasParentEqualToOneOfItsChildren = true;\n\n return $this;\n }\n\n $this->parent = $parent;\n\n return $this;\n }", "public function setParent(MenuEntry $parent)\n {\n if ($this->parent !== null) {\n throw new LogicException('Parent menu association can not be changed after being set.');\n }\n\n $this->parent = $parent;\n\n return $this;\n }", "public function setParent($parent): self\n {\n $this->parent = $parent;\n\n return $this;\n }", "public function setParentId($parent_id) {\n $parent_id = (int) $parent_id;\n\n if (!isset($parent_id) || $parent_id == \"\") {\n $parent_id = \"0\";\n }\n $this->fields[\"parent_id\"] = $parent_id;\n\n return $this;\n }", "public function getParentnode()\n {\n return $this->__parentnode__;\n }", "public function getParentNode() {}", "public function setParentMessageId(int $parentMessageId) {\n $this->parentMessageId = $parentMessageId;\n }", "public function setNewParent($value)\n {\n return $this->set('NewParent', $value);\n }", "function _setParent(& $parent)\n {\n $this->_parent =& $parent;\n $this->_canvas =& $this->_parent->_getCanvas();\n\n if (is_array($this->_elements)) {\n $keys = array_keys($this->_elements);\n foreach ($keys as $key) {\n if (is_object($this->_elements[$key])) {\n $this->_elements[$key]->_setParent($this);\n }\n }\n unset($keys);\n }\n }", "public function setParent(Registry $parent) {\n\t\t$this->parent = $parent;\n\t}", "public function setParent(Page $parent = null)\n {\n $this->parent = $parent;\n\n return $this;\n }", "public function setParentItem($parentItem) {\n $this->parentItem = $parentItem;\n\n return $this;\n }", "public function setParent(self $parent, string $parentAssociationMapping): void;", "protected function setParent(Page $parent)\n {\n $this->parent = $parent;\n\n return $this;\n }", "public function setParentDocument(object $parent): self\n {\n $this->parent = $parent;\n\n return $this;\n }", "function setParent( $value )\r\n {\r\n if ( is_a( $value, \"eZImageCategory\" ) )\r\n {\r\n $this->ParentID = $value->id();\r\n }\r\n }", "public function setIdParent($id_parent)\n {\n $this->id_parent = $id_parent;\n\n return $this;\n }", "public function setParentMessage(Message $parentMessage)\n {\n $this->parentMessage = $parentMessage;\n }", "public function setIdParent($idParent) \n\t{\n\t\t$this->idParent = $idParent;\n\t\treturn $this;\n\t}", "public function setParent(Message $parentMessage) {}", "public function setParentTaskId(?string $parentTaskId)\n {\n $this->parentTaskId = $parentTaskId;\n\n return $this;\n }", "public function setParentId($val)\n {\n $this->_propDict[\"parentId\"] = $val;\n return $this;\n }", "public function reSetInheritedParentId()\n\t{\n\t\tif($this->getInheritanceType() != InheritanceType::INHERIT)\n\t\t\t$this->setInheritedParentId(null);\n\t\telse\n\t\t\t$this->setInheritedParentId($this->getActuallInheritedParentId());\n\t}", "public function parent( $parent = null ) {\n\t\tif( $parent !== null ) {\n\t\t\t$this->parent = $parent;\n\t\t}\n\n\t\treturn $this->parent;\n\t}", "protected function get_parent()\r\n {\r\n return $this->parent;\r\n }", "public function setParent ($value) {\n\t\n\t\t// validation\n\t\tif ($this->pageID) {\n\t\t\n\t\t\t// check IDs aren't identical\n\t\t\tif ($this->pageID == $value) {\n\t\t\t\t$this->setMessage(strFirst(LANG_INVALID.\" \".LANG_PARENT));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// check this parent isn't a child of this page\n\t\t\t$pagesModel = new PagesModel();\n\t\t\t$ids = $pagesModel->getChildrenAsArray($this->pageID);\n\t\t\t\n\t\t\tif (in_array($value, $ids)) {\n\t\t\t\t$this->setMessage(strFirst(LANG_INVALID.\" \".LANG_PARENT));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t$this->setData(\"pageParent\", intval($value));\n\t\treturn true;\n\t\n\t}", "public function setParent(ThemeMenuItem $parent = null)\n {\n }", "public function getParentNode()\r\n {\r\n return $this->_parentNode ? $this->_parentNode : false;\r\n }", "function setParentTopicId($parentTopicId) {\n\t\t$this->setData('parentTopicId', $parentTopicId);\n\t}", "public function setParentId($parent_id)\n\t{\n\t\t$this->parent_id = $parent_id;\n\n\t\treturn $this;\n\t}", "public function set_parent_type($parent_type)\n {\n $this->set_default_property(self::PROPERTY_PARENT_TYPE, $parent_type);\n }", "public function setParentId(int $parent_id = null) : CNabuDataObject\n {\n $this->setValue('nb_commerce_product_category_parent_id', $parent_id);\n \n return $this;\n }", "public function setParent(Model $model)\n {\n $this->parent = $model;\n return $this;\n }", "public function setParentWriter(\\Sincco\\Excell\\Writer\\IWriter $pWriter = null)\n {\n $this->parentWriter = $pWriter;\n }", "public function setParentMenu($parentMenu){\n $this->parentMenu = $parentMenu;\n return $this;\n }", "public function parentNode()\n {\n return null;\n }", "public function setParentId($parentId)\n\t{\n\t\t$this->parentId = $parentId;\n\t}", "public function setParentId($parent_id)\n {\n $this->parent_id = $parent_id;\n\n return $this;\n }", "public function setParent(Tx_Wpj_Domain_Model_place $parent) {\n\t\t$this->parent = $parent;\n\t\t$this->accuracy = count( $this->pathToRoot($this) );\t\n\t}", "public function setRuleParent(Rule $ruleParent) : void\n {\n\n $this->ruleParent = $ruleParent;\n }", "public function setParent($id, $data = [])\n\t{\n\t\t$this->parent = [\n\t\t\t'id' => $id,\n\t\t\t'url' => isset($data['url']) ? $data['url'] : null,\n\t\t\t'path' => isset($data['path']) ? $data['path'] : null\n\t\t];\n\t}", "public function setParent($data, $currentRecord)\n {\n $this->parentRecord = [\n 'data' => $data,\n 'currentRecord' => $currentRecord\n ];\n }", "public function set_parent(Fieldset $fieldset) {\n\t\tif (! empty ( $this->fieldset_parent )) {\n\t\t\tthrow new \\RuntimeException ( 'Fieldset already has a parent, belongs to \"' . $this->parent ()->name . '\".' );\n\t\t}\n\t\t\n\t\t$children = $fieldset->children ();\n\t\twhile ( $child = array_shift ( $children ) ) {\n\t\t\tif ($child === $this) {\n\t\t\t\tthrow new \\RuntimeException ( 'Circular reference detected, adding a Fieldset that\\'s already a child as a parent.' );\n\t\t\t}\n\t\t\t$children = array_merge ( $child->children (), $children );\n\t\t}\n\t\t\n\t\t$this->fieldset_parent = $fieldset;\n\t\t$fieldset->add_child ( $this );\n\t\treturn $this;\n\t}", "public function parent()\n {\n }", "public function setSkuParent(?string $skuParent = null): self\n {\n // validation for constraint: string\n if (!is_null($skuParent) && !is_string($skuParent)) {\n throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($skuParent, true), gettype($skuParent)), __LINE__);\n }\n if (is_null($skuParent) || (is_array($skuParent) && empty($skuParent))) {\n unset($this->SkuParent);\n } else {\n $this->SkuParent = $skuParent;\n }\n \n return $this;\n }" ]
[ "0.83225507", "0.79335314", "0.7705811", "0.76145583", "0.75762635", "0.75071263", "0.75018597", "0.75018597", "0.74901074", "0.7429061", "0.7383314", "0.7319894", "0.72148144", "0.7201187", "0.7123215", "0.7091682", "0.70636123", "0.70559883", "0.7032391", "0.7014905", "0.69508827", "0.69479764", "0.6924725", "0.6871339", "0.68586504", "0.683823", "0.68219876", "0.6813429", "0.6796074", "0.67806494", "0.6770189", "0.6765929", "0.67321527", "0.67321527", "0.67321527", "0.6700256", "0.6681983", "0.6669154", "0.6657828", "0.6657828", "0.66215146", "0.6611635", "0.6602597", "0.65538865", "0.6526094", "0.65184265", "0.6517965", "0.6517965", "0.6465664", "0.6464816", "0.6460326", "0.6450321", "0.6450321", "0.6449427", "0.6443742", "0.64283574", "0.64266163", "0.63849294", "0.6370145", "0.6370138", "0.6357747", "0.6349184", "0.6338469", "0.63354254", "0.63220555", "0.63219076", "0.6301044", "0.6288051", "0.6267016", "0.6241002", "0.6231199", "0.62293625", "0.62236476", "0.6175588", "0.6167158", "0.61351514", "0.6132873", "0.61155903", "0.6109529", "0.6109084", "0.6089764", "0.60853684", "0.60669285", "0.6023036", "0.6003562", "0.60004574", "0.5993791", "0.59936947", "0.5991479", "0.59646076", "0.59533787", "0.59370667", "0.593495", "0.59220356", "0.5910856", "0.58903736", "0.5870794", "0.58586895", "0.5854519", "0.58271086" ]
0.72155887
12
Determines if the node is allowed children.
final public function allowsChildren() { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function canHaveChildren() {}", "function isChildren()\n {\n return count($this->children)>0;\n }", "final public function hasChildren() {\n\t\treturn false;\n\t}", "public function has_children()\n {\n return ($this->size > 2);\n }", "public function hasChildren()\n {\n return count($this->children) > 0 ? true : false;\n }", "public function hasChildren() {}", "public function hasChildren() {}", "public function hasChildren() {}", "public function hasChildren() {}", "public function hasChildren() {}", "public function hasChildren()\n\t{\n\t\treturn ! $this->current()->isLeaf();\n\t}", "public function hasChildren();", "public function hasChildren();", "public function hasChildren();", "public function hasChildren();", "public function hasChildren()\n\t{\n\t\treturn !empty($this->children);\n\t}", "private function has_children() {\n return !empty($this->menuitems);\n }", "public function WantsChildren() {\r\n return false;\r\n }", "public function hasChildren()\n {\n return !empty($this->children);\n }", "static function cws_has_children() {\n\t\tglobal $post;\n\n\t\t$children = get_pages( array( 'child_of' => $post->ID ) );\n\n\t\tif ( count( $children ) == 0 ) {\n\n\t\t\treturn false;\n\n\t\t} else {\n\n\t\t\treturn true;\n\n\t\t}\n\n\t}", "public function hasChildren () {\n return ($this->current () instanceof self);\n }", "public function hasChildren()\n {\n return $this->children->count() == 0 ? false : true;\n }", "public function hasChildren()\n {\n }", "public function hasChildren()\n {\n }", "#[\\ReturnTypeWillChange]\n public function hasChildren()\n {\n return $this->current()->hasChildNodes();\n }", "public function hasChildren() \n {\n return count($this->children) > 0;\n }", "public function childrenAllowed($in)\n {\n $elt = $this->getElement($in);\n\n return !($elt && ($elt['a'] & self::ELT_NOINFERIORS));\n }", "public function hasChildren(): bool;", "function has_child () {\n\t\treturn sizeof($this->children) ? true : false;\n\t}", "public function hasChildren() {\n\t\treturn $this->children()->count() > 0;\n\t}", "public function getHasChildren()\n {\n return (boolean)$this->_has_children;\n }", "public function hasChildren() : bool\n {\n return $this->children->isNotEmpty();\n }", "final public function hasChildren(): bool\n {\n return $this->valid() && $this->current()->hasPages();\n }", "public function hasChildren(): bool\n {\n return $this->children()->count() > 0;\n }", "public function childElementsAllowed() {}", "public function hasListedChildren(): bool\n {\n return $this->children()->listed()->count() > 0;\n }", "public function hasChildren()\n {\n return (null !== $this->children) && count($this->children);\n }", "public function canApply(): bool\n {\n if (is_null($this->subject)) {\n return false;\n }\n $parent = $this->getParentNode();\n $nodeType = $this->subject->getNodeType();\n\n return $parent && $this->isNodeTypeAllowedAsChildNode($parent, $nodeType);\n }", "public function hasChildren(BaseObject $node)\n {\n return (bool)($node->getRightValue() - $node->getLeftValue() > 1);\n }", "public function hasUnlistedChildren(): bool\n {\n return $this->children()->unlisted()->count() > 0;\n }", "public function hasChildren()\n {\n return $this->childContainer->hasItem();\n }", "public function hasChild()\n {\n return count($this->_children) > 0;\n }", "public function canApply()\n {\n $parent = $this->getSiblingNode()->findParentNode();\n $nodeType = $this->getSubject()->getNodeType();\n\n return NodeInfoHelper::isNodeTypeAllowedAsChildNode($parent, $nodeType);\n }", "public function hasChildNodes() {}", "public function hasChildren()\n {\n return $this->myChildren()->exists();\n }", "public function isChildOnly();", "public function hasChildren()\n {\n $query = 'SELECT category_id FROM '. \\rex::getTablePrefix() .'d2u_machinery_categories '\n .'WHERE parent_category_id = '. $this->category_id;\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n\n if ($result->getRows() > 0) {\n return true;\n }\n\n return false;\n\n }", "protected function _hasAllowedChildren(array $children): bool\n {\n foreach ($children as $child) {\n if ($this->Auth->urlAllowed($child['url'])) {\n return true;\n }\n }\n\n return false;\n }", "public function isChildSupported();", "public function hasChilds() {\n if(is_bool($this->hasChilds)){\n if(($this->hasChilds and empty($this->childs)) or (!$this->hasChilds and !empty($this->childs))){\n return $this->getResource()->hasChilds();\n } else {\n return $this->hasChilds;\n }\n }\n return $this->getResource()->hasChilds();\n }", "public function isChildOf($node)\n\t{\n\t\treturn $this->getLevel()>$node->getLevel();\n\t}", "public function hasChildren() {\n return $this->children()->count();\n }", "public function isChild()\n {\n return $this->parentId != null;\n }", "public function has_children($nid)\n\t{\n\t\treturn !empty($this->children[$nid]);\n\t}", "public function isOnlyChild(): bool\n {\n if ($this->isFirstChild() === true && $this->isLastChild() === true) {\n return true;\n } else {\n return false;\n }\n }", "function has_children(){\n\t\tglobal $post;\n\t\t$pages = get_pages('child_of='.$post->ID);\n\t\treturn count($pages);\n\t}", "public function isChild(): bool\n {\n return false;\n }", "function hasChildren($options = null) {\n\t\treturn (bool) $this->numChildren($options);\n\t}", "public function valid()\r\n {\r\n return (current($this->children) !== FALSE);\r\n }", "function has_visible_children() {\n\t\t$this->load_children();\n\t\tforeach ($this->_children as $c) {\n\t\t\tif ($c->visible()) return true;\n\t\t}\n\t\treturn false;\n\t}", "function file_allow_as_child($node) {\n\t\treturn false;\n\t}", "public function isChild()\n {\n if (false === $this->parent_category) {\n return false;\n }\n\n return true;\n\n }", "private function hasChilds(): bool\n {\n return (bool)$this->treePathModelClass::find()\n ->byParentId($this->owner->id)\n ->byChildId($this->owner->getAttribute($this->ownerParentIdAttribute))\n ->count();\n }", "final public function hasChild(CtkBuildable $node) {\n\t\treturn false;\n\t}", "#[ReturnTypeWillChange]\n public function hasChildren()\n {\n return $this->iterator->hasChildren();\n }", "public function isChild() {\n\t\treturn $this->_parent !== null;\n\t}", "public function accepted_children()\r\n\t{\r\n\t\treturn $this->accepted_children;\r\n\t}", "public function hasInvisibleChildren() {\n return $this->children()->invisible()->count();\n }", "function has_children(){\n\tglobal $post;\n\t$pages = get_pages('child_of=' . $post->ID);\n\treturn count($pages);\n}", "function has_children() {\n global $post;\n\n $pages = get_pages('child_of=' . $post->ID);\n return count($pages);\n}", "function has_children() {\n \n global $post;\n\n $pages = get_pages('child_of=' . $post->ID);\n \n return count($pages);\n}", "public function isChild(): bool;", "public function hasChildren( $permissionCheck='view', $member=NULL, $subnodes=TRUE, $_where=array() )\n\t{\n\t\treturn ( $this->childrenCount( $permissionCheck, $member, $subnodes, $_where ) > 0 );\n\t}", "public function hasOrderableChildNodes()\n {\n return $this->hasOrderableChildNodes;\n }", "public function hasParentChildFilter() {\n return $this->_has(4);\n }", "function hasChildren( &$childrenCount, $id = \"this\" )\r\n {\r\n $ret = false;\r\n\r\n if ( $id == \"this\" )\r\n {\r\n $id = $this->ID;\r\n }\r\n\r\n if ( is_numeric( $id ) )\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n $company_type_array = array();\r\n $db->array_query( $company_type_array, \"SELECT ParentID FROM eZContact_CompanyType WHERE ParentID='$id'\" );\r\n $childrenCount = count( $company_type_array );\r\n\r\n if ( $childrenCount != 0 )\r\n {\r\n $ret = true;\r\n }\r\n }\r\n\r\n return $ret;\r\n }", "public function canAdd()\n\t{\n\t\t/* If there is no parent/child relationship and no subnode class, you can't add a child */\n\t\tif( static::$databaseColumnParent === NULL AND static::$subnodeClass === NULL )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn static::restrictionCheck( 'add' );\n\t}", "public function accept(): bool\n {\n return $this->hasChildren() || in_array($this->current()->getFilename(), $this->acceptedFilenames);\n }", "public function hasChildrenMinimumAge() {\n\t\treturn !empty($this->childrenMinimumAge);\n\t}", "public function hasVisibleChildren() {\n return $this->children()->visible()->count();\n }", "function has_children(){\n global $post;\n\n $pages = get_pages('child_of= '. $post->ID);\n return count($pages);\n}", "public function hasChildActions() {}", "public function hasChildren($parent) {\n\t\t// If the left and right are x and x+1, then there is no kids\n\t\tif ($parent['Aco']['rght'] == $parent['Aco']['lft'] +1 ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function check_access() {\n foreach ($this->children as $child) {\n if ($child->check_access()) {\n return true;\n }\n }\n return false;\n }", "public function hasChildNodes( $nodeId )\n {\n return $this->getChildCount( $nodeId ) > 0;\n }", "public function getIsShowChildren();", "public function hasChildren($in, $filter = false)\n {\n $elt = $this->getElement($in);\n\n if ($elt && isset($this->_parent[$elt['v']])) {\n foreach ($this->_parent[$elt['v']] as $val) {\n $v = $this->_tree[$val];\n\n if (($this->_showunsub &&\n !$this->isContainer($v) &&\n !$this->isNamespace($v)) ||\n $this->isSubscribed($v)) {\n /* If skipping special mailboxes, need to check an element\n * for at least one non-special child. */\n if (!$filter ||\n !($this->_cache['filter']['mask'] & self::FLIST_NOSPECIALMBOXES) ||\n !IMP_Mailbox::get($val)->special) {\n return true;\n }\n }\n\n /* So this element is not a visible child, but its children\n * may still be. */\n if ($this->hasChildren($v, $filter)) {\n return true;\n }\n }\n }\n\n return false;\n }", "public function HasChild()\n\t{\n\t\treturn ($this->Child()->count()) ? true : false;\n\t}", "public function hasAnySelectedChildren() : bool\n {\n return $this->hasChildren()\n && $this->children->hasAnySelected();\n }", "public function hasChildren ($selector = null) {\r\n\t\t\r\n\t\tif (!isset($selector)) \r\n\t\t\tforeach ($this as $node) \r\n\t\t\t\tif ($node->childNodes->length === 0) return false;\r\n\t\t\r\n\t\tif (is_object($selector) AND get_class($selector) === 'DOMElement') {\r\n\t\t\t\r\n\t\t\tforeach ($this as $node) {\r\n\t\t\t\t\t\r\n\t\t\t\t$is_parent = false;\r\n\t\t\t\t\r\n\t\t\t\tforeach ($node->childNodes as $child) \r\n\t\t\t\t\tif ($child->isSameNode($selector)) $is_parent = true;\r\n\t\t\t\t\r\n\t\t\t\tif ($is_parent === false) return false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} elseif (is_string($selector)) {\r\n\t\t\t\r\n\t\t\tforeach ($this as $node) {\r\n\t\t\t\t$node = $this->initListObject($node);\r\n\t\t\t\t$this->xml_query = $node->children();\r\n\t\t\t\tif ($this->select($selector, null, XDT::SELECT_FILTER)->length === 0) return false;\r\n\t\t\t}\r\n\t\t} else return false;\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public function testHasChildren()\n {\n $this->assertTrue($this->p1->hasChildren());\n $this->assertTrue($this->p2->hasChildren());\n\n $this->assertTrue($this->c11->hasChildren());\n $this->assertFalse($this->c12->hasChildren());\n\n $this->assertFalse($this->c21->hasChildren());\n $this->assertFalse($this->c22->hasChildren());\n $this->assertFalse($this->c23->hasChildren());\n\n $this->assertFalse($this->c111->hasChildren());\n }", "function has_children(){\n global $post;\n\n $pages = get_pages( 'child_of=' . $post->ID );\n return count($pages);\n}", "function category_has_children() {\n global $wpdb;\n $term = get_queried_object();\n $category_children_check = $wpdb->get_results(\" SELECT * FROM wp_term_taxonomy WHERE parent = '$term->term_id' \");\n if ($category_children_check) {\n return true;\n } else {\n return false;\n }\n}", "public function getIsChildAttribute(){\n return $this->parent_id != NULL;\n }", "public static function has_children( $mf ) {\n\t\treturn ( self::is_microformat( $mf ) && isset( $mf['children'] ) );\n\t}", "public function is_leaf()\n {\n return ( ! $this->has_children());\n }", "function is_child($parent) {\n\tglobal $wp_query;\n\tif ($wp_query->post->post_parent == $parent) { $return = true; } else { $return = false; }\n\treturn $return;\n}", "final public function allowsParent() {\n\t\treturn true;\n\t}", "public function isLeaf()\r\n {\r\n return null === $this->children[static::POSITION_LEFT]\r\n && null === $this->children[static::POSITION_RIGHT];\r\n }", "function gemini_migrate_d5_menu_item_has_children($mid) {\n $result = gemini_migrate_d5_get_menu('D5');\n $menu = gemini_migrate_d5_menu_flat($result);\n\n foreach($menu as $m) {\n if($m['pid'] == $mid) {\n return TRUE;\n }\n }\n\n return FALSE;\n}" ]
[ "0.7782169", "0.7439577", "0.73829496", "0.7340907", "0.7249016", "0.7231493", "0.72313994", "0.72313994", "0.72313994", "0.72313994", "0.718624", "0.71645445", "0.71645445", "0.71645445", "0.71645445", "0.71552926", "0.7153716", "0.71522504", "0.71467394", "0.712846", "0.7123841", "0.7114416", "0.7110181", "0.7110181", "0.71069944", "0.7105497", "0.70942813", "0.70664316", "0.701128", "0.700697", "0.6994139", "0.6991077", "0.6974132", "0.6970932", "0.6916193", "0.69145495", "0.6908275", "0.69053566", "0.6903797", "0.6897874", "0.6895815", "0.68828845", "0.6875206", "0.6872609", "0.6862994", "0.68547577", "0.68295056", "0.67494875", "0.6735623", "0.67221755", "0.67181855", "0.6716523", "0.6659582", "0.66315633", "0.6621253", "0.6603616", "0.65908647", "0.65494037", "0.65312475", "0.6529308", "0.6490575", "0.6483858", "0.64731014", "0.64411956", "0.6403882", "0.6395673", "0.63908046", "0.63894826", "0.6386167", "0.6367744", "0.6332548", "0.63272667", "0.63072246", "0.62691855", "0.62402076", "0.62082016", "0.6134018", "0.6130374", "0.61268395", "0.61117816", "0.61041445", "0.60959136", "0.6092221", "0.6063663", "0.6052628", "0.60473263", "0.60394275", "0.6017704", "0.5992134", "0.5975219", "0.59605515", "0.5937121", "0.59365493", "0.5891449", "0.5885749", "0.58456415", "0.58148926", "0.578851", "0.5768582", "0.57566416" ]
0.7883431
0
Determines if the node has child nodes.
final public function hasChildren() { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasChildNodes() {}", "#[\\ReturnTypeWillChange]\n public function hasChildren()\n {\n return $this->current()->hasChildNodes();\n }", "public function hasChildren()\n {\n return $this->children->count() == 0 ? false : true;\n }", "public function hasChildren()\n {\n return count($this->children) > 0 ? true : false;\n }", "public function hasChildren()\n {\n return !empty($this->children);\n }", "public function hasChildren()\n\t{\n\t\treturn !empty($this->children);\n\t}", "public function hasChildren() : bool\n {\n return $this->children->isNotEmpty();\n }", "public function hasChildren() \n {\n return count($this->children) > 0;\n }", "public function hasChildren(): bool\n {\n return $this->children()->count() > 0;\n }", "public function hasChildren() {\n\t\treturn $this->children()->count() > 0;\n\t}", "public function hasChildren()\n\t{\n\t\treturn ! $this->current()->isLeaf();\n\t}", "public function hasChildren();", "public function hasChildren();", "public function hasChildren();", "public function hasChildren();", "public function hasChildren()\n {\n return (null !== $this->children) && count($this->children);\n }", "function has_child () {\n\t\treturn sizeof($this->children) ? true : false;\n\t}", "public function hasChild()\n {\n return count($this->_children) > 0;\n }", "public function hasChildren(): bool;", "public function hasChildren() {}", "public function hasChildren() {}", "public function hasChildren() {}", "public function hasChildren() {}", "public function hasChildren() {}", "public function hasChildren()\n {\n return $this->childContainer->hasItem();\n }", "public function hasChildren()\n {\n }", "public function hasChildren()\n {\n }", "function isChildren()\n {\n return count($this->children)>0;\n }", "public function hasChildren()\n {\n return $this->myChildren()->exists();\n }", "public function hasChildren() {\n return $this->children()->count();\n }", "public function hasChildren () {\n return ($this->current () instanceof self);\n }", "public function hasChilds() {\n if(is_bool($this->hasChilds)){\n if(($this->hasChilds and empty($this->childs)) or (!$this->hasChilds and !empty($this->childs))){\n return $this->getResource()->hasChilds();\n } else {\n return $this->hasChilds;\n }\n }\n return $this->getResource()->hasChilds();\n }", "public function getHasChildren()\n {\n return (boolean)$this->_has_children;\n }", "final public function hasChildren(): bool\n {\n return $this->valid() && $this->current()->hasPages();\n }", "public function has_children()\n {\n return ($this->size > 2);\n }", "private function has_children() {\n return !empty($this->menuitems);\n }", "final public function hasChild(CtkBuildable $node) {\n\t\treturn false;\n\t}", "public function hasChildren(BaseObject $node)\n {\n return (bool)($node->getRightValue() - $node->getLeftValue() > 1);\n }", "static function cws_has_children() {\n\t\tglobal $post;\n\n\t\t$children = get_pages( array( 'child_of' => $post->ID ) );\n\n\t\tif ( count( $children ) == 0 ) {\n\n\t\t\treturn false;\n\n\t\t} else {\n\n\t\t\treturn true;\n\n\t\t}\n\n\t}", "#[ReturnTypeWillChange]\n public function hasChildren()\n {\n return $this->iterator->hasChildren();\n }", "public function hasChildren()\n {\n $query = 'SELECT category_id FROM '. \\rex::getTablePrefix() .'d2u_machinery_categories '\n .'WHERE parent_category_id = '. $this->category_id;\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n\n if ($result->getRows() > 0) {\n return true;\n }\n\n return false;\n\n }", "private function hasChilds(): bool\n {\n return (bool)$this->treePathModelClass::find()\n ->byParentId($this->owner->id)\n ->byChildId($this->owner->getAttribute($this->ownerParentIdAttribute))\n ->count();\n }", "public function has_children($nid)\n\t{\n\t\treturn !empty($this->children[$nid]);\n\t}", "public function HasChild()\n\t{\n\t\treturn ($this->Child()->count()) ? true : false;\n\t}", "function has_children(){\n\t\tglobal $post;\n\t\t$pages = get_pages('child_of='.$post->ID);\n\t\treturn count($pages);\n\t}", "public function hasChildNodes( $nodeId )\n {\n return $this->getChildCount( $nodeId ) > 0;\n }", "public function element_has_childs($id) {\n global $db;\n if ($db->fetch_atom(\"SELECT count(*) FROM `\".$this->table.\"` WHERE ROOT=\".$this->root.\" AND PARENT=\".$id) > 0)\n return true;\n return false;\n }", "public function isEmpty()\r\n {\r\n return count($this->childs) > 0 ? false : true;\r\n }", "public function hasInvisibleChildren() {\n return $this->children()->invisible()->count();\n }", "public function isOnlyChild(): bool\n {\n if ($this->isFirstChild() === true && $this->isLastChild() === true) {\n return true;\n } else {\n return false;\n }\n }", "function hasChildren($options = null) {\n\t\treturn (bool) $this->numChildren($options);\n\t}", "public function hasListedChildren(): bool\n {\n return $this->children()->listed()->count() > 0;\n }", "public function isChild()\n {\n return $this->parentId != null;\n }", "function has_children(){\n\tglobal $post;\n\t$pages = get_pages('child_of=' . $post->ID);\n\treturn count($pages);\n}", "public function hasDescendants();", "public function isChild() {\n\t\treturn $this->_parent !== null;\n\t}", "public function hasUnlistedChildren(): bool\n {\n return $this->children()->unlisted()->count() > 0;\n }", "public function hasVisibleChildren() {\n return $this->children()->visible()->count();\n }", "public function isChildOnly();", "function has_children() {\n global $post;\n\n $pages = get_pages('child_of=' . $post->ID);\n return count($pages);\n}", "public function hasOrderableChildNodes()\n {\n return $this->hasOrderableChildNodes;\n }", "public function is_empty() {\n\t\treturn (\n\t\t\t! isset( $this->root )\n\t\t\t|| ! $this->root->hasChildNodes()\n\t\t);\n\t}", "function has_children() {\n \n global $post;\n\n $pages = get_pages('child_of=' . $post->ID);\n \n return count($pages);\n}", "public function hasChildFolders()\n {\n return $this->ChildFolders()->exists();\n }", "function has_visible_children() {\n\t\t$this->load_children();\n\t\tforeach ($this->_children as $c) {\n\t\t\tif ($c->visible()) return true;\n\t\t}\n\t\treturn false;\n\t}", "public function hasChildren($id){\n if($this->getTable()\n ->where($this->treeParentRow,$id)\n ->count(\"*\")==0){\n return false;\n }\n else{\n return true;\n }\n }", "public function hasChildren ($selector = null) {\r\n\t\t\r\n\t\tif (!isset($selector)) \r\n\t\t\tforeach ($this as $node) \r\n\t\t\t\tif ($node->childNodes->length === 0) return false;\r\n\t\t\r\n\t\tif (is_object($selector) AND get_class($selector) === 'DOMElement') {\r\n\t\t\t\r\n\t\t\tforeach ($this as $node) {\r\n\t\t\t\t\t\r\n\t\t\t\t$is_parent = false;\r\n\t\t\t\t\r\n\t\t\t\tforeach ($node->childNodes as $child) \r\n\t\t\t\t\tif ($child->isSameNode($selector)) $is_parent = true;\r\n\t\t\t\t\r\n\t\t\t\tif ($is_parent === false) return false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} elseif (is_string($selector)) {\r\n\t\t\t\r\n\t\t\tforeach ($this as $node) {\r\n\t\t\t\t$node = $this->initListObject($node);\r\n\t\t\t\t$this->xml_query = $node->children();\r\n\t\t\t\tif ($this->select($selector, null, XDT::SELECT_FILTER)->length === 0) return false;\r\n\t\t\t}\r\n\t\t} else return false;\r\n\t\t\r\n\t\treturn true;\r\n\t}", "function has_children($node)\n{\n if (isset($node->left) && isset($node->right)) {\n $leaves = [];\n $leaves[] = has_children($node->left);\n $leaves[] = has_children($node->right);\n return $leaves;\n } else if (isset($node->left)) {\n return has_children($node->left);\n } else if (isset($node->right)) {\n return has_children($node->right);\n } else {\n return $node->root;\n }\n}", "public function canHaveChildren() {}", "public function hasAnySelectedChildren() : bool\n {\n return $this->hasChildren()\n && $this->children->hasAnySelected();\n }", "public function isChild(): bool\n {\n return false;\n }", "public function hasChildren($parent) {\n\t\t// If the left and right are x and x+1, then there is no kids\n\t\tif ($parent['Aco']['rght'] == $parent['Aco']['lft'] +1 ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function WantsChildren() {\r\n return false;\r\n }", "function has_children(){\n global $post;\n\n $pages = get_pages('child_of= '. $post->ID);\n return count($pages);\n}", "public function valid()\r\n {\r\n return (current($this->children) !== FALSE);\r\n }", "public function isChild()\n {\n if (false === $this->parent_category) {\n return false;\n }\n\n return true;\n\n }", "public function isRootNode()\n {\n return true;\n }", "public function isChild(): bool;", "public function isChildOf($node)\n\t{\n\t\treturn $this->getLevel()>$node->getLevel();\n\t}", "protected function hasChild(NodeInterface $node)\n {\n $children = $this->getComposedCollection();\n\n return $children->containsKey($node->getNodename());\n }", "public function hasLeftChild()\n\t{\n\t\treturn isset($this->leftChild);\n\t}", "public function testHasChildren()\n {\n $this->assertTrue($this->p1->hasChildren());\n $this->assertTrue($this->p2->hasChildren());\n\n $this->assertTrue($this->c11->hasChildren());\n $this->assertFalse($this->c12->hasChildren());\n\n $this->assertFalse($this->c21->hasChildren());\n $this->assertFalse($this->c22->hasChildren());\n $this->assertFalse($this->c23->hasChildren());\n\n $this->assertFalse($this->c111->hasChildren());\n }", "public static function isChild( $rootNode, $node )\n {\n $db = eZDB::instance();\n $nodeId = $node->attribute( 'node_id' );\n $nodePath = $rootNode->attribute( 'path_string' );\n\n $pathString = \"path_string like '$nodePath%' and \";\n\n $query = \"SELECT ezcontentobject_tree.*\n FROM ezcontentobject_tree,\n ezcontentobject,\n ezcontentclass\n WHERE $pathString\n node_id = $nodeId AND\n ezcontentclass.version=0 AND\n ezcontentobject_tree.contentobject_id = ezcontentobject.id AND\n ezcontentclass.id = ezcontentobject.contentclass_id\";\n\n $nodeListArray = $db->arrayQuery( $query );\n\n return isset( $nodeListArray[0] ) ? true : false;\n }", "public function hasChildren( $permissionCheck='view', $member=NULL, $subnodes=TRUE, $_where=array() )\n\t{\n\t\treturn ( $this->childrenCount( $permissionCheck, $member, $subnodes, $_where ) > 0 );\n\t}", "public function hasContentElement(): bool\n {\n return $this->isChildElementSet(1);\n }", "function has_children(){\n global $post;\n\n $pages = get_pages( 'child_of=' . $post->ID );\n return count($pages);\n}", "final public function hasParent() {\n\t\treturn ($this->_parentNode !== null);\n\t}", "function hasChildren( &$childrenCount, $id = \"this\" )\r\n {\r\n $ret = false;\r\n\r\n if ( $id == \"this\" )\r\n {\r\n $id = $this->ID;\r\n }\r\n\r\n if ( is_numeric( $id ) )\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n $company_type_array = array();\r\n $db->array_query( $company_type_array, \"SELECT ParentID FROM eZContact_CompanyType WHERE ParentID='$id'\" );\r\n $childrenCount = count( $company_type_array );\r\n\r\n if ( $childrenCount != 0 )\r\n {\r\n $ret = true;\r\n }\r\n }\r\n\r\n return $ret;\r\n }", "public function hasChildDocuments() {}", "public function hasParent() {\n\t\treturn $this->parent()->count() == 1;\n\t}", "function domTreeIsEmpty() {\n global $dom;\n $root = $dom->documentElement;\n $isEmpty = !($root->hasChildNodes());\n return $isEmpty;\n}", "public function hasChildren($item_id)\n {\n $this->db->where('parent_item_id', $item_id)->from($this->config->item('database_table_menu'));\n\n return ($this->db->count_all_results() == 0 ? false : true);\n }", "function has_child($id){\n\t\t$rs = $this->db->query('select count(*) from c_dokumen_informasi where parent_id='.$id.'')->result_array();\n\t\t$row = $rs;\n\t\treturn $row[0] > 0 ? true : false;\n\t}", "public function getHasChild()\n {\n $sql = \"SELECT * FROM \" . TB_USAGE . \" WHERE parent_id = \" . $this->db->sqltext($this->mix_id);\n $this->db->query($sql);\n if ($this->db->num_rows() > 0) {\n $this->hasChild = true;\n } else {\n $this->hasChild = false;\n }\n\n return $this->hasChild;\n }", "public function childExists($id) {\n\t\treturn ($this->getChild($id) !== null);\n\t}", "function has_childs($id)\n {\n $childs = $this->get_list_childs($id);\n if(count($childs)>0)\n return true;\n return false;\n }", "function test_get_children()\r\n\t{\r\n\t\t$rnc = 1;\r\n\t\t$depth = 2;\r\n\t\t$npl = 3; \r\n\t\t// Just see if empty nodes are recognized\r\n\t\t$nids = $this->_setup_root_nodes(3);\r\n\t\tforeach($nids AS $rix => $nid)\r\n\t\t{\r\n\t\t\t$this->assertFalse($this->_tree->get_children($nid), 'getChildren returned value for empty rootnode');\r\n\t\t} \r\n\t\t// Now build a little tree to test\r\n\t\t$relation_tree = $this->_create_sub_node($rnc, $depth, $npl);\r\n\r\n\t\t$rootnodes = $this->_tree->get_root_nodes();\r\n\t\t$exp_cct = 0;\r\n\t\t$cct = 0;\r\n\t\tforeach($rootnodes AS $rid => $rootnode)\r\n\t\t{ \r\n\t\t\t// Traverse the tree and verify it against the relationTree\r\n\t\t\t$cct = $cct + $this->_traverse_children($rootnode, $relation_tree, true); \r\n\t\t\t// Calc the expected number of children from lft-rgt\r\n\t\t\t$exp_cct = $exp_cct + floor(($rootnode['r'] - $rootnode['l']) / 2);\r\n\t\t} \r\n\t\t// Test if all created nodes got returned\r\n\t\t$this->assertEqual($exp_cct, $cct, 'Total node count returned is wrong');\r\n\t\treturn true;\r\n\t}", "public function evaluateChildNodes();", "public function hasChild($itemID){\n foreach ($this->children as $node){\n if($node->itemID === $itemID){\n return true;\n }\n\n }\n return false;\n }", "public function isChildSupported();" ]
[ "0.8415711", "0.8315343", "0.82838696", "0.8250786", "0.8247916", "0.8226179", "0.8187223", "0.81460714", "0.81459546", "0.8128275", "0.81024617", "0.80841255", "0.80841255", "0.80841255", "0.80841255", "0.8079649", "0.8049684", "0.8047055", "0.799931", "0.797158", "0.797158", "0.797158", "0.797158", "0.79701173", "0.79220957", "0.7834524", "0.7834524", "0.78247315", "0.78041524", "0.7784754", "0.77266985", "0.7640164", "0.76346016", "0.75612915", "0.7536158", "0.7531376", "0.7526376", "0.75013375", "0.7491019", "0.74162567", "0.7397093", "0.7317735", "0.7304757", "0.72809815", "0.71665365", "0.7144873", "0.7107037", "0.70945936", "0.70939726", "0.7074352", "0.7062897", "0.7061554", "0.7044318", "0.6922992", "0.6916038", "0.6910995", "0.6892276", "0.6883657", "0.6868132", "0.6856014", "0.68429476", "0.6837192", "0.6836875", "0.6814864", "0.6786142", "0.6780355", "0.6775572", "0.6742656", "0.67288953", "0.66862607", "0.6657504", "0.6646805", "0.6610301", "0.659771", "0.6586281", "0.657751", "0.6569619", "0.6565117", "0.6561264", "0.6544801", "0.6533514", "0.65248877", "0.64990556", "0.64944744", "0.6480312", "0.6458847", "0.64582765", "0.64535743", "0.63881755", "0.63529086", "0.63417137", "0.6338338", "0.63379645", "0.6337239", "0.6320245", "0.63195866", "0.6317627", "0.62699074", "0.6268532", "0.6264066" ]
0.814092
9
Determines if a node is a child of this node.
final public function hasChild(CtkBuildable $node) { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isChild()\n {\n return $this->parentId != null;\n }", "public function isChild() {\n\t\treturn $this->_parent !== null;\n\t}", "public function isChild()\n {\n if (false === $this->parent_category) {\n return false;\n }\n\n return true;\n\n }", "public function isOnlyChild(): bool\n {\n if ($this->isFirstChild() === true && $this->isLastChild() === true) {\n return true;\n } else {\n return false;\n }\n }", "public function hasChild()\n {\n return count($this->_children) > 0;\n }", "public function isChildOf($node)\n\t{\n\t\treturn $this->getLevel()>$node->getLevel();\n\t}", "function has_child () {\n\t\treturn sizeof($this->children) ? true : false;\n\t}", "public function isChild(): bool\n {\n return false;\n }", "public function isChild(): bool;", "public function isChildOnly();", "public static function isChild( $rootNode, $node )\n {\n $db = eZDB::instance();\n $nodeId = $node->attribute( 'node_id' );\n $nodePath = $rootNode->attribute( 'path_string' );\n\n $pathString = \"path_string like '$nodePath%' and \";\n\n $query = \"SELECT ezcontentobject_tree.*\n FROM ezcontentobject_tree,\n ezcontentobject,\n ezcontentclass\n WHERE $pathString\n node_id = $nodeId AND\n ezcontentclass.version=0 AND\n ezcontentobject_tree.contentobject_id = ezcontentobject.id AND\n ezcontentclass.id = ezcontentobject.contentclass_id\";\n\n $nodeListArray = $db->arrayQuery( $query );\n\n return isset( $nodeListArray[0] ) ? true : false;\n }", "function isChildren()\n {\n return count($this->children)>0;\n }", "function is_child($parent) {\n\tglobal $wp_query;\n\tif ($wp_query->post->post_parent == $parent) { $return = true; } else { $return = false; }\n\treturn $return;\n}", "public function hasChildren () {\n return ($this->current () instanceof self);\n }", "public function hasChildNodes() {}", "public function HasChild()\n\t{\n\t\treturn ($this->Child()->count()) ? true : false;\n\t}", "public function hasChildren()\n {\n return count($this->children) > 0 ? true : false;\n }", "public function hasChildren(BaseObject $node)\n {\n return (bool)($node->getRightValue() - $node->getLeftValue() > 1);\n }", "public function element_is_child($id_child, $id_parent) {\n $parent = $this->element_read($id_parent);\n $child = $this->element_read($id_child);\n if (($child[\"LFT\"] > $parent[\"LFT\"]) && ($child[\"RGT\"] < $parent[\"RGT\"]))\n return true;\n return false;\n }", "public function hasChild($itemID){\n foreach ($this->children as $node){\n if($node->itemID === $itemID){\n return true;\n }\n\n }\n return false;\n }", "public function hasChildren()\n {\n return $this->children->count() == 0 ? false : true;\n }", "public function hasChildren() \n {\n return count($this->children) > 0;\n }", "public function isChildSupported();", "#[\\ReturnTypeWillChange]\n public function hasChildren()\n {\n return $this->current()->hasChildNodes();\n }", "public function isChildOf(BaseObject $node, BaseObject $parent_node)\n {\n return ($node->getParentIdValue() === $parent_node->getPrimaryKey()\n && $node->getScopeIdValue() === $parent_node->getScopeIdValue());\n }", "public function is_child( $page_id ){\n\t\tglobal $post;\n\t\tif( is_page() && ( $post->post_parent == $page_id ) ){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function hasChildren(): bool;", "public function hasChildren()\n {\n return !empty($this->children);\n }", "public function isCurrentChild(): bool;", "public function getIsChildAttribute(){\n return $this->parent_id != NULL;\n }", "function isChildOrSubChildOf($refArticle) {\n\t\tif (is_numeric($refArticle)) {\n\t\t\t$refArticle = polarbear_article::getInstance($refArticle);\n\t\t}\n\t\t$isChild = false;\n\t\t// loop our way up until we reach the top article or refArticle\n\t\t// $refArticle\n\t\t$doLoop = true;\n\t\t$tmpA = $this;\n\t\twhile ($doLoop) {\n\t\t\t// get parent article\n\t\t\t$tmpA = $tmpA->parent();\n\t\t\tif ($tmpA == null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t#echo \"<br><br>tmpA:\".$tmpA->getTitleArticle();\n\t\t\t#echo \"<br> refArticle->getId():\" . $refArticle->getId();\n\t\t\t#echo \"<br> tmpA->getId():\" . $tmpA->getId();\n\t\t\t#echo \"<br> tmpA->getParentId():\"; var_dump($tmpA->getParentId());\n\t\t\t// check if the parent article is the refArticle. if it is, that means that $this is a child of $refArticle\n\t\t\tif ($tmpA->getId() == $refArticle->getId()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t// if parent is null = is at top level\n\t\t\tif ($tmpA->getParentId()==null) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}\n\n\t\tpb_pqp_log_speed(\"article isChildOrSubChildOf()\");\n\n\t\treturn false;\n\t}", "public function hasChildren()\n\t{\n\t\treturn !empty($this->children);\n\t}", "public function has_children()\n {\n return ($this->size > 2);\n }", "public function hasChildren()\n {\n return $this->childContainer->hasItem();\n }", "public function hasChildren();", "public function hasChildren();", "public function hasChildren();", "public function hasChildren();", "public function getHasChildren()\n {\n return (boolean)$this->_has_children;\n }", "public function hasChildren()\n\t{\n\t\treturn ! $this->current()->isLeaf();\n\t}", "public function getHasChild()\n {\n $sql = \"SELECT * FROM \" . TB_USAGE . \" WHERE parent_id = \" . $this->db->sqltext($this->mix_id);\n $this->db->query($sql);\n if ($this->db->num_rows() > 0) {\n $this->hasChild = true;\n } else {\n $this->hasChild = false;\n }\n\n return $this->hasChild;\n }", "public function hasChildren(): bool\n {\n return $this->children()->count() > 0;\n }", "public function hasChilds() {\n if(is_bool($this->hasChilds)){\n if(($this->hasChilds and empty($this->childs)) or (!$this->hasChilds and !empty($this->childs))){\n return $this->getResource()->hasChilds();\n } else {\n return $this->hasChilds;\n }\n }\n return $this->getResource()->hasChilds();\n }", "public function childExists ( $nodeId ) {\n\n return array_key_exists($nodeId, $this->getChilds());\n }", "public function hasChildren() : bool\n {\n return $this->children->isNotEmpty();\n }", "public function hasChildren()\n {\n return (null !== $this->children) && count($this->children);\n }", "protected function hasChild(NodeInterface $node)\n {\n $children = $this->getComposedCollection();\n\n return $children->containsKey($node->getNodename());\n }", "function is_child($pageID) { \n\tglobal $post; \n\tif( is_page() && ($post->post_parent==$pageID) ) {\n return true;\n\t} else { \n return false; \n\t}\n}", "public function hasChildren() {\n\t\treturn $this->children()->count() > 0;\n\t}", "public function hasLeftChild()\n\t{\n\t\treturn isset($this->leftChild);\n\t}", "public function child($index = 0)\r\n {\r\n if (is_null($index)) {\r\n return $this->childs; \r\n }\r\n if (array_key_exists($index, $this->childs)) {\r\n return $this->childs[$index];\r\n }\r\n return false;\r\n }", "public function hasChildren()\n {\n $query = 'SELECT category_id FROM '. \\rex::getTablePrefix() .'d2u_machinery_categories '\n .'WHERE parent_category_id = '. $this->category_id;\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n\n if ($result->getRows() > 0) {\n return true;\n }\n\n return false;\n\n }", "public function childExists($id) {\n\t\treturn ($this->getChild($id) !== null);\n\t}", "private function hasChilds(): bool\n {\n return (bool)$this->treePathModelClass::find()\n ->byParentId($this->owner->id)\n ->byChildId($this->owner->getAttribute($this->ownerParentIdAttribute))\n ->count();\n }", "public function isLastChild(): bool\n {\n return $this->is_last_child;\n }", "abstract public function isNode ( );", "public function hasChildNodes( $nodeId )\n {\n return $this->getChildCount( $nodeId ) > 0;\n }", "public function hasChildren() {}", "public function hasChildren() {}", "public function hasChildren() {}", "public function hasChildren() {}", "public function hasChildren() {}", "public function has_children($nid)\n\t{\n\t\treturn !empty($this->children[$nid]);\n\t}", "public function hasChild($type)\n {\n foreach ($this->children as $child) {\n if ($child->getType() === $type) {\n return true;\n }\n }\n return false;\n }", "final public function hasChildren() {\n\t\treturn false;\n\t}", "public function getHasActiveChild(): bool\n {\n return $this->hasActiveChild;\n }", "public function element_has_childs($id) {\n global $db;\n if ($db->fetch_atom(\"SELECT count(*) FROM `\".$this->table.\"` WHERE ROOT=\".$this->root.\" AND PARENT=\".$id) > 0)\n return true;\n return false;\n }", "public function hasChildren()\n {\n return $this->myChildren()->exists();\n }", "public function isChildOf($page) {\n if(!is_a($page, 'Page')) $page = page($page);\n\n return $this->is($page) ? false : $this->parent->is($page);\n }", "function ep_is_child_of($page_id) {\n\tglobal $post;\n\t$is_child = false;\n\t$parents = get_post_ancestors($post);\n\tif ($parents) {\n\t\tforeach ($parents as $one_parent_id) {\n\t\t\tif ($one_parent_id == $page_id) {\n\t\t\t\t$is_child = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn $is_child;\n}", "public function isChildOf( $childId, $parentId )\n {\n $nodeId = $this->getParentId( $childId );\n $parentId = (string) $parentId;\n return $parentId === $nodeId;\n }", "static function cws_has_children() {\n\t\tglobal $post;\n\n\t\t$children = get_pages( array( 'child_of' => $post->ID ) );\n\n\t\tif ( count( $children ) == 0 ) {\n\n\t\t\treturn false;\n\n\t\t} else {\n\n\t\t\treturn true;\n\n\t\t}\n\n\t}", "public function hasChildren()\n {\n }", "public function hasChildren()\n {\n }", "protected function isChildProcess()\n\t{\n\t\tglobal $isChildProcess;\n\n\t\treturn isset($isChildProcess) && $isChildProcess;\n\t}", "private function has_children() {\n return !empty($this->menuitems);\n }", "public function hasRightChild()\n\t{\n\t\treturn isset($this->rightChild);\n\t}", "public function isDescendantOf( $childId, $parentId )\n {\n $parentId = (string) $parentId;\n $nodeId = $childId;\n do\n {\n $nodeId = $this->getParentId( $nodeId );\n if ( $parentId === $nodeId )\n {\n return true;\n }\n } while ( $nodeId !== null );\n return false;\n }", "public function hasChild($name)\n\t{\n\t\treturn $this->_auth->hasItemChild($this->_calendarId,$this->_name,$name);\n\t}", "public function is_child($target)\n {\n if ( ! ($target instanceof $this))\n $target = $this->factory_item($target);\n elseif ( !$target->loaded )\n $target->reload();\n\n return ((int) $this->parent_key === (int) $target->primary_key);\n }", "public function isFirstChild(): bool\n {\n return $this->is_first_child;\n }", "protected function isNthChild($node, $value, $reverse = false, $byType = false): bool\n\t{\n\t\t[$groupSize, $elementInGroup] = Util::parseAnB($value);\n\t\t$parent = $node->parentNode;\n\t\tif (empty($parent)\n\t\t\t|| ($groupSize === 0 && $elementInGroup === 0)\n\t\t\t|| ($groupSize > 0 && $elementInGroup > $groupSize)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// First we need to find the position of $node in other elements.\n\t\tif ($reverse) {\n\t\t\t$pos = $this->nodePositionFromEnd($node, $byType);\n\t\t} else {\n\t\t\t$pos = $this->nodePositionFromStart($node, $byType);\n\t\t}\n\n\t\t// If group size is 0, we just check to see if this\n\t\t// is the nth element:\n\t\tif ($groupSize === 0) {\n\t\t\treturn $pos === $elementInGroup;\n\t\t}\n\n\t\t// Next, we normalize $elementInGroup\n\t\tif ($elementInGroup < 0) {\n\t\t\t$elementInGroup = $groupSize + $elementInGroup;\n\t\t}\n\t\t$prod = ($pos - $elementInGroup) / $groupSize;\n\n\t\treturn is_int($prod) && $prod >= 0;\n\t}", "function custom_is_child($pid)\n{\n global $post; // load details about this page\n $anc = get_post_ancestors($post->ID);\n foreach ($anc as $ancestor) {\n if (is_page() && $ancestor == $pid) {\n return true;\n }\n }\n return false; // we're elsewhere\n}", "public function isGrandChild($a_startnode_id,$a_querynode_id)\n\t{\n\t\treturn $this->getRelation($a_startnode_id, $a_querynode_id) == self::RELATION_PARENT;\n\t}", "public function is_leaf()\n {\n return ( ! $this->has_children());\n }", "function is_child_of($theparentid){\n\t$childpages = get_pages('child_of='.$theparentid);\n\tforeach($childpages as $thepage){ \n\t\tif( is_page($thepage->ID)){\n\t\t\treturn true;\n\t\t}\n\t\n\t} // end for each \n\treturn false;\n}", "public function hasOrderableChildNodes()\n {\n return $this->hasOrderableChildNodes;\n }", "abstract public function hasItemChild($itemName, $childName);", "public function hasParent(BaseObject $node)\n {\n return (bool)$node->getParentIdValue();\n }", "public function isDescendantOf(BaseObject $descendant_node, BaseObject $node)\n {\n return (\n $node->getLeftValue() <= $descendant_node->getLeftValue()\n && $node->getRightValue() >= $descendant_node->getRightValue()\n && $node->getScopeIdValue() === $descendant_node->getScopeIdValue()\n );\n }", "public static function hasChilds($id)\n {\n $result = self::findAll([\n 'id_parent' => $id\n ]);\n if (!$result) {\n return false;\n } else {\n return true;\n }\n }", "final public function hasChildren(): bool\n {\n return $this->valid() && $this->current()->hasPages();\n }", "public function isParent();", "public function remove_child(SBBCodeParser_Node $child)\r\n\t{\r\n\t\t$key = array_search($what, $this->children);\r\n\r\n\t\tif($key === false)\r\n\t\t\treturn false;\r\n\r\n\t\t$this->children[$key]->set_parent();\r\n\t\tunset($this->children[$key]);\r\n\t\treturn true;\r\n\t}", "public function isRootNode()\n {\n return true;\n }", "public function isLeaf()\r\n {\r\n return null === $this->children[static::POSITION_LEFT]\r\n && null === $this->children[static::POSITION_RIGHT];\r\n }", "public function isChildOfMine(Route $route)\n {\n return (boolean) $this->children[$route->getName()];\n }", "public function isDescendantOf($post): bool\n {\n $givenPost = $post instanceof static ? $post->wpPost() : get_post($post);\n $myAncestors = $this->ancestors;\n $isDescendant = $myAncestors->search(function (Post $myAncestor) use ($givenPost) {\n return $givenPost->ID === $myAncestor->id;\n });\n\n return $isDescendant !== false;\n }", "function has_child($id){\n\t\t$rs = $this->db->query('select count(*) from c_dokumen_informasi where parent_id='.$id.'')->result_array();\n\t\t$row = $rs;\n\t\treturn $row[0] > 0 ? true : false;\n\t}", "public function canApply()\n {\n $parent = $this->getSiblingNode()->findParentNode();\n $nodeType = $this->getSubject()->getNodeType();\n\n return NodeInfoHelper::isNodeTypeAllowedAsChildNode($parent, $nodeType);\n }" ]
[ "0.78043455", "0.769076", "0.73376924", "0.7164119", "0.7136918", "0.7039642", "0.70053774", "0.699184", "0.68647105", "0.66530263", "0.6577549", "0.6538332", "0.65284574", "0.6517924", "0.6473631", "0.6458456", "0.6456004", "0.6440618", "0.6405818", "0.6383382", "0.6307312", "0.62658995", "0.6241864", "0.622609", "0.6199509", "0.61954063", "0.61896193", "0.615999", "0.61523724", "0.61485755", "0.6143557", "0.61249244", "0.61167604", "0.60953534", "0.60921353", "0.60921353", "0.60921353", "0.60921353", "0.60809076", "0.6079503", "0.6071358", "0.60570127", "0.60511786", "0.6050335", "0.60201895", "0.6013746", "0.5988177", "0.59866583", "0.5982654", "0.5977625", "0.59630513", "0.5949254", "0.5942889", "0.59373444", "0.5934296", "0.59273136", "0.5925796", "0.5910949", "0.5910949", "0.5910949", "0.5910949", "0.5909865", "0.5902724", "0.5900941", "0.5879701", "0.5877274", "0.5868913", "0.58583266", "0.5843029", "0.5838889", "0.5833284", "0.5829152", "0.58279127", "0.58279127", "0.58180493", "0.5806214", "0.5801188", "0.57991785", "0.5792707", "0.57759917", "0.57614374", "0.5754534", "0.570782", "0.57055384", "0.56873566", "0.56817186", "0.5678106", "0.56605655", "0.5631409", "0.5621491", "0.55900323", "0.5588214", "0.558344", "0.55825347", "0.5548824", "0.55478805", "0.5542042", "0.5537321", "0.5535137", "0.55228525" ]
0.68469954
9
Returns the child nodes of this node as an array.
final public function getChildren() { return array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getChildNodes() : array {\n return $this->childNodes;\n }", "public function children()\n {\n return (array) $this->children;\n }", "public function getChildren(): array {\n return iterator_to_array(clone $this->children);\n }", "public function getChildren(): array\n {\n return $this->children->toArray();\n }", "public function getChildNodes()\n {\n return array_values($this->getChildNodesById());\n }", "public function get_children() : array\n {\n return $this->children;\n }", "public function children()\n {\n $children = $this->getAttribute('children') ?: [];\n\n if ($children && ! is_array($children) && ! ($children instanceof Collection)) {\n return (array) $children;\n }\n\n return $children;\n }", "public function getChildren()\r\n\t{\r\n\t\treturn $this->childrenNodes;\r\n\t}", "public function getChildren(): array;", "public function getAllChildNode()\r\n {\r\n return $this->_childNodes;\r\n }", "public function children (){\n\t\treturn array();\n\t}", "public function children()\n {\n $this->buildTree();\n return $this->childrenInternal();\n }", "public function getChildNodes() {}", "public function getChildNodes() {}", "public function get_children() {\n\t\treturn $this->children;\n\t}", "protected function getIteratorArray()\n {\n return $this->getChildren();\n }", "public function getChildren() \n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren() {\n\t\treturn $this->children;\n\t}", "public function getChildren() {\n\t\treturn $this->children;\n\t}", "public function getChildren()\n {\n return $this->children;\n }", "public function children()\r\n\t{\r\n\t\treturn $this->children;\r\n\t}", "public function getChildren()\n\t{\n\t\treturn $this->children;\n\t}", "public function getChildren()\n\t{\n\t\treturn $this->children;\n\t}", "public function getChildren()\n {\n return $this->_children;\n }", "public function getChildren() {\n\t\treturn $this->_children;\n\t}", "public function getChildNodes();", "function children() {\n\t\t$this->load_children();\n\t\treturn $this->_children;\n\t}", "public function getChilds() {\n return $this->__childs;\n }", "public function getChilds()\n {\n return $this->childs;\n }", "public function get_child_nodes_recursive() {\n\t\t$nodes = array();\n\n\t\tforeach ( $this->child_nodes as $node ) {\n\t\t\t$nodes[ $node->get_code() ] = $node;\n\n\t\t\t$nodes = array_merge( $nodes, $node->get_child_nodes_recursive() );\n\t\t}\n\n\t\treturn $nodes;\n\t}", "public function get_children();", "public function getChildren(): ?array;", "public function children() {\n return $this->descendants(1);\n }", "public function children()\n\t{\n\t\treturn $this->descendants(1);\n\t}", "public function getChildren() {\n $childNodes = $this->getNode()->getChildren();\n $children = array();\n foreach ($childNodes as $childNode) {\n $child = $childNode->getPage($this->getLang());\n if ($child) {\n $children[] = $child;\n }\n }\n return $children;\n }", "public function getChildren()\n {\n $query = 'SELECT category_id FROM '. \\rex::getTablePrefix() .'d2u_machinery_categories '\n .'WHERE parent_category_id = '. $this->category_id;\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n\n $children = [];\n for ($i = 0; $i < $result->getRows(); ++$i) {\n $children[] = new self((int) $result->getValue('category_id'), $this->clang_id);\n $result->next();\n }\n return $children;\n }", "public function loadChildNodes()\n {\n $ids = $this->_cache->getBackend()->getChildNodeIds($this);\n return $this->setChildNodeIds($ids);\n }", "public function Children()\n {\n return $this->childrenOfSection('');\n }", "protected function convertChildrenToArray()\n {\n $data = array();\n foreach ($this->getChildren() as $name => $child) {\n $data = array_merge($data, $this->convertChildToArray($name, $child));\n }\n return $data;\n }", "public function getNodes(): array\n {\n return $this->nodes;\n }", "public function getNodes(): array\n {\n return $this->nodes;\n }", "public function get_all(): array\n {\n return $this->nodes;\n }", "public function getChildElements() {}", "function getChildNodes() ;", "public function GetChildren() {\n\t\treturn $this->Children;\n\t}", "public function getAsArray() {\n if($this->xmldb->xml) {\n $vals = array();\n $nodeList = $this->xmldb->xml->documentElement->childNodes;\n foreach ($nodeList as $node) {\n if (is_a($node, \"DOMElement\")) {\n #extract the child text value from each node\n $vals[] = $node->firstChild->nodeValue;\n }\n }\n \n return $vals;\n }\n }", "protected function convertChildrenToArray(): array\n {\n return $this->children()->keys();\n }", "public function getChildren(): Collection\n {\n return $this->children;\n }", "public function getChildren(): Collection\n {\n return $this->children;\n }", "public function allChildrenElements() {\n\t\treturn $this->childrenElements()->with('allChildrenElements');\n\t}", "#[\\ReturnTypeWillChange]\n public function getChildren()\n {\n $element = $this->current();\n $childContext = $this->elementProcessor->processElementChildren(\n $element,\n $this->contexts[$this->contextMap[$this->key()]]\n );\n return new static($element->childNodes, $childContext, $this->elementProcessor);\n }", "public function Children()\n {\n return $this->Root->childrenOfSection($this->URLSegment);\n }", "public function as_array() {\n return $this->elements;\n }", "public function getChildren()\n {\n // Singleton: both getChild and getChildren are called\n // by the Sabre_DAV_Browser_Plugin\n if (empty($this->children)) {\n $storedFiles = $this->fileStorage->get_directory_files(\n $this->storedFile->get_contextid(),\n $this->storedFile->get_component(),\n $this->storedFile->get_filearea(),\n $this->itemId,\n $this->storedFile->get_filepath(),\n false, // recursive\n true, // includedirs\n 'filepath ASC, filename ASC' // sort\n );\n\n foreach ($storedFiles as $storedFile) {\n if ($storedFile->is_directory()) {\n $this->children[][] = new DAVRootPoolDirectory($storedFile);\n } else {\n $this->children[][] = new DAVRootPoolFile($storedFile);\n }\n }\n }\n\n return $this->children;\n }", "function _gatherChildren($nid) {\n\t$return = array();\n\t$node =& $this->_allNodes[$nid];\n\tif (is_array ($this->_allParent[$node->id])) {\n\t\tforeach ($this->_allParent[$node->id] as $nodeZ) {\n\t\t$z =& $this->_allNodes[$nodeZ];\n\t\t// We found a child\n\t\t$this->_nodeArrayizeData($z);\n\t\t// Check for references\n\t\t$this->_makeReferences($z);\n\t\t// Merge with the big array we're returning\n\t\t// The big array being all the data of the children of our parent node\n\t\t$return = $this->_array_kmerge($return,$z->data);\n\t\t}\n\t}\n\treturn $return;\n\t}", "public function getChildPages(): array\n {\n return $this->childPages;\n }", "public function getChildNodesById()\n {\n if (! $this->_allChildrenKnown) {\n $this->loadChildNodes();\n }\n return $this->_childNodesById;\n }", "public function getKnownChildNodes()\n {\n return $this->_childNodesById;\n }", "public function getChildren()\n\t{\n\t\t$children = $this->current()->getChildren();\n\n\t\t// Using ref as per PHP source\n\t\tif (empty($this->ref))\n\t\t{\n\t\t\t$this->ref = new \\ReflectionClass($this);\n\t\t}\n\n\t\treturn $this->ref->newInstance($children);\n\t}", "public function childrenElements() {\n\t\treturn $this->hasMany('\\App\\Hierarchy', 'parent_id', 'id');\n\t}", "public function getChildren() {}", "public function getChildren() {}", "public function getChildren() {}", "public function getChildrenIterative(): array\n {\n //not using $this->getTopLevelParents, it would be concerns violation\n $topLevelParents = $this->categoryRepository->getTopLevelParents();\n\n $results[0] = $topLevelParents;\n $parents = $topLevelParents;\n\n $results = $this->iterate($results);\n\n return $results;\n }", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "#[ReturnTypeWillChange]\n public function getChildren()\n {\n return new self($this->iterator->getChildren(), $this->excluded);\n }", "public function elements()\n {\n return [];\n }", "public function getChildren() {\n\t\t$children = $this->categoryRepository->findAllChildren($this);\n\t\treturn $children;\n\t}", "public function getChildren () {\n return $this->current ();\n }", "public function getAllNodes(): array\n\t{\n\t\t/** @var Node[] $nodes */\n\t\t$nodes = $this->nodeAttrIndex->getAllElements();\n\t\treturn $nodes;\n\t}", "function descendants() {\n\t\t$out = array();\n\t\t$this->get_descendants($out);\n\t\treturn $out;\n\t}", "public function values () {\r\n\t\t\r\n\t\t$values = array();\r\n\t\tforeach ($this as $node) {\r\n\t\t\t$values[] = $node->nodeValue;\r\n\t\t}\r\n\t\t\r\n\t\treturn $values;\r\n\t}", "public function childrenRecursive()\n\t\t{\n\t\t\treturn $this->children()->with('childrenRecursive');\n\t\t}", "protected function getChildEntities() {\n\n\t\treturn array();\n\t}", "public function toArray()\n {\n return $this->_elements;\n }", "public function getNodes()\n {\n return $this->nodes;\n }", "public function getNodes()\n {\n return $this->nodes;\n }", "public function toArray()\n {\n return $this->elements;\n }", "public function getChilds();", "function get_children() {\n\t\t\n\t\tif (!is_array($this->children)) :\n\t\t\n\t\t\t$this->children = array();\n\t\t\t\n\t\t\tif ($this->is_type('variable')) $child_post_type = 'product_variation'; else $child_post_type = 'product';\n\t\t\n\t\t\tif ( $children_products =& get_children( 'post_parent='.$this->id.'&post_type='.$child_post_type.'&orderby=menu_order&order=ASC' ) ) :\n\n\t\t\t\tif ($children_products) foreach ($children_products as $child) :\n\t\t\t\t\t\n\t\t\t\t\tif ($this->is_type('variable')) :\n\t\t\t\t\t\t$child->product = &new woocommerce_product_variation( $child->ID );\n\t\t\t\t\telse :\n\t\t\t\t\t\t$child->product = &new woocommerce_product( $child->ID );\n\t\t\t\t\tendif;\n\t\t\t\t\t\n\t\t\t\tendforeach;\n\t\t\t\t$this->children = (array) $children_products;\n\t\t\tendif;\n\t\t\t\n\t\tendif;\n\t\t\n\t\treturn $this->children;\n\t}", "public function getNodes(){\n\t\treturn $this->nodes;\n\t}", "public function children ($selector = null) { \r\n\t\t\r\n\t\t$l = new XDTNodeList();\r\n\t\t\tforeach ($this as $node) \r\n\t\t\t\tforeach ($node->childNodes as $child) $l->add($child);\r\n\t\t\t\r\n\t\tif (!isset($selector)) return $l;\r\n\t\t\r\n\t\t$this->xml_query = $l;\r\n\t\treturn $this->select($selector, null, XDT::SELECT_FILTER);\r\n\t}", "public function getChildren()\n {\n return $this->inheritanceList;\n }", "public function getResults()\n {\n if ($this->_children === null) {\n $this->_children = $this->getFreshResults();\n }\n return $this->_children;\n }" ]
[ "0.8418066", "0.81136", "0.80979496", "0.8087373", "0.8038098", "0.8009374", "0.78061616", "0.75933874", "0.75644505", "0.7498086", "0.7445753", "0.744398", "0.7396642", "0.7396383", "0.73725575", "0.7346226", "0.73402417", "0.7333206", "0.7333206", "0.7333206", "0.7333206", "0.7333206", "0.7333206", "0.7333206", "0.7333206", "0.73171455", "0.73171455", "0.7317097", "0.7315887", "0.73128384", "0.73128384", "0.730738", "0.72576344", "0.72455174", "0.7204123", "0.7179724", "0.71793485", "0.7163022", "0.71489894", "0.7148162", "0.7127581", "0.7118416", "0.7058538", "0.7031972", "0.694276", "0.6935736", "0.692339", "0.691411", "0.691411", "0.68912756", "0.6834543", "0.68293816", "0.681013", "0.6789404", "0.6773717", "0.67705286", "0.67705286", "0.67551243", "0.6743912", "0.6658648", "0.66516614", "0.66450244", "0.66435957", "0.66388065", "0.662395", "0.6606739", "0.660288", "0.65903056", "0.65803707", "0.65803707", "0.65803707", "0.6576967", "0.65519917", "0.65519917", "0.65519917", "0.65519917", "0.65519917", "0.65519917", "0.65519917", "0.65519917", "0.65519917", "0.6542378", "0.65415806", "0.6532939", "0.6529965", "0.6522063", "0.6520335", "0.64957136", "0.64551187", "0.6449842", "0.6433606", "0.64314747", "0.64314747", "0.6429968", "0.64285415", "0.6399968", "0.63971746", "0.63933927", "0.6390229", "0.6381379" ]
0.7592311
8
Returns the first child node of this node.
final public function getFirst() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstChild() {\n\t\t$children = $this->children();\n\t\tif (sizeof($children>0)) {\n\t\t\treturn $children[0];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public function firstChild()\n {\n $node = $this->node->firstChild;\n\n if ($node === null) {\n return null;\n }\n\n return new Element($node);\n }", "public function &firstChild()\n {\n $ret = null;\n if (! count($this->_children)) {\n return $ret;\n }\n return $this->_children[0];\n }", "function &firstChild () {\r\n $ret = null;\r\n if (!count ($this->_children)) {\r\n return $ret;\r\n }\r\n return $this->_children[0];\r\n }", "public function getFirstChild();", "public function getFirstNode()\n {\n return $this->firstNode;\n }", "public function first () { return new XDTNodeList($this[0]); }", "public function first()\n {\n return count($this->nodes)?$this->nodes[0]:null;\n }", "public function getChild()\n {\n return $this->child;\n }", "public function getFirstChildByName($name) {\n foreach($this->__childs as $child) {\n if ($child->getName() == $name) {\n return $child;\n }\n }\n return null; \n }", "public function getFirst()\n {\n return (\n is_null($this->parent) ?\n null :\n $this->parent->content[0]\n );\n }", "public function get_child($position) : HTMLNode\n {\n return $this -> children -> get($position);\n }", "public function getChild($c){\n if($this->childNodes[$c] != NULL){\n return $this->childNodes[$c];\n }\n else{\n return NULL;\n }\n }", "public function getFChild()\n {\n return $this->f_child;\n }", "public function getChild($id){\n foreach ($this->children as $node){\n if($node->itemID === $id){\n return $node;\n }\n }\n return null;\n }", "public function getLeftChild()\n\t{\n\t\treturn $this->leftChild;\n\t}", "public function getPChild()\n {\n return $this->p_child;\n }", "public function getFirstRootNode()\n {\n $qb = $this->_qbFactory\n ->getRootNodeQueryBuilder()\n ->setMaxResults(1);\n try {\n return $qb->getQuery()->getSingleResult();\n } catch (NoResultsException $e) {\n return null;\n }\n }", "public function getLastChild()\n\t{\n\t\treturn $this->children[count($this->children)-1];\n\t}", "public function getRootNode() : Node\n {\n return $this->rootNode;\n }", "public function getChildByIndex($index)\n {\n $index = intval($index);\n\n return ((null !== $this->children) && array_key_exists($index, $this->children)) ? $this->children[$index] : null;\n }", "public function isFirstChild(): bool\n {\n return $this->is_first_child;\n }", "protected function getChild(string $nodename): ?NodeInterface\n {\n $children = $this->getComposedCollection();\n\n return $children->get($nodename);\n }", "public function getAllChildNode()\r\n {\r\n return $this->_childNodes;\r\n }", "public function child($index = 0)\r\n {\r\n if (is_null($index)) {\r\n return $this->childs; \r\n }\r\n if (array_key_exists($index, $this->childs)) {\r\n return $this->childs[$index];\r\n }\r\n return false;\r\n }", "public function lastChild()\n {\n $node = $this->node->lastChild;\n\n if ($node === null) {\n return null;\n }\n\n return new Element($node);\n }", "public function first() {\n return $this->nth( 0 );\n }", "public function FirstChildOf($item)\n {\n if ($item)\n {\n $sql = Access::SqlBuilder();\n $tbl = PageContent::Schema()->Table();\n $where = $sql->Equals($tbl->Field('Parent'), $sql->Value($item->GetID()))\n ->And_($sql->IsNull($tbl->Field('Previous')));\n \n return PageContent::Schema()->First($where);\n }\n else\n {\n return $this->TopMost();\n }\n }", "public function root() {\n $node = $this;\n while ($parent = $node->getParent())\n $node = $parent;\n return $node;\n }", "public function current ( ) {\n\n return current($this->_childs);\n }", "public function retrieveFirstChild(BaseObject $node)\n {\n $c = new Criteria();\n $c->add(self::getColumnConstant(get_class($node), 'left'), $node->getLeftValue() + 1, Criteria::EQUAL);\n $c->add(self::getColumnConstant(get_class($node), 'scope'), $node->getScopeIdValue(), Criteria::EQUAL);\n\n return call_user_func(array(get_class($node->getPeer()), 'doSelectOne'), $c);\n }", "public function next ( ) {\n\n return next($this->_childs);\n }", "public function getUncle()\r\n {\r\n if (null !== $this->getGrandParent()) {\r\n return $this->getGrandParent()->getChild(-$this->getParent()->getPosition());\r\n }\r\n\r\n return null;\r\n }", "public function setFirstChild(bool $value = true): Delta\n {\n $this->is_first_child = $value;\n\n return $this;\n }", "public function getRootNode() {}", "public function name() { return $this[0]->nodeName; }", "function &getLeftSibling()\n\t{\n\t\tif (!is_object($this->_item)) {\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\treturn $this->_leftsibling;\n\t}", "function &getLeftSibling()\n\t{\n\t\tif (!is_object($this->_item))\n\t\t{\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\treturn $this->_leftsibling;\n\t}", "public function FirstChildOf($item)\n {\n $sql = Access::SqlBuilder();\n if ($item)\n {\n $tblNavItem = NavigationItem::Schema()->Table();\n $where = $sql->IsNull($tblNavItem->Field('Previous'))\n ->And_($sql->Equals($tblNavItem->Field('Parent'), $sql->Value($item->GetID())));\n \n return NavigationItem::Schema()->First($where);\n }\n else\n {\n return $this->TopMost();\n }\n }", "public function getChildNodes();", "public function getNode() {\r\n return $this->node;\r\n }", "public function parentNode()\n {\n return new Element($this->node->parentNode);\n }", "public function getNode()\n\t{\n\t\treturn $this->_node;\n\t}", "public function getFirstChildByType($type)\n {\n foreach ($this->children as $child) {\n if ($child->getType() === $type) {\n return $child;\n }\n }\n return false;\n }", "public function getNode()\n {\n return $this->node;\n }", "public function getNode()\n {\n return $this->node;\n }", "public function getNode()\n {\n return $this->node;\n }", "public function getNode()\n {\n return $this->node;\n }", "public function getFirst()\n\t{\n\t\treturn $this;\n\t}", "public function getRootNode(){\n\t\tif(!$this->root_node) {\n\t\t\treturn null;\n\t\t}\n\t\treturn $this->root_node;\n\t}", "public function getNode()\n {\n return parent::getNode();\n }", "public function findRootNode()\n {\n return $this->repository->findOneBy(array('lvl' => 0));\n }", "public function GetMin() {\r\n if($this->root == null)\r\n return null;\r\n\r\n $node = $this->root;\r\n\r\n while($node->left != null)\r\n $node = $node->left;\r\n\r\n return $node;\r\n }", "public function getChild ( $nodeId ) {\n\n if(false === $this->childExists($nodeId))\n throw new Exception(\n 'Child %s does not exist.', 0, $nodeId);\n\n return $this->_childs[$nodeId];\n }", "public function node()\n\t{\n\t\t$registry = Jquarry_Registry::instance();\n\t\t\n\t\treturn $registry->get_node($this->node_id());\n\t}", "public function getLastChild();", "public function getLastChild();", "public function first()\n {\n return parent::first();\n }", "public function first()\n {\n return parent::first();\n }", "public function first()\n {\n return parent::first();\n }", "public function first()\n {\n return parent::first();\n }", "public function first()\n {\n return parent::first();\n }", "public function first()\n {\n return parent::first();\n }", "public function first()\n {\n return parent::first();\n }", "public function first()\n {\n return parent::first();\n }", "public function first()\n {\n return parent::first();\n }", "public function first()\n {\n return parent::first();\n }", "public function first()\n {\n return parent::first();\n }", "public function first()\n {\n return parent::first();\n }", "public function first()\n {\n return parent::first();\n }", "public function first()\n {\n return parent::first();\n }", "public function first()\n {\n return parent::first();\n }", "public function first()\n {\n return parent::first();\n }", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function getChildNodes() {}", "public function getChildNodes() {}", "public function getContentElement(): ?ContentElementInterface\n {\n return $this->getChildElement(1);\n }", "public function & getRoot()\n\t{\n\t\t$r = null;\n\t\tforeach($this->m_document->childNodes as $c)\n\t\t{\n\t\t\tif($c->nodeType == XML_ELEMENT_NODE)\n\t\t\t{\n\t\t\t\t$r = new ZXmlTag($c);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(!$r)\n\t\t\t$r = new ZXmlTag($this->m_document);\n\n\t\treturn $r;\n\t}", "private function getChildNode($node, $name) {\n\t\tforeach ($node->childNodes as $child) {\n\t\t\tif ($child->nodeName === $name) {\n\t\t\t\treturn $child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public function getLowestTopChild()\n {\n $current = $this->getCurrent();\n while (!\\is_null($current)) {\n if ($current instanceof TopMenuItem) {\n return $current;\n }\n $current = $current->getParent();\n }\n\n return null;\n }", "public function parentNode()\n {\n return null;\n }" ]
[ "0.7909703", "0.785417", "0.77718514", "0.77534854", "0.692618", "0.68995184", "0.6750996", "0.6614837", "0.6580448", "0.6478152", "0.6441489", "0.6435494", "0.6349834", "0.62961566", "0.6094803", "0.60846853", "0.6043376", "0.59984595", "0.59815824", "0.590827", "0.5855173", "0.58383125", "0.5821614", "0.5808054", "0.57849056", "0.57774407", "0.57761323", "0.5729729", "0.572108", "0.572062", "0.5703796", "0.5674751", "0.5640666", "0.5620152", "0.5613686", "0.56083894", "0.5605613", "0.56000435", "0.5594144", "0.5588582", "0.5588292", "0.55700815", "0.5566681", "0.5558054", "0.5539447", "0.5539447", "0.5539447", "0.5539447", "0.55321133", "0.55313635", "0.5521467", "0.5510697", "0.5505898", "0.55019563", "0.54828966", "0.54702747", "0.54702747", "0.54699725", "0.54699725", "0.54699725", "0.54699725", "0.54699725", "0.54699725", "0.54699725", "0.54699725", "0.54699725", "0.54699725", "0.54699725", "0.54699725", "0.54699725", "0.54699725", "0.54699725", "0.54699725", "0.5459461", "0.5459461", "0.5459461", "0.5459461", "0.5459461", "0.5459461", "0.5459461", "0.5459461", "0.5459461", "0.5459461", "0.5459461", "0.5459461", "0.5459461", "0.5459461", "0.5459461", "0.5459461", "0.5459461", "0.5459461", "0.5459461", "0.5459461", "0.5459461", "0.5445909", "0.5442966", "0.5437028", "0.5431769", "0.54279023", "0.5389123", "0.5387392" ]
0.0
-1
Returns the last child node of this node.
final public function getLast() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLastChild()\n\t{\n\t\treturn $this->children[count($this->children)-1];\n\t}", "public function lastChild()\n {\n $node = $this->node->lastChild;\n\n if ($node === null) {\n return null;\n }\n\n return new Element($node);\n }", "public function getLastChild();", "public function getLastChild();", "function &lastChild () {\r\n $ret = null;\r\n $c = count ($this->_children);\r\n if (!$c) {\r\n return $ret;\r\n }\r\n return $this->_children[$c-1];\r\n }", "public function &lastChild()\n {\n $ret = null;\n $c = count($this->_children);\n if (! $c) {\n return $ret;\n }\n return $this->_children[$c-1];\n }", "public function getLastNode()\n {\n return $this->lastNode;\n }", "public function last_tag_node()\r\n\t{\r\n\t\t$children_len = count($this->children);\r\n\r\n\t\tfor($i=$children_len-1; $i >= 0; $i--)\r\n\t\t\tif($this->children[$i] instanceof SBBCodeParser_TagNode)\r\n\t\t\t\treturn $this->children[$i];\r\n\r\n\t\treturn null;\r\n\t}", "public function last () { return new XDTNodeList($this[$this->length-1]); }", "public function getLast()\n {\n return (\n is_null($this->parent) ?\n null :\n $this->parent->content[count($this->parent->content) - 1]\n );\n }", "public function getLastCreatedNode() {\n $node = end($this->nodes);\n\n return $node;\n }", "function getEndNode(){\n return $this->endNode;\n }", "public function getLastRootNode()\n {\n $qb = $this->qbFactory\n ->getRootNodeQueryBuilder()\n ->orderBy('e.' . $this->getPathFieldName(), 'DESC')\n ->setMaxResults(1);\n try {\n return $this->getNode($qb->getQuery()->getSingleResult());\n } catch (NoResultException $e) {\n return null;\n }\n }", "public function retrieveLastChild(BaseObject $node)\n {\n $c = new Criteria();\n $c->add(self::getColumnConstant(get_class($node), 'right'), $node->getRightValue() - 1, Criteria::EQUAL);\n $c->add(self::getColumnConstant(get_class($node), 'scope'), $node->getScopeIdValue(), Criteria::EQUAL);\n\n return call_user_func(array(get_class($node->getPeer()), 'doSelectOne'), $c);\n }", "public function removeLastChild();", "public function last()\n {\n return end($this->_elements);\n }", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n\t{\n\t\treturn parent::last();\n\t}", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n return parent::last();\n }", "public function last()\n {\n $this->cursor = $this->length - 1;\n\n return $this->current();\n }", "public function last()\n {\n if (count($this->items)) {\n return end($this->items);\n }\n\n return null;\n }", "public function end()\n {\n # attach internal tree to parent\n $this->parentNode->getNode()->addChild($this->getNode());\n \n return $this->parentNode; \n }", "public function last() {\n\t\tif ($this->isNotEmpty()) {\n\t\t\t$length = $this->length();\n\t\t\t$counter = 1;\n\n\t\t\tforeach ($this->_value as $value) {\n\t\t\t\tif ($counter === $length) {\n\t\t\t\t\treturn $value;\n\t\t\t\t}\n\n\t\t\t\t++$counter;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "function last()\r\n {\r\n if ($this->count()>=1)\r\n {\r\n return($this->items[count($this->items)-1]);\r\n }\r\n else\r\n {\r\n return(null);\r\n }\r\n }", "public function last() {\n if ($this->count >= 1) {\n return $this->items[count($this->items) - 1];\n }\n else\n return null;\n }", "public function last()\n {\n return \\count($this->data) > 0 ? $this->data[\\count($this->data) - 1] : null;\n }", "public function getLast()\n {\n $k = count($this);\n if ($k > 0) {\n return $this[$k - 1];\n }\n }", "public function getEnd() : Nodo|null\n {\n return $this->end;\n }", "public function getLast()\n\t{\n\t\treturn $this->last;\n\t}", "public function end()\n {\n return $this->parent;\n }", "public function getUncle()\r\n {\r\n if (null !== $this->getGrandParent()) {\r\n return $this->getGrandParent()->getChild(-$this->getParent()->getPosition());\r\n }\r\n\r\n return null;\r\n }", "public function getChild()\n {\n return $this->child;\n }", "public function end(): self\n {\n // Remove last element from stack.\n foreach ($this->stack as $stack) {\n \\array_pop($stack);\n }\n\n return $this->parent ?? $this;\n }", "public function isLastChild(): bool\n {\n return $this->is_last_child;\n }", "public function lastElement(): string {\n $len = count($this->elements);\n return $len > 0 ? $this->elements[$len - 1] : '';\n }", "function last($n=1) \n {\n //if we have a valid element, return it\n if ($this->count - $n >= 0) \n return $this->stack[$this->count-$n];\n //otherwise, return null\n else\n return null;\n }", "public function last() {\n return end($this->list);\n }", "public function last() {\n $this->_active_query->order(['DESC' => 'id']);\n return $this->first();\n }", "function last ()\n {\n return $this->A ? array_slice ($this->A, -1)[0] : null;\n }", "public function right(): ?Node\n {\n return $this->right;\n }", "public function last()\n {\n if ($this->list === null)\n $this->rewind();\n $row = end($this->list);\n return $row;\n }", "public function lastItem() {\n\t\treturn $this->fastForward()->current();\n\t}", "public function getLastItem()\n {\n if ($this->valid() === false) {\n return null;\n }\n return $this->getRow($this->count() - 1);\n }", "public function last() {\n\t\treturn $this->valueForKey($this->lastKey());\n\t}", "public function last()\r\n\t{\r\n\t\treturn end($this->_items);\r\n\t}", "public function last()\n {\n if ($this->getNumParts() < 1) {\n return null;\n }\n\n return end($this->identifierParts);\n }", "public function getRightChild()\n\t{\n\t\treturn $this->rightChild;\n\t}", "public function getLastMatch()\n {\n $node = $this->getXml()->getElementsByTagName('LastMatch')->item(0);\n if ($node !== null && $node->hasChildNodes()) {\n $lastmatch = new \\DOMDocument('1.0', 'UTF-8');\n $lastmatch->appendChild($lastmatch->importNode($node, true));\n return new LastMatch($lastmatch, Config\\Config::MATCH_SENIOR);\n }\n return null;\n }", "public function last()\n {\n return end($this->items);\n }", "public function getFChild()\n {\n return $this->f_child;\n }", "public function getLast()\n {\n $this->update();\n $count = sizeof($this->data);\n if (isset($this->data[$count - 1])) {\n return $this->updateValueIfNeeded($this->data, $count - 1);\n }\n return null;\n }", "public function last()\n {\n return (null === $this->getDraft()) ? $this->getData($this->count() - 1) : $this->getDraft()->last();\n }", "public function get_child($position) : HTMLNode\n {\n return $this -> children -> get($position);\n }", "public function last()\n {\n foreach (array_reverse($this->lists) as $list) {\n foreach ($list->reverse() as $record) {\n return $record;\n }\n }\n return null;\n }", "public function GetMax() {\r\n if($this->root == null)\r\n return null;\r\n\r\n $node = $this->root;\r\n\r\n while($node->right != null)\r\n $node = $node->right;\r\n\r\n return $node;\r\n }", "public function bottom()\n {\n if ($this->isEmpty()) {\n throw new \\RuntimeException(sprintf('%s is empty', __CLASS__));\n }\n\n return $this->head;\n }", "public function getLastMatch()\n {\n return new Xml\\Match\\Chunk($this->getXml('LastMatch'));\n }", "public function last() {\n return $this->seek($this->data['num_rows'] - 1);\n }", "public function last() {\n\t\t$result = $this->get_result();\n\n\t\treturn array_pop( $result );\n\t}", "public function lastValue()\n\t{\n\t\treturn $this->last()->value;\n\t}", "public function last(): mixed\n {\n return array_last($this->data);\n }", "public function last()\n {\n return $this->fixedArray->offsetGet($this->currentSize - 1);\n }", "public function __get($name)\n\t{\n\t\tif ($this->_lastChild !== null &&\n\t\t\t\t$this->_lastChild->_node->nodeName === $this->_prefix . $name)\n\t\t{\n\t\t\treturn $this->_lastChild;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$element = $this->_element($name);\n\t\t\t$this->_lastChild = new self($this->_doc, $element,\n\t\t\t\t\t$this->_nsUri, $this->_prefix, $this->_qualifyAttributes);\n\t\t\treturn $this->_lastChild;\n\t\t}\n\t}", "public function last()\n {\n return $this->all()->last();\n }", "public function getPChild()\n {\n return $this->p_child;\n }", "public function end()\n {\n # construct the node from this definition.\n $node = $this->getNode();\n $children = $this->children();\n $parent = $this->getParent();\n \n # append child compositeNodes to the selectorNode \n foreach($children as $child) {\n $node->addChild($child);\n }\n \n # append generators compositeNode to the parent builder.\n $parent->append($node);\n \n # return the parent to continue chain.\n return $parent;\n }" ]
[ "0.8670471", "0.84469956", "0.82278454", "0.82278454", "0.8067385", "0.8020301", "0.77429277", "0.76669425", "0.73860556", "0.7359422", "0.7063451", "0.68913794", "0.68122005", "0.6700331", "0.66831243", "0.6652818", "0.6640706", "0.6640706", "0.6640706", "0.6640706", "0.6640706", "0.6640706", "0.6640706", "0.6640706", "0.6640706", "0.6640706", "0.6640706", "0.6640706", "0.6640706", "0.6640706", "0.6640706", "0.6640706", "0.6640706", "0.6640706", "0.6640706", "0.6640706", "0.6640706", "0.66149867", "0.66149867", "0.66149867", "0.66149867", "0.66149867", "0.66149867", "0.66149867", "0.66149867", "0.66149867", "0.66149867", "0.66149867", "0.66149867", "0.66149867", "0.66149867", "0.66149867", "0.66149867", "0.6536281", "0.6455004", "0.64357066", "0.64280057", "0.64159524", "0.6364696", "0.63640505", "0.6343683", "0.63206345", "0.63029265", "0.6300915", "0.62947047", "0.6285259", "0.6245694", "0.62280035", "0.619561", "0.6154915", "0.6131776", "0.6117927", "0.6113373", "0.61118686", "0.6090633", "0.6078752", "0.6078103", "0.60751206", "0.6069285", "0.60644495", "0.6060583", "0.6042814", "0.60271", "0.5988902", "0.5987549", "0.5956134", "0.5954046", "0.59480345", "0.5928875", "0.5892153", "0.5877436", "0.5876203", "0.58634025", "0.5858272", "0.58502364", "0.58495975", "0.58374166", "0.582387", "0.58208406", "0.5814936" ]
0.63668764
58
Returns the previous node before this node in the common parent.
final public function getPrevious() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPrevious()\n {\n $prev = $this;\n $find = false;\n if (!is_null($this->parent)) {\n foreach ($this->parent->content as $c) {\n if ($c === $this) {\n $find=true;\n break;\n }\n if (!$find) {\n $prev = $c;\n }\n }\n }\n return $prev;\n }", "public function previousNode(): ?Node\n {\n return $this->traverse('previous');\n }", "public function prevSibling()\n {\n return $this->adjacentSibling(-1);\n }", "public function prev() {\n return $this->_prev($this->parent->children(), func_get_args());\n }", "public function getPrevSibling();", "public function previousSibling()\n {\n $node = $this->node->previousSibling;\n\n if ($node === null) {\n return null;\n }\n\n return new Element($node);\n }", "public function prev_entry()\n\t{\n\t\treturn $this->_prev_next('prev');\n\t}", "public function loadPreviousSibling()\n {\n $id = $this->_cache->getBackend()->getPreviousSiblingId($this);\n return $this->setPreviousSiblingId($id);\n }", "public function getPrevSibling()\n\t{\n\t\t$owner=$this->getOwner();\n\t\t$db=$owner->getDbConnection();\n\t\t$criteria=$owner->getDbCriteria();\n\t\t$alias=$db->quoteColumnName($owner->getTableAlias());\n\t\t$criteria->addCondition($alias.'.'.$db->quoteColumnName($this->rightAttribute).'='.($owner->{$this->leftAttribute}-1));\n\n\t\tif($this->hasManyRoots)\n\t\t\t$criteria->addCondition($alias.'.'.$db->quoteColumnName($this->rootAttribute).'='.$owner->{$this->rootAttribute});\n\n\t\treturn $owner->find();\n\t}", "function getPrevNode($data)\n\t{\n\t\treturn $this->find('first', array(\n\t\t\t\t\t'conditions'\t=> array($this->name . '.lft < ' . $data[$this->name]['lft']),\n\t\t\t\t\t'order'\t\t\t=> $this->name . '.lft DESC'));\t\t\n\t}", "public function prev()\n {\n $current = $this->current();\n\n if ($current) {\n $this->current = $current->getBefore();\n }\n }", "function prevArticle() {\n\t\t$parent = $this->parent();\n\t\tif (!$parent) {\n\t\t\treturn false;\n\t\t}\n\t\t$parentChildren = $parent->children();\n\t\t$aCount = sizeof($parentChildren);\n\t\t$foundAtPos=null;\n\t\tfor ($i=0;$i<$aCount;$i++) {\n\t\t\tif ($parentChildren[$i]->getId() == $this->getId()) {\n\t\t\t\t$foundAtPos=($i-1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($foundAtPos>=0) {\n\t\t\treturn $parentChildren[$foundAtPos];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function getPrevious()\n {\n return $this->previous;\n }", "public function getPrevious()\n {\n return $this->previous;\n }", "public function get_previous() { return $this->getPrevious(); }", "public function previousItem() {\n\t\treturn $this->previous()->current();\n\t}", "public function prevInvisible() {\n if(!$this->parent) {\n return null;\n } else {\n return $this->_prev($this->parent->children(), func_get_args(), 'invisible');\n }\n }", "public function retrievePrevSibling(BaseObject $node)\n {\n $c = new Criteria();\n $c->add(self::getColumnConstant(get_class($node), 'right'), $node->getLeftValue() - 1, Criteria::EQUAL);\n $c->add(self::getColumnConstant(get_class($node), 'scope'), $node->getScopeIdValue(), Criteria::EQUAL);\n\n return call_user_func(array(get_class($node->getPeer()), 'doSelectOne'), $c);\n }", "public function getPrevious()\n {\n return $this->hasPrevious() ? $this->curPage - 1 : null;\n }", "public function GetPrevLevel()\n {\n return $this->prevLevel;\n }", "function prev() {\n\n $next = $this->find('first', array('conditions'=>array('position <'=>$this->data['Ringsite']['position']),\n 'order'=>'position DESC'));\n\n if (empty($next)) {\n $next = $this->find('first', array('conditions'=>array('position >='=>0),\n 'order'=>'position DESC'));\n }\n\n return $next;\n }", "public function previous() {\r\n return prev($this->collection);\r\n }", "public function getPrev() {\n\t\treturn $this->pagefiles->getPrev($this); \n\t}", "public function Previous()\n {\n return parent::Previous();\n }", "public function getPrevBlock()\n {\n return $this->prevBlock;\n }", "public static function getPreviousSiblingElement($node) {\n do {\n $node = $node->previousSibling;\n } while ($node && !($node instanceof DOMElement));\n return $node;\n }", "public function previousElement();", "public function prev()\n {\n return prev($this->steps);\n }", "public function getPrev($criteria = null)\n\t{\n\t\treturn $this->_getRelativeElement($criteria, -1);\n\t}", "#[\\ReturnTypeWillChange]\n public function prev()\n {\n $value = prev($this->_data);\n return key($this->_data) !== null ? $value : null;\n }", "public function prevSibling($path)\n {\n return $this->adjacentSibling($path, -1);\n }", "public function prevVisible() {\n if(!$this->parent) {\n return null;\n } else {\n return $this->_prev($this->parent->children(), func_get_args(), 'visible');\n }\n }", "public function getPrev()\n {\n return self::find()->where(['<', 'id', $this->id])->orderBy(['id' => SORT_DESC])->limit(1)->one();\n }", "public function getPrevious($key)\n\t{\n\t\tif (in_array($key, $this->_keys))\n\t\t{\n\t\t\treturn $this->_previous[$key];\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public function previous_day()\n {\n return $this->subDay();\n }", "public function previous_page(){\n if($this->current_page > 1){\n return $this->current_page - 1;\n }\n else{\n return NULL;\n }\n }", "function prevPage() {\n\t\treturn $this->hasPrevPage() ? $this->url(array('p' => $this->p + 1)) : null;\n\t}", "public function PreviousOf($item)\n {\n return $item->GetPrevious();\n }", "public function PreviousOf($item)\n {\n return $item->GetPrevious();\n }", "public function PreviousOf($item)\n {\n return $item->GetPrevious();\n }", "public function getPrevPage()\n {\n return $this->prevPage;\n }", "public function previous() {\n\t\t--$this->_position;\n\t\treturn $this;\n\t}", "public function getPrevious() {}", "protected function GetPreviousStep()\n {\n static $oPreviousStep;\n if (!$oPreviousStep) {\n $oPreviousStep = TdbShopOrderStepList::GetPreviousStep($this);\n }\n\n return $oPreviousStep;\n }", "public function Previous()\n {\n $item = false;\n if ($this->getItemPointer() >= 0) {\n $item = $this->Current();\n $this->setItemPointer($this->getItemPointer() - 1);\n }\n\n return $item;\n }", "public function getParent() {\r\n\t\tif ($this->pzkParentId) {\r\n\t\t\treturn pzk_store_element($this->pzkParentId);\r\n\t\t}\r\n\t\treturn NULL;\r\n\t}", "public function prev() {\n $db = $this->getDbConnection();\n $criteria = $this->getDbCriteria();\n $alias = $db->quoteColumnName($this->getTableAlias());\n $criteria->addCondition($alias . '.' . $db->quoteColumnName($this->rightAttribute) . '=' . ($this->{$this->leftAttribute} - 1));\n\n if ($this->hasManyRoots) {\n $criteria->addCondition($alias . '.' . $db->quoteColumnName($this->rootAttribute) . '=' . CDbCriteria::PARAM_PREFIX . CDbCriteria::$paramCount);\n $criteria->params[CDbCriteria::PARAM_PREFIX . CDbCriteria::$paramCount++] = $this->{$this->rootAttribute};\n }\n\n return $this;\n }", "public function getParentnode()\n {\n return $this->__parentnode__;\n }", "static public function getPrevPage() {\n\t\treturn self::$prev_page;\n\t}", "public function getPrevious();", "public function prev(){\n\t\t$this->nextRow(-1,'min');\n\t}", "public function getPreviousPage()\n\t{\n\t\treturn $this->previousPage;\n\t}", "public function getParentNode() {}", "public function getPrevSiblingsQuery($node, $includeSelf = false)\n {\n return $this->getPrevSiblingsQueryBuilder($node, $includeSelf)->getQuery();\n }", "public function getPrevSiblings($node, $includeSelf = false)\n {\n return $this->getPrevSiblingsQuery($node, $includeSelf)->toArray();\n }", "public function getParent() {\n\t\tif ($this->path === '/') {\n\t\t\treturn NULL;\n\t\t}\n\t\treturn $this->nodeDataRepository->findOneByPath($this->parentPath, $this->workspace);\n\t}", "public function getPrevMarker()\n {\n $this->currentMarker--;\n if($this->currentMarker<0) return false;\n else return $this->getCurrentMarker();\n }", "public function getPreviousObject()\n {\n return $this->__object;\n }", "public function getParent(){\n\t\treturn $this->father;\n\t}", "public function prev_link()\n\t{\n\t\treturn $this->link_to_page($this->get_cur_page() - 1);\n\t}", "public function getPrevBlock();", "public function getPreviousArticle() {\n return ArticleLanguageVersion::join('article', 'translated_article.article_id', '=', 'article.id')\n ->where('article.created', '<', $this->article->created)\n ->where('translated_article.language', $this->articleLanguageVersion->language)\n ->where('translated_article.published', true)\n ->orderBy('article.created', 'DESC')\n ->first();\n }", "public function getPreviousPost()\n\t{\n\t\treturn static::find()\n\t\t\t->where('id < :id', [':id' => $this->id])\n\t\t\t->orderBy('time_create DESC')->limit(1)->One();\n\t}", "public function get_prev( $in_same_term = false ) {\n\t\treturn $this->prev($in_same_term);\n\t}", "private function getPreviousPartitionStep()\n\t{\n\t\t// Fetch the partition steps and wanted partitioning of the last saved action\n\t\t$undoStep = array_pop($this->undoArray);\n\n\t\t// If it is NULL, there are no undo steps\n\t\tif (is_null($undoStep))\n\t\t\treturn(NULL);\n\n\t\t// If the current partition steps are equal to the last saved partition steps => go back another step in the history\n\t\tif ($this->getUndoMd5() == md5(serialize($undoStep['ps'])))\n\t\t{\n\t\t\t// Fetch the partition steps and wanted partitioning of the (2nd) last saved action\n\t\t\t$undoStep = array_pop($this->undoArray);\n\n\t\t\t// If it is NULL, there are no undo steps (now)\n\t\t\tif (is_null($undoStep))\n\t\t\t\treturn(NULL);\n\t\t}\n\n\t\treturn($undoStep);\n\t}", "public function prevpage() {\n return $this->current_page - 1;\n }", "public function getPreviousPage() {\n\t\tif (($this->currentPage - 1) <= 0) {\n\t\t\t$this->currentPage = $this->countPages();\n\t\t\treturn $this->currentPage;\n\t\t} else {\n\t\t\treturn --$this->currentPage;\n\t\t}\n\t}", "final public function getParent() {\n\t\treturn $this->_parentNode;\n\t}", "public function getPrevious(\n ?array $criteria = null,\n ?array $order = null\n ) {\n if ($this->getNode()->getPosition() <= 1) {\n return null;\n }\n if (null === $order) {\n $order = [];\n }\n\n if (null === $criteria) {\n $criteria = [];\n }\n\n $criteria['parent'] = $this->getNode()->getParent();\n /*\n * Use < operator to get first previous nodeSource\n * even if it’s not the previous position index\n */\n $criteria['position'] = [\n '<',\n $this->getNode()->getPosition(),\n ];\n\n $order['position'] = 'DESC';\n\n return $this->getRepository()->findOneBy(\n $criteria,\n $order\n );\n }", "public function getPreviousPage()\n {\n if ($this->getReverseOrder()) {\n return min($this->getNumberOfTotalPages(), $this->current_page + 1);\n }\n return max(1, $this->current_page - 1);\n }", "function get_previous_item($item = null)\n{\n if (!$item) {\n $item = get_current_record('item');\n }\n return $item->previous();\n}", "public function getPrevLink()\n {\n return $this->getAlbum()->getPrevLink($this);\n }", "public function move_to_prev_sibling($target)\n {\n $target = $this->parent_from($target, $this->parent_column);\n return $this->move($target, TRUE, 0, 0, FALSE);\n }", "function get_previous_comic($in_same_category = false, $category = null) { return get_adjacent_comic($category, true, $in_same_category); }", "public function getPreviousVersion()\n {\n $versions = $this->getVersions();\n\n return count($versions) > 1 ? $versions[1] : 0;\n }", "public function get_parent() {\n\t\treturn $this->parent();\n\t}", "function get_previous_id($forum_id=0, $care_of_subs=true)\n\t{\n\t\tif ( empty($forum_id) )\n\t\t{\n\t\t\t$res = $forum_id;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$forum_main = $this->data[$forum_id]['forum_main'];\n\n\t\t\t// no subs yet (not possible) : previous is main\n\t\t\tif ( empty($this->data[$forum_main]['subs']) )\n\t\t\t{\n\t\t\t\t$res = $forum_id;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// find previous pos\n\t\t\t\t$tsubs = array_flip($this->data[$forum_main]['subs']);\n\t\t\t\t$i = $tsubs[$forum_id] - 1;\n\t\t\t\t// already in first position : previous is main\n\t\t\t\tif ( $i < 0 )\n\t\t\t\t{\n\t\t\t\t\t$res = $forum_main;\n\t\t\t\t}\n\t\t\t\t// get previous\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$res = $care_of_subs ? $this->data[ $this->data[$forum_main]['subs'][$i] ]['last_child_id'] : $this->data[$forum_main]['subs'][$i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}", "public function parentNode()\n {\n return null;\n }", "public function getParent()\n {\n if (! $this->parentrecord) {\n list($this->parentrecord, $unused) = self::getParentAndChild($this->flatpath);\n }\n return $this->parentrecord;\n }", "public function previousPage()\n {\n return$this->currentPage - 1;\n }", "public function getPrevSibling(array $columns = ['*']);", "public function getParent(): ?self\n {\n if ($this->parent === $this) {\n return null;\n }\n\n return $this->parent;\n }", "public function insert_as_prev_sibling($target)\n {\n $target = $this->parent_from($target, $this->parent_column);\n return $this->insert($target, $this->left_column, 0, 0);\n }", "public function asPrevious(): static\n {\n $this->type = 'prev';\n\n return $this;\n }", "public function previousPage()\n\t{\n\t\t$this->_currentPage--;\n\n\t\tif ($this->_currentPage < 0) {\n\t\t\t$this->_currentPage = $this->count()-1;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function previous(): static\n {\n $link = Arr::get($this->links, 'prev');\n\n throw_unless($link, NoPreviousPageException::class);\n\n return $this->getResults($link);\n }", "public function getPreviousUrl() {\r\n\t\treturn $this->Session->read('history.current');\r\n\t}", "public function getPriorException(){\n // dont call this method getPrevious as in php5.3+ because this\n // method is final and we want this to run in 5 and 5.3+\n return $this->priorException;\n }", "public function getPrevious() {\r\n $previousDate = $this->getStartDate();\r\n $previousDate->modify('-1 ' . $this->getMode());\r\n\r\n return $previousDate->getTimestamp();\r\n }", "protected function get_parent()\r\n {\r\n return $this->parent;\r\n }", "public function parent()\n {\n if ( !$this->loaded )\n $this->reload();\n\n if ($this->is_root())\n return NULL;\n\n if ( ! in_array('parent', $this->_objects) )\n {\n $sql = \"SELECT * FROM $this->_table_name\n WHERE \n $this->primary_column = $this->parent_key\n ORDER BY \". $this->_sorting[0] .\" \". $this->_sorting[1] .\"\n \";\n\n $result = $this->_db->query($sql);\n\n $this->_objects['parent'] = $this->factory_set($result)[0];\n }\n\n return $this->_objects['parent'];\n }", "public function previousPage() {\r\n\t\t$intReturn = ($this->getCurrentPage() - 1 > 0) ? ($this->getCurrentPage() - 1) : 1;\r\n\r\n\t\treturn $intReturn;\r\n\t}", "public function getPreviousValue()\n {\n return $this->previousValue instanceof ValidFromAndUntilValueBuilder ? $this->previousValue->build() : $this->previousValue;\n }", "public function previous(): int;", "public function previous($previous): static\n {\n $this->previous = $previous;\n // $this->previousLabel = $label;\n\n return $this;\n }", "public function parent()\n\t{\n\t\tif( static::$databaseColumnParent !== NULL )\n\t\t{\n\t\t\t$parentColumn = static::$databaseColumnParent;\n\t\t\tif( $this->$parentColumn !== static::$databaseColumnParentRootValue )\n\t\t\t{\n\t\t\t\treturn static::load( $this->$parentColumn );\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( isset( static::$parentNodeClass ) )\n\t\t{\n\t\t\t$parentNodeClass = static::$parentNodeClass;\n\t\t\t$parentColumn = static::$parentNodeColumnId;\n\t\t\tif( $this->$parentColumn )\n\t\t\t{\n\t\t\t\treturn $parentNodeClass::load( $this->$parentColumn );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn NULL;\n\t}", "public function getTreeParent(){\n return $this->treeParentRow;\n }", "final public function getParent()\n\t{\n\t\treturn $this->parent;\n\t}", "public function getParent()\n\t{\n\t\treturn $this->parent;\n\t}", "public function getParent()\n\t{\n\t\treturn $this->parent;\n\t}" ]
[ "0.8331974", "0.7805668", "0.7789767", "0.7576522", "0.7559238", "0.75513285", "0.7537708", "0.7439251", "0.7432675", "0.73726857", "0.7296436", "0.72257066", "0.71299654", "0.71299654", "0.7115595", "0.70967144", "0.70664227", "0.70285827", "0.7016926", "0.7006968", "0.700354", "0.7001867", "0.6996477", "0.69810283", "0.69806594", "0.6979154", "0.6918796", "0.68676656", "0.68547773", "0.6850102", "0.68330675", "0.6788473", "0.6769486", "0.67633265", "0.67465633", "0.6737304", "0.67267734", "0.6720197", "0.6698929", "0.6698929", "0.66662186", "0.6665093", "0.66592", "0.6640208", "0.6614337", "0.6574858", "0.65704525", "0.6531348", "0.6529545", "0.65157604", "0.6432093", "0.6430003", "0.6416087", "0.64087975", "0.6403285", "0.63878465", "0.6356865", "0.63410866", "0.6333893", "0.63068706", "0.6306253", "0.6279248", "0.6274931", "0.6273878", "0.6271154", "0.62595385", "0.62561226", "0.62540233", "0.62468636", "0.6233231", "0.62294525", "0.62194335", "0.6215144", "0.6207308", "0.6194142", "0.6183304", "0.615104", "0.6144266", "0.6127549", "0.61067504", "0.61038125", "0.6075573", "0.60751194", "0.6074518", "0.60693866", "0.6064585", "0.60616845", "0.60572237", "0.6052372", "0.605108", "0.6048385", "0.6033579", "0.6001962", "0.5993736", "0.5993295", "0.5993225", "0.59889424", "0.5987074", "0.59865516", "0.59865516" ]
0.71348363
12
Returns the next node after this node in the common parent.
final public function getNext() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNext()\n {\n $next = null;\n $find = false;\n if (!is_null($this->parent)) {\n foreach ($this->parent->content as $c) {\n if ($find) {\n $next = &$c;\n break;\n }\n if ($c == $this) {\n $find = true;\n }\n }\n }\n return $next;\n }", "public function getNextSibling();", "public function getNextSibling()\n\t{\n\t\t$owner=$this->getOwner();\n\t\t$db=$owner->getDbConnection();\n\t\t$criteria=$owner->getDbCriteria();\n\t\t$alias=$db->quoteColumnName($owner->getTableAlias());\n\t\t$criteria->addCondition($alias.'.'.$db->quoteColumnName($this->leftAttribute).'='.($owner->{$this->rightAttribute}+1));\n\n\t\tif($this->hasManyRoots)\n\t\t\t$criteria->addCondition($alias.'.'.$db->quoteColumnName($this->rootAttribute).'='.$owner->{$this->rootAttribute});\n\n\t\treturn $owner->find();\n\t}", "public function nextSibling()\n {\n return $this->adjacentSibling(1);\n }", "public function retrieveNextSibling(BaseObject $node)\n {\n $c = new Criteria();\n $c->add(self::getColumnConstant(get_class($node), 'left'), $node->getRightValue() + 1, Criteria::EQUAL);\n $c->add(self::getColumnConstant(get_class($node), 'scope'), $node->getScopeIdValue(), Criteria::EQUAL);\n\n return call_user_func(array(get_class($node->getPeer()), 'doSelectOne'), $c);\n }", "public function getNext ()\n {\n return prev ( $this->_list ) ;\n }", "public function nextNode(): ?Node\n {\n return $this->traverse('next');\n }", "public function loadNextSibling()\n {\n $id = $this->_cache->getBackend()->getNextSiblingId($this);\n return $this->setNextSiblingId($id);\n }", "public function next() {\n return $this->_next($this->parent->children(), func_get_args());\n }", "public function next()\n {\n $current = $this->current();\n\n if ($current) {\n $this->current = $current->getAfter();\n }\n }", "public function getNext()\n {\n return $this->next;\n }", "public static function getNextSiblingElement($node) {\n do {\n $node = $node->nextSibling;\n } while ($node && !($node instanceof DOMElement));\n return $node;\n }", "public function next_entry()\n\t{\n\t\treturn $this->_prev_next('next');\n\t}", "public function next ( ) {\n\n return next($this->_childs);\n }", "public function nextSibling()\n {\n $node = $this->node->nextSibling;\n\n if ($node === null) {\n return null;\n }\n\n return new Element($node);\n }", "public function next() {\n $this->index++;\n return $this->valid() ? $this->current() : null;\n }", "function getNextNode($data)\n\t{\t\t\n\t\treturn $this->find('first', array(\n\t\t\t\t\t'conditions'\t=> array($this->name . '.lft > ' . $data[$this->name]['lft']),\n\t\t\t\t\t'order'\t\t\t=> $this->name . '.lft'));\t\t\t\t\t\t\t \t\t\t\t\t\n\t}", "public function next()\n {\n if ($this->index !== NULL) {\n $val = $this->pathItemList[$this->index];\n $this->index = $this->index + 1 < count($this->pathItemList) ? $this->index + 1 : NULL;\n return $val;\n }\n return NULL;\n }", "public function previousNode(): ?Node\n {\n return $this->traverse('previous');\n }", "public function getPrevSibling();", "public function getNextSibling(array $columns = ['*']);", "public function end()\n {\n return $this->parent;\n }", "function &getRightSibling()\n\t{\n\t\tif (!is_object($this->_item)) {\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\treturn $this->_rightsibling;\n\t}", "public function end()\n {\n # attach internal tree to parent\n $this->parentNode->getNode()->addChild($this->getNode());\n \n return $this->parentNode; \n }", "function &getRightSibling()\n\t{\n\t\tif (!is_object($this->_item))\n\t\t{\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\treturn $this->_rightsibling;\n\t}", "public function getLast()\n {\n return (\n is_null($this->parent) ?\n null :\n $this->parent->content[count($this->parent->content) - 1]\n );\n }", "public function next()\r\n\t{\r\n\t\t$this->i++;\r\n\t\tif( isset($this->elements[$this->i]) )\r\n\t\t{\r\n\t\t\treturn $this->elements[$this->i];\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public function getLastChild();", "public function getLastChild();", "public function getLastChild()\n\t{\n\t\treturn $this->children[count($this->children)-1];\n\t}", "public function nextElement()\n {\n $t = $this->it->next();\n //System.out.println(\"pulled \"+adaptor.getType(t));\n if ($t == $this->it->up) {\n $this->level--;\n if ($this->level == 0 && $this->hasNilRoot) {\n return $this->it->next(); // don't give last UP; get EOF\n }\n } else if ($t == $this->it->down) {\n $this->level++;\n }\n if ($this->level == 0 && $this->adaptor->isNil($t)) { // if nil root, scarf nil, DOWN\n $this->hasNilRoot = true;\n $t = $this->it->next(); // t is now DOWN, so get first real node next\n $this->level++;\n $t = $this->it->next();\n }\n return $t;\n }", "public function next()\r\n {\r\n next($this->children);\r\n }", "function nextArticle() {\n\t\t$parent = $this->parent();\n\t\tif (!$parent) {\n\t\t\treturn false;\n\t\t}\n\t\t$parentChildren = $parent->children();\n\t\t$aCount = sizeof($parentChildren);\n\t\t$foundAtPos=null;\n\t\tfor ($i=0;$i<$aCount;$i++) {\n\t\t\tif ($parentChildren[$i]->getId() == $this->getId()) {\n\t\t\t\t$foundAtPos=($i+1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\t\t\t\n\t\tif ($foundAtPos>=0 && $foundAtPos<$aCount) {\n\t\t\treturn $parentChildren[$foundAtPos];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function getNext()\n {\n return $this->hasNext() ? $this->curPage + 1 : null;\n }", "public function getLastNode()\n {\n return $this->lastNode;\n }", "public function next() {\r\n\t\t$line = parent::next();\r\n\t\tif (!is_null($line)) {\r\n\t\t\t$this->position++;\r\n\t\t\t$this->lastLine = $this->parse($line);\r\n\t\t\treturn $this->lastLine;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public function getNext()\n {\n $nextIndex = $this->getIndex() + 1;\n\n return $this->offsetGet($nextIndex);\n }", "public function next()\n {\n // @see array_shift which does this directly in php\n // return array_shift($this->queueItems);\n\n if (empty($this->queueItems)) {\n return null;\n }\n\n $first = current($this->queueItems);\n\n // remove this from the queue\n array_shift($this->queueItems);\n\n return $first;\n }", "function &lastChild () {\r\n $ret = null;\r\n $c = count ($this->_children);\r\n if (!$c) {\r\n return $ret;\r\n }\r\n return $this->_children[$c-1];\r\n }", "public function end()\n {\n # construct the node from this definition.\n $node = $this->getNode();\n $children = $this->children();\n $parent = $this->getParent();\n \n # append child compositeNodes to the selectorNode \n foreach($children as $child) {\n $node->addChild($child);\n }\n \n # append generators compositeNode to the parent builder.\n $parent->append($node);\n \n # return the parent to continue chain.\n return $parent;\n }", "public function prevSibling()\n {\n return $this->adjacentSibling(-1);\n }", "public function sibling(){\n\t\treturn parent::sibling();\n\t}", "public function sibling(){\n\t\treturn parent::sibling();\n\t}", "public function next() {\n $element = next($this->elements);\n\n return $element;\n }", "public function last_tag_node()\r\n\t{\r\n\t\t$children_len = count($this->children);\r\n\r\n\t\tfor($i=$children_len-1; $i >= 0; $i--)\r\n\t\t\tif($this->children[$i] instanceof SBBCodeParser_TagNode)\r\n\t\t\t\treturn $this->children[$i];\r\n\r\n\t\treturn null;\r\n\t}", "public function end(): self\n {\n // Remove last element from stack.\n foreach ($this->stack as $stack) {\n \\array_pop($stack);\n }\n\n return $this->parent ?? $this;\n }", "public function next() {\n\t\t++$this->_position;\n\t\treturn $this;\n\t}", "protected function findNextStep()\n {\n $this->moveToStep($this->current);\n $this->next=$this->findNext();\n return $this;\n }", "public function nextInvisible() {\n if(!$this->parent) {\n return null;\n } else {\n return $this->_next($this->parent->children(), func_get_args(), 'invisible');\n }\n }", "public function &lastChild()\n {\n $ret = null;\n $c = count($this->_children);\n if (! $c) {\n return $ret;\n }\n return $this->_children[$c-1];\n }", "public function next() {\n do { \n if (NULL !== ($element= $this->collections[$this->_current]->next())) return $element;\n \n // End of current collection, close it and continue with next collection\n // In case the end of collections has been reached, return NULL\n $this->collections[$this->_current]->close();\n if (++$this->_current >= sizeof($this->collections)) {\n $this->_current--;\n return NULL;\n }\n $this->collections[$this->_current]->open();\n } while (1);\n }", "public function moveAsNextSiblingOf(Doctrine_Record $dest);", "public function next() {\n $db = $this->getDbConnection();\n $criteria = $this->getDbCriteria();\n $alias = $db->quoteColumnName($this->getTableAlias());\n $criteria->addCondition($alias . '.' . $db->quoteColumnName($this->leftAttribute) . '=' . ($this->{$this->rightAttribute} + 1));\n\n if ($this->hasManyRoots) {\n $criteria->addCondition($alias . '.' . $db->quoteColumnName($this->rootAttribute) . '=' . CDbCriteria::PARAM_PREFIX . CDbCriteria::$paramCount);\n $criteria->params[CDbCriteria::PARAM_PREFIX . CDbCriteria::$paramCount++] = $this->{$this->rootAttribute};\n }\n\n return $this;\n }", "protected function fetchAdjacentLesser(){\r\n $query = static::prepareSQL(\r\n 'SELECT *\r\n FROM %table\r\n WHERE %orderby_col < ?\r\n AND parent_id = ?\r\n ORDER BY %orderby_col DESC\r\n LIMIT 1'\r\n );\r\n\r\n $query->execute([$this->{$this->orderby}, $this->parent_id]);\r\n return $query->fetch();\r\n }", "public function move_to_next_sibling($target)\n {\n $target = $this->parent_from($target, $this->parent_column);\n return $this->move($target, FALSE, 1, 0, FALSE);\n }", "public function getPrevious()\n {\n $prev = $this;\n $find = false;\n if (!is_null($this->parent)) {\n foreach ($this->parent->content as $c) {\n if ($c === $this) {\n $find=true;\n break;\n }\n if (!$find) {\n $prev = $c;\n }\n }\n }\n return $prev;\n }", "public function nextItem() {\n\t\treturn $this->next()->current();\n\t}", "public function getNextItem($outsetNodeUuid, $initialItemUuid, $distance = 1)\n {\n if (empty($initialItemUuid)) {\n return null;\n }\n\n $nextItem = null;\n $currItem = $this->findByPK($initialItemUuid);\n\n $index = array_search($initialItemUuid, $currItem->parent->content);\n if ($index < count($currItem->parent->content) - $distance ) {\n $nextItemUuid = $currItem->parent->content[$index + $distance];\n $nextItem = $this->findByPK($nextItemUuid);\n } else if ($index >= count($currItem->parent->content) - $distance ) {\n // last element reached.\n // For the mean time, return null;\n // @todo - When reached the parent's last child, go one parent up\n // and get the first child.\n }\n return $nextItem;\n }", "public function next()\n {\n $row = $this->getRow($this->pointer);\n if($row){\n $this->pointer++;\n }\n return $row;\n }", "public function down(): ?Node\n {\n return $this->down;\n }", "public function next()\n {\n $this->incrIndex();\n\n return $this->getCurrent();\n }", "public function next()\n {\n return next($this->_elements);\n }", "public function getNext() {\n\t\treturn $this->pagefiles->getNext($this); \n\t}", "public function getParentNode() {}", "public function retrievePrevSibling(BaseObject $node)\n {\n $c = new Criteria();\n $c->add(self::getColumnConstant(get_class($node), 'right'), $node->getLeftValue() - 1, Criteria::EQUAL);\n $c->add(self::getColumnConstant(get_class($node), 'scope'), $node->getScopeIdValue(), Criteria::EQUAL);\n\n return call_user_func(array(get_class($node->getPeer()), 'doSelectOne'), $c);\n }", "public function NextOf($item)\n {\n return NavigationItem::Schema()->ByPrevious($item);\n }", "private function findEndOfList(Node $node)\n {\n while (!is_null($node->next)) {\n $node = $node->next;\n }\n \n return $node;\n }", "public function right(): ?Node\n {\n return $this->right;\n }", "public function retrieveLastChild(BaseObject $node)\n {\n $c = new Criteria();\n $c->add(self::getColumnConstant(get_class($node), 'right'), $node->getRightValue() - 1, Criteria::EQUAL);\n $c->add(self::getColumnConstant(get_class($node), 'scope'), $node->getScopeIdValue(), Criteria::EQUAL);\n\n return call_user_func(array(get_class($node->getPeer()), 'doSelectOne'), $c);\n }", "public function getNextSiblings(array $columns = ['*']);", "public function getNext()\n {\n return parent::getNext() ?: $this->getRepo()->newVoidModel();\n }", "public function loadPreviousSibling()\n {\n $id = $this->_cache->getBackend()->getPreviousSiblingId($this);\n return $this->setPreviousSiblingId($id);\n }", "public function getPrevSibling()\n\t{\n\t\t$owner=$this->getOwner();\n\t\t$db=$owner->getDbConnection();\n\t\t$criteria=$owner->getDbCriteria();\n\t\t$alias=$db->quoteColumnName($owner->getTableAlias());\n\t\t$criteria->addCondition($alias.'.'.$db->quoteColumnName($this->rightAttribute).'='.($owner->{$this->leftAttribute}-1));\n\n\t\tif($this->hasManyRoots)\n\t\t\t$criteria->addCondition($alias.'.'.$db->quoteColumnName($this->rootAttribute).'='.$owner->{$this->rootAttribute});\n\n\t\treturn $owner->find();\n\t}", "public function getNextSiblingsQuery($node, $includeSelf = false)\n {\n return $this->getNextSiblingsQueryBuilder($node, $includeSelf)->getQuery();\n }", "function getEndNode(){\n return $this->endNode;\n }", "public function previousSibling()\n {\n $node = $this->node->previousSibling;\n\n if ($node === null) {\n return null;\n }\n\n return new Element($node);\n }", "public function nextVisible() {\n if(!$this->parent) {\n return null;\n } else {\n return $this->_next($this->parent->children(), func_get_args(), 'visible');\n }\n }", "public function getNext($criteria = null)\n\t{\n\t\treturn $this->_getRelativeElement($criteria, 1);\n\t}", "public function popToken ()\n {\n if ( !$this->hasToken() )\n return NULL;\n\n $next = $this->inner->popToken();\n\n $type = $next->getType();\n\n // If the first token we read is an open curly, it doesn't affect the depth\n if ( $this->first )\n $this->first = FALSE;\n\n else if ( $type == Token::T_CURLY_OPEN || $type == Token::T_DOLLAR_OPEN_CURLY_BRACES )\n $this->depth++;\n\n else if ( $type == Token::T_CURLY_CLOSE )\n $this->depth--;\n\n return $next;\n }", "protected function fetchAdjacentGreater(){\r\n $query = static::prepareSQL(\r\n 'SELECT *\r\n FROM %table\r\n WHERE %orderby_col > ?\r\n AND parent_id = ?\r\n ORDER BY %orderby_col\r\n LIMIT 1'\r\n );\r\n\r\n $query->execute([$this->{$this->orderby}, $this->parent_id]);\r\n return $query->fetch();\r\n }", "function get_next_item($item = null)\n{\n if (!$item) {\n $item = get_current_record('item');\n }\n return $item->next();\n}", "public function moveNext() {\n\t\tif($this->getPointer() <= $this->getLast()) {\n\t\t\t$this->pointer++;\n\t\t\t\n\t\t\treturn $this->pointer;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function nextSibling($path)\n {\n return $this->adjacentSibling($path, 1);\n }", "public function getNextSiblings($node, $includeSelf = false)\n {\n return $this->getNextSiblingsQuery($node, $includeSelf)->toArray();\n }", "public function getNext() {}", "public function getNext() {}", "function next() {\n\n return $this->skip(1);\n }", "public function next() {\n $this->nextElem();\n }", "#[\\ReturnTypeWillChange]\n public function next()\n {\n $value = $this->_skipNext ? current($this->_data) : next($this->_data);\n $this->_skipNext = false;\n return key($this->_data) !== null ? $value : null;\n }", "function get_next_comic($in_same_category = false, $category = null) { return get_adjacent_comic($category, false, $in_same_category); }", "public function asNext(): static\n {\n $this->type = 'next';\n\n return $this;\n }", "public function next() {\n\t\treturn next($this->_value);\n\t}", "public function getNext()\n {\n return self::find()->where(['>', 'id', $this->id])->limit(1)->one();\n }", "public function insert_as_next_sibling($target)\n {\n $target = $this->parent_from($target, $this->parent_column);\n return $this->insert($target, $this->right_column, 1, 0);\n }", "public function next(): mixed\n {\n $item = false;\n if ($this->getItemPointer() < $this->Length()) {\n $item = $this->Current();\n $this->setItemPointer($this->getItemPointer() + 1);\n }\n\n return $item;\n }", "function next() {\r\n $this->index++;\r\n return $this->list[$this->index];\r\n }", "public function next($search=null){\n\t\treturn $this->look_on_same_row(\"next\",$search);\n\t}", "public function getSiblings()\n\t{\n\t\t$folderFiles = $this->Parent->Files;\n\t\tforeach ($folderFiles as $key => $item) {\n\t\t\tif ($this->name == $item->name) {\n\t\t\t\t$prev = $key - 1;\n\t\t\t\t$current = $key + 1;\n\t\t\t\t$next = $key + 1;\n\t\t\t}\n\t\t}\n\t\tif ($next >= count($folderFiles)) {\n\t\t\t$next = 0;\n\t\t}\n\t\tif ($prev < 0) {\n\t\t\t$prev = count($folderFiles) - 1;\n\t\t}\n\n\t\t$result = new stdClass();\n\t\t$result->next = $folderFiles[$next];\n\t\t$result->previous = $folderFiles[$prev];\n\t\t$result->current = $current;\n\t\t$result->count = count($folderFiles);\n\n\t\treturn $result;\n\t}", "public function getLastSibling(array $columns = ['*']);", "public function getNext();" ]
[ "0.75268507", "0.68934745", "0.68866533", "0.66833735", "0.65698004", "0.6382568", "0.63546336", "0.63029605", "0.62576604", "0.625619", "0.6120316", "0.60716075", "0.6044811", "0.60279506", "0.60272616", "0.6009663", "0.59958595", "0.5986714", "0.5961782", "0.5929814", "0.5908648", "0.58826435", "0.58511484", "0.58400154", "0.5833752", "0.57941777", "0.57857597", "0.57830536", "0.57830536", "0.5764657", "0.57321775", "0.56942946", "0.56884605", "0.56649286", "0.5661869", "0.5629918", "0.5627263", "0.56114846", "0.56094855", "0.56028706", "0.5589382", "0.55562", "0.55562", "0.55497146", "0.5547294", "0.554644", "0.5542193", "0.55339426", "0.55310047", "0.55275226", "0.5526571", "0.5512717", "0.55028313", "0.54903", "0.5487129", "0.5479655", "0.5479361", "0.54565465", "0.5454183", "0.54521716", "0.5448507", "0.5401862", "0.53931975", "0.5386682", "0.5383729", "0.5377595", "0.53748506", "0.5359739", "0.5354289", "0.5350443", "0.5349947", "0.5329819", "0.5328601", "0.53116554", "0.5307818", "0.53017765", "0.5291218", "0.5282999", "0.52749044", "0.52641445", "0.52459246", "0.52447593", "0.52393365", "0.5236451", "0.52341664", "0.52301586", "0.5224157", "0.5218186", "0.5213748", "0.521062", "0.52024275", "0.519749", "0.51930696", "0.5189088", "0.51869243", "0.5178685", "0.51688176", "0.51656485", "0.51629144", "0.51521814" ]
0.61264646
10
Executes a callback function on each of the child nodes.
final public function each($callback, array $data = array(), $deep = false) { return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function iterateChildren();", "public function getChildNodes();", "public function getChildNodes() {}", "public function getChildNodes() {}", "public function each($callback)\n {\n array_walk($this->items, $callback);\n }", "public function forEach(callable $callback): void {\n\t\tforeach ($this as $value) {\n\t\t\t$callback($value);\n\t\t}\n\t}", "function walk($parent_id, $callback) {\n $callback($this, $parent_id);\n $children = $this->children($parent_id);\n foreach($children as $c) {\n $this->walk($c, $callback);\n }\n }", "private function call($callback)\n {\n if ($this->getInnerIterator()->hasChildren()) {\n $this->callIfExists($callback);\n }\n }", "public function beginChildren()\n {\n parent::beginChildren();\n\n $this->call($this->descendCallback);\n }", "public function evaluateChildNodes();", "function getChildNodes() ;", "public function each(callable $callback): void\n {\n Tools::each($callback, $this->entries());\n }", "public function each(callable $callback);", "public function each(callable $callback);", "public function each(callable $callback);", "public function each(callable $callback);", "public function each($callback)\n {\n foreach ($this->entries as $entry) {\n call_user_func_array($callback, [\n 'file' => $entry,\n ]);\n }\n }", "public function get_children();", "public function ajax_callback()\n {\n echo $this->get_children();\n exit;\n }", "public function each ($func_name) { \r\n\t\t\r\n\t\tif (!function_exists($func_name)) return null;\r\n\t\t\r\n\t\tforeach ($this as $index => $node) $func_name($index, $node); \r\n\t}", "public function each(callable $callback): void\n {\n $this->blocks->each($callback);\n }", "public static function applyCallback(callable $callback, NodeInterface $root, $targetClass = ChildNodeInterface::class)\n {\n $processed = [];\n $f = function (ChildNodeInterface $targetNode) use ($callback, $targetClass, &$f, &$processed) {\n if (in_array($targetNode, $processed, true)) {\n return;\n }\n $nodes = $targetNode instanceof ParentNodeInterface\n ? $targetNode->getChildrenRecursive()->toArray()\n : [];\n $nodes[] = $targetNode;\n\n /** @var NodeInterface $node */\n foreach ($nodes as $node) {\n $node instanceof $targetClass && call_user_func($callback, $node);\n $node instanceof ParentNodeInterface && $node->children()->onItemAdd($f);\n $processed[] = $node;\n }\n };\n $f($root);\n }", "public function endChildren()\n {\n parent::endChildren();\n\n $this->call($this->ascendCallback);\n }", "public function parse($data, $callback){\r\n $parser = new \\SimpleXMLIterator($data);\r\n $this->content = $data;\r\n //process the root node\r\n if(isset($callback)){\r\n foreach($this->mappings as $mapping){\r\n if(strcmp($mapping->name(), $parser->getName()) == 0){\r\n $result = $this->invokeParser($mapping, $parser);\r\n if(isset($result)){\r\n $this->results[] = $result;\r\n }\r\n }\r\n }\r\n }\r\n //process children\r\n $this->start($parser, $callback);\r\n return $this->results;\r\n }", "public function traverseExpressions(callable $callback);", "public function _templateProcessing($attrs, $children) {\r\n $this->processingFunction = function($controller) use($children) {\r\n foreach($children as $child) {\r\n $child->__invoke($controller);\r\n }\r\n };\r\n }", "public function run(\\Traversable $items, callable $itemCallback)\n {\n $this->start();\n foreach ($items as $item) {\n call_user_func($itemCallback, $this, $item);\n }\n return $this->finish();\n }", "public function each(\\Closure $callback);", "public function getChildElements() {}", "public function _responseProcessing($attrs, $children) {\n $this->processingFunction = function($controller) use($children) {\n foreach($children as $child) {\n $child->__invoke($controller);\n }\n };\n }", "public function getChildren() {}", "public function getChildren() {}", "public function getChildren() {}", "protected function processFileTree () {\n\t\t$files = $this->populateFileTree();\n\t\tforeach ($files as $file) {\n\t\t\t$this->processFile($file);\n\t\t}\n\t}", "private function start($node, $callback)\r\n {\r\n for($node->rewind(); $node->valid(); $node->next())\r\n {\r\n if(isset($callback))\r\n {\r\n $mapping = $callback->getObject($node->key());\r\n if(!empty($mapping))\r\n {\r\n $result = $this->invokeParser($mapping, $node->current());\r\n if(isset($result)){\r\n $this->results[] = $result;\r\n }\r\n }\r\n }\r\n if($node->hasChildren())\r\n {\r\n $this->start($node->current(), $callback);\r\n }\r\n }\r\n }", "function loadedChildren()\r\n {\r\n //Calls childrens loaded recursively\r\n reset($this->components->items);\r\n while (list($k,$v)=each($this->components->items))\r\n {\r\n $v->loaded();\r\n }\r\n }", "private function iterate($children , &$all )\n\t{\n\t\t//in case of arrau has some elements\n\t\t// var_dump($children->attributes());echo \" Is Array :\".is_array($children->attributes()) ;die;\n\t\t//if($children->count() )\n\t\tif($children)\n\t\t\tforeach ($children as $key => $child) {\n\n\t\t\t\t//check if a node has key\n\t\t\t\tif(($child->attributes()[\"Key\"]) != null)\n\t\t\t\t{\n\t\t\t\t\t$all[] = $child;\n\t\t\t\t\t//echo \"in iterate :\".$child->attributes()[\"key\"].\"<br>\";\n\t\t\t\t}\n\t\t\t\t\t$this->iterate($child->AirSegmentRef , $all );\n\t\t}\n\t}", "protected function collectChildren(): void\n {\n $this->collection = new Collection();\n foreach ($this->rawResults as $blockChildContent) {\n $this->collection->add(Block::fromResponse($blockChildContent));\n }\n }", "public function loadChildNodes()\n {\n $ids = $this->_cache->getBackend()->getChildNodeIds($this);\n return $this->setChildNodeIds($ids);\n }", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "private function parseChildNodes(): void\n {\n foreach ($this->node->childNodes as $node)\n {\n /** @var \\DOMNode $node */\n switch ($node->nodeName)\n {\n case 'include':\n $this->parsePatternNodeAttributes($node, $this->includes);\n break;\n\n case 'exclude':\n $this->parsePatternNodeAttributes($node, $this->excludes);\n break;\n\n case '#text';\n break;\n\n default:\n throw new ConfigException(\"Unexpected child node '%s' found at %s:%d\",\n $node->nodeName,\n $this->path,\n $node->getLineNo());\n }\n }\n }", "public function testAddChild_Loop()\n\t{\n\t\t$someChild1 = new child('somechild1 att');\n\t\t$someChild2 = new child('somechild2 att');\n\t\t$someChild3 = new child('somechild3 att');\n\n\t\t$childList = array($someChild1, $someChild2, $someChild3);\n\n\t\tforeach ($childList as $child)\n\t\t{\n\t\t\t$this->object->AddChild($child);\n\t\t}\n\n\t\t$this->assertEquals('somechild1 att', $this->object->childList[0]->attribute);\n\t\t$this->assertEquals('somechild2 att', $this->object->childList[1]->attribute);\n\t\t$this->assertEquals('somechild3 att', $this->object->childList[2]->attribute);\n\t}", "public function each(callable $f)\n {\n array_walk($this->items, $f);\n }", "protected function buildRenderChildrenClosure() {}", "protected function actionPostLoadingEvent()\n {\n if (self::$child_data === null) {\n self::$child_data = [];\n foreach ($this->getParentModel()->children->child->iterateItems() as $node_uuid => $node) {\n if (empty((string)$node->enabled)) {\n continue;\n }\n $conn_uuid = (string)$node->connection;\n if (!isset(self::$child_data[$conn_uuid])) {\n self::$child_data[$conn_uuid] = [];\n }\n foreach (self::$child_attrs as $key) {\n if (!isset(self::$child_data[$conn_uuid][$key])) {\n self::$child_data[$conn_uuid][$key] = [];\n }\n self::$child_data[$conn_uuid][$key][] = (string)$node->$key;\n }\n }\n }\n foreach ($this->internalChildnodes as $node) {\n if (!$node->getInternalIsVirtual()) {\n $extra_attr = ['local_ts' => '', 'remote_ts' => ''];\n $conn_uuid = (string)$node->getAttribute('uuid');\n foreach (self::$child_attrs as $key) {\n $child_node = new TextField();\n $child_node->setInternalIsVirtual();\n if (isset(self::$child_data[$conn_uuid]) && !empty(self::$child_data[$conn_uuid][$key])) {\n $child_node->setValue(implode(',', array_unique(self::$child_data[$conn_uuid][$key])));\n }\n $node->addChildNode($key, $child_node);\n }\n }\n }\n return parent::actionPostLoadingEvent();\n }", "public function walk($callback, array $args = array())\n {\n $results = array();\n $useItemCallback = is_string($callback) && strpos($callback, '::') === false;\n foreach($this->_data as $id => $item) {\n if ($useItemCallback) {\n $cb = array($item , $callback);\n } else {\n $cb = $callback;\n array_unshift($args, $item);\n }\n $results[$id] = call_user_func_array($cb, $args);\n }\n return $results;\n }", "public function renderChildren() {}", "function submit() {\n foreach ($this->submit_callbacks as $callback) {\n call_user_func($callback, $this);\n }\n foreach ($this->children as $element) {\n $element->submit();\n }\n }", "function add_children(){\n\t\t\t\t\t//if the array has a parent add it to the parents child array\n\t\tforeach ($this->nodes as $node){\n\t\t\tif($node->parent!=-1){\n\t\t\t\tif(isset($this->nodes[$node->parent])){\n\t\t\t\t\t$parent=$this->nodes[$node->parent];\n\t\t\t\t\t$parent->add_child($node->id);\n\t\t\t\t}else{\n\t\t\t\t\tprint_error('nonode','socialwiki');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function getChilds();", "public function removeChildNodes() {}", "public function getChildren()\n {\n }", "public function getChildren()\n {\n }", "public function traverse(callable $callable)\n {\n }", "public function each($callback)\n {\n foreach ($this as $item) {\n $callback($item);\n }\n return $this;\n }", "function allChildProcessComplete(){\n print \"All child processing completed \\n\";\n}", "private function parse()\n {\n $this->parseChildrenNodes($this->_dom, $this->_rootNode);\n }", "public function hasChildNodes() {}", "public function forEach(callable $callable): void\n {\n foreach ($this->entries() as $key => $value)\n { $callable($value, $key, $this); }\n }", "public function getChildren(array $columns = ['*']);", "public function each($callback, $fetchMode = \\PDO::FETCH_ASSOC)\n {\n while ($row = $this->statement->fetch($fetchMode)) {\n $callback($row);\n }\n }", "public function getChildren(): array;", "function children() {\n\t\t$this->load_children();\n\t\treturn $this->_children;\n\t}", "function wp_find_hierarchy_loop($callback, $start, $start_parent, $callback_args = array())\n {\n }", "public function getAllChildNode()\r\n {\r\n return $this->_childNodes;\r\n }", "public function each(callable $callback)\n {\n array_map($callback, $this->stack);\n\n return $this;\n }", "public function map($sel, $callback)\n\t{\n\n\t\t$nodes = pq($sel);\n\t\t$this->data = [];\n\t\tforeach ($nodes as $node) {\n\t\t\t// node is a domelement\n\t\t\t$node = pq($node);\n\t\t\t$datum = $this->$callback($node);\n\t\t\t$this->data[] = $datum;\n\t\t}\n// $this->data = $data;\n\n\t\treturn $this;\n\t}", "private function getAllChildren($region)\n {\n foreach ($region->children as $child){\n $this->allChildrenIds[] = $child->id;\n if (count($child->children) > 0){\n $this->getAllChildren($child);\n }\n }\n }", "function printChild($data)\n{\n\n}", "public function map($callback, $callbackArg = null) {\n\treturn array_walk($this->_elArray, $callback, $callbackArg);\n}", "public function each($callback, $chunkSize = 1000)\n {\n $i = 0;\n $this->chunk($chunkSize, function($entries) use ($callback, $i) {\n foreach ($entries as $e) {\n $callback($e, $i);\n $i++;\n }\n });\n }", "public function readWithCallback(callable $callback)\n {\n while (!$this->eof()) {\n $content = $this->readPart();\n\n if ($content == null) {\n break;\n }\n\n $callback($content, null);\n }\n }", "function addChildren(array $children) : void;", "public function traverse(): void\n {\n // Register data hooks on the table\n $this->registerHandlerDefinitions($this->definition->tableName, $this->definition->tca);\n \n // Register data hooks on the types and fields\n $this->traverseTypes();\n $this->traverseFields();\n \n // Allow externals\n $this->eventBus->dispatch(new CustomDataHookTraverserEvent($this->definition, function () {\n $this->registerHandlerDefinitions(...func_get_args());\n }));\n }", "public function setChildren(NodeList $children) {\n\t\t$this->children = $children;\n\t}", "public function callback();", "public function map(callable $callback, array $data, $maxChildren)\n {\n $this->disconnectAll();\n $pids = [];\n $res = [];\n\n try {\n foreach ($data as $k => $args) {\n $pid = pcntl_fork();\n if ($pid == -1) {\n throw new ForkException(pcntl_strerror(pcntl_get_last_error()));\n } elseif ($pid > 0) {\n // if we are in parent collect pids of child processes\n $pids[$pid] = $k;\n // reserve place for result value in proper sequence\n $res[$k] = null;\n // wait some child to exit if max children reached\n if (count($pids) >= $maxChildren) {\n $pid = pcntl_wait($status);\n $res[$pids[$pid]] = $this->getValue($pid, $status);\n unset($pids[$pid]);\n }\n } else {\n // do the job in child\n try {\n try {\n $this->connectAll();\n $result = call_user_func_array($callback, (array)$args);\n $this->putValue(getmypid(), $result);\n } catch (Exception $ex) {\n $msg = $this->logException($ex);\n $this->putValue(getmypid(), $msg);\n exit(1);\n }\n } catch (Exception $ex) {\n exit(1);\n } finally {\n exit(0);\n }\n }\n }\n } finally {\n // wait all remaining processes\n foreach ($pids as $pid => $one) {\n pcntl_waitpid($pid, $status);\n $res[$pids[$pid]] = $this->getValue($pid, $status);\n }\n $this->connectAll();\n }\n\n return $res;\n }", "public function walk()\n {\n return function ($callback) {\n array_walk($this->items, $callback);\n };\n }", "protected function deleteChildren() {}", "function _gatherChildren($nid) {\n\t$return = array();\n\t$node =& $this->_allNodes[$nid];\n\tif (is_array ($this->_allParent[$node->id])) {\n\t\tforeach ($this->_allParent[$node->id] as $nodeZ) {\n\t\t$z =& $this->_allNodes[$nodeZ];\n\t\t// We found a child\n\t\t$this->_nodeArrayizeData($z);\n\t\t// Check for references\n\t\t$this->_makeReferences($z);\n\t\t// Merge with the big array we're returning\n\t\t// The big array being all the data of the children of our parent node\n\t\t$return = $this->_array_kmerge($return,$z->data);\n\t\t}\n\t}\n\treturn $return;\n\t}", "public function getChildrenQuery();", "function render_callback() {\n\t\t$callback = NULL === $this->render_callback\n\t\t\t? array( $this, 'render_page' )\n\t\t\t: $this->render_callback;\n\n\t\tcall_user_func( $callback, $this );\n\t}", "function _page_traverse_name($page_id, &$children, &$result)\n {\n }", "protected function listChildren()\n {\n $this->children = new ArrayObject();\n if ($this->cursor instanceof DOMNode) {\n $childrenNodes = $this->cursor->childNodes;\n foreach ($childrenNodes as $child) {\n switch ($child->nodeName) {\n case 'text:p':\n $element = new OpenDocument_Element_Paragraph($child, $this);\n break;\n case 'text:h':\n $element = new OpenDocument_Element_Heading($child, $this);\n break;\n default:\n $element = false;\n }\n if ($element) {\n $this->children->append($element);\n }\n }\n }\n }", "public function enumerateFiles($callback);", "public function childNodes($idx = -1)\n {\n $nodeList = $this->getIterator();\n\n if ($idx === -1) {\n return $nodeList;\n }\n\n if (isset($nodeList[$idx])) {\n return $nodeList[$idx];\n }\n\n return null;\n }", "function render_callback() {\n\t\t$callback = NULL === $this->render_callback\n\t\t\t? array( $this, 'render' )\n\t\t\t: $this->render_callback;\n\n\t\tcall_user_func( $callback, $this );\n\t}", "public function apply(callable $callback);", "public function fetchAll(callable $callback = NULL);", "public function walkSearchableEntities(callable $callback)\n {\n $query = $this->getSearchableEntitiesQuery();\n if (property_exists($this, 'walkSearchableWith') && !empty($this->walkSearchableWith)) {\n $query->with($this->walkSearchableWith);\n }\n\n $query->chunk(1000, function ($entities) use ($callback) {\n $callback($entities);\n });\n }", "public function map(callable $callback): Sequence;", "static public function callbackItemsContainer($i, $v, $piecesPath) {\n $document = pq($v);\n self::$callbackResultHelper[$i]['container'] = $document->html();\n\n foreach ($piecesPath as $traverse) {\n foreach($traverse as $method => $arg) {\n $pieces = $document->$method($arg);\n }\n }\n phpQuery::each($pieces, array(__CLASS__, 'callbackItemsPieces'), new CallbackParam, new CallbackParam, $i);\n }", "public function getChildren() {\n $childNodes = $this->getNode()->getChildren();\n $children = array();\n foreach ($childNodes as $childNode) {\n $child = $childNode->getPage($this->getLang());\n if ($child) {\n $children[] = $child;\n }\n }\n return $children;\n }" ]
[ "0.6595269", "0.64285487", "0.6387632", "0.63863707", "0.6334177", "0.6329996", "0.6239527", "0.62331754", "0.62168336", "0.62017244", "0.61088604", "0.61075777", "0.6072097", "0.6072097", "0.6072097", "0.6072097", "0.5913235", "0.5824274", "0.5789463", "0.5764517", "0.57221955", "0.5693193", "0.5689691", "0.5650916", "0.55567265", "0.55418026", "0.55174476", "0.5514408", "0.5486725", "0.54344743", "0.54205215", "0.54205215", "0.54205215", "0.54150087", "0.54121464", "0.53765875", "0.53576654", "0.534884", "0.53147256", "0.52970934", "0.52970934", "0.52970934", "0.52970934", "0.52970934", "0.52970934", "0.52970934", "0.52970934", "0.52970934", "0.52827966", "0.528077", "0.5278373", "0.52647847", "0.5242844", "0.5189522", "0.5158583", "0.5157761", "0.5141725", "0.51405036", "0.5121505", "0.51058626", "0.51058626", "0.50624764", "0.50573474", "0.5037989", "0.502711", "0.4991485", "0.4989742", "0.49730048", "0.496791", "0.49320728", "0.4925019", "0.49215025", "0.49188763", "0.48972428", "0.48752373", "0.48622963", "0.48526227", "0.48490956", "0.48402995", "0.48274255", "0.48225886", "0.48210502", "0.4816811", "0.4815765", "0.48136124", "0.4809238", "0.48042327", "0.4799985", "0.4799686", "0.47959507", "0.47768247", "0.47662395", "0.4761139", "0.47598734", "0.47590405", "0.47550705", "0.47543842", "0.4747476", "0.47432488", "0.4741317", "0.47380772" ]
0.0
-1
Returns a duplicate of the node.
final public function copy(array $params = null) { return clone $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function duplicate()\n {\n $duplicator = new NodeDuplicator(\n $this->getNode(),\n $this->objectManager,\n $this->nodeNamePolicy\n );\n return $duplicator->duplicate();\n }", "public function duplicate(){\n\t\treturn self::cloneObject($this);\n\t}", "public function cloneNode() {\n return clone $this;\n }", "public function cloneNode()\n\t\t{\n\t\t\t$oDomNode = dom_import_simplexml( $this );\n\t\t\t$oNewNode = $oDomNode->cloneNode( true );\n\t\t\t\n\t\t\treturn( simplexml_import_dom( $oNewNode, \"SimpleXMLElementExt\" ) );\t\t\t\n\t\t\t\n\t\t}", "private function replicateNodeTree(Node $node): Node\n {\n /** @var Node $new */\n $new = $node->copy();\n\n $this->copyChildren($node, $new);\n\n return $new;\n }", "public function createDuplicate();", "public function duplicate()\n {\n }", "public function createClone()\n {\n return clone $this;\n }", "function duplicate($obj) {\n $newObj = $obj;\n return $newObj;\n}", "public function duplicate() {\n \t\t\n \t\ttry {\n\t\t\t\n\t \t\t// start duplicate\n\t\t\t$class = get_class($this);\n \t\t\t$duplicate = new $class;\n \t\t\t\n\t \t\t// duplicate row fields\n\t \t\t$this->duplicateRow($duplicate);\n\t \t\t\n \t\t\t// duplicate data\n\t \t\t$this->duplicateData($duplicate);\n\t \t\t\n\t \t\t// duplicate items\n\t \t\t$this->duplicateChildren($duplicate);\n\t \t\t\n\t \t\t$duplicate->setDuplicate($this->getId());\n \t\t\n \t\t\treturn $duplicate;\n \t\t\t\n \t\t} catch (Exception $e) {\n \t\t\n \t\t\treturn false;\n \t\t\t\n \t\t}\n \t\t\n \t}", "function copy() {\r\n\t\t\t$cloneLink = new LinkNode($this->getDOMDocument());\r\n\t\t\t$cloneLink->setAttribute('href',$this->getAttribute('href'));\r\n\t\t\t$cloneLink->setAttribute('target',$this->getAttribute('target'));\r\n\t\t\t\r\n\t\t\treturn $cloneLink;\r\n\t\t}", "function get_copy()\r\n\t{\r\n\t\t$copy = clone($this);\r\n\r\n\t\t$copy->id = NULL;\r\n\r\n\t\treturn $copy;\r\n\t}", "function get_clone()\r\n\t{\r\n\t\treturn clone($this);\r\n\t}", "function copy ()\n {\n return clone $this;\n }", "function &copy( )\n {\n $new = $this;\n $new->unsetID();\n $new->store();\n\n return $new;\n }", "function getClone(){\n\t\t\treturn clone($this);\n\t\t}", "public function copy(): self\n {\n return $this->immute(true); // force immute\n }", "public function copy()\n {\n $set = clone $this;\n return $set;\n }", "function copy(){ return $this->_copy(); }", "public function getCopy();", "public function getCopy();", "public function copy()\n {\n $that = clone($this);\n\n return $that;\n }", "public function clone(): Rut\n {\n return clone $this;\n }", "public function getClone()\n {\n return $this->clone;\n }", "public function clone() {\n return null;\n }", "public function getRepeatNode()\n {\n return $this->repeatNode;\n }", "public function copyNode(Node $node, Node $parent)\n {\n /** @var Node $new */\n $new = $this->replicateNodeTree($node);\n\n $parent->appendNode($new);\n\n $parent->fresh();\n\n $this->rebuildNodeBranchRoute($parent);\n\n $this->normalizeChildNodesSortIndex($parent);\n\n return $parent->fresh();\n }", "public function copy()\n {\n if($this->is_copy)\n {\n return $this;\n }\n else\n {\n $obj = clone $this;\n $obj->is_copy = true;\n return $obj;\n }\n }", "public function copy()\n {\n return new static($this);\n }", "function dup() {\n\t\t$slide = clone $this;\n\t\t$slide->gen_id();\n\t\t$slide->set_index($slide->get_index() + 1);\n\t\t$slide->set_lock(NULL);\n\n\t\t// Make sure all directories are created.\n\t\t$slide->write();\n\n\t\t$tmp = [];\n\t\tforeach ($this->get_assets() as $a) {\n\t\t\t$tmp[] = $a->clone($slide);\n\t\t}\n\t\t$slide->set_assets($tmp);\n\n\t\t// Write latest changes.\n\t\t$slide->write();\n\n\t\t$queue = $slide->get_queue();\n\t\t$queue->add($slide);\n\t\t$queue->write();\n\n\t\treturn $slide;\n\t}", "public function &copy_preg_node($node) {\n $result = clone $node;\n return $result;\n }", "public function copy(): self;", "public function __clone() {\n\t\treturn clone $this;\n }", "function removeDuplicate(){\n\t\t$current = $this->head;\n\t\t$index = null; \n\t\t$temp = null;\n\t\tif($this->head == NULL){\n\t\t\treturn \"list is empty\";\n\t\t}else{\n\t\t\twhile($current != NULL){\n\t\t\t\t$temp = $current;\n\t\t\t\t$index = $current->next;\n\n\t\t\t\twhile($index != NULL){\n\t\t\t\t\tif($current->data == $index->data){\n\t\t\t\t\t\t$temp->next = $index->next;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$temp = $index;\n\t\t\t\t\t}\n\t\t\t\t\t$index = $index->next;\n\t\t\t\t}\n\t\t\t\t$current = $current->next;\n\t\t\t}\n\t\t}\n\t}", "public function duplicate() {\n\t\t$page = parent::duplicate();\n\t\t\n\t\t// the form fields\n\t\tif($this->Fields()) {\n\t\t\tforeach($this->Fields() as $field) {\n\t\t\t\t$newField = $field->duplicate();\n\t\t\t\t$newField->ParentID = $page->ID;\n\t\t\t\t$newField->write();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// the emails\n\t\tif($this->EmailRecipients()) {\n\t\t\tforeach($this->EmailRecipients() as $email) {\n\t\t\t\t$newEmail = $email->duplicate();\n\t\t\t\t$newEmail->FormID = $page->ID;\n\t\t\t\t$newEmail->write();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $page;\n\t}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this;}", "function __clone() { return $this; }", "function __clone() { return $this; }", "public function copy(): Model\n {\n $new = $this->replicate();\n $new->push();\n\n return $new;\n }", "public function __clone();", "public function __clone();", "public function __clone() {\n\t\tif ($this->dimensions instanceof Collection) {\n\t\t\t$existingDimensions = $this->dimensions->toArray();\n\t\t\t$this->dimensions = new ArrayCollection();\n\t\t\t/** @var NodeDimension $existingDimension */\n\t\t\tforeach ($existingDimensions as $existingDimension) {\n\t\t\t\t$this->dimensions->add(new NodeDimension($this, $existingDimension->getName(), $existingDimension->getValue()));\n\t\t\t}\n\t\t}\n\t}", "public function __clone()\n {\n $this->object1 = clone $this->object1;\n return $this->object1;\n }", "public function copy();", "public function setDuplicate($duplicate) {\n\t\t$this->_duplicate = $duplicate;\n\t\treturn $this;\n\t}", "public function duplicateAction()\n {\n $id = $this->getRequest()->get($this->admin->getIdParameter());\n $email = $this->admin->getObject($id);\n\n $cloner = $this->container->get('librinfo.email.cloning');\n\n $object = $cloner->cloneEmail($email);\n\n return $this->createAction($object);\n }", "function makeClone()\n {\n $this->id = 0;\n }", "public function duplicate(DomainResource $resource): Action\n {\n $clone = clone $this;\n $clone->resource = $resource;\n return $clone;\n }", "protected function pickNewNode()\n {\n // mark current active node as inactive\n $this->getActiveNode()->setInactive(true);\n $this->setActiveNodeIndex($this->pickNode());\n\n return $this;\n }", "public function clone()\n {\n \n }", "public function shiftNode();", "public function getDuplicate() {\n\t\tif ($this->_duplicate == null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->_duplicate;\n\t}", "public function __clone() {}", "public function __clone() {}", "public function __clone() {}", "public function __clone() {}", "final public function __clone()\n {\n return;\n }", "public function copy()\n\t\t{\n\t\t\treturn unserialize(serialize($this)); \n\t\t}", "public function &copy() {\n $copy = clone $this;\n return $copy;\n }", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}" ]
[ "0.82958126", "0.754263", "0.7497843", "0.7123807", "0.68968034", "0.65360004", "0.63945055", "0.631674", "0.6251477", "0.6250337", "0.62381965", "0.6201114", "0.6095647", "0.604233", "0.60077184", "0.5974419", "0.595604", "0.5941394", "0.5935824", "0.588741", "0.588741", "0.5885973", "0.58851457", "0.5874631", "0.5858773", "0.5847386", "0.58418", "0.58371913", "0.5827324", "0.5811716", "0.57976377", "0.57664734", "0.57414216", "0.5727232", "0.5700176", "0.568608", "0.568608", "0.568608", "0.568608", "0.568608", "0.568608", "0.568608", "0.568608", "0.568608", "0.568608", "0.568608", "0.568608", "0.568608", "0.568608", "0.568608", "0.568608", "0.568608", "0.5676726", "0.5676726", "0.5668755", "0.5611264", "0.5611264", "0.56112224", "0.558557", "0.555792", "0.55567676", "0.5554548", "0.5553485", "0.5550356", "0.5549241", "0.55403775", "0.5529605", "0.550512", "0.54990363", "0.54990363", "0.54990363", "0.54990363", "0.54837525", "0.5482816", "0.54824364", "0.5467932", "0.5467932", "0.5467932", "0.5467932", "0.5467932", "0.5467932", "0.5467932", "0.5467932", "0.5467932", "0.5467932", "0.5467932", "0.54593503", "0.54593503", "0.54593503", "0.54593503", "0.54593503", "0.54593503", "0.54593503", "0.54593503", "0.54593503", "0.54593503", "0.54593503", "0.54593503", "0.54593503", "0.54593503", "0.54593503" ]
0.0
-1
Adds a node to this node as a child.
final public function add(CtkBuildable $node) { throw new CakeException('Cannot add children to node'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addChild(Node $child);", "public function addChild(Node $child)\n {\n $this->children[] = $child;\n }", "function addChild( $node )\n\t\t{\n\t\t$this->childs[] = $node ;\n\t\t}", "public function add($child) {\n $this->children[] = $child;\n }", "public function addChild(Node $child) {\n return $this->root->addChild($child);\n }", "public function addChild(Node $node)\n {\n $node->setParent($this);\n\n $this->child[] = $node;\n\n return $this;\n\n }", "public function addChild(self $child): void\n\t{\n\t\tif (!$this->children->contains($child)) {\n\t\t\t// ...and assign it to collection\n\t\t\t$this->children->add($child);\n\t\t}\n\t}", "public function appendChild(Node $node)\n {\n $this->_children[] = $node;\n }", "public function addChildNode(\\F3\\Fluid\\Core\\Parser\\SyntaxTree\\NodeInterface $childNode);", "public function add_child($child) {\n\t\t$this->children[] = $child;\n\t}", "public function addChildNode( SimpleXMLElement $oChild ) \n\t\t{\n\t\t\t$oParentDOM = dom_import_simplexml( $this );\n\t\t\t$oChildDOM = dom_import_simplexml( $oChild );\n\t\t\t$oNewParentDOM = $oParentDOM->ownerDocument->importNode( $oChildDOM, true );\n\t\t\t$oParentDOM->appendChild( $oNewParentDOM );\n\t\t\n\t\t}", "public function addChild(CategoryTreeNodeInterface $child);", "public function addChild(self $child): self\n {\n $this->children[] = $child;\n\n return $this;\n }", "public function addChild(pdoMap_Core_XML_Node $child) {\n $this->__childs[] = $child;\n // echo 'Add child '.$this->getName().'.'.$child->getName().'<br />';\n }", "public function add_child(SBBCodeParser_Node $child)\r\n\t{\r\n\t\t$this->children[] = $child;\r\n\t\t$child->set_parent($this);\r\n\t}", "public function add_child(HTMLNode $node): int\n {\n return $this -> children -> add($node);\n }", "function add_child( $child ) {\n\t\tif( $child instanceof ModularPost ) {\n\t\t\t$this->children[] = $child;\n\t\t}\n\t}", "protected function append($child): void\n {\n $this->children[] = $child;\n }", "public function addChild($itemID){\n $child = new FPNode($itemID,1,$this);\n array_push($this->children, $child);\n return $child;\n }", "public function set_addChildNode($param)\n\t{\n\t\t$this->addChildNode = $param; return $this;\n\t}", "function add_node($child_id, tree_node $tt) {\n $this->triples[$child_id] = $tt;\n $this->children[$tt->parent_id][$child_id] = true;\n }", "function addChild( $ni )\n\t\t{\n\t\t$this->childs[] = $ni ;\n\t\t}", "function appendChild ($a_node)\n\t{\n\t\treturn $this->doc->append_child($a_node);\n\t}", "final public function addChild ()\n {\n throw new ChildException('Trying to add child to self closing HTML element');\n }", "public function add($child, $type = null, array $options = array());", "public function addChild($child)\r\n\t{\r\n\t\t$this->last = $child->last;\r\n\r\n\t\t$this->entries []= $child;\r\n\t}", "public function addChildAsLast(Node $node)\n {\n if(null === $this->children)\n {\n $this->children = array();\n }\n\n $this->children[] = $node;\n }", "public function addChild(object $child): self\n {\n $this->children->add($child);\n\n return $this;\n }", "function addChild($name) {\n\t\tarray_push($this->childrens, $name);\n\t}", "public function appendChild($childNode)\r\n {\r\n $this->_childNodes[$childNode->id] = $childNode;\r\n $childNode->setParentNode($this);\r\n }", "public function pushNode( $node );", "public function appendChild(Pagemill_Node $node) {\r\n\t\t$tmp = new Pagemill_Stream(true);\r\n\t\t$node->rawOutput($tmp);\r\n\t\t$this->_text .= $tmp->peek();\r\n\t}", "public function add($child, $name = false) {\n\t\tif( $name ) {\n\t\t\t$this->childs[$name] = $child;\n\t\t} else {\n\t\t\t$this->childs[] = $child;\n\t\t}\n\t\treturn $this;\n\t}", "public function add_child(\\WP_Comment $child)\n {\n }", "public function addChild(Node $node, $pos = null) {\n //set the child node level\n $node->level = $this->level+1;\n\n //set the parent node\n $node->parent = $this;\n\n //if the position is unset, add the node at the endding\n if(is_null($pos)) {\n $this->nodes->push($node);\n } else {\n if($pos < 0) {\n //if the position is less than 0, add the node at the beginning\n $pos = 0;\n } else if($pos > $this->nodes->count()) {\n //if the position is greater than the node count, add the node at the endding\n $pos = $this->nodes->count();\n }\n\n $this->nodes->add($pos, $node);\n }\n\n return $this->clearFindCache();\n }", "public function addNode(self $node) : self\n {\n $this->append($node);\n return $this;\n }", "public function add($child)\r\n {\r\n if ($child instanceof tag) {\r\n if ($child->id && array_key_exists($child->id,$this->ref)) {\r\n return $this->ref[$child->id]; \r\n }\r\n $child->tagdep = abs($this->tagdep) + 1;\r\n $this->tagdep = abs($this->tagdep) * -1;\r\n }\r\n //Append child to childs repo\r\n $this->childs[] = $child;\r\n //If child isn't object return $this tag\r\n if (!is_object($child)) {\r\n return $this;\r\n }\r\n if ($child->id) {\r\n $this->ref[$child->id] =& $child;\r\n }\r\n $child->parent =& $this;\r\n return $child;\r\n }", "public function appendChild($child, array $options = array()) \n {\n $this->children[] = $child;\n\n return $child;\n }", "public function appendChild($child = NULL)\n\t{\n\t\tif ($child instanceof DOMNode) {\n\t\t\tparent::appendChild($child);\n\t\t}\n\t\treturn $this;\n\t}", "protected function addChildIfMissing(NodeInterface $child)\n {\n $this->addChild($child);\n }", "public function AddChildElement(IElement $child)\r\n {\r\n $this->Children[] = $child->Render();\r\n }", "abstract public function insert ( \\Hoa\\Tree\\Generic $child );", "public function addChildItem(BasketItem $item)\n {\n // add child item price\n $priceData = $this->getPrice()->toArray();\n $priceData['real_price'] += $item->getPrice()->getPrice();\n $this->price = new Price($priceData);\n\n $this->children[] = $item;\n }", "function append($node) {\n\t\tif (!is_array($node)) {\n\t\t\t$this->child[]=$node;\n\t\t} else if (is_array($node)) {\n\t\t\tfor ($childIdx=0; $childIdx<count($node); $childIdx++)\n\t\t\t\t$this->child[]=$node[$childIdx];\n\t\t}\n\t}", "abstract public function addItemChild($itemName, $childName);", "public function addChild(ExecutableInterface $newChildNode)\r\n\t{\r\n\t\tif (count($this->childrenNodes)>0)\r\n\t\t{\r\n\t\t\t$this->childrenNodes[] = $newChildNode;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->childrenNodes = array($newChildNode);\r\n\t\t}\r\n\t\treturn $this->childrenNodes;\r\n\t}", "private function pushNode(\\DOMElement $node)\r\n {\r\n $this->currentNode = $this->currentNode->appendChild($node);\r\n }", "public function addChild(EntityInterface $child, $position = null);", "function addChild(T_CompositeLeaf $child,$key=null)\n {\n if (isset($key)) {\n $this->children[$key] = $child;\n } else {\n $this->children[] = $child;\n }\n return $this;\n }", "public function addNode(string $name, string $value) : self\n {\n $this->xml->addChild($name, $value);\n\n return $this;\n }", "public function insertChildNode($child, $parent)\n {\n $parent = $this->getNode($parent);\n return $this->insertNode($child, $parent);\n }", "public function addChild(CustomDefAbstract $def)\n\t{\n\t\t$this->children->add($def);\n\t\t$def['parent'] = $this;\n\t\t$this->_onPropertyChanged('children', $this->children, $this->children);\n\t}", "public function addNode($node, $action = self::NODE_ADD);", "public function __invoke(Node $node, Node $parent): Node\n {\n if (! $node->isRootNode()) {\n $node->getParentNode()->removeNode($node);\n }\n\n $parent->addChildNodes($node);\n\n return $node;\n }", "function addChild($key, IBabylonModel $child) : IBabylonModel;", "public function append(Node $node)\n {\n\n if (!is_array($this->_children)) {\n $this->_children = [];\n }\n\n $this->_children[] = $node;\n return $this;\n }", "function addChild(&$abstractframe)\n {\n $this->m_childs[] = &$abstractframe;\n }", "function appendChild(&$treeItem, $parentItem) {\n\t\t$this->trackItem($treeItem);\n\n\t\tif ($parentItem == null) {\n\t//\t\t$parentItem =& $this->_rootNode;\n\t\t\t$this->rootItem->children[] = $treeItem->getId();\n\t\t} else {\n\t\t\t//get the global reference\n\t\t\t$parentItem =& $this->getItem($parentItem);\n\t\t\tif ($treeItem->_expanded) {\n\t\t\t\t$this->expandBranch($parentItem);\n\t\t\t}\n\t//\t\t$parentItem->appendChild($treeItem);\n\t\t\t$parentItem->children[] = $treeItem->getId();\n\t\t\t$treeItem->_parentPointer = $parentItem->getId();\n\t\t}\n\t}", "function add($n)\n\t{\n\t\tif (is_array($n))\n\t\t{\n\t\t\tfor($i = 0; $i < count($n); ++$i)\n\t\t\t{\n\t\t\t\t$this->children[] = $n[$i];\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->children[] = $n;\n\t\t}\n\t}", "function add($n)\n\t{\n\t\tif (is_array($n))\n\t\t{\n\t\t\tfor($i = 0; $i < count($n); ++$i)\n\t\t\t{\n\t\t\t\t$this->children[] = $n[$i];\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->children[] = $n;\n\t\t}\n\t}", "public function addChild($child)\n\t{\n\t\tif ($child instanceof ElseNode) {\n\t\t\tif (!$this->getLastChild() instanceof IfNode) {\n\t\t\t\tthrow new \\PHPSass\\Exception('@else(if) directive must come after @(else)if', $child);\n\t\t\t\t}\n\t\t\t$this->getLastChild()->addElse($child);\n\t\t\t}\n\t\telse {\n\t\t\t$this->children[]=$child;\n\t\t\t$child->parent=$this;\n\t\t\t$child->setRoot($this->root);\n\t\t\t}\n\t}", "public function addChild(ModelInterface $child, $placeholder = null, $append = false);", "public function createchild($value) {\n return $this->setProperty('createchild', $value);\n }", "public function addChild($arg = \"\", $index = -1) {\n\t\tif ($index < 0 || $index >= count($this->children)-1) {\n\t\t\tif (is_array($arg)) {\n\t\t\t\tforeach ($arg as $a) {\n\t\t\t\t\t$this -> addChild($a);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($arg instanceof Node) {\n\t\t\t\t\tif ($arg -> parentNode) {\n\t\t\t\t\t\t$arg -> parentNode -> removeChild($arg);\n\t\t\t\t\t}\n\t\t\t\t\t$arg -> parentNode = $this;\n\t\t\t\t\treturn $this -> children[] = $arg;\n\t\t\t\t} elseif (is_string((string) $arg)) {\n\t\t\t\t\t$textNode = new TextNode($arg);\n\t\t\t\t\t$textNode -> parentNode = $this;\n\t\t\t\t\treturn $this -> children[] = $textNode;\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif (is_int($index)) {\n\t\t\tfor ($i = count($this->children); $i >= $index; $i--) {\n\t\t\t\t$child = $this->children[$i];\n\t\t\t\t$this->children[$i+1] = $child;\n\t\t\t}\n\t\t\tif ($arg instanceof Node) {\n\t\t\t\tif ($arg -> parentNode) {\n\t\t\t\t\t$arg -> parentNode -> removeChild($arg);\n\t\t\t\t}\n\t\t\t\t$arg -> parentNode = $this;\n\t\t\t\treturn $this -> children[$index] = $arg;\n\t\t\t} elseif (is_string((string) $arg)) {\n\t\t\t\t$textNode = new TextNode($arg);\n\t\t\t\t$textNode -> parentNode = $this;\n\t\t\t\treturn $this -> children[$index] = $textNode;\n\t\t\t}\n\t\t}\n\t}", "public function addChild(BlockInterface $child, $key = null)\n {\n if (null !== $key) {\n $this->children->set($key, $child);\n\n return true;\n }\n\n return $this->children->add($child);\n }", "public function AddChild(string $childHTML)\r\n {\r\n $this->Children[] = $childHTML;\r\n }", "public function testAddChild_Simple()\n\t{\n\t\t$this->object->AddChild($this->child);\n\t\t$this->assertType(\"child\", $this->object->childList[0]);\n\t\t$this->assertEquals(1, sizeof($this->object->childList));\n\t}", "public function addChild($route, Action $action) {\n // and extend the segment to contain the whole expression\n // if it contains a `/`\n if(substr_compare($route, '</', 0, 2) === 0) {\n preg_match('/<\\/.*?\\/>[^\\/]*/', $route, $matches);\n $segment = $matches[0];\n $segment_length = strlen($segment);\n if($segment_length < strlen($route))\n $remaining = substr($route, $segment_length + 1);\n } else {\n list($segment, $remaining) = preg_split(self::URL_SEGMENT_DELIMITER, $route, 2) + array(null, null);\n }\n\n if(!isset($this->children[$segment])) {\n $this->children[$segment] = new Node();\n }\n\n if(isset($remaining) && strlen($remaining) > 0) {\n $this->children[$segment]->addChild($remaining, $action);\n } else\n $this->children[$segment]->setAction($action);\n\n }", "public function addChild(ThemeMenuItem $child)\n {\n }", "function add_children(){\n\t\t\t\t\t//if the array has a parent add it to the parents child array\n\t\tforeach ($this->nodes as $node){\n\t\t\tif($node->parent!=-1){\n\t\t\t\tif(isset($this->nodes[$node->parent])){\n\t\t\t\t\t$parent=$this->nodes[$node->parent];\n\t\t\t\t\t$parent->add_child($node->id);\n\t\t\t\t}else{\n\t\t\t\t\tprint_error('nonode','socialwiki');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function addChild(HTMLElement $el) {\n\t\tparent::addChild($el);\n\t\t/* Add pointer to last child, and its children */\n\t\t$this->rAddPointers($this->getChild($this->getNoOfChildren()-1));\n\t}", "public function addLine($line) {\n\t\t$this->children[] = $line;\n\t\treturn $this;\n\t}", "function add_child($dom, $base, $name, $value) {\n\tif ($value) {\n\t\t// Stupid DOMDocument functions don't escape ampersands (&)\n\t\t$value = str_replace('&', '&amp;', $value);\n\t\t$child = $base->appendChild($dom->createElement($name, $value));\n\t} else {\n\t\t$child = $base->appendChild($dom->createElement($name));\n\t}\n\treturn $child;\n}", "public function addChild($name = null, $content = null, array $attrs = [], $rule = self::AFTER_TEXT): Element\n {\n if ($name instanceof self) {\n $child = $name;\n $rule = trim($content);\n } else {\n $child = new static($name, $content, $attrs);\n }\n\n $rule = $this->isValidRule($rule) ? $rule : $this->defaultAddRule;\n $this->children[$rule][] = $child;\n\n return $child;\n }", "public function orX($child): void\n {\n $this->append($child);\n }", "function insertChildAfter (&$node, &$reference) {\r\n if (!is_object ($node)) {\r\n return false;\r\n }\r\n \r\n // root nodes may not be children of other nodes!\r\n if ($node->_type == STRINGPARSER_NODE_ROOT) {\r\n return false;\r\n }\r\n \r\n // is the reference node a child?\r\n $child = $this->_findChild ($reference);\r\n \r\n if ($child === false) {\r\n return false;\r\n }\r\n \r\n // if node already has a parent\r\n if ($node->_parent !== false) {\r\n // remove node from there\r\n $parent =& $node->_parent;\r\n if (!$parent->removeChild ($node, false)) {\r\n return false;\r\n }\r\n unset ($parent);\r\n }\r\n \r\n $index = count ($this->_children) - 1;\r\n // move all nodes to a new index\r\n while ($index >= $child + 1) {\r\n // save object\r\n $object =& $this->_children[$index];\r\n // we have to unset it because else it will be\r\n // overridden in in the loop\r\n unset ($this->_children[$index]);\r\n // put object to new position\r\n $this->_children[$index+1] =& $object;\r\n $index--;\r\n }\r\n $this->_children[$child + 1] =& $node;\r\n return true;\r\n }", "public function appendChild(AbstractMenuItem $Item)\n {\n $this->children[] = $Item;\n }", "final public function addFrom(CtkBuildable $node, $prepend = false) {\n\t\tthrow new CakeException(sprintf('Cannot add children to %s', get_class($this)));\n\t}", "abstract protected function addNode(\\DOMNode $target, \\DOMNode $source);", "private function addNode(Node $node, Bid $bid): void\n {\n // If the new node is larger then then pass to the left subtree, else pass to the right\n $direction = strcmp($bid->bidId, $node->bid->bidId) < 0 ? 'left' : 'right';\n\n // If no subtree exists for the given direction, create a new subtree in that direction\n if ($node->$direction === null) {\n // Set the node's subtree to a new node\n $node->$direction = new Node($bid);\n } else {\n // A subtree in this direction exists, so we need\n // to recursively traverse it to insert it into the\n // correct position within that tree.\n $this->addNode($node->$direction, $bid);\n }\n }", "public function addChild( $parentId, ezcTreeNode $childNode )\n {\n if ( $this->inTransaction )\n {\n $this->addTransactionItem( new ezcTreeTransactionItem( ezcTreeTransactionItem::ADD, $childNode, null, $parentId ) );\n return;\n }\n\n $q = $this->createAddNodeQuery( $childNode->id );\n $q->set( 'parent_id', $q->bindValue( $parentId ) )\n ->set( 'id', $q->bindValue( $childNode->id ) );\n $s = $q->prepare();\n $s->execute();\n\n $this->store->storeDataForNode( $childNode, $childNode->data );\n }", "public function addChild($name)\n\t{\n\t\treturn $this->_auth->addItemChild($this->_calendarId,$this->_name,$name);\n\t}", "function addNode( $nodeValue, $nodeName)\n\t{\n\t\t$GLOBALS['xml_api']->AttachToXml( $nodeValue, $nodeName);\n\t}", "function create_dom_node(&$dom, &$parent_node, $node_name, $node_value = NULL){\n\t\t$node = $dom->create_element($node_name);\n\t\t$new_node = $parent_node->append_child($node);\n\t\tif($node_value != NULL){\n\t\t\t$txt_node = $dom->create_text_node($node_value);\n\t\t\t$new_node->append_child($txt_node);\n\t\t}\n\t\treturn $new_node;\n\t}", "public function addChildWithCDATA($name, $value = NULL) {\n $new_child = $this->addChild($name);\n if ($new_child !== NULL) {\n $node = dom_import_simplexml($new_child);\n $no = $node->ownerDocument;\n $node->appendChild($no->createCDATASection($value));\n }\n return $new_child;\n }", "public function setChild($child)\n {\n $this->child = $child;\n }", "function &AppendNode($Name)\n {\n //$node =& new XMLNode($Name);\n $node = new XMLNode($Name); // FRC\n $node->SetParent($this);\n\n // Do not use array_push with pass-by-reference any more to avoid\n // allow_call_time_pass_reference warning (Oliver Grahl, 2006-08-31)\n //array_push($this->ChildNodes, &$node);\n $this->ChildNodes[] =& $node;\n\n return $node;\n }", "public function add($title, $description, $parentId = null);", "public function addNode(string $name, NodeInterface $node): NodeInterface\n {\n $this->nodes[$name] = $node;\n\n return $this;\n }", "public function insert(Node $node)\n {\n $this->root->insert($node);\n }", "public function addChild(PlaceholderInterface $child);", "public function enterNode(Node $node)\n {\n }", "#[\\ReturnTypeWillChange]\n\tfunction addChild($name, $value = null, $namespace = null):CX {/** @var CX $r */\n\t\ttry {$r = parent::addChild($this->k($name), $value, $namespace);}\n\t\tcatch (Th $th) {df_error(\"Tag <{$name}>. Value: «{$value}». Error: «%s».\", df_xts($th));}\n\t\treturn $r;\n\t}", "function insertChildBefore (&$node, &$reference) {\r\n if (!is_object ($node)) {\r\n return false;\r\n }\r\n \r\n // root nodes may not be children of other nodes!\r\n if ($node->_type == STRINGPARSER_NODE_ROOT) {\r\n return false;\r\n }\r\n \r\n // is the reference node a child?\r\n $child = $this->_findChild ($reference);\r\n \r\n if ($child === false) {\r\n return false;\r\n }\r\n \r\n // if node already has a parent\r\n if ($node->_parent !== null) {\r\n // remove node from there\r\n $parent =& $node->_parent;\r\n if (!$parent->removeChild ($node, false)) {\r\n return false;\r\n }\r\n unset ($parent);\r\n }\r\n \r\n $index = count ($this->_children) - 1;\r\n // move all nodes to a new index\r\n while ($index >= $child) {\r\n // save object\r\n $object =& $this->_children[$index];\r\n // we have to unset it because else it will be\r\n // overridden in in the loop\r\n unset ($this->_children[$index]);\r\n // put object to new position\r\n $this->_children[$index+1] =& $object;\r\n $index--;\r\n }\r\n $this->_children[$child] =& $node;\r\n return true;\r\n }", "function _pushNode (&$node) {\r\n $stack_count = count ($this->_stack);\r\n $max_node =& $this->_stack[$stack_count-1];\r\n if (!$max_node->appendChild ($node)) {\r\n return false;\r\n }\r\n $this->_stack[$stack_count] =& $node;\r\n return true;\r\n }", "protected function addChild(NodeInterface $child)\n {\n $context = new ExceptionContext(\n 'exception.propimmutable',\n 'Read only'\n );\n\n throw new PropImmutableException($context);\n }", "public static function appendChild(\\SimpleXMLElement $to, \\SimpleXMLElement $from)\n {\n $toDom = dom_import_simplexml($to);\n $fromDom = dom_import_simplexml($from);\n $toDom->appendChild($toDom->ownerDocument->importNode($fromDom, true));\n }", "public function insertChildAfter(&$node, &$reference)\n {\n if (! is_object($node)) {\n return false;\n }\n\n // root nodes may not be children of other nodes!\n if ($node->_type == self::NODE_ROOT) {\n return false;\n }\n\n // is the reference node a child?\n $child = $this->_findChild($reference);\n\n if ($child === false) {\n return false;\n }\n\n // if node already has a parent\n if ($node->_parent !== false) {\n // remove node from there\n $parent =& $node->_parent;\n if (! $parent->removeChild($node, false)) {\n return false;\n }\n unset($parent);\n }\n\n $index = count($this->_children) - 1;\n // move all nodes to a new index\n while ($index >= $child + 1) {\n // save object\n $object =& $this->_children[$index];\n // we have to unset it because else it will be\n // overridden in in the loop\n unset($this->_children[$index]);\n // put object to new position\n $this->_children[$index+1] =& $object;\n $index--;\n }\n $this->_children[$child + 1] =& $node;\n return true;\n }", "public function testAddChild_Modification()\n\t{\n\t\t$this->object->AddChild($this->child);\n\t\t$this->child->attribute = \"changed att\";\n\t\t$this->assertEquals(\"changed att\", $this->object->childList[0]->attribute);\n\t}", "public function addNode($node)\n {\n $this->_tree->addNode($node);\n\n /* If any extra columns included here add them now. */\n if (!empty($node['right'])) {\n $this->addNodeExtra($node['id'],\n Horde_Tree_Renderer::EXTRA_RIGHT,\n $node['right']);\n }\n if (!empty($node['left'])) {\n $this->addNodeExtra($node['id'],\n Horde_Tree_Renderer::EXTRA_LEFT,\n $node['left']);\n }\n }" ]
[ "0.83781385", "0.76881486", "0.75892305", "0.71660656", "0.7158922", "0.70509785", "0.7042457", "0.7040599", "0.69980556", "0.6971137", "0.68763995", "0.6857314", "0.67896897", "0.676381", "0.6734846", "0.66822916", "0.6580756", "0.6525707", "0.64458984", "0.64412534", "0.6404609", "0.6391422", "0.63697124", "0.6357584", "0.6356058", "0.6297066", "0.6286489", "0.62273777", "0.61690676", "0.6085544", "0.60666233", "0.60653806", "0.604945", "0.6036634", "0.60239834", "0.60195124", "0.60180825", "0.6016238", "0.59988105", "0.5995537", "0.5938795", "0.59208804", "0.5860175", "0.582528", "0.58199", "0.57683784", "0.57665426", "0.5746497", "0.5730951", "0.57302827", "0.5727492", "0.5722785", "0.56882274", "0.56638795", "0.56418186", "0.56401795", "0.5637101", "0.56354964", "0.5610581", "0.5610581", "0.5606042", "0.5597838", "0.5591094", "0.5588391", "0.55682445", "0.5564382", "0.55624145", "0.555985", "0.5539382", "0.55249286", "0.5510555", "0.5507433", "0.54721427", "0.54444516", "0.5407908", "0.5403262", "0.53907883", "0.5386486", "0.53735805", "0.53694224", "0.5356353", "0.5344839", "0.53404856", "0.5339119", "0.53385776", "0.5316282", "0.5301357", "0.5300253", "0.5277772", "0.5274097", "0.52646124", "0.5254498", "0.5219709", "0.52101994", "0.52076685", "0.5188902", "0.5185305", "0.51654613", "0.51489997", "0.51345843" ]
0.6088483
29
Adds a node before the specified node.
final public function addBefore(CtkBuildable $node, CtkBuildable $before) { throw new CakeException(sprintf('Cannot add children to %s', get_class($this))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function insertBefore (DOMNode $newnode , $refnode = null) {}", "public function getAppendBeforeNode();", "public function insertBefore($key, $data){\n $input = new Node($data);\n $temp = $this->head;\n while($temp != NULL){\n if(($temp->data == $key) && ($temp == $this->head)){\n $this->addFirst($input);\n break;\n }elseif($temp->next->data == $key){\n $input->next = $temp->next;\n $temp->next = &$input;\n break;\n }\n $temp = $temp->next;\n }\n }", "public function insertBefore($exist, $add)\n {\n $exist = $this->index($exist);\n $type = ($exist === 0) ? 'prepend' : false;\n $nodes = $this->normalize($add, isset($this->nodes[$exist]) ? $this->nodes[$exist] : null, $type);\n $numNodes = count($nodes);\n if ($numNodes > 0) {\n if ($exist < 0) {\n $this->nodes = array_merge($this->nodes, $nodes);\n } else {\n array_splice($this->nodes, $exist, 0, $nodes);\n }\n if (!empty($this->indexes)) {\n foreach ($this->indexes as $id => $index) {\n if ($exist <= $index) {\n $this->indexes[$id] = $index + $numNodes;\n }\n }\n }\n }\n\n return $this;\n }", "public function insertToHead($node)\n {\n $node->setNext($this->head);\n $this->head = $node;\n }", "public function prepend ($content) {\r\n\t\t\r\n\t\tif ($this->length < 1) return null;\r\n\t\t\r\n\t\t$args = func_get_args();\r\n\t\tforeach ($args as $offset => $value) \r\n\t\t\tif ($value = $this->process($value)) \r\n\t\t\t\tforeach ($this as $node) \r\n\t\t\t\t\tif (get_class($value) === 'XDTNodeList') $node->insertBefore($value[0], $node->firstChild);\r\n\t\t\t\t\telse $node->insertBefore($value, $node->firstChild);\r\n\t\t\t\t\r\n\t\treturn $this;\r\n\t}", "public function prepend(?Node $node): bool {\n if ($node === null) {\n return false;\n }\n $node->setNext($this->getHead());\n $this->setHead($node);\n return true;\n }", "public function insertBefore ($target) { \r\n\t\t\r\n\t\tif ($target = $this->process($target)) \r\n\t\t\tforeach ($this as $node) \r\n\t\t\t\tif (get_class() === 'XDTNodeList') $target[0]->parentNode->insertBefore($node, $target[0]);\r\n\t\t\t\telse $target->parentNode->insertBefore($node, $target);\r\n\t\t\t\t\r\n\t\treturn $this;\r\n\t}", "public function testOldNodeInsertBeforeItself()\n {\n $this->haveFixture('animal', 'an_addon', false);\n \n $model13 = Animal::findOne(13);\n \n $this->expectExceptionMessage('You cannot insert after of before yourself');\n $model13->insertBefore($model13);\n }", "function insertChildBefore (&$node, &$reference) {\r\n if (!is_object ($node)) {\r\n return false;\r\n }\r\n \r\n // root nodes may not be children of other nodes!\r\n if ($node->_type == STRINGPARSER_NODE_ROOT) {\r\n return false;\r\n }\r\n \r\n // is the reference node a child?\r\n $child = $this->_findChild ($reference);\r\n \r\n if ($child === false) {\r\n return false;\r\n }\r\n \r\n // if node already has a parent\r\n if ($node->_parent !== null) {\r\n // remove node from there\r\n $parent =& $node->_parent;\r\n if (!$parent->removeChild ($node, false)) {\r\n return false;\r\n }\r\n unset ($parent);\r\n }\r\n \r\n $index = count ($this->_children) - 1;\r\n // move all nodes to a new index\r\n while ($index >= $child) {\r\n // save object\r\n $object =& $this->_children[$index];\r\n // we have to unset it because else it will be\r\n // overridden in in the loop\r\n unset ($this->_children[$index]);\r\n // put object to new position\r\n $this->_children[$index+1] =& $object;\r\n $index--;\r\n }\r\n $this->_children[$child] =& $node;\r\n return true;\r\n }", "public function insertChildBefore(&$node, &$reference)\n {\n if (! is_object($node)) {\n return false;\n }\n\n // root nodes may not be children of other nodes!\n if ($node->_type == self::NODE_ROOT) {\n return false;\n }\n\n // is the reference node a child?\n $child = $this->_findChild($reference);\n\n if ($child === false) {\n return false;\n }\n\n // if node already has a parent\n if ($node->_parent !== null) {\n // remove node from there\n $parent =& $node->_parent;\n if (! $parent->removeChild($node, false)) {\n return false;\n }\n unset($parent);\n }\n\n $index = count($this->_children) - 1;\n // move all nodes to a new index\n while ($index >= $child) {\n // save object\n $object =& $this->_children[$index];\n // we have to unset it because else it will be\n // overridden in in the loop\n unset($this->_children[$index]);\n // put object to new position\n $this->_children[$index+1] =& $object;\n $index--;\n }\n $this->_children[$child] =& $node;\n return true;\n }", "public function testExistedNodeFirstSiblingsMovePrependTo()\n {\n $model8 = Animal::findOne(8);\n $model9 = Animal::findOne(9);\n \n $this->assertTrue($model8->prependTo($model8->parent()));\n $this->assertEquals(1, $model8->weight);\n $model9->refresh();\n $this->assertEquals(2, $model9->weight);\n }", "public function prepend($obj) {\r\n\t\t$obj->pzkParentId = @$this->id;\r\n\t\tarray_unshift($this->children, $obj);\r\n\t}", "public function before($beforeNode): int\n {\n $rank = $this->rank($beforeNode);\n\n if ($rank > -1) {\n if ($rank > $this->rank($this->nodeId)) {\n $rank--;\n }\n $rank = $this->toRank($rank);\n }\n\n return $rank;\n }", "public function pushNode( $node );", "public function insertBefore(Element $newElement, Element $refElement)\n {\n $this->contentManager->insertBefore($newElement, $refElement);\n\n return $this;\n }", "public function testNewNodeInsertBeforeFirstChild()\n {\n $model1 = Animal::findOne(1);\n $model4 = Animal::findOne(4);\n \n $model = new Animal();\n $model->name = 'new'; \n \n $this->assertTrue($model->insertBefore($model1));\n $model1->refresh();\n $model4->refresh();\n \n $this->assertSame('', $model->path);\n $this->assertEquals(1, $model->level);\n $this->assertEquals(1, $model->weight); \n \n $this->assertEquals(2, $model1->weight); \n $this->assertEquals(5, $model4->weight); \n }", "public function unshiftNode( $node );", "public function pushFront($value) {\n $node = new Node($value);\n $node->next = $this->head;\n $this->head = $node;\n $this->size++;\n }", "public function moveBefore($target) {\n return $this->moveNode($target, $target->{$this->leftAttribute}, 0);\n }", "public function PreOrderTraversal($node) {\r\n if($node != null){\r\n echo $node->data.\" \";\r\n $this->PreOrderTraversal($node->left);\r\n $this->PreOrderTraversal($node->right);\r\n }\r\n }", "public function enterNode(Node $node)\n {\n }", "public function before(&$obj) {\r\n\t\tif ($parent = $this->getParent()) {\r\n\t\t\t$parent->insert($obj, $this->index());\r\n\t\t}\r\n\t}", "public function testPrepend($content, callable $assert)\n {\n $dom = (new Dom($this->demoElement()))\n ->append($node = $this->demoCData())\n ->prepend($content);\n\n $assert($content, $dom->children()->get(), function (array $expected) use ($node) {\n return array_merge($expected, [$node]);\n });\n }", "public function insertBefore($target, $runValidation=true, $attributes=null) {\n return $this->addNode($target, $target->{$this->leftAttribute}, 0, $runValidation, $attributes);\n }", "public function prepend($value)\n\t{\n\t\tarray_unshift($this->stack, $value);\n\t}", "public function prepend($value, $key = null)\n {\n $key ? $this->unshiftKey($key, $value) : $this->unshift($value);\n }", "public function prependTo ($target) { \r\n\t\t\r\n\t\tif ($target = $this->process($target))\r\n\t\t\tforeach ($this as $node) \r\n\t\t\t\tif (get_class($target) === 'XDTNodeList' OR is_array($target)) \r\n\t\t\t\t\tforeach ($target as $t) $t->insertBefore($node, $t->firstChild);\r\n\t\t\t\telse $target->insertBefore($node, $target->firstChild);\r\n\t\t\t\t\r\n\t\treturn $this;\r\n\t}", "public function prepend($prepend): self {\n return new self($prepend, $this);\n }", "public function before($content)\n {\n $this->before = $content;\n\n return $this;\n }", "function insertAtFirst($data){\n\t\t$newNode = new ListNode($data);\n\n\t\tif($this->head == NULL){\n\t\t\t$this->head = $newNode;\n\t\t\t$this->tail = $newNode;\n\n\t\t}else{\n\t\t\t$temp = $this->head;\n\t\t\t$this->head = $newNode;\n\t\t\t$this->head->next = $temp;\n\t\t}\n\t}", "public function insertFirst($data){\r\n $link = new Note($data);\r\n $link->next = $this->firstNode;\r\n $this->firstNode = $link;\r\n if($this->lastNode == null){\r\n $this->lastNode = $link;\r\n $this->count ++;\r\n }\r\n }", "public function prepend($value, $key = null)\n {\n return parent::prepend($value, $key);\n $this->performHook('modified');\n return $this;\n }", "public function insertChildBeforeSibling(CategoryTreeNodeInterface $child, $nextSiblingId);", "public function insertBefore(\\SetaPDF_Core_Type_AbstractType $value, $beforeIndex = 0) {}", "public function insertAsPrevSiblingOf(BaseObject $node, BaseObject $dest_node)\n {\n if ($dest_node->isRoot())\n {\n $msg = 'Root nodes cannot have siblings';\n throw new Exception($msg);\n }\n\n $node->setLeftValue($dest_node->getLeftValue());\n $node->setRightValue($dest_node->getLeftValue() + 1);\n $node->setScopeIdValue($dest_node->getScopeIdValue());\n $node->setParentIdValue($dest_node->getParentIdValue());\n\n $this->addPreSaveStackEntries($this->shiftRLValues(get_class($node->getPeer()),\n $node->getLeftValue(),\n 2,\n $dest_node->getScopeIdValue()));\n\n $dest_node->setLeftValue($dest_node->getLeftValue() + 2);\n $dest_node->setRightValue($dest_node->getRightValue() + 2);\n $this->addPreSaveStackEntries(array($dest_node));\n }", "public function preAnalyzeNode(\n CodeBase $code_base,\n Context $context,\n Node $node\n );", "function newItemBefore()\r\n\t{\r\n\t\t$this->content_obj->newItemBefore();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "function addBefore($name, $data, $before) {\n $new_data = array();\n $added = false;\n \n foreach($this->data as $k => $v) {\n if($k == $before) {\n $new_data[$name] = $data;\n $added = true;\n } // if\n \n $new_data[$k] = $v;\n } // foreach\n \n if(!$added) {\n $new_data[$name] = $data;\n } // if\n \n $this->data = $new_data;\n \n return $data;\n }", "public function addFirst($data){\n $input = new Node($data);\n if($this->isEmpty()){\n $this->head = &$input;\n $this->tail = &$input;\n }else{\n $input->next = $this->head;\n $this->head = &$input;\n }\n }", "function addNodeafter($node,$flag){\n $node->next = $flag->next;\n $flag->next = $node;\n $this->_length++;\n }", "public function setBefore(string $content): HtmlElementInterface;", "public function prependTo($value) {\n \n return $this->append($value);\n }", "public function prepend(LayoutBlock $block): self\n {\n $this->blocks->prepend($block);\n return $this;\n }", "public function insert(Node $node)\n {\n $this->root->insert($node);\n }", "public function prependGroup($group, ?\\SetaPDF_Core_Document_OptionalContent_Group $parent = null, $beforeIndex = 0, $nextToOrLabel = null, $label = '') {}", "public function before($stringOrObject)\n {\n array_unshift($this->before, $stringOrObject);\n\n return $this;\n }", "public function prepend( $key, $value )\n\t{\n\t\t$array = $this->get( $key );\n\t\tarray_unshift( $array, $value );\n\t\t$this->set( $key, $array );\n\t}", "public function add_before($name, $label = '', array $attributes = array(), array $rules = array(), $fieldname = null) {\n\t\t$field = $this->add ( $name, $label, $attributes, $rules );\n\t\t\n\t\t// Remove from tail and reinsert at correct location\n\t\tunset ( $this->fields [$field->name] );\n\t\t\n\t\tif (! \\Arr::insert_before_key ( $this->fields, array (\n\t\t\t\t$field->name => $field \n\t\t), $fieldname, true )) {\n\t\t\tthrow new \\RuntimeException ( 'Field \"' . $fieldname . '\" does not exist in this Fieldset. Field \"' . $name . '\" can not be added.' );\n\t\t}\n\t\t\n\t\treturn $field;\n\t}", "public function insertAsFirstChildOf(BaseObject $node, BaseObject $dest_node)\n {\n $node->setLeftValue($dest_node->getLeftValue() + 1);\n $node->setRightValue($dest_node->getLeftValue() + 2);\n $node->setScopeIdValue($dest_node->getScopeIdValue());\n $node->setParentIdValue($dest_node->getPrimaryKey());\n $this->addPreSaveStackEntries($this->shiftRLValues(get_class($node->getPeer()),\n $node->getLeftValue(),\n 2,\n $dest_node->getScopeIdValue()));\n\n $dest_node->setRightValue($dest_node->getRightValue() + 2);\n $this->addPreSaveStackEntries(array($dest_node));\n }", "final public function addFrom(CtkBuildable $node, $prepend = false) {\n\t\tthrow new CakeException(sprintf('Cannot add children to %s', get_class($this)));\n\t}", "protected static function prepend_to_selector($selector, $to_prepend)\n {\n }", "public function prepend($content)\n\t{\n\t\t$this->content = $content.$this->content;\n\t}", "private function pushNode(\\DOMElement $node)\r\n {\r\n $this->currentNode = $this->currentNode->appendChild($node);\r\n }", "public function ahead(): int\n {\n if ($this->hasNodeId()) {\n if ($this->nodeId !== head($this->ranks)) {\n $ranks = $this->ranks;\n $ranks = array_diff($ranks, [$this->nodeId]);\n $this->commit(array_merge([$this->nodeId], $ranks));\n }\n\n return 1;\n }\n }", "public function setPredecessorOf($predecessorOf) {\n $this->properties['predecessorOf'] = $predecessorOf;\n\n return $this;\n }", "public function moveToPrevSiblingOf(BaseObject $node, BaseObject $dest_node)\n {\n $node->setParentIdValue($dest_node->getParentIdValue());\n $node->setScopeIdValue($dest_node->getScopeIdValue());\n $this->addPreSaveStackEntries(self::getUpdateTreeQueries($node, $dest_node->getLeftValue()));\n }", "public function prepend($key, $value)\n {\n $array = $this->get($key);\n\n array_unshift($array, $value);\n\n $this->set($key, $array);\n }", "public function insert_as_prev_sibling($target)\n {\n $target = $this->parent_from($target, $this->parent_column);\n return $this->insert($target, $this->left_column, 0, 0);\n }", "public function prepend($content, string $username = '', string $avatar = ''): void {\n\t\t$payload = static::createPayload($content, $username, $avatar);\n\t\tarray_unshift($this->queue, $payload);\n\t}", "public function before(string|int|float $message): self\n {\n return $this->addMessage(new Before($message));\n }", "public function sortElementBefore (\n SortableEntityInterface $entity,\n ?SortableEntityInterface $before,\n array $where = []\n ) : bool\n {\n if ($entity === $before)\n {\n return false;\n }\n\n $entities = $this->getBaseQuery($where)\n ->select(\"t\")\n ->addOrderBy(\"t.sortOrder\", \"asc\")\n ->getQuery()\n ->iterate();\n\n $index = 0;\n\n foreach ($entities as $row)\n {\n /** @var SortableEntityInterface $existing */\n $existing = $row[0];\n\n // skip entity to move, as it will be placed below\n if ($existing === $entity)\n {\n continue;\n }\n\n // reference element found, move $entity before it\n if ($existing === $before)\n {\n $entity->setSortOrder($index);\n ++$index;\n }\n\n $existing->setSortOrder($index);\n ++$index;\n }\n\n // no $before reference element given, it should be moved to the end\n // -> just use next index\n if (null === $before)\n {\n $entity->setSortOrder($index);\n }\n\n return true;\n }", "public function moveBefore($target)\n\t{\n\t\t$owner=$this->getOwner();\n\n\t\tif($owner->getIsNewRecord())\n\t\t\tthrow new CException(Yii::t('yiiext','The node should not be new record.'));\n\n\t\tif($owner->equals($target))\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be self.'));\n\n\t\tif($target->isDescendantOf($owner))\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be descendant.'));\n\n\t\tif($target->isRoot())\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be root.'));\n\n\t\tif($this->hasManyRoots && $owner->{$this->rootAttribute}!==$target->{$this->rootAttribute})\n\t\t\treturn $this->moveBetweenTrees($target,$target->{$this->leftAttribute},$target->{$this->levelAttribute}-$owner->{$this->levelAttribute});\n\t\telse\n\t\t\treturn $this->moveNode($target->{$this->leftAttribute},$target->{$this->levelAttribute}-$owner->{$this->levelAttribute});\n\t}", "protected function preInsert(&$entity) {\n $this->validateEntity($entity);\n\n $this->startTransaction();\n if (isset($entity['parent_id']) && !empty($entity['parent_id'])) {\n $lastCommentForEntityAndParent = $this->getLastCommentForEntity($entity);\n if (!empty($lastCommentForEntityAndParent)) {\n $entity['level'] = $lastCommentForEntityAndParent['level'];\n $lastChild = $this->getLastChild($lastCommentForEntityAndParent);\n $entity['sortorder'] = $lastChild['sortorder'];\n } else {\n $parent = $this->getOneWhere(array('id' => $entity['parent_id']), 'id, sortorder, parent_id, level');\n $entity['level'] = $parent['level'] + 1;\n $entity['sortorder'] = $parent['sortorder'];\n }\n $this->incrementSortorderForEntity($entity);\n } else {\n $maxSortOrder = $this->getMaxSortorderForEntity($entity);\n $entity['level'] = 0;\n $entity['sortorder'] = $maxSortOrder + 1;\n }\n\n $this->commitTransaction();\n }", "public function addNode($node, $action = self::NODE_ADD);", "public function AddItemToStart($item)\n {\n array_unshift($this->_items, $item);\n if ($this->getItemPointer() > 0) {\n $this->setItemPointer($this->getItemPointer() + 1);\n }\n }", "public function testNewNodePrependToRoot()\n {\n $model2 = Animal::findOne(2);\n $root = $model2->getRoot();\n $model4 = Animal::findOne(4);\n \n $model = new Animal();\n $model->name = 'new';\n \n $this->assertTrue($model->prependTo($root));\n $this->assertSame($root, $model->getRoot());\n $this->assertSame('', $model->path);\n $this->assertEquals(1, $model->level);\n $this->assertEquals(1, $model->weight);\n \n $model2->refresh();\n $this->assertEquals(3, $model2->weight);\n $model4->refresh();\n $this->assertEquals(5, $model4->weight);\n \n }", "function prepend ()\n {\n call_user_func_array ('array_unshift', array_merge ($this->A, func_get_args ()));\n return $this;\n }", "public function prepend(callable $rule)\n {\n array_unshift($this->rules, $rule);\n }", "protected function prepend($value, $valueBefore = null, $valueBeforeIndex = null)\n {\n $value = (array) $value;\n $before = array();\n $after = $this->data;\n if (null !== $valueBefore && count($found = array_keys($after, $valueBefore))) {\n $index = $found[0];\n if (array_key_exists($valueBeforeIndex, $found)) {\n $index = $found[$valueBeforeIndex];\n }\n $before = array_slice($after, 0, $index);\n $after = array_slice($after, $index);\n }\n $this->data = array_merge($before, $value, $after);\n\n return $this;\n }", "public static function prepend($key, $value)\n {\n $array = self::get($key);\n\n array_unshift($array, $value);\n\n self::set($key, $array);\n }", "protected function preorder($nodes){\n if(empty($nodes)){\n return;\n }\n\n foreach($nodes as $node){\n $this->visit_root($node);\n\n $this->visit_children($node);\n }\n }", "public function insert($val) {\n // Make sure element being inserted is type of Node.\n if (!is_object($val) || getclass($val) !== \"Node\") {\n $node = new Node($val);\n } else {\n $node = $val;\n }\n\n $this->_head->setPrev($node);\n\n $node->setNext($this->_head);\n $node->setPrev($this->_sentinel);\n $this->_head = $node;\n }", "public function unshift($var)\n {\n $node = new Node($var);\n if ($this->first_node !== null) {\n $node->setNext($this->first_node);\n $this->first_node->setPrev($node);\n }\n $node->first_node = $node;\n }", "public function prependTo($target, $runValidation=true, $attributes=null) {\n return $this->addNode($target, $target->{$this->leftAttribute} + 1, 1, $runValidation, $attributes);\n }", "public function before($beforeVerify) {\n $this->before[] = $beforeVerify;\n return $this;\n }", "public function prepend(string $line, string $content): Content\n {\n $this->content = preg_replace('~^(' . $line . ')$~sm', $content . PHP_EOL . '\\1', $this->content);\n return $this;\n }", "public function before_content( $content ) {\n\t\t\t$this->before_content .= $content;\n\n\t\t\treturn $this->before_content;\n\t\t}", "public function addTotalBefore(Varien_Object $total, $before=null)\n {\n if ($before !== null) {\n if (!is_array($before)) {\n $before = array($before);\n }\n foreach ($before as $beforeTotals) {\n if (isset($this->_totals[$beforeTotals])) {\n $totals = array();\n foreach ($this->_totals as $code => $item) {\n if ($code == $beforeTotals) {\n $totals[$total->getCode()] = $total;\n }\n $totals[$code] = $item;\n }\n $this->_totals = $totals;\n return $this;\n }\n }\n }\n $totals = array();\n $first = array_shift($this->_totals);\n $totals[$first->getCode()] = $first;\n $totals[$total->getCode()] = $total;\n foreach ($this->_totals as $code => $item) {\n $totals[$code] = $item;\n }\n $this->_totals = $totals;\n return $this;\n }", "public function prepend(string $key, $value)\n {\n // TODO: Implement prepend() method.\n }", "public function insertAsPrevSiblingOf(Doctrine_Record $dest);", "private function preOrderAnalyze(Context $context, Node $node): Context\n {\n // Visit the given node populating the code base\n // with anything we learn and get a new context\n // indicating the state of the world within the\n // given node\n // Equivalent to (new PostOrderAnalysisVisitor(...)($node)) but faster than using __invoke()\n $context = (new PreOrderAnalysisVisitor(\n $this->code_base,\n $context\n ))->{Element::VISIT_LOOKUP_TABLE[$node->kind] ?? 'handleMissingNodeKind'}($node);\n\n // Let any configured plugins do a pre-order\n // analysis of the node.\n ConfigPluginSet::instance()->preAnalyzeNode(\n $this->code_base,\n $context,\n $node\n );\n return $context;\n }", "public function insertNode($data)\n {\n $link = new ListNode($data);\n\n if ($this->firstNode != NULL) {\n $this->lastNode->next = $link;\n $link->next = NULL;\n $this->lastNode = &$link;\n } else {\n $link->next = $this->firstNode;\n $this->firstNode = &$link;\n if ($this->lastNode == NULL) {\n $this->lastNode = &$link;\n }\n }\n $this->count++;\n }", "function addChild( $node )\n\t\t{\n\t\t$this->childs[] = $node ;\n\t\t}", "public function prepend($key, $value)\n {\n $array = $this->get($key);\n\n array_unshift($array, $value);\n\n $this->set($key, $array);\n\n return $this;\n }", "public function before(string $key): Change\n {\n $this->after = null;\n $this->before = $key;\n\n return $this;\n }", "public function testPrependOrdering()\n {\n $one = function () {\n };\n $two = function () {\n };\n\n $stack = new MiddlewareStack();\n $this->assertCount(0, $stack);\n\n $stack->push($one);\n $this->assertCount(1, $stack);\n\n $stack->prepend($two);\n $this->assertCount(2, $stack);\n\n $this->assertSame($two, $stack->get(0));\n $this->assertSame($one, $stack->get(1));\n }", "function getPrevNode($data)\n\t{\n\t\treturn $this->find('first', array(\n\t\t\t\t\t'conditions'\t=> array($this->name . '.lft < ' . $data[$this->name]['lft']),\n\t\t\t\t\t'order'\t\t\t=> $this->name . '.lft DESC'));\t\t\n\t}", "function setPrepend($text) {\n\n $this->field['prepend'] = $text;\n return $this;\n\n }", "public function moveBefore($name, $where)\n\t{\n\t\tif (!$this->isBuilt) {\n\t\t\t$this->build();\n\t\t}\n\n\t\t$component = $this->getComponent($name);\n\t\t$this->removeComponent($component);\n\t\t$this->addComponent($component, $name, $where);\n\t}", "public function prependFilter($filter)\n {\n return $this->addFilter($filter, self::CHAIN_PREPEND);\n }", "public function testExistedNodeSiblingsMoveAppendTo()\n {\n $model8 = Animal::findOne(8);\n \n $this->assertTrue($model8->appendTo($model8->parent()));\n $this->assertEquals(3, $model8->weight);\n }", "public function prependRepeat($var = '')\n {\n if (!$this->isWritable()) {\n return;\n }\n $this->repeatParent->setHeaderList(array_merge($this->repeatParent->getHeaderList(), $this->getHeaderList()));\n $appendNode = $this->repeatNode;\n if ($var && $this->repeatParent) {\n $appendNode = $this->repeatParent->getVarElement($var);\n }\n $insertNode = $appendNode->ownerDocument->importNode($this->getDocument()->documentElement, true);\n return $insertNode;\n }", "public function addChild(Node $child);", "function prepend($content) {\n\t\t$this->write($content . $this->read());\n\t}", "public function prependTo($target,$runValidation=true,$attributes=null)\n\t{\n\t\t$owner=$this->getOwner();\n\n\t\tif(!$owner->getIsNewRecord())\n\t\t\tthrow new CDbException(Yii::t('yiiext','The node cannot be inserted because it is not new.'));\n\n\t\tif($owner->equals($target))\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be self.'));\n\n\t\tif($runValidation && !$owner->validate())\n\t\t\treturn false;\n\n\t\tif($this->hasManyRoots)\n\t\t\t$owner->{$this->rootAttribute}=$target->{$this->rootAttribute};\n\n\t\t$owner->{$this->levelAttribute}=$target->{$this->levelAttribute}+1;\n\t\t$key=$target->{$this->leftAttribute}+1;\n\n\t\treturn $this->addNode($key,$attributes);\n\t}", "function prepend($f){\n\t\t$this->pipe->prepend($f);\n\t\treturn $this;\n\t}", "public function before($key, $nkey, $name, Closure $callback)\n\t{\n\t\treturn $this->insert($key, $nkey, $name, $callback, __FUNCTION__);\n\t}", "public function prepend() {\n $num_of_args = func_num_args();\n if ( $num_of_args == 1 && gettype( func_get_arg( 0 ) ) == \"array\" ) {\n $args = func_get_arg( 0 );\n $num_of_args = count( $args );\n } else {\n $args = func_get_args();\n }\n for ( $i = 0; $i < $num_of_args; $i++ ) {\n $arg = $args[$i];\n if ( $arg instanceof AbstractHTMLElement ) {\n $arg = $arg->asHTML();\n }\n $this->content = $arg . $this->content;\n }\n return $this;\n }", "public function before($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }" ]
[ "0.80076665", "0.7039313", "0.67718965", "0.6546532", "0.63464546", "0.62512606", "0.6245053", "0.6244906", "0.6219497", "0.6142735", "0.6131885", "0.59556025", "0.5952647", "0.59383327", "0.5871021", "0.5831786", "0.5814597", "0.57992494", "0.57983136", "0.5732195", "0.57086176", "0.56806153", "0.5679969", "0.5620632", "0.5615417", "0.5587509", "0.55826634", "0.5579178", "0.55579305", "0.5556691", "0.5517851", "0.55120003", "0.5506095", "0.5494665", "0.54698503", "0.54477084", "0.54420525", "0.5412068", "0.5390995", "0.5389595", "0.53875566", "0.5376722", "0.53560436", "0.5355677", "0.535301", "0.5327701", "0.5322132", "0.5301333", "0.52995455", "0.5284566", "0.5279501", "0.52707446", "0.5267187", "0.5265458", "0.5257753", "0.52422804", "0.5237279", "0.5229542", "0.5227534", "0.5220291", "0.5219661", "0.521384", "0.5213406", "0.52128434", "0.5205847", "0.5196651", "0.51853234", "0.5170217", "0.5169153", "0.514706", "0.51457876", "0.5111205", "0.5097024", "0.509588", "0.5083753", "0.50812465", "0.5079997", "0.50738156", "0.5069538", "0.50625646", "0.5053865", "0.50471383", "0.5038723", "0.50204575", "0.50189406", "0.49996096", "0.49909174", "0.49861613", "0.497895", "0.4958128", "0.49348316", "0.49286795", "0.49277192", "0.49274522", "0.49152797", "0.49075192", "0.490373", "0.48936954", "0.48821422", "0.48776412" ]
0.6841655
2
Adds a node after the specified node.
final public function addAfter(CtkBuildable $node, CtkBuildable $after) { throw new CakeException(sprintf('Cannot add children to %s', get_class($this))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addNodeafter($node,$flag){\n $node->next = $flag->next;\n $flag->next = $node;\n $this->_length++;\n }", "public function addChildAsLast(Node $node)\n {\n if(null === $this->children)\n {\n $this->children = array();\n }\n\n $this->children[] = $node;\n }", "public function insertAfter($key, $data){\n $input = new Node($data);\n $temp = $this->head;\n while($temp != NULL){\n if($temp->data == $key){\n $input->next = $temp->next;\n $temp->next = &$input;\n break;\n }\n $temp = $temp->next;\n }\n }", "public function insertAsLastChildOf(BaseObject $node, BaseObject $dest_node)\n {\n $node->setLeftValue($dest_node->getRightValue());\n $node->setRightValue($dest_node->getRightValue() + 1);\n $node->setScopeIdValue($dest_node->getScopeIdValue());\n $node->setParentIdValue($dest_node->getPrimaryKey());\n \n $this->addPreSaveStackEntries($this->shiftRLValues(get_class($node->getPeer()),\n $node->getLeftValue(),\n 2,\n $dest_node->getScopeIdValue()));\n \n $dest_node->setRightValue($dest_node->getRightValue() + 2);\n $this->addPreSaveStackEntries(array($dest_node));\n }", "public function insertAfter($exist, $add)\n {\n $exist = $this->index($exist);\n $nodes = $this->normalize($add, isset($this->nodes[$exist]) ? $this->nodes[$exist] : null);\n $numNodes = count($nodes);\n if ($numNodes > 0) {\n if ($exist < 0) {\n $this->nodes = array_merge($nodes, $this->nodes);\n } else {\n array_splice($this->nodes, $exist + 1, 0, $nodes);\n }\n if (!empty($this->indexes)) {\n foreach ($this->indexes as $id => $index) {\n if ($exist < $index) {\n $this->indexes[$id] = $index + $numNodes;\n }\n }\n }\n }\n\n return $this;\n }", "public function pushNode( $node );", "public function insertBefore (DOMNode $newnode , $refnode = null) {}", "public function appendChild(Node $node)\n {\n $this->_children[] = $node;\n }", "function insertChildAfter (&$node, &$reference) {\r\n if (!is_object ($node)) {\r\n return false;\r\n }\r\n \r\n // root nodes may not be children of other nodes!\r\n if ($node->_type == STRINGPARSER_NODE_ROOT) {\r\n return false;\r\n }\r\n \r\n // is the reference node a child?\r\n $child = $this->_findChild ($reference);\r\n \r\n if ($child === false) {\r\n return false;\r\n }\r\n \r\n // if node already has a parent\r\n if ($node->_parent !== false) {\r\n // remove node from there\r\n $parent =& $node->_parent;\r\n if (!$parent->removeChild ($node, false)) {\r\n return false;\r\n }\r\n unset ($parent);\r\n }\r\n \r\n $index = count ($this->_children) - 1;\r\n // move all nodes to a new index\r\n while ($index >= $child + 1) {\r\n // save object\r\n $object =& $this->_children[$index];\r\n // we have to unset it because else it will be\r\n // overridden in in the loop\r\n unset ($this->_children[$index]);\r\n // put object to new position\r\n $this->_children[$index+1] =& $object;\r\n $index--;\r\n }\r\n $this->_children[$child + 1] =& $node;\r\n return true;\r\n }", "public function after(&$obj) {\r\n\t\tif ($parent = $this->getParent()) {\r\n\t\t\t$parent->insert($obj, $this->index() + 1);\r\n\t\t}\r\n\t}", "public function insertChildAfter(&$node, &$reference)\n {\n if (! is_object($node)) {\n return false;\n }\n\n // root nodes may not be children of other nodes!\n if ($node->_type == self::NODE_ROOT) {\n return false;\n }\n\n // is the reference node a child?\n $child = $this->_findChild($reference);\n\n if ($child === false) {\n return false;\n }\n\n // if node already has a parent\n if ($node->_parent !== false) {\n // remove node from there\n $parent =& $node->_parent;\n if (! $parent->removeChild($node, false)) {\n return false;\n }\n unset($parent);\n }\n\n $index = count($this->_children) - 1;\n // move all nodes to a new index\n while ($index >= $child + 1) {\n // save object\n $object =& $this->_children[$index];\n // we have to unset it because else it will be\n // overridden in in the loop\n unset($this->_children[$index]);\n // put object to new position\n $this->_children[$index+1] =& $object;\n $index--;\n }\n $this->_children[$child + 1] =& $node;\n return true;\n }", "public function insertAfter ($target) { \r\n\t\t\r\n\t\tif ($target = $this->process($target)) \r\n\t\t\tforeach ($this as $node) \r\n\t\t\t\tif (get_class() === 'XDTNodeList') $target[0]->parentNode->insertBefore($node, $target[0]->nextSibling);\r\n\t\t\t\telse $target->parentNode->insertBefore($node, $target->nextSibling); \r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function addNode($node, $action = self::NODE_ADD);", "public function addLast($data){\n $input = new Node($data);\n if($this->isEmpty()){\n $this->head = &$input;\n $this->tail = &$input;\n }else{\n $this->tail->next = &$input;\n $this->tail = &$input;\n }\n }", "public function testNewNodeInsertAfterLastChild()\n {\n $model4 = Animal::findOne(4);\n \n $model = new Animal();\n $model->name = 'new'; \n \n $this->assertTrue($model->insertAfter($model4));\n $model4->refresh();\n \n $this->assertSame('', $model->path);\n $this->assertEquals(1, $model->level);\n $this->assertEquals(5, $model->weight); \n \n $this->assertEquals(4, $model4->weight); \n }", "public function addChild(Node $child);", "function insertAtLast($data){\n\t\t$newNode = new ListNode($data);\n\t\tif($this->head == NULL){\n\t\t\t$this->head = $newNode;\n\t\t\t$this->tail = $newNode;\n\t\t}else{\n\t\t\t$this->tail->next = $newNode;\n\t\t\t$this->tail = $newNode;\n\t\t}\n\t}", "public function appendNode($type) {\n $node = new Node($type, $this->current);\n $this->current->append($node);\n $this->current = $node;\n }", "public function unshiftNode( $node );", "function addChild( $node )\n\t\t{\n\t\t$this->childs[] = $node ;\n\t\t}", "public function addLast($e);", "private function pushNode(\\DOMElement $node)\r\n {\r\n $this->currentNode = $this->currentNode->appendChild($node);\r\n }", "public function getAppendBeforeNode();", "public function push_back($newElement) {\n $newNode = new Node();\n $newNode->data = $newElement;\n $newNode->next = null; \n if($this->head == null) {\n $this->head = $newNode;\n } else {\n $temp = new Node();\n $temp = $this->head;\n while($temp->next != null) {\n $temp = $temp->next;\n }\n $temp->next = $newNode;\n } \n }", "function appendChild ($a_node)\n\t{\n\t\treturn $this->doc->append_child($a_node);\n\t}", "public function moveToLastChildOf(BaseObject $node, BaseObject $dest_node)\n {\n $node->setParentIdValue($dest_node->getPrimaryKey());\n $node->setScopeIdValue($dest_node->getScopeIdValue());\n $this->addPreSaveStackEntries(self::getUpdateTreeQueries($node, $dest_node->getRightValue()));\n }", "public function resolveNextNode(NodeContract $node, NodeContract $new_node)\n {\n // Nothing to resolve...\n }", "public function moveAfter($target) {\n return $this->moveNode($target, $target->{$this->rightAttribute} + 1, 0);\n }", "public function testExistedNodeSiblingsMoveAppendTo()\n {\n $model8 = Animal::findOne(8);\n \n $this->assertTrue($model8->appendTo($model8->parent()));\n $this->assertEquals(3, $model8->weight);\n }", "function addAfter($name, $data, $after) {\n $new_data = array();\n $added = false;\n \n foreach($this->data as $k => $v) {\n $new_data[$k] = $v;\n \n if($k == $after) {\n $new_data[$name] = $data;\n $added = true;\n } // if\n } // foreach\n \n if(!$added) {\n $new_data[$name] = $data;\n } // if\n \n $this->data = $new_data;\n \n return $data;\n }", "function append_node_last_by_id( $node_id, $data )\n\t{\n\t\t$node = $this->get_node_by_id($node_id);\n\n\t\tif(!$node)\n\t\t\treturn false;\n\n\t\treturn $this->insert_node( $node['rgt'], $data );\n\t}", "public function moveToNextSiblingOf(BaseObject $node, BaseObject $dest_node)\n {\n $node->setParentIdValue($dest_node->getParentIdValue());\n $node->setScopeIdValue($dest_node->getScopeIdValue());\n $this->addPreSaveStackEntries(self::getUpdateTreeQueries($node, $dest_node->getRightValue() + 1));\n }", "public function add_after($name, $label = '', array $attributes = array(), array $rules = array(), $fieldname = null) {\n\t\t$field = $this->add ( $name, $label, $attributes, $rules );\n\t\t\n\t\t// Remove from tail and reinsert at correct location\n\t\tunset ( $this->fields [$field->name] );\n\t\tif (! \\Arr::insert_after_key ( $this->fields, array (\n\t\t\t\t$field->name => $field \n\t\t), $fieldname, true )) {\n\t\t\tthrow new \\RuntimeException ( 'Field \"' . $fieldname . '\" does not exist in this Fieldset. Field \"' . $name . '\" can not be added.' );\n\t\t}\n\t\t\n\t\treturn $field;\n\t}", "function append($node) {\n\t\tif (!is_array($node)) {\n\t\t\t$this->child[]=$node;\n\t\t} else if (is_array($node)) {\n\t\t\tfor ($childIdx=0; $childIdx<count($node); $childIdx++)\n\t\t\t\t$this->child[]=$node[$childIdx];\n\t\t}\n\t}", "public function appendChild(Pagemill_Node $node) {\r\n\t\t$tmp = new Pagemill_Stream(true);\r\n\t\t$node->rawOutput($tmp);\r\n\t\t$this->_text .= $tmp->peek();\r\n\t}", "public function addChild(Node $child)\n {\n $this->children[] = $child;\n }", "public function testExistedNodeSiblingsMoveinsertAfterMiddle()\n {\n $this->haveFixture('animal', 'an_addon', false);\n \n $model11 = Animal::findOne(11);\n $model13 = Animal::findOne(13);\n $model15 = Animal::findOne(15);\n \n \n $this->assertTrue($model11->insertAfter($model13));\n \n $model13->refresh();\n $model15->refresh();\n \n $this->assertEquals(2, $model13->weight);\n $this->assertEquals(3, $model11->weight);\n $this->assertEquals(5, $model15->weight);\n }", "private function addNode(Node $node, Bid $bid): void\n {\n // If the new node is larger then then pass to the left subtree, else pass to the right\n $direction = strcmp($bid->bidId, $node->bid->bidId) < 0 ? 'left' : 'right';\n\n // If no subtree exists for the given direction, create a new subtree in that direction\n if ($node->$direction === null) {\n // Set the node's subtree to a new node\n $node->$direction = new Node($bid);\n } else {\n // A subtree in this direction exists, so we need\n // to recursively traverse it to insert it into the\n // correct position within that tree.\n $this->addNode($node->$direction, $bid);\n }\n }", "public function insertToHead($node)\n {\n $node->setNext($this->head);\n $this->head = $node;\n }", "public function insertAfter($target, $runValidation=true, $attributes=null) {\n return $this->addNode($target, $target->{$this->rightAttribute} + 1, 0, $runValidation, $attributes);\n }", "public function append(?Node $node): bool {\n if ($node === null) {\n return false;\n }\n $head = $this->getHead();\n if ($head === null) {\n $this->setHead($node);\n return true;\n }\n while ($head->getNext() !== null) {\n $head = $head->getNext();\n }\n $head->setNext($node);\n return true;\n }", "public function insertAfter($idElementRef, $tagNewElement, $idNewElement) {\n\n\t\t$this->response->insertAfter($idElementRef, $tagNewElement, $idNewElement);\n\t}", "public function after($afterNode): int\n {\n $rank = $this->rank($afterNode);\n\n if ($rank > -1) {\n if ($rank < $this->rank($this->nodeId)) {\n $rank++;\n }\n $rank = $this->toRank($rank);\n }\n\n return $rank;\n }", "public function insertAsNextSiblingOf(BaseObject $node, BaseObject $dest_node)\n {\n if ($dest_node->isRoot())\n {\n $msg = 'Root nodes cannot have siblings';\n throw new Exception($msg);\n }\n\n $node->setLeftValue($dest_node->getRightValue() + 1);\n $node->setRightValue($dest_node->getRightValue() + 2);\n $node->setScopeIdValue($dest_node->getScopeIdValue());\n $node->setParentIdValue($dest_node->getParentIdValue());\n\n $this->addPreSaveStackEntries($this->shiftRLValues(get_class($node->getPeer()),\n $node->getLeftValue(),\n 2,\n $dest_node->getScopeIdValue()));\n }", "public function setAfter(string $content): HtmlElementInterface;", "public function insertAsLastChildOf(Doctrine_Record $dest);", "public function addChild(Node $node)\n {\n $node->setParent($this);\n\n $this->child[] = $node;\n\n return $this;\n\n }", "function newItemAfter()\r\n\t{\r\n\t\t$this->content_obj->newItemAfter();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "public function insert(Node $node)\n {\n $this->root->insert($node);\n }", "public function addNode(self $node) : self\n {\n $this->append($node);\n return $this;\n }", "public function insertNode($data)\n {\n $link = new ListNode($data);\n\n if ($this->firstNode != NULL) {\n $this->lastNode->next = $link;\n $link->next = NULL;\n $this->lastNode = &$link;\n } else {\n $link->next = $this->firstNode;\n $this->firstNode = &$link;\n if ($this->lastNode == NULL) {\n $this->lastNode = &$link;\n }\n }\n $this->count++;\n }", "public function appendGroup($group, ?\\SetaPDF_Core_Document_OptionalContent_Group $parent = null, $afterIndex = null, $nextToOrLabel = null, $label = '') {}", "protected function append($child): void\n {\n $this->children[] = $child;\n }", "public function moveAfter($target)\n\t{\n\t\t$owner=$this->getOwner();\n\n\t\tif($owner->getIsNewRecord())\n\t\t\tthrow new CException(Yii::t('yiiext','The node should not be new record.'));\n\n\t\tif($owner->equals($target))\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be self.'));\n\n\t\tif($target->isDescendantOf($owner))\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be descendant.'));\n\n\t\tif($target->isRoot())\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be root.'));\n\n\t\tif($this->hasManyRoots && $owner->{$this->rootAttribute}!==$target->{$this->rootAttribute})\n\t\t\treturn $this->moveBetweenTrees($target,$target->{$this->rightAttribute}+1,$target->{$this->levelAttribute}-$owner->{$this->levelAttribute});\n\t\telse\n\t\t\treturn $this->moveNode($target->{$this->rightAttribute}+1,$target->{$this->levelAttribute}-$owner->{$this->levelAttribute});\n\t}", "public function insert_as_next_sibling($target)\n {\n $target = $this->parent_from($target, $this->parent_column);\n return $this->insert($target, $this->right_column, 1, 0);\n }", "function addNode( $nodeValue, $nodeName)\n\t{\n\t\t$GLOBALS['xml_api']->AttachToXml( $nodeValue, $nodeName);\n\t}", "public function shiftNode();", "public function enterNode(Node $node)\n {\n }", "function append_node_last( $lft, $data )\n\t{\n\t\t$node = $this->get_node($lft);\n\n\t\tif(!$node)\n\t\t\treturn false;\n\n\t\treturn $this->insert_node( $node['rgt'], $data );\n\t}", "public function moveAsLastChildOf(Doctrine_Record $dest);", "public function insertAsNextSiblingOf(Doctrine_Record $dest);", "public function testNodeinsertAsChildAtPositionToNewNode()\n {\n $this->haveFixture('animal', 'an_addon', false);\n \n $model13 = Animal::findOne(13);\n $model = new Animal(['name' => 'new']);\n \n $this->expectExceptionMessage('You cannot add nodes to a new node');\n $model13->insertAsChildAtPosition($model, 3);\n }", "public function add (DOMElement $node) {\r\n\t \r\n\t if (array_push($this->list, $node)) {\r\n\t\t\t$this->length++;\r\n\t\t\treturn true;\r\n\t\t} else return false;\r\n\t}", "public function completeNode() {\n $this->current = $this->current->parent();\n }", "public function after($key, $nkey, $name, Closure $callback)\n\t{\n\t\treturn $this->insert($key, $nkey, $name, $callback, __FUNCTION__);\n\t}", "public function insertChildBeforeSibling(CategoryTreeNodeInterface $child, $nextSiblingId);", "public function insertAfter(Element $newElement, Element $refElement)\n {\n $this->contentManager->insertAfter($newElement, $refElement);\n\n return $this;\n }", "public function add_child(HTMLNode $node): int\n {\n return $this -> children -> add($node);\n }", "public function append(Node $node)\n {\n\n if (!is_array($this->_children)) {\n $this->_children = [];\n }\n\n $this->_children[] = $node;\n return $this;\n }", "public function afterNodeAdded(NodeInterface $node)\n {\n if (!$node->getNodeType()->isOfType('Garagist.Author:Mixin.User')) {\n return;\n }\n\n $this->setAuthorOfPostNodeToCurrentUser($node);\n }", "function appendReferenceNodeForLO ($a_node, $a_lo_id, $a_lm_id, $a_prev_sibling)\n\t{\n\t\t$newnode = $this->createElement(\"LO\");\n\t\t\n\t\tif (empty($a_prev_sibling))\n\t\t{\n\t\t\t$node = $a_node->append_child($newnode);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$node = $a_prev_sibling->append_sibling($newnode);\n\t\t}\n\n\t\t$node->set_attribute(\"id\",$a_lo_id);\n\t\t$node->set_attribute(\"lm\",$a_lm_id);\n\t}", "public function moveAsNextSiblingOf(Doctrine_Record $dest);", "public function orX($child): void\n {\n $this->append($child);\n }", "public function addNode($node)\n {\n $this->_tree->addNode($node);\n\n /* If any extra columns included here add them now. */\n if (!empty($node['right'])) {\n $this->addNodeExtra($node['id'],\n Horde_Tree_Renderer::EXTRA_RIGHT,\n $node['right']);\n }\n if (!empty($node['left'])) {\n $this->addNodeExtra($node['id'],\n Horde_Tree_Renderer::EXTRA_LEFT,\n $node['left']);\n }\n }", "function _pushNode (&$node) {\r\n $stack_count = count ($this->_stack);\r\n $max_node =& $this->_stack[$stack_count-1];\r\n if (!$max_node->appendChild ($node)) {\r\n return false;\r\n }\r\n $this->_stack[$stack_count] =& $node;\r\n return true;\r\n }", "public function after($content)\n {\n $this->after = $content;\n\n return $this;\n }", "public function moveToNextNode(): bool\n {\n $moved = FALSE;\n $node = $this->currentNode->nextSibling;\n \n if ($node instanceof \\DOMNode) {\n $this->currentNode = $node;\n $moved = TRUE;\n }\n \n return $moved;\n }", "public function addElse($node)\n\t{\n\t\tif ($this->else===NULL) {\n\t\t\t$node->parent=$this;\n\t\t\t$node->root=$this->root;\n\t\t\t$this->else=$node;\n\t\t\t}\n\t\telse {\n\t\t\t$this->else->addElse($node);\n\t\t\t}\n\n\t\treturn $this;\n\t}", "public function Append($value = 0, $column = 0) {\n\t\t// if the list is empty\n\t\tif ($this->isEmpty()) {\n\t\t\t$this->tail = new Node($value, $column, null);\n\t\t\t$this->head = $this->tail;\n\t\t\t$this->count++;\n\t\t} else {\n\t\t\t// make a new node assigning to the newest node\n\t\t\t$this->head->SetNext(new Node($value, $column, null));\n\t\t\t$this->head = $this->head->Next();\n\t\t\t$this->count++;\n\t\t}\n\t}", "public function moveNode(?PhpcrChildrenInterface $newParent = null, ?string $newNodename = null);", "public function addAfter($where, $to_add, $content)\n {\n return str_replace($where, $where . $to_add, $content);\n }", "public function afterInsert() {\n\t\t\tparent::afterInsert();\n\t\t\t//$this->pos = 1;\n\t\t\t$this->updatePos(1);\n\t\t}", "public function addNeighborReference(GuidedSnakeNode $node)\n {\n if (!$this->isNear($node)) {\n throw new Exception('This node could ne be added since it\\'s not really near');\n }\n\n // Keep a reference to this child\n $this->neighborReferences[$node->getStringIdentifier()] = $node;\n }", "public function testOldNodeInsertBeforeItself()\n {\n $this->haveFixture('animal', 'an_addon', false);\n \n $model13 = Animal::findOne(13);\n \n $this->expectExceptionMessage('You cannot insert after of before yourself');\n $model13->insertBefore($model13);\n }", "public function next()\n {\n $current = $this->current();\n\n if ($current) {\n $this->current = $current->getAfter();\n }\n }", "public function after_insert() {}", "public function after(string $key): Change\n {\n $this->before = null;\n $this->after = $key;\n\n return $this;\n }", "public function addChildNode(\\F3\\Fluid\\Core\\Parser\\SyntaxTree\\NodeInterface $childNode);", "public function applyToNode(Node $node);", "public function PostOrderTraversal($node) {\r\n if($node != null) {\r\n $this->PostOrderTraversal($node->left);\r\n $this->PostOrderTraversal($node->right);\r\n echo $node->data.\" \";\r\n }\r\n }", "function add_node($child_id, tree_node $tt) {\n $this->triples[$child_id] = $tt;\n $this->children[$tt->parent_id][$child_id] = true;\n }", "public function afterInsert(): void\n {\n if ($this->owner->getAttribute($this->ownerParentIdAttribute)) {\n $this->addTreePathOwnerToParents();\n }\n $this->addTreePathOwnerToOwner();\n }", "public function pushBack($value) {\n $node = new Node($value);\n $this->tail->next = $node;\n $this->tail = $node;\n $this->size++;\n }", "function add_title_node($node)\n{\n $result = $node->xpath('//mydata[1]/*[1]');\n\n if (!empty($result[0])) {\n $name = $result[0]->getName();\n $node->addChild('title', $name);\n }\n\n return $node;\n}", "private function append ($node) {\n\n if(empty($node->id)) {\n Debug::printMsg('<li><span style=\"color:orange\">No predefined id found, so creating node</span> ('.$node->className.$node->tableName.')</li>');\n }\n\n // if this record is required then make sure it is valid (error==0) and non-empty\n if($this->isRequired($node)) {\n\n Debug::printMsg('<li><span style=\"color:orange\">Property is required</span> ('.$node->classId.$node->tableName.')</li>');\n\n // required but has errors or is empty and has no id\n if(($node->hasErrors() || $node->isEmpty()) && empty($node->id)) {\n\n if($node->hasErrors()) {\n\n $this->errors[] = $node->getErrors();\n Debug::printMsg('<span style=\"color:red\">...but has errors!</span>');\n\n } else if ($node->isEmpty()) {\n\n Debug::printMsg('<span style=\"color:red\">...but is empty!</span>');\n }\n \n\n // required, no errors and non-empty -> accept\n } else {\n\n $this->data[] = $node;\n // mark to template that this was found\n Debug::printMsg('<li><span style=\"color:green\">...and found!</span> </li>');\n $this->markIsRequired($node);\n }\n\n // not required but has errors\n } else if($node->hasErrors()) {\n \n $this->errors[] = $node->errors;\n\n // not required but is non-empty or has id -> accept\n } else if (!$node->isEmpty() || !empty($node->id)) {\n\n $this->data[] = $node;\n }\n\n }", "function addNode($nodename, $nodeaddress) {\n\t$query = sprintf(\"INSERT INTO Nodes VALUES('%s','%s')\",\n\t\tmysql_real_escape_string($nodename),\n\t\tmysql_real_escape_string($nodeaddress)\n\t);\n\t\n\tdb_query($query);\n}", "function _appendToLastTextChild ($text) {\r\n $scount = count ($this->_stack);\r\n if ($scount == 0) {\r\n return false;\r\n }\r\n return $this->_stack[$scount-1]->appendToLastTextChild ($text);\r\n }", "public function addFieldAfter($newField, $targetField)\n {\n if (!($newField instanceof Base)) {\n $newField = $this->convertToField($newField);\n }\n\n $indexToInsert = null;\n $newFieldsList = array();\n foreach ($this->fields as $key => $field) {\n $newFieldsList[$key] = $field;\n if ($field === $targetField) {\n $newField->setForm($this);\n if ($newField->getKey()) {\n $newFieldsList[$newField->getKey()] = $newField;\n } else {\n $newFieldsList[] = $newField;\n }\n }\n }\n\n $this->fields = $newFieldsList;\n }", "public function attach(Node $node): void\n {\n $type = $this->determineResponseType($node->source());\n $queueItem = new ResponseQueueItem($node->command(), $type, 0, $this->options);\n $this->responses->put($node->value(), $queueItem);\n }", "function &AppendNode($Name)\n {\n //$node =& new XMLNode($Name);\n $node = new XMLNode($Name); // FRC\n $node->SetParent($this);\n\n // Do not use array_push with pass-by-reference any more to avoid\n // allow_call_time_pass_reference warning (Oliver Grahl, 2006-08-31)\n //array_push($this->ChildNodes, &$node);\n $this->ChildNodes[] =& $node;\n\n return $node;\n }" ]
[ "0.7696656", "0.6771784", "0.65175265", "0.6188816", "0.6107677", "0.61040723", "0.60862356", "0.6033241", "0.6023598", "0.59521323", "0.5836208", "0.5831884", "0.58112335", "0.57608616", "0.5737349", "0.57331336", "0.56643367", "0.56597143", "0.56374", "0.5633122", "0.55766004", "0.5539685", "0.5533816", "0.5495835", "0.54919547", "0.5464702", "0.54530126", "0.5432789", "0.5425396", "0.53786635", "0.5364344", "0.5356574", "0.5327857", "0.5326081", "0.5322645", "0.5310939", "0.53058225", "0.5280355", "0.5278648", "0.5274782", "0.52565235", "0.5253824", "0.52534944", "0.5250223", "0.5248923", "0.52482295", "0.523411", "0.52313316", "0.52228415", "0.5218975", "0.5186697", "0.517534", "0.51286393", "0.5111005", "0.5109091", "0.5107713", "0.5086357", "0.50821763", "0.50633085", "0.5056671", "0.5052094", "0.5025554", "0.50113094", "0.500115", "0.49978453", "0.49950776", "0.49861386", "0.49757034", "0.49684265", "0.4951436", "0.49512103", "0.49423864", "0.49415484", "0.4939279", "0.49254355", "0.49232057", "0.49219167", "0.4914245", "0.49105746", "0.4909875", "0.4898856", "0.48973215", "0.48950148", "0.48788914", "0.4875735", "0.48701337", "0.48676097", "0.48549718", "0.4853785", "0.48472276", "0.48445135", "0.48399392", "0.4837785", "0.4820618", "0.48135826", "0.48067653", "0.48057517", "0.4804566", "0.4798305", "0.4791788" ]
0.6551407
2
Adds an array of nodes to this node as children.
final public function addMany(array $nodes) { throw new CakeException(sprintf('Cannot add children to %s', get_class($this))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addChildren(array $children);", "function addChildren(array $children) : void;", "function add_children(){\n\t\t\t\t\t//if the array has a parent add it to the parents child array\n\t\tforeach ($this->nodes as $node){\n\t\t\tif($node->parent!=-1){\n\t\t\t\tif(isset($this->nodes[$node->parent])){\n\t\t\t\t\t$parent=$this->nodes[$node->parent];\n\t\t\t\t\t$parent->add_child($node->id);\n\t\t\t\t}else{\n\t\t\t\t\tprint_error('nonode','socialwiki');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function setChildren(array $children);", "public function addChildren(array $items)\n {\n $this->children->addItems($items);\n\n return $this;\n }", "public function setChildren(array $children)\n {\n $this->children = [];\n foreach ($children as $child) {\n if ($child instanceof Node) {\n $this->addChild($child);\n }\n }\n }", "public function addChildren(array $children): self\n {\n foreach ($children as $child) {\n if (is_string($child)) {\n $child = new TextNode([\n 'node' => $child,\n ]);\n }\n\n $this->addChild($child);\n }\n\n return $this;\n }", "public function setChildren(ArrayCollection $children)\n {\n $this->children = $children;\n\n return $this;\n }", "function add($n)\n\t{\n\t\tif (is_array($n))\n\t\t{\n\t\t\tfor($i = 0; $i < count($n); ++$i)\n\t\t\t{\n\t\t\t\t$this->children[] = $n[$i];\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->children[] = $n;\n\t\t}\n\t}", "function add($n)\n\t{\n\t\tif (is_array($n))\n\t\t{\n\t\t\tfor($i = 0; $i < count($n); ++$i)\n\t\t\t{\n\t\t\t\t$this->children[] = $n[$i];\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->children[] = $n;\n\t\t}\n\t}", "public function getChildren(): array;", "public function getChildren() {}", "public function getChildren() {}", "public function getChildren() {}", "public function setChildren(array $children) {\n\t\t$this->tmpSetChildren($children);\n\t}", "public function add_children(HTMLCollection $collection){\n $this -> children = $collection;\n }", "abstract protected function getNewChildren(): array ;", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function setChildNodeIds(array $ids)\n {\n // since some child nodes may already exist out of order, in order for childNodes to end up\n // in the correct order, we must empty the array first\n $this->_childNodesById = array();\n\n if (count($ids) > 0) {\n // add child nodes, setting their parent/child and inner prev/next relationships\n $this->addChildNodeIds($ids, true, true);\n // addChildNodeIds does not set the first child's previousSibling nor the last's nextSibling\n // so we manually set these to null\n $this->getKnownChildNodeById($ids[0])->setPreviousSiblingId(null, false, false);\n $this->getKnownChildNodeById(array_pop($ids))->setNextSiblingId(null, false, false);\n }\n $this->_allChildrenKnown = true;\n return $this;\n }", "public function setChildren(NodeList $children) {\n\t\t$this->children = $children;\n\t}", "public function get_children();", "function append($node) {\n\t\tif (!is_array($node)) {\n\t\t\t$this->child[]=$node;\n\t\t} else if (is_array($node)) {\n\t\t\tfor ($childIdx=0; $childIdx<count($node); $childIdx++)\n\t\t\t\t$this->child[]=$node[$childIdx];\n\t\t}\n\t}", "public function get_children() : array\n {\n return $this->children;\n }", "public function getChildNodes() {}", "public function getChildNodes() {}", "public function appendChildren(array $elements) {\n\t\tforeach ($elements as $element) {\n\t\t\t$this->appendChild($element);\n\t\t}\n\t}", "public function children (){\n\t\treturn array();\n\t}", "public function getChildren()\n {\n }", "public function getChildren()\n {\n }", "public function addFromArray(array $array)\r\n {\r\n foreach ($array as $child) {\r\n $this->add($child);\r\n }\r\n return $this;\r\n }", "function addChild( $node )\n\t\t{\n\t\t$this->childs[] = $node ;\n\t\t}", "function addChild($name) {\n\t\tarray_push($this->childrens, $name);\n\t}", "public function getChildren(): array {\n return iterator_to_array(clone $this->children);\n }", "public function children()\n {\n return (array) $this->children;\n }", "public function children()\n {\n $this->buildTree();\n return $this->childrenInternal();\n }", "public function setChildren(Collection $children): void\n {\n $this->children = $children;\n }", "public function getChildren(): ?array;", "function children() {\n\t\t$this->load_children();\n\t\treturn $this->_children;\n\t}", "public function getChildNodes();", "public function setChildren($children) {\n $this->children = $children;\n\n return $this;\n }", "public function setChildrenFromDOMNodes(array $children): void\n {\n foreach ($children as $node) {\n if ($node instanceof DOMText) {\n // TODO: we are skipping the actual text inside the Node.. is this useful?\n continue;\n }\n\n switch ($node->localName) {\n case Payment::NODE_NAME:\n $payment = Payment::createFromDomNode($node);\n $this->addPayment($payment);\n break;\n default:\n throw new CFDIException(sprintf(\"Unknown children node '%s' in %s\", $node->nodeName, self::NODE_NS_NAME));\n }\n }\n }", "public function getChilds();", "private function addChildren(array $childs): void\n {\n foreach ($childs as $child) {\n\n $this->authManager->addChild(\n $this->createItem($this->name),\n $this->createChild($child)\n );\n }\n }", "final public function getChildren() {\n\t\treturn array();\n\t}", "public function getChildren(): array\n {\n return $this->children->toArray();\n }", "public function loadChildNodes()\n {\n $ids = $this->_cache->getBackend()->getChildNodeIds($this);\n return $this->setChildNodeIds($ids);\n }", "function getChildren() {\n foreach ( $this->parents as $parent ) {\n $this->children[$parent->name()]=array();\n foreach ( $this->items as $item ) {\n if ( $item->parent_id() == $parent->id() ) {\n $this->children[$parent->name()][]=$item;\n }\n }\n }\n }", "public function getChildren()\r\n\t{\r\n\t\treturn $this->childrenNodes;\r\n\t}", "public function get_children() {\n\t\treturn $this->children;\n\t}", "public function getChildren()\n {\n // Singleton: both getChild and getChildren are called\n // by the Sabre_DAV_Browser_Plugin\n if (empty($this->children)) {\n $storedFiles = $this->fileStorage->get_directory_files(\n $this->storedFile->get_contextid(),\n $this->storedFile->get_component(),\n $this->storedFile->get_filearea(),\n $this->itemId,\n $this->storedFile->get_filepath(),\n false, // recursive\n true, // includedirs\n 'filepath ASC, filename ASC' // sort\n );\n\n foreach ($storedFiles as $storedFile) {\n if ($storedFile->is_directory()) {\n $this->children[][] = new DAVRootPoolDirectory($storedFile);\n } else {\n $this->children[][] = new DAVRootPoolFile($storedFile);\n }\n }\n }\n\n return $this->children;\n }", "function addChild( $ni )\n\t\t{\n\t\t$this->childs[] = $ni ;\n\t\t}", "public function getChildren()\n {\n return $this->children;\n }", "public function children(array $query = []): Collection\n {\n $children = static::all(array_merge($query, ['post_parent' => $this->id()]));\n\n return $this->setAttribute(__METHOD__, $children);\n }", "public function set_children($children)\n {\n $childData = [];\n foreach ($children as $child) {\n $childData[] = new Page($child);\n }\n $this->data['children'] = $childData;\n }", "public function removeChildNodes() {}", "public function getChildren(array $columns = ['*']);", "public function children()\n {\n $children = $this->getAttribute('children') ?: [];\n\n if ($children && ! is_array($children) && ! ($children instanceof Collection)) {\n return (array) $children;\n }\n\n return $children;\n }", "public function addNodesFromArray(array $parameters) : self\n {\n foreach ($parameters as $name => $value) {\n if (is_array($value)) {\n $this->addChildNodeWithNodesFromArray($name, $value);\n continue;\n }\n\n $this->addNode($name, $value);\n }\n\n return $this;\n }", "public function getChildren() \n {\n return $this->children;\n }", "public function children()\r\n\t{\r\n\t\treturn $this->children;\r\n\t}", "protected function setChildren(array $children = null)\n {\n if ($children !== null) {\n $this->children = Pages::factory($children, $this);\n }\n\n return $this;\n }", "#[ReturnTypeWillChange]\n public function getChildren()\n {\n return new self($this->iterator->getChildren(), $this->excluded);\n }", "public function __construct($children = array()) {\n $this->tagName = 'div';\n foreach($children as $c) {\n $this->appendChild($c);\n }\n }", "public function setChildren($presences): void\n {\n $this->children = $presences;\n }", "public function children()\n {\n return $this->belongsToMany(Node::class,'rbac_edges','parent_id','child_id')\n ->as('edge')->using(Edge::class);\n }", "public function addChildDocuments(array &$docs) {}", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildNodes() : array {\n return $this->childNodes;\n }", "public function getChildren(): Collection\n {\n return $this->children;\n }", "public function getChildren(): Collection\n {\n return $this->children;\n }", "public function getChildren()\n {\n $query = 'SELECT category_id FROM '. \\rex::getTablePrefix() .'d2u_machinery_categories '\n .'WHERE parent_category_id = '. $this->category_id;\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n\n $children = [];\n for ($i = 0; $i < $result->getRows(); ++$i) {\n $children[] = new self((int) $result->getValue('category_id'), $this->clang_id);\n $result->next();\n }\n return $children;\n }", "public function getChildren() {\n\t\treturn $this->children;\n\t}", "public function getChildren() {\n\t\treturn $this->children;\n\t}", "public function addChildren(BlockInterface $children)\n {\n return $this->addChild($children);\n }", "public function getChildElements() {}", "public function getChildren()\n\t{\n\t\treturn $this->children;\n\t}", "public function getChildren()\n\t{\n\t\treturn $this->children;\n\t}", "public function __construct()\n {\n $this->children = [];\n }", "public function add($child) {\n $this->children[] = $child;\n }", "public function childrens()\n {\n return $this->hasMany(self::class, 'parent_id');\n }", "protected function convertChildrenToArray()\n {\n $data = array();\n foreach ($this->getChildren() as $name => $child) {\n $data = array_merge($data, $this->convertChildToArray($name, $child));\n }\n return $data;\n }", "public function __construct()\n {\n $this->children = new ArrayCollection();\n }", "public function getChildren()\n {\n return $this->_children;\n }", "public function getChildren() {\n\t\treturn $this->_children;\n\t}", "public function renderChildren() {}" ]
[ "0.79234344", "0.75128704", "0.74833965", "0.7092819", "0.70302635", "0.69920653", "0.6749784", "0.64732796", "0.6426426", "0.6426426", "0.63213325", "0.6293087", "0.6293087", "0.6293087", "0.62740886", "0.6256044", "0.6216699", "0.6212888", "0.6212888", "0.6212888", "0.6212888", "0.6212888", "0.6212888", "0.6212888", "0.6212888", "0.6212888", "0.6207962", "0.61480653", "0.61413544", "0.6047398", "0.60244083", "0.59916395", "0.5991553", "0.5990605", "0.59375674", "0.59347236", "0.59347236", "0.59240067", "0.5896809", "0.5894459", "0.5880199", "0.5875114", "0.5870178", "0.58627325", "0.5854157", "0.5821651", "0.57858384", "0.5783044", "0.5769482", "0.5762251", "0.5731938", "0.5708815", "0.56782585", "0.5669856", "0.56528974", "0.5650728", "0.564378", "0.5616084", "0.5584185", "0.5569999", "0.5564721", "0.55646795", "0.5540119", "0.55380553", "0.5535538", "0.5532049", "0.5523877", "0.5520175", "0.5519197", "0.55057937", "0.5499901", "0.54960465", "0.54883575", "0.5475917", "0.54745036", "0.54745036", "0.54745036", "0.54745036", "0.54745036", "0.54745036", "0.54745036", "0.54745036", "0.5472752", "0.5470266", "0.5470266", "0.5464843", "0.54583985", "0.54583985", "0.5417755", "0.5415364", "0.5410007", "0.5410007", "0.54023033", "0.53880453", "0.53712505", "0.53671813", "0.5361125", "0.5346182", "0.5339442", "0.53393525" ]
0.6854739
6
Inherits the children of another node.
final public function addFrom(CtkBuildable $node, $prepend = false) { throw new CakeException(sprintf('Cannot add children to %s', get_class($this))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getChildNodes() {}", "public function getChildNodes() {}", "public function getChildNodes();", "abstract public function inherit($parent);", "function getChildNodes() ;", "public function getChildren() {}", "public function getChildren() {}", "public function getChildren() {}", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren()\n {\n }", "public function getChildren()\n {\n }", "function add_children(){\n\t\t\t\t\t//if the array has a parent add it to the parents child array\n\t\tforeach ($this->nodes as $node){\n\t\t\tif($node->parent!=-1){\n\t\t\t\tif(isset($this->nodes[$node->parent])){\n\t\t\t\t\t$parent=$this->nodes[$node->parent];\n\t\t\t\t\t$parent->add_child($node->id);\n\t\t\t\t}else{\n\t\t\t\t\tprint_error('nonode','socialwiki');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function get_children();", "public function beginChildren()\n {\n parent::beginChildren();\n\n $this->call($this->descendCallback);\n }", "public function getChildElements() {}", "public function getChilds();", "private function inherit()\n\t{\n\t\t$this->log(1, '...Computing inheritance(s?)');\n\t\tforeach($this->_classes as $class_name => $class_def)\n\t\t{\n\t\t\t$this->log(2,\"For Class $class_name\");\n\t\t\t$parent_name = $class_def->get_parent_class_name();\n\t\t\tif(!empty($parent_name))\n\t\t\t{\n\t\t\t\t$this->log(2, \" parent = \".$parent_name);\n\t\t\t\t$parent_def = &$this->_classes[$parent_name];\n\t\t\t\t$parent_def->_children[] = $class_def;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->log(2, \" no parent\");\n\t\t\t\t$_top_classes[] = $class_def;\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach($_top_classes as $top_class)\n\t\t{\n\t\t\t$this->traverse_class_hierarchy($top_class);\n\t\t}\t\t\n\t}", "public function combine_child(){\n\t\t\t\techo 'Child begin-> '.parent::combine_parent().' <-Child end. ';\n\t\t\t}", "public function removeChildNodes() {}", "public function setChildren(NodeList $children) {\n\t\t$this->children = $children;\n\t}", "public function getChildren()\n {\n return $this->inheritanceList;\n }", "public function iterateChildren();", "public function renderChildren() {}", "#[ReturnTypeWillChange]\n public function getChildren()\n {\n return new self($this->iterator->getChildren(), $this->excluded);\n }", "abstract public function getChildrenTypes();", "public function endChildren()\n {\n parent::endChildren();\n\n $this->call($this->ascendCallback);\n }", "function inherit() { \n // Determine parent 'display' value\n $handler =& get_css_handler('display');\n\n // 'display' CSS property processed AFTER this; so parent display value will be\n // on the top of the stack\n //\n $parent_display = $handler->get();\n\n // Inherit vertical-align from table-rows \n if ($parent_display === \"table-row\" || $parent_display === \"table\") {\n $this->push($this->get());\n return;\n }\n\n $this->push(is_inline_element($parent_display) ? $this->get() : $this->default_value());\n }", "protected function actionPostLoadingEvent()\n {\n if (self::$child_data === null) {\n self::$child_data = [];\n foreach ($this->getParentModel()->children->child->iterateItems() as $node_uuid => $node) {\n if (empty((string)$node->enabled)) {\n continue;\n }\n $conn_uuid = (string)$node->connection;\n if (!isset(self::$child_data[$conn_uuid])) {\n self::$child_data[$conn_uuid] = [];\n }\n foreach (self::$child_attrs as $key) {\n if (!isset(self::$child_data[$conn_uuid][$key])) {\n self::$child_data[$conn_uuid][$key] = [];\n }\n self::$child_data[$conn_uuid][$key][] = (string)$node->$key;\n }\n }\n }\n foreach ($this->internalChildnodes as $node) {\n if (!$node->getInternalIsVirtual()) {\n $extra_attr = ['local_ts' => '', 'remote_ts' => ''];\n $conn_uuid = (string)$node->getAttribute('uuid');\n foreach (self::$child_attrs as $key) {\n $child_node = new TextField();\n $child_node->setInternalIsVirtual();\n if (isset(self::$child_data[$conn_uuid]) && !empty(self::$child_data[$conn_uuid][$key])) {\n $child_node->setValue(implode(',', array_unique(self::$child_data[$conn_uuid][$key])));\n }\n $node->addChildNode($key, $child_node);\n }\n }\n }\n return parent::actionPostLoadingEvent();\n }", "public function getAllChildNode()\r\n {\r\n return $this->_childNodes;\r\n }", "public function getSubNodeNames();", "public function children()\n\t{\t\treturn $this->hasMany(GroupInheritance::class, \"parent\");\n\t}", "public function loadChildNodes()\n {\n $ids = $this->_cache->getBackend()->getChildNodeIds($this);\n return $this->setChildNodeIds($ids);\n }", "function addChildren(array $children) : void;", "public function getChildren()\r\n\t{\r\n\t\treturn $this->childrenNodes;\r\n\t}", "public function getChildrenQuery();", "abstract protected function getNewChildren(): array ;", "public function evaluateChildNodes();", "public function visit(Node $n) {\n parent::visit($n);\n }", "public static function appendChild(\\SimpleXMLElement $to, \\SimpleXMLElement $from)\n {\n $toDom = dom_import_simplexml($to);\n $fromDom = dom_import_simplexml($from);\n $toDom->appendChild($toDom->ownerDocument->importNode($fromDom, true));\n }", "public function getChildren()\n\t{\n\t\t$children = $this->current()->getChildren();\n\n\t\t// Using ref as per PHP source\n\t\tif (empty($this->ref))\n\t\t{\n\t\t\t$this->ref = new \\ReflectionClass($this);\n\t\t}\n\n\t\treturn $this->ref->newInstance($children);\n\t}", "function children() {\n\t\t$this->load_children();\n\t\treturn $this->_children;\n\t}", "public function sub_combine_c() {\n\t\t\n\t\techo 'Subchild begin-bring from childclass-> '.parent::combine_child().' <-subchild end';\n\t}", "private function parseChildNodes(): void\n {\n foreach ($this->node->childNodes as $node)\n {\n /** @var \\DOMNode $node */\n switch ($node->nodeName)\n {\n case 'include':\n $this->parsePatternNodeAttributes($node, $this->includes);\n break;\n\n case 'exclude':\n $this->parsePatternNodeAttributes($node, $this->excludes);\n break;\n\n case '#text';\n break;\n\n default:\n throw new ConfigException(\"Unexpected child node '%s' found at %s:%d\",\n $node->nodeName,\n $this->path,\n $node->getLineNo());\n }\n }\n }", "public function __clone()\n\t{\n\t\t$this->children=[];\n\t}", "function descendants() {\n\t\t/*\n\t\tget all children of this article\n\t\tfor each child, run the same query..\n\t\t*/\n\t\t$childs = $this->children();\n\t\t$subChilds = array();\n\t\tforeach ($childs as $oneChild) {\n\t\t\t$subChilds = array_merge($subChilds, $oneChild->descendants());\n\t\t}\n\t\t$childs = array_merge($childs, $subChilds);\n\t\tpb_pqp_log_speed(\"article descendants()\");\n\t\treturn $childs;\n\t}", "public function children()\n\t{\n\t\treturn $this->descendants(1);\n\t}", "function getChildren() {\n foreach ( $this->parents as $parent ) {\n $this->children[$parent->name()]=array();\n foreach ( $this->items as $item ) {\n if ( $item->parent_id() == $parent->id() ) {\n $this->children[$parent->name()][]=$item;\n }\n }\n }\n }", "public function setChildren(array $children);", "public function children (){\n\t\treturn array();\n\t}", "public function getChildren(): array;", "public function getChildren(array $columns = ['*']);", "public function add_children(HTMLCollection $collection){\n $this -> children = $collection;\n }", "#[\\ReturnTypeWillChange]\n public function getChildren()\n {\n $element = $this->current();\n $childContext = $this->elementProcessor->processElementChildren(\n $element,\n $this->contexts[$this->contextMap[$this->key()]]\n );\n return new static($element->childNodes, $childContext, $this->elementProcessor);\n }", "public function addChildren(array $children);", "public function __construct($children = array()) {\n $this->tagName = 'div';\n foreach($children as $c) {\n $this->appendChild($c);\n }\n }", "function appendChildren () {\n $this->menu[]=new Marker('start');\n foreach ( $this->items as $item ) {\n if ( $item->parent_id() == $this->current->id() ) {\n $this->menu[]=$item;\n }\n }\n $check=end($this->menu);\n if ( $check->isStart() )\n array_pop($this->menu);\n else\n $this->menu[]=new Marker('end');\n }", "public function childrenElements() {\n\t\treturn $this->hasMany('\\App\\Hierarchy', 'parent_id', 'id');\n\t}", "public function getChildNodes()\n {\n return array_values($this->getChildNodesById());\n }", "function _set_decendants ($parent, $to_add)\n {\n $parent = $parent ? $parent : 0;\n \n if (isset($this->data[ $parent ]['descendants']))\n {\n $this->data[ $parent ]['descendants'] = array_merge($this->data[ $parent ]['descendants'],$to_add);\n }\n else\n {\n $this->data[ $parent ]['descendants'] = $to_add;\n }\n\n if (isset($this->data[ $parent ]['parent']))\n {\n // One up the tree\n $this->_set_decendants($this->data[ $parent ]['parent'], $to_add);\n }\n }", "public function children() {\n return $this->descendants(1);\n }", "public function replaceChildren($parent, $startChildIndex, $stopChildIndex, $t);", "private function setParentChildrenClass() {\n $tmp_schemedata = $this->schemedata;\n \n // replace parents with primary key.\n foreach($this->schemedata as $index => $class) {\n $parents = array();\n $see = array();\n foreach ($class['parents'] as $parent=>$cols) {\n foreach($tmp_schemedata as $tmp_class) {\n if ($tmp_class['table'] == $parent) {\n $tmp = $tmp_class['pkFields'];\n $tmp_cols = $cols;\n $tmp2 = array();\n foreach ($tmp as $key=>$val) {\n $key = array_shift($tmp_cols);\n $tmp2[$key] = $val;\n }\n $parents[$tmp_class['name']] = $tmp2;\n $see[] = $tmp_class['name'];\n }\n }\n }\n $this->schemedata[$index]['parents'] = $parents;\n $this->schemedata[$index]['see'] = $see;\n }\n\n // children\n foreach($this->schemedata as $index => $class) {\n foreach ($class['parents'] as $parent=>$cols) {\n foreach($tmp_schemedata as $tmp_class) {\n if ($tmp_class['table'] == $this->schemedata[$parent]['table']) {\n if ($class['type'] != 'TO' AND $class['type'] != 'TS' AND $class['type'] != 'TB') {\n $tmp = $class['parents']; // children's parent def\n $tmp2 = array();\n foreach ($tmp as $key=>$val) {\n if($key == $tmp_class['name']) {\n $tmp2 = $val;\n }\n }\n if($class['name']) {\n $this->schemedata[$tmp_class['name']]['children'][$class['name']] = $tmp2;\n $this->schemedata[$tmp_class['name']]['see'][] = $class['name'];\n } else {\n $this->schemedata[$tmp_class['name']]['children'][$index] = $tmp2;\n }\n }\n }\n }\n }\n }\n\n // relationships\n foreach($this->schemedata as $class) {\n if ($class['type'] == 'TO' OR $class['type'] == 'TS' OR $class['type'] == 'TB') {\n foreach ($class['parents'] as $parent=>$pkFields) {\n if(!isset($this->schemedata[$parent]['relationships'])) {\n $this->schemedata[$parent]['relationships'] = array();\n }\n // add parent to another parent list getter\n foreach ($class['parents'] as $p=>$fs) {\n if ($parent != $p) {\n $type = 'List';\n $mname = '';\n foreach($fs as $k => $v) {\n $name = $k;\n }\n foreach($class['params'] as $param) {\n if($name == $param['name']) {\n $type = ($param['pair']=='N')?'List':'Class';\n break;\n }\n }\n\n $this->schemedata[$parent]['relationships'][$p]= array(\n 'table' => $class['table'],\n 'myFields' => $pkFields,\n 'fields' => $fs,\n 'type' => $type\n );\n }\n }\n }\n }\n }\n\n // rewrite relation key for parents, children and relations\n foreach($this->schemedata as $key => $class) {\n // parent\n foreach($class['parents'] as $k1 => $values) {\n foreach($values as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$k2) {\n unset($this->schemedata[$key]['parents'][$k1][$k2]);\n $this->schemedata[$key]['parents'][$k1][$param['mname']] = $value;\n break;\n }\n }\n }\n }\n // children\n foreach($class['children'] as $k1 => $values) {\n foreach($values as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['children'][$k1][$k2] = $param['mname'];\n break;\n }\n }\n }\n }\n // relations\n if(isset($class['relationships'])) {\n foreach($class['relationships'] as $k1 => $values) {\n foreach($values['myFields'] as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['relationships'][$k1]['myFields'][$k2] = $param['mname'];\n break;\n }\n }\n }\n foreach($values['fields'] as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['relationships'][$k1]['fields'][$k2] = $param['mname'];\n break;\n }\n }\n }\n }\n }\n }\n }", "public function addChild(Node $child);", "public function setChildrenFromDOMNodes(array $children): void\n {\n foreach ($children as $node) {\n if ($node instanceof DOMText) {\n // TODO: we are skipping the actual text inside the Node.. is this useful?\n continue;\n }\n\n switch ($node->localName) {\n case Payment::NODE_NAME:\n $payment = Payment::createFromDomNode($node);\n $this->addPayment($payment);\n break;\n default:\n throw new CFDIException(sprintf(\"Unknown children node '%s' in %s\", $node->nodeName, self::NODE_NS_NAME));\n }\n }\n }", "public function hasChildNodes() {}", "public function children() {\n\t\treturn $this->hasMany(Forum::getSectionClass(), \"parent_id\")->orderBy(\"weight\", \"desc\");\n\t}", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildrenField()\n {\n return $this->inheritanceField;\n }", "public function getChildren() \n {\n return $this->children;\n }", "public function setChildren($children) {\n $this->children = $children;\n\n return $this;\n }", "public function children()\n {\n if (is_a($this->children, 'Kirby\\Cms\\Pages') === true) {\n return $this->children;\n }\n\n return $this->children = Pages::factory($this->inventory()['children'], $this);\n }", "public function setChildren(array $children)\n {\n $this->children = [];\n foreach ($children as $child) {\n if ($child instanceof Node) {\n $this->addChild($child);\n }\n }\n }", "function loadedChildren()\r\n {\r\n //Calls childrens loaded recursively\r\n reset($this->components->items);\r\n while (list($k,$v)=each($this->components->items))\r\n {\r\n $v->loaded();\r\n }\r\n }", "public function children()\n {\n return $this->belongsToMany(Node::class,'rbac_edges','parent_id','child_id')\n ->as('edge')->using(Edge::class);\n }", "public function getChildren()\n\t{\n\t\treturn new static($this->getInnerIterator()->getChildren(), $this->excludeMasks);\n\t}", "public function getSubBlocks();", "public function appendChild(Node $node)\n {\n $this->_children[] = $node;\n }", "function append($node) {\n\t\tif (!is_array($node)) {\n\t\t\t$this->child[]=$node;\n\t\t} else if (is_array($node)) {\n\t\t\tfor ($childIdx=0; $childIdx<count($node); $childIdx++)\n\t\t\t\t$this->child[]=$node[$childIdx];\n\t\t}\n\t}", "public function testChildren()\n {\n $cData = $this->demoCData();\n $comment1 = $this->demoComment();\n $comment2 = $this->demoComment();\n $comment3 = $this->demoComment();\n\n $element1 = $this->demoElement()\n ->insertAfter($cData)\n ->insertAfter($comment1);\n $element2 = $this->demoElement()\n ->insertAfter($comment2);\n\n $dom = (new Dom())\n ->add($element1)\n ->add($element2)\n ->add($comment3);\n\n $this->assertSame([$cData, $comment1, $comment2], $dom->children()->get());\n }", "protected function listChildren()\n {\n $this->children = new ArrayObject();\n if ($this->cursor instanceof DOMNode) {\n $childrenNodes = $this->cursor->childNodes;\n foreach ($childrenNodes as $child) {\n switch ($child->nodeName) {\n case 'text:p':\n $element = new OpenDocument_Element_Paragraph($child, $this);\n break;\n case 'text:h':\n $element = new OpenDocument_Element_Heading($child, $this);\n break;\n default:\n $element = false;\n }\n if ($element) {\n $this->children->append($element);\n }\n }\n }\n }", "public function allChildrenElements() {\n\t\treturn $this->childrenElements()->with('allChildrenElements');\n\t}", "function addChild( $node )\n\t\t{\n\t\t$this->childs[] = $node ;\n\t\t}", "public function getChildren () {\n return $this->current ();\n }", "public function children()\n {\n $this->buildTree();\n return $this->childrenInternal();\n }", "public function getChildNodes() : array {\n return $this->childNodes;\n }", "public function children ($selector = null) { \r\n\t\t\r\n\t\t$l = new XDTNodeList();\r\n\t\t\tforeach ($this as $node) \r\n\t\t\t\tforeach ($node->childNodes as $child) $l->add($child);\r\n\t\t\t\r\n\t\tif (!isset($selector)) return $l;\r\n\t\t\r\n\t\t$this->xml_query = $l;\r\n\t\treturn $this->select($selector, null, XDT::SELECT_FILTER);\r\n\t}", "public function isChildOnly();", "function &getChildren()\n\t{\n global $jlistConfig;\n \n\t\tif (!is_object($this->_item)) {\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\t// Order subcategories\n\t\tif (sizeof($this->_children)) {\n\t\t\t$params = $this->getState()->get('params');\n \n // Sort order defined in menu?\n $orderby_pri = $params->get('orderby_pri');\n \n if (!$orderby_pri){\n // When not we use jD settings\n $cats_order = (int)$jlistConfig['cats.order'];\n if ($cats_order == 1){\n $params->set('orderby_pri', 'alpha');\n } elseif ($cats_order == 2){\n $params->set('orderby_pri', 'ralpha');\n } \n }\n \n\t\t\tif ($params->get('orderby_pri') == 'alpha' || $params->get('orderby_pri') == 'ralpha') {\n\t\t\t\t$this->_children = ArrayHelper::sortObjects($this->_children, 'title', ($params->get('orderby_pri') == 'alpha') ? 1 : (-1));\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_children;\n\t}", "public function addInheritance($inhdata)\n {\n if ($inhdata instanceof Inheritance) {\n $inh = $inhdata;\n $inh->setColumn($this);\n if ($this->inheritanceList === null) {\n $this->inheritanceList = array();\n $this->isEnumeratedClasses = true;\n }\n $this->inheritanceList[] = $inh;\n\n return $inh;\n } else {\n $inh = new Inheritance();\n $inh->loadFromXML($inhdata);\n\n return $this->addInheritance($inh);\n }\n }", "public function setChildren(Collection $children): void\n {\n $this->children = $children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }" ]
[ "0.640123", "0.64009917", "0.6338444", "0.6139745", "0.60453206", "0.59346896", "0.59346896", "0.59346896", "0.5887354", "0.5887354", "0.5887354", "0.5887354", "0.5887354", "0.5887354", "0.5887354", "0.5887354", "0.5887354", "0.58665335", "0.58665335", "0.57611483", "0.5753887", "0.5739435", "0.56669366", "0.5597356", "0.5571285", "0.55356574", "0.553453", "0.5485104", "0.5464468", "0.54255617", "0.5361611", "0.5333524", "0.5314815", "0.5305004", "0.52105373", "0.5208508", "0.51885957", "0.5186349", "0.5125332", "0.51190734", "0.50907105", "0.5074019", "0.5070199", "0.50565314", "0.5056193", "0.5054241", "0.50541866", "0.50446254", "0.5040513", "0.5031387", "0.5023203", "0.5022274", "0.5021774", "0.502013", "0.5016188", "0.50132614", "0.5011009", "0.50033796", "0.49995118", "0.4996399", "0.4988198", "0.49860454", "0.4980592", "0.49724248", "0.49621493", "0.49574125", "0.49561033", "0.49395856", "0.493841", "0.49305862", "0.49237102", "0.49099457", "0.49056983", "0.4897167", "0.48963064", "0.48918825", "0.48855323", "0.48818868", "0.48669004", "0.48557246", "0.48507953", "0.4838308", "0.48106554", "0.48085687", "0.48072907", "0.48069867", "0.47969645", "0.47946393", "0.47822493", "0.4782138", "0.4777885", "0.47566485", "0.47499233", "0.47453985", "0.47315374", "0.4724829", "0.4720751", "0.4716272", "0.47155702", "0.47155702", "0.47155702" ]
0.0
-1
Conditionally adds a node to this node as a child.
final public function addIf($condition = false, CtkBuildable $node) { throw new CakeException(sprintf('Cannot add children to %s', get_class($this))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addChild(Node $child);", "protected function addChildIfMissing(NodeInterface $child)\n {\n $this->addChild($child);\n }", "public function addChild(self $child): void\n\t{\n\t\tif (!$this->children->contains($child)) {\n\t\t\t// ...and assign it to collection\n\t\t\t$this->children->add($child);\n\t\t}\n\t}", "public function addChild(Node $child)\n {\n $this->children[] = $child;\n }", "public function addChild(Node $child) {\n return $this->root->addChild($child);\n }", "public function addChildNode( SimpleXMLElement $oChild ) \n\t\t{\n\t\t\t$oParentDOM = dom_import_simplexml( $this );\n\t\t\t$oChildDOM = dom_import_simplexml( $oChild );\n\t\t\t$oNewParentDOM = $oParentDOM->ownerDocument->importNode( $oChildDOM, true );\n\t\t\t$oParentDOM->appendChild( $oNewParentDOM );\n\t\t\n\t\t}", "function addChild( $node )\n\t\t{\n\t\t$this->childs[] = $node ;\n\t\t}", "public function addChildNode(\\F3\\Fluid\\Core\\Parser\\SyntaxTree\\NodeInterface $childNode);", "public function addChild(CategoryTreeNodeInterface $child);", "function add_child( $child ) {\n\t\tif( $child instanceof ModularPost ) {\n\t\t\t$this->children[] = $child;\n\t\t}\n\t}", "final public function hasChild(CtkBuildable $node) {\n\t\treturn false;\n\t}", "protected function append($child): void\n {\n $this->children[] = $child;\n }", "public function orX($child): void\n {\n $this->append($child);\n }", "public function addChild(pdoMap_Core_XML_Node $child) {\n $this->__childs[] = $child;\n // echo 'Add child '.$this->getName().'.'.$child->getName().'<br />';\n }", "public function appendChild(Node $node)\n {\n $this->_children[] = $node;\n }", "public function addChild($child)\n\t{\n\t\tif ($child instanceof ElseNode) {\n\t\t\tif (!$this->getLastChild() instanceof IfNode) {\n\t\t\t\tthrow new \\PHPSass\\Exception('@else(if) directive must come after @(else)if', $child);\n\t\t\t\t}\n\t\t\t$this->getLastChild()->addElse($child);\n\t\t\t}\n\t\telse {\n\t\t\t$this->children[]=$child;\n\t\t\t$child->parent=$this;\n\t\t\t$child->setRoot($this->root);\n\t\t\t}\n\t}", "public function add_child($child) {\n\t\t$this->children[] = $child;\n\t}", "public function add($child) {\n $this->children[] = $child;\n }", "function appendChild ($a_node)\n\t{\n\t\treturn $this->doc->append_child($a_node);\n\t}", "function add_node($child_id, tree_node $tt) {\n $this->triples[$child_id] = $tt;\n $this->children[$tt->parent_id][$child_id] = true;\n }", "final public function addChild ()\n {\n throw new ChildException('Trying to add child to self closing HTML element');\n }", "public function createchild($value) {\n return $this->setProperty('createchild', $value);\n }", "public function appendChild($child = NULL)\n\t{\n\t\tif ($child instanceof DOMNode) {\n\t\t\tparent::appendChild($child);\n\t\t}\n\t\treturn $this;\n\t}", "public function add_child(SBBCodeParser_Node $child)\r\n\t{\r\n\t\t$this->children[] = $child;\r\n\t\t$child->set_parent($this);\r\n\t}", "public function appendChild($child, array $options = array()) \n {\n $this->children[] = $child;\n\n return $child;\n }", "public function addChild(self $child): self\n {\n $this->children[] = $child;\n\n return $this;\n }", "abstract public function insert ( \\Hoa\\Tree\\Generic $child );", "function create_dom_node(&$dom, &$parent_node, $node_name, $node_value = NULL){\n\t\t$node = $dom->create_element($node_name);\n\t\t$new_node = $parent_node->append_child($node);\n\t\tif($node_value != NULL){\n\t\t\t$txt_node = $dom->create_text_node($node_value);\n\t\t\t$new_node->append_child($txt_node);\n\t\t}\n\t\treturn $new_node;\n\t}", "public function add($child, $type = null, array $options = array());", "public function set_addChildNode($param)\n\t{\n\t\t$this->addChildNode = $param; return $this;\n\t}", "public function add($child, $name = false) {\n\t\tif( $name ) {\n\t\t\t$this->childs[$name] = $child;\n\t\t} else {\n\t\t\t$this->childs[] = $child;\n\t\t}\n\t\treturn $this;\n\t}", "public function add_child(\\WP_Comment $child)\n {\n }", "public function addChild(Node $node)\n {\n $node->setParent($this);\n\n $this->child[] = $node;\n\n return $this;\n\n }", "public function addChild(BlockInterface $child, $key = null)\n {\n if (null !== $key) {\n $this->children->set($key, $child);\n\n return true;\n }\n\n return $this->children->add($child);\n }", "public function addChild($itemID){\n $child = new FPNode($itemID,1,$this);\n array_push($this->children, $child);\n return $child;\n }", "public function addChild($child)\r\n\t{\r\n\t\t$this->last = $child->last;\r\n\r\n\t\t$this->entries []= $child;\r\n\t}", "public function addChildWithCDATA($name, $value = NULL) {\n $new_child = $this->addChild($name);\n if ($new_child !== NULL) {\n $node = dom_import_simplexml($new_child);\n $no = $node->ownerDocument;\n $node->appendChild($no->createCDATASection($value));\n }\n return $new_child;\n }", "public function appendChild(Pagemill_Node $node) {\r\n\t\t$tmp = new Pagemill_Stream(true);\r\n\t\t$node->rawOutput($tmp);\r\n\t\t$this->_text .= $tmp->peek();\r\n\t}", "public function add_child(HTMLNode $node): int\n {\n return $this -> children -> add($node);\n }", "function _pushNode (&$node) {\r\n $stack_count = count ($this->_stack);\r\n $max_node =& $this->_stack[$stack_count-1];\r\n if (!$max_node->appendChild ($node)) {\r\n return false;\r\n }\r\n $this->_stack[$stack_count] =& $node;\r\n return true;\r\n }", "protected function renderElseChild() {}", "function add_child($dom, $base, $name, $value) {\n\tif ($value) {\n\t\t// Stupid DOMDocument functions don't escape ampersands (&)\n\t\t$value = str_replace('&', '&amp;', $value);\n\t\t$child = $base->appendChild($dom->createElement($name, $value));\n\t} else {\n\t\t$child = $base->appendChild($dom->createElement($name));\n\t}\n\treturn $child;\n}", "public function addChildAsLast(Node $node)\n {\n if(null === $this->children)\n {\n $this->children = array();\n }\n\n $this->children[] = $node;\n }", "public function addChild(ModelInterface $child, $placeholder = null, $append = false);", "final public function add(CtkBuildable $node) {\n\t\tthrow new CakeException('Cannot add children to node');\n\t}", "public function isChildOnly();", "public function appendChild($childNode)\r\n {\r\n $this->_childNodes[$childNode->id] = $childNode;\r\n $childNode->setParentNode($this);\r\n }", "public function setHasChildren($value)\n {\n $this->_has_children = (boolean)$value;\n return $this;\n }", "public function addChild(Node $node, $pos = null) {\n //set the child node level\n $node->level = $this->level+1;\n\n //set the parent node\n $node->parent = $this;\n\n //if the position is unset, add the node at the endding\n if(is_null($pos)) {\n $this->nodes->push($node);\n } else {\n if($pos < 0) {\n //if the position is less than 0, add the node at the beginning\n $pos = 0;\n } else if($pos > $this->nodes->count()) {\n //if the position is greater than the node count, add the node at the endding\n $pos = $this->nodes->count();\n }\n\n $this->nodes->add($pos, $node);\n }\n\n return $this->clearFindCache();\n }", "function insertChildBefore (&$node, &$reference) {\r\n if (!is_object ($node)) {\r\n return false;\r\n }\r\n \r\n // root nodes may not be children of other nodes!\r\n if ($node->_type == STRINGPARSER_NODE_ROOT) {\r\n return false;\r\n }\r\n \r\n // is the reference node a child?\r\n $child = $this->_findChild ($reference);\r\n \r\n if ($child === false) {\r\n return false;\r\n }\r\n \r\n // if node already has a parent\r\n if ($node->_parent !== null) {\r\n // remove node from there\r\n $parent =& $node->_parent;\r\n if (!$parent->removeChild ($node, false)) {\r\n return false;\r\n }\r\n unset ($parent);\r\n }\r\n \r\n $index = count ($this->_children) - 1;\r\n // move all nodes to a new index\r\n while ($index >= $child) {\r\n // save object\r\n $object =& $this->_children[$index];\r\n // we have to unset it because else it will be\r\n // overridden in in the loop\r\n unset ($this->_children[$index]);\r\n // put object to new position\r\n $this->_children[$index+1] =& $object;\r\n $index--;\r\n }\r\n $this->_children[$child] =& $node;\r\n return true;\r\n }", "function insertChildAfter (&$node, &$reference) {\r\n if (!is_object ($node)) {\r\n return false;\r\n }\r\n \r\n // root nodes may not be children of other nodes!\r\n if ($node->_type == STRINGPARSER_NODE_ROOT) {\r\n return false;\r\n }\r\n \r\n // is the reference node a child?\r\n $child = $this->_findChild ($reference);\r\n \r\n if ($child === false) {\r\n return false;\r\n }\r\n \r\n // if node already has a parent\r\n if ($node->_parent !== false) {\r\n // remove node from there\r\n $parent =& $node->_parent;\r\n if (!$parent->removeChild ($node, false)) {\r\n return false;\r\n }\r\n unset ($parent);\r\n }\r\n \r\n $index = count ($this->_children) - 1;\r\n // move all nodes to a new index\r\n while ($index >= $child + 1) {\r\n // save object\r\n $object =& $this->_children[$index];\r\n // we have to unset it because else it will be\r\n // overridden in in the loop\r\n unset ($this->_children[$index]);\r\n // put object to new position\r\n $this->_children[$index+1] =& $object;\r\n $index--;\r\n }\r\n $this->_children[$child + 1] =& $node;\r\n return true;\r\n }", "public function add($child)\r\n {\r\n if ($child instanceof tag) {\r\n if ($child->id && array_key_exists($child->id,$this->ref)) {\r\n return $this->ref[$child->id]; \r\n }\r\n $child->tagdep = abs($this->tagdep) + 1;\r\n $this->tagdep = abs($this->tagdep) * -1;\r\n }\r\n //Append child to childs repo\r\n $this->childs[] = $child;\r\n //If child isn't object return $this tag\r\n if (!is_object($child)) {\r\n return $this;\r\n }\r\n if ($child->id) {\r\n $this->ref[$child->id] =& $child;\r\n }\r\n $child->parent =& $this;\r\n return $child;\r\n }", "public function isChildSupported();", "function addChild( $ni )\n\t\t{\n\t\t$this->childs[] = $ni ;\n\t\t}", "public function addChild(ThemeMenuItem $child)\n {\n }", "public function insertChildNode($child, $parent)\n {\n $parent = $this->getNode($parent);\n return $this->insertNode($child, $parent);\n }", "function has_child () {\n\t\treturn sizeof($this->children) ? true : false;\n\t}", "function appendChild(&$treeItem, $parentItem) {\n\t\t$this->trackItem($treeItem);\n\n\t\tif ($parentItem == null) {\n\t//\t\t$parentItem =& $this->_rootNode;\n\t\t\t$this->rootItem->children[] = $treeItem->getId();\n\t\t} else {\n\t\t\t//get the global reference\n\t\t\t$parentItem =& $this->getItem($parentItem);\n\t\t\tif ($treeItem->_expanded) {\n\t\t\t\t$this->expandBranch($parentItem);\n\t\t\t}\n\t//\t\t$parentItem->appendChild($treeItem);\n\t\t\t$parentItem->children[] = $treeItem->getId();\n\t\t\t$treeItem->_parentPointer = $parentItem->getId();\n\t\t}\n\t}", "public function addChild(object $child): self\n {\n $this->children->add($child);\n\n return $this;\n }", "function file_allow_as_child($node) {\n\t\treturn false;\n\t}", "function append($node) {\n\t\tif (!is_array($node)) {\n\t\t\t$this->child[]=$node;\n\t\t} else if (is_array($node)) {\n\t\t\tfor ($childIdx=0; $childIdx<count($node); $childIdx++)\n\t\t\t\t$this->child[]=$node[$childIdx];\n\t\t}\n\t}", "function addChild(T_CompositeLeaf $child,$key=null)\n {\n if (isset($key)) {\n $this->children[$key] = $child;\n } else {\n $this->children[] = $child;\n }\n return $this;\n }", "public function testExistedNodeSiblingsMoveAppendTo()\n {\n $model8 = Animal::findOne(8);\n \n $this->assertTrue($model8->appendTo($model8->parent()));\n $this->assertEquals(3, $model8->weight);\n }", "public function AddChildElement(IElement $child)\r\n {\r\n $this->Children[] = $child->Render();\r\n }", "function addChild($name) {\n\t\tarray_push($this->childrens, $name);\n\t}", "public function child($childName, $joinType = 'LEFT', $additionalCols = Array(), $matching = '=')\n {\n $this->addChild($childName, $joinType, $additionalCols, $matching);\n }", "public function insertChildBeforeSibling(CategoryTreeNodeInterface $child, $nextSiblingId);", "private function insertNode($child, $parent)\n {\n $this->db->beginTransaction();\n $sql = \"UPDATE \" . $this->table . \" SET rgt = rgt + 2 WHERE rgt >= ?\";\n $this->modify($sql, [$parent->rgt]);\n\n $sql = \"UPDATE \" . $this->table . \" SET lft = lft + 2 WHERE lft > ?\";\n $this->modify($sql, [$parent->rgt]);\n\n $sql = \"UPDATE \" . $this->table . \" SET lft = ?, rgt = ?, parent_id = ?, lvl = ? WHERE id = ?\";\n $level = $parent->lvl+1;\n $this->modify($sql, [$parent->rgt, $parent->rgt+1, $parent->id, $level, $child]);\n\n return $this->db->commit();\n }", "private function pushNode(\\DOMElement $node)\r\n {\r\n $this->currentNode = $this->currentNode->appendChild($node);\r\n }", "abstract public function addItemChild($itemName, $childName);", "public function isChild(): bool\n {\n return false;\n }", "public function pushNode( $node );", "public function insertChildAfter(&$node, &$reference)\n {\n if (! is_object($node)) {\n return false;\n }\n\n // root nodes may not be children of other nodes!\n if ($node->_type == self::NODE_ROOT) {\n return false;\n }\n\n // is the reference node a child?\n $child = $this->_findChild($reference);\n\n if ($child === false) {\n return false;\n }\n\n // if node already has a parent\n if ($node->_parent !== false) {\n // remove node from there\n $parent =& $node->_parent;\n if (! $parent->removeChild($node, false)) {\n return false;\n }\n unset($parent);\n }\n\n $index = count($this->_children) - 1;\n // move all nodes to a new index\n while ($index >= $child + 1) {\n // save object\n $object =& $this->_children[$index];\n // we have to unset it because else it will be\n // overridden in in the loop\n unset($this->_children[$index]);\n // put object to new position\n $this->_children[$index+1] =& $object;\n $index--;\n }\n $this->_children[$child + 1] =& $node;\n return true;\n }", "public function addChild(EntityInterface $child, $position = null);", "public function __invoke(Node $node, Node $parent): Node\n {\n if (! $node->isRootNode()) {\n $node->getParentNode()->removeNode($node);\n }\n\n $parent->addChildNodes($node);\n\n return $node;\n }", "#[\\ReturnTypeWillChange]\n\tfunction addChild($name, $value = null, $namespace = null):CX {/** @var CX $r */\n\t\ttry {$r = parent::addChild($this->k($name), $value, $namespace);}\n\t\tcatch (Th $th) {df_error(\"Tag <{$name}>. Value: «{$value}». Error: «%s».\", df_xts($th));}\n\t\treturn $r;\n\t}", "public function insertChildBefore(&$node, &$reference)\n {\n if (! is_object($node)) {\n return false;\n }\n\n // root nodes may not be children of other nodes!\n if ($node->_type == self::NODE_ROOT) {\n return false;\n }\n\n // is the reference node a child?\n $child = $this->_findChild($reference);\n\n if ($child === false) {\n return false;\n }\n\n // if node already has a parent\n if ($node->_parent !== null) {\n // remove node from there\n $parent =& $node->_parent;\n if (! $parent->removeChild($node, false)) {\n return false;\n }\n unset($parent);\n }\n\n $index = count($this->_children) - 1;\n // move all nodes to a new index\n while ($index >= $child) {\n // save object\n $object =& $this->_children[$index];\n // we have to unset it because else it will be\n // overridden in in the loop\n unset($this->_children[$index]);\n // put object to new position\n $this->_children[$index+1] =& $object;\n $index--;\n }\n $this->_children[$child] =& $node;\n return true;\n }", "public static function addChildAsCDATA($parent, $name, $value = null)\n {\n $new_child = $parent->addChild($name);\n\n if ($new_child !== null) {\n $node = dom_import_simplexml($new_child);\n $no = $node->ownerDocument;\n // createCDATASection() returns an empty CDATA if value is a false boolean\n // workaround: use intval of value instead\n $cdata = $no->createCDATASection((string)(is_bool($value) ? intval($value) : $value));\n $node->appendChild($cdata);\n }\n\n return $new_child;\n }", "protected function addChild(NodeInterface $child)\n {\n $context = new ExceptionContext(\n 'exception.propimmutable',\n 'Read only'\n );\n\n throw new PropImmutableException($context);\n }", "public function hasChildNodes() {}", "function add_children(){\n\t\t\t\t\t//if the array has a parent add it to the parents child array\n\t\tforeach ($this->nodes as $node){\n\t\t\tif($node->parent!=-1){\n\t\t\t\tif(isset($this->nodes[$node->parent])){\n\t\t\t\t\t$parent=$this->nodes[$node->parent];\n\t\t\t\t\t$parent->add_child($node->id);\n\t\t\t\t}else{\n\t\t\t\t\tprint_error('nonode','socialwiki');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function addChild(ExecutableInterface $newChildNode)\r\n\t{\r\n\t\tif (count($this->childrenNodes)>0)\r\n\t\t{\r\n\t\t\t$this->childrenNodes[] = $newChildNode;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->childrenNodes = array($newChildNode);\r\n\t\t}\r\n\t\treturn $this->childrenNodes;\r\n\t}", "public function addChild(PlaceholderInterface $child);", "public function AddChild(string $childHTML)\r\n {\r\n $this->Children[] = $childHTML;\r\n }", "final public function addFrom(CtkBuildable $node, $prepend = false) {\n\t\tthrow new CakeException(sprintf('Cannot add children to %s', get_class($this)));\n\t}", "public function setChild($child)\n {\n $this->child = $child;\n }", "public function isChild(): bool;", "public function testAddChild_Simple()\n\t{\n\t\t$this->object->AddChild($this->child);\n\t\t$this->assertType(\"child\", $this->object->childList[0]);\n\t\t$this->assertEquals(1, sizeof($this->object->childList));\n\t}", "public function setLastChild(bool $value = true): Delta\n {\n $this->is_last_child = $value;\n\n return $this;\n }", "public function appendChild($item, ?\\SetaPDF_Core_Document $document = null, $mode = null) {}", "function addChild($key, IBabylonModel $child) : IBabylonModel;", "public function testAddChild_Modification()\n\t{\n\t\t$this->object->AddChild($this->child);\n\t\t$this->child->attribute = \"changed att\";\n\t\t$this->assertEquals(\"changed att\", $this->object->childList[0]->attribute);\n\t}", "public function isOnlyChild(): bool\n {\n if ($this->isFirstChild() === true && $this->isLastChild() === true) {\n return true;\n } else {\n return false;\n }\n }", "public function isChild()\n {\n return $this->parentId != null;\n }", "function add($parentname, $something) {\n $parent =& $this->locate($parentname);\n if (is_null($parent)) {\n debugging('parent does not exist!');\n return false;\n }\n\n if (is_a($something, 'part_of_admin_tree')) {\n if (!is_a($parent, 'parentable_part_of_admin_tree')) {\n debugging('error - parts of tree can be inserted only into parentable parts');\n return false;\n }\n $parent->children[] = $something;\n return true;\n\n } else {\n debugging('error - can not add this element');\n return false;\n }\n\n }", "public function addChild(CustomDefAbstract $def)\n\t{\n\t\t$this->children->add($def);\n\t\t$def['parent'] = $this;\n\t\t$this->_onPropertyChanged('children', $this->children, $this->children);\n\t}", "public function addChild($header = \"\");", "public function WantsChildren() {\r\n return false;\r\n }", "public function addElse($node)\n\t{\n\t\tif ($this->else===NULL) {\n\t\t\t$node->parent=$this;\n\t\t\t$node->root=$this->root;\n\t\t\t$this->else=$node;\n\t\t\t}\n\t\telse {\n\t\t\t$this->else->addElse($node);\n\t\t\t}\n\n\t\treturn $this;\n\t}", "public function get_child($position) : HTMLNode\n {\n return $this -> children -> get($position);\n }" ]
[ "0.7423277", "0.6686382", "0.65202665", "0.65020585", "0.6398468", "0.63334215", "0.62865317", "0.6247421", "0.6190925", "0.6176126", "0.61677957", "0.6124729", "0.6058088", "0.6039321", "0.6023294", "0.60165787", "0.60148895", "0.5976568", "0.59093624", "0.5833765", "0.58103114", "0.57834405", "0.5770818", "0.5748317", "0.5720276", "0.5717598", "0.5693938", "0.56887865", "0.56873953", "0.5660831", "0.5640218", "0.5612474", "0.5591073", "0.55802655", "0.55605114", "0.5553766", "0.55438155", "0.554356", "0.5536643", "0.5493011", "0.54822224", "0.5474238", "0.54679483", "0.54641026", "0.54339457", "0.54308915", "0.5427626", "0.5424106", "0.5423879", "0.5389782", "0.53579676", "0.53335214", "0.53251326", "0.53045267", "0.5300297", "0.5298837", "0.5296193", "0.5280487", "0.5270683", "0.5270242", "0.5265083", "0.5260435", "0.52436733", "0.52374053", "0.52159995", "0.5210018", "0.5205827", "0.5198022", "0.51943076", "0.5184544", "0.5172594", "0.51706123", "0.5162633", "0.5145243", "0.5141735", "0.51348776", "0.51323164", "0.5116054", "0.5114692", "0.5101843", "0.5097865", "0.5094862", "0.509411", "0.50667995", "0.5049114", "0.50461566", "0.50367635", "0.50360996", "0.50341034", "0.50193536", "0.5009538", "0.5008391", "0.5000646", "0.49756834", "0.49661162", "0.4955489", "0.49430084", "0.49413288", "0.49378935", "0.49358642" ]
0.66711754
2
Adds a node to this node as a child while the callback function returns a node.
final public function addWhile($callback, array $data = array()) { throw new CakeException(sprintf('Cannot add children to %s', get_class($this))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addChild(Node $child);", "function appendChild ($a_node)\n\t{\n\t\treturn $this->doc->append_child($a_node);\n\t}", "public function addChild(Node $child) {\n return $this->root->addChild($child);\n }", "function addChild( $node )\n\t\t{\n\t\t$this->childs[] = $node ;\n\t\t}", "public function addChild(Node $child)\n {\n $this->children[] = $child;\n }", "public function appendChild($child, array $options = array()) \n {\n $this->children[] = $child;\n\n return $child;\n }", "public function addChild($itemID){\n $child = new FPNode($itemID,1,$this);\n array_push($this->children, $child);\n return $child;\n }", "public function addChild(CategoryTreeNodeInterface $child);", "function create_dom_node(&$dom, &$parent_node, $node_name, $node_value = NULL){\n\t\t$node = $dom->create_element($node_name);\n\t\t$new_node = $parent_node->append_child($node);\n\t\tif($node_value != NULL){\n\t\t\t$txt_node = $dom->create_text_node($node_value);\n\t\t\t$new_node->append_child($txt_node);\n\t\t}\n\t\treturn $new_node;\n\t}", "public function appendChild($child = NULL)\n\t{\n\t\tif ($child instanceof DOMNode) {\n\t\t\tparent::appendChild($child);\n\t\t}\n\t\treturn $this;\n\t}", "public function addChildNode(\\F3\\Fluid\\Core\\Parser\\SyntaxTree\\NodeInterface $childNode);", "public function appendChild(Pagemill_Node $node) {\r\n\t\t$tmp = new Pagemill_Stream(true);\r\n\t\t$node->rawOutput($tmp);\r\n\t\t$this->_text .= $tmp->peek();\r\n\t}", "function &AppendNode($Name)\n {\n //$node =& new XMLNode($Name);\n $node = new XMLNode($Name); // FRC\n $node->SetParent($this);\n\n // Do not use array_push with pass-by-reference any more to avoid\n // allow_call_time_pass_reference warning (Oliver Grahl, 2006-08-31)\n //array_push($this->ChildNodes, &$node);\n $this->ChildNodes[] =& $node;\n\n return $node;\n }", "public function appendChild(Node $node)\n {\n $this->_children[] = $node;\n }", "public function pushNode( $node );", "public function addChild(Node $node)\n {\n $node->setParent($this);\n\n $this->child[] = $node;\n\n return $this;\n\n }", "public function addChild(self $child): void\n\t{\n\t\tif (!$this->children->contains($child)) {\n\t\t\t// ...and assign it to collection\n\t\t\t$this->children->add($child);\n\t\t}\n\t}", "public function add_child(HTMLNode $node): int\n {\n return $this -> children -> add($node);\n }", "public function addChildNode( SimpleXMLElement $oChild ) \n\t\t{\n\t\t\t$oParentDOM = dom_import_simplexml( $this );\n\t\t\t$oChildDOM = dom_import_simplexml( $oChild );\n\t\t\t$oNewParentDOM = $oParentDOM->ownerDocument->importNode( $oChildDOM, true );\n\t\t\t$oParentDOM->appendChild( $oNewParentDOM );\n\t\t\n\t\t}", "public function add_child($child) {\n\t\t$this->children[] = $child;\n\t}", "public function add($child) {\n $this->children[] = $child;\n }", "public function addChild(ExecutableInterface $newChildNode)\r\n\t{\r\n\t\tif (count($this->childrenNodes)>0)\r\n\t\t{\r\n\t\t\t$this->childrenNodes[] = $newChildNode;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->childrenNodes = array($newChildNode);\r\n\t\t}\r\n\t\treturn $this->childrenNodes;\r\n\t}", "public function set_addChildNode($param)\n\t{\n\t\t$this->addChildNode = $param; return $this;\n\t}", "protected function append($child): void\n {\n $this->children[] = $child;\n }", "public function addChild(self $child): self\n {\n $this->children[] = $child;\n\n return $this;\n }", "public function createchild($value) {\n return $this->setProperty('createchild', $value);\n }", "function add_child($dom, $base, $name, $value) {\n\tif ($value) {\n\t\t// Stupid DOMDocument functions don't escape ampersands (&)\n\t\t$value = str_replace('&', '&amp;', $value);\n\t\t$child = $base->appendChild($dom->createElement($name, $value));\n\t} else {\n\t\t$child = $base->appendChild($dom->createElement($name));\n\t}\n\treturn $child;\n}", "function add_node($child_id, tree_node $tt) {\n $this->triples[$child_id] = $tt;\n $this->children[$tt->parent_id][$child_id] = true;\n }", "function add_child( $child ) {\n\t\tif( $child instanceof ModularPost ) {\n\t\t\t$this->children[] = $child;\n\t\t}\n\t}", "final public function addChild ()\n {\n throw new ChildException('Trying to add child to self closing HTML element');\n }", "public function add_child(SBBCodeParser_Node $child)\r\n\t{\r\n\t\t$this->children[] = $child;\r\n\t\t$child->set_parent($this);\r\n\t}", "public function addChildAsLast(Node $node)\n {\n if(null === $this->children)\n {\n $this->children = array();\n }\n\n $this->children[] = $node;\n }", "public function __invoke(Node $node, Node $parent): Node\n {\n if (! $node->isRootNode()) {\n $node->getParentNode()->removeNode($node);\n }\n\n $parent->addChildNodes($node);\n\n return $node;\n }", "public function addChild(pdoMap_Core_XML_Node $child) {\n $this->__childs[] = $child;\n // echo 'Add child '.$this->getName().'.'.$child->getName().'<br />';\n }", "public function end()\n {\n # attach internal tree to parent\n $this->parentNode->getNode()->addChild($this->getNode());\n \n return $this->parentNode; \n }", "public function add($child, $type = null, array $options = array());", "public function addChild($child)\r\n\t{\r\n\t\t$this->last = $child->last;\r\n\r\n\t\t$this->entries []= $child;\r\n\t}", "abstract public function insert ( \\Hoa\\Tree\\Generic $child );", "public function add($child, $name = false) {\n\t\tif( $name ) {\n\t\t\t$this->childs[$name] = $child;\n\t\t} else {\n\t\t\t$this->childs[] = $child;\n\t\t}\n\t\treturn $this;\n\t}", "function insertChildAfter (&$node, &$reference) {\r\n if (!is_object ($node)) {\r\n return false;\r\n }\r\n \r\n // root nodes may not be children of other nodes!\r\n if ($node->_type == STRINGPARSER_NODE_ROOT) {\r\n return false;\r\n }\r\n \r\n // is the reference node a child?\r\n $child = $this->_findChild ($reference);\r\n \r\n if ($child === false) {\r\n return false;\r\n }\r\n \r\n // if node already has a parent\r\n if ($node->_parent !== false) {\r\n // remove node from there\r\n $parent =& $node->_parent;\r\n if (!$parent->removeChild ($node, false)) {\r\n return false;\r\n }\r\n unset ($parent);\r\n }\r\n \r\n $index = count ($this->_children) - 1;\r\n // move all nodes to a new index\r\n while ($index >= $child + 1) {\r\n // save object\r\n $object =& $this->_children[$index];\r\n // we have to unset it because else it will be\r\n // overridden in in the loop\r\n unset ($this->_children[$index]);\r\n // put object to new position\r\n $this->_children[$index+1] =& $object;\r\n $index--;\r\n }\r\n $this->_children[$child + 1] =& $node;\r\n return true;\r\n }", "function _pushNode (&$node) {\r\n $stack_count = count ($this->_stack);\r\n $max_node =& $this->_stack[$stack_count-1];\r\n if (!$max_node->appendChild ($node)) {\r\n return false;\r\n }\r\n $this->_stack[$stack_count] =& $node;\r\n return true;\r\n }", "function append($node) {\n\t\tif (!is_array($node)) {\n\t\t\t$this->child[]=$node;\n\t\t} else if (is_array($node)) {\n\t\t\tfor ($childIdx=0; $childIdx<count($node); $childIdx++)\n\t\t\t\t$this->child[]=$node[$childIdx];\n\t\t}\n\t}", "private function pushNode(\\DOMElement $node)\r\n {\r\n $this->currentNode = $this->currentNode->appendChild($node);\r\n }", "function addChild( $ni )\n\t\t{\n\t\t$this->childs[] = $ni ;\n\t\t}", "public function test_childNodeAdded() : void\n {\n $form = $this->createForm();\n $group = $form->addGroup('group');\n\n $this->assertFalse($this->formEventCalled);\n $this->assertFalse($this->containerEventCalled);\n\n $form->onFormNodeAdded(array($this, 'callback_formNodeAdded'));\n $form->onNodeAdded(array($this, 'callback_nodeAdded'));\n\n $group->addText('foo');\n\n $this->assertTrue($this->formEventCalled);\n $this->assertFalse($this->containerEventCalled);\n }", "final public function add(CtkBuildable $node) {\n\t\tthrow new CakeException('Cannot add children to node');\n\t}", "function add_children(){\n\t\t\t\t\t//if the array has a parent add it to the parents child array\n\t\tforeach ($this->nodes as $node){\n\t\t\tif($node->parent!=-1){\n\t\t\t\tif(isset($this->nodes[$node->parent])){\n\t\t\t\t\t$parent=$this->nodes[$node->parent];\n\t\t\t\t\t$parent->add_child($node->id);\n\t\t\t\t}else{\n\t\t\t\t\tprint_error('nonode','socialwiki');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function parseToNode($node_id, $node_name, $id, $key, $value)\n\t{\n\t\t$query = \"//*[@c.\" . $node_name . \"][@id='\" . $node_id . \"']//*[@c.\" . $key . \"]\";\n\t\t$results = $this->xpath->query($query);\n\n\t\tif ($results->length > 0) {\n\t\t\t$child_node = $results->item(0);\n\t\t\t$child_node->setAttribute('rel', $id);\n\t\t\t$child_node->setAttribute('id', 'c.' . $key . $id);\n\n\t\t\tif (is_array($value)) {\n\t\t\t\tforeach ($value as $key2 => $value2) {\n\t\t\t\t\tif ($key2 === 0) {\n\t\t\t\t\t\t$child_node->nodeValue = $value2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$child_node->setAttribute($key2, $value2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->setElementContent($child_node, $value);\n\t\t\t}\n\t\t\t$child_node->removeAttribute('c.' . $key);\n\t\t}\n\t}", "function addChild(T_CompositeLeaf $child,$key=null)\n {\n if (isset($key)) {\n $this->children[$key] = $child;\n } else {\n $this->children[] = $child;\n }\n return $this;\n }", "function addChild($name) {\n\t\tarray_push($this->childrens, $name);\n\t}", "protected function addChildIfMissing(NodeInterface $child)\n {\n $this->addChild($child);\n }", "public function insertChildAfter(&$node, &$reference)\n {\n if (! is_object($node)) {\n return false;\n }\n\n // root nodes may not be children of other nodes!\n if ($node->_type == self::NODE_ROOT) {\n return false;\n }\n\n // is the reference node a child?\n $child = $this->_findChild($reference);\n\n if ($child === false) {\n return false;\n }\n\n // if node already has a parent\n if ($node->_parent !== false) {\n // remove node from there\n $parent =& $node->_parent;\n if (! $parent->removeChild($node, false)) {\n return false;\n }\n unset($parent);\n }\n\n $index = count($this->_children) - 1;\n // move all nodes to a new index\n while ($index >= $child + 1) {\n // save object\n $object =& $this->_children[$index];\n // we have to unset it because else it will be\n // overridden in in the loop\n unset($this->_children[$index]);\n // put object to new position\n $this->_children[$index+1] =& $object;\n $index--;\n }\n $this->_children[$child + 1] =& $node;\n return true;\n }", "public function addNode(string $name, string $value) : self\n {\n $this->xml->addChild($name, $value);\n\n return $this;\n }", "public function get_child($position) : HTMLNode\n {\n return $this -> children -> get($position);\n }", "public function addChild(Node $node, $pos = null) {\n //set the child node level\n $node->level = $this->level+1;\n\n //set the parent node\n $node->parent = $this;\n\n //if the position is unset, add the node at the endding\n if(is_null($pos)) {\n $this->nodes->push($node);\n } else {\n if($pos < 0) {\n //if the position is less than 0, add the node at the beginning\n $pos = 0;\n } else if($pos > $this->nodes->count()) {\n //if the position is greater than the node count, add the node at the endding\n $pos = $this->nodes->count();\n }\n\n $this->nodes->add($pos, $node);\n }\n\n return $this->clearFindCache();\n }", "public function addChild(CustomDefAbstract $def)\n\t{\n\t\t$this->children->add($def);\n\t\t$def['parent'] = $this;\n\t\t$this->_onPropertyChanged('children', $this->children, $this->children);\n\t}", "public function getChildNodes() {}", "public function getChildNodes() {}", "public function addNode(self $node) : self\n {\n $this->append($node);\n return $this;\n }", "final public function hasChild(CtkBuildable $node) {\n\t\treturn false;\n\t}", "public function add($child)\r\n {\r\n if ($child instanceof tag) {\r\n if ($child->id && array_key_exists($child->id,$this->ref)) {\r\n return $this->ref[$child->id]; \r\n }\r\n $child->tagdep = abs($this->tagdep) + 1;\r\n $this->tagdep = abs($this->tagdep) * -1;\r\n }\r\n //Append child to childs repo\r\n $this->childs[] = $child;\r\n //If child isn't object return $this tag\r\n if (!is_object($child)) {\r\n return $this;\r\n }\r\n if ($child->id) {\r\n $this->ref[$child->id] =& $child;\r\n }\r\n $child->parent =& $this;\r\n return $child;\r\n }", "public function appendNode($type) {\n $node = new Node($type, $this->current);\n $this->current->append($node);\n $this->current = $node;\n }", "public function addChild(BlockInterface $child, $key = null)\n {\n if (null !== $key) {\n $this->children->set($key, $child);\n\n return true;\n }\n\n return $this->children->add($child);\n }", "public function addChild($arg = \"\", $index = -1) {\n\t\tif ($index < 0 || $index >= count($this->children)-1) {\n\t\t\tif (is_array($arg)) {\n\t\t\t\tforeach ($arg as $a) {\n\t\t\t\t\t$this -> addChild($a);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($arg instanceof Node) {\n\t\t\t\t\tif ($arg -> parentNode) {\n\t\t\t\t\t\t$arg -> parentNode -> removeChild($arg);\n\t\t\t\t\t}\n\t\t\t\t\t$arg -> parentNode = $this;\n\t\t\t\t\treturn $this -> children[] = $arg;\n\t\t\t\t} elseif (is_string((string) $arg)) {\n\t\t\t\t\t$textNode = new TextNode($arg);\n\t\t\t\t\t$textNode -> parentNode = $this;\n\t\t\t\t\treturn $this -> children[] = $textNode;\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif (is_int($index)) {\n\t\t\tfor ($i = count($this->children); $i >= $index; $i--) {\n\t\t\t\t$child = $this->children[$i];\n\t\t\t\t$this->children[$i+1] = $child;\n\t\t\t}\n\t\t\tif ($arg instanceof Node) {\n\t\t\t\tif ($arg -> parentNode) {\n\t\t\t\t\t$arg -> parentNode -> removeChild($arg);\n\t\t\t\t}\n\t\t\t\t$arg -> parentNode = $this;\n\t\t\t\treturn $this -> children[$index] = $arg;\n\t\t\t} elseif (is_string((string) $arg)) {\n\t\t\t\t$textNode = new TextNode($arg);\n\t\t\t\t$textNode -> parentNode = $this;\n\t\t\t\treturn $this -> children[$index] = $textNode;\n\t\t\t}\n\t\t}\n\t}", "public function addChild(object $child): self\n {\n $this->children->add($child);\n\n return $this;\n }", "function addChild($key, IBabylonModel $child) : IBabylonModel;", "public function getChildNodes();", "abstract protected function createChild(string $name): Item;", "public function addChildWithCDATA($name, $value = NULL) {\n $new_child = $this->addChild($name);\n if ($new_child !== NULL) {\n $node = dom_import_simplexml($new_child);\n $no = $node->ownerDocument;\n $node->appendChild($no->createCDATASection($value));\n }\n return $new_child;\n }", "public function addNode($node, $action = self::NODE_ADD);", "public function addChild(ModelInterface $child, $placeholder = null, $append = false);", "public function append(Node $node)\n {\n\n if (!is_array($this->_children)) {\n $this->_children = [];\n }\n\n $this->_children[] = $node;\n return $this;\n }", "function &newNode($node)\n {\n global $g_modules, $config_atkroot, $g_overloaders;\n\n /* check for file */\n $file = nodeFile($node);\n if (!file_exists($file))\n { \n atkimport(\"atk.utils.atkclassloader\");\n $res = atkClassLoader::invokeFromString(atkconfig(\"missing_class_handler\"), array(\"node\"=>$node));\n if ($res!==false)\n {\n return $res;\n }\n else\n {\n atkerror(\"Cannot create node, because a required file ($file) does not exist!\", \"critical\");\n return NULL;\n }\n }\n\n /* include file */\n include_once($file);\n\n /* module */\n $module = getNodeModule($node);\n\n /* now that we have included the node source file, we check\n * for overloaders (because overloaders might need the included file!)\n */\n $overloader = &$this->nodeOverloader($node);\n if ($overloader != NULL)\n {\n $overloader->m_module = $module;\n return $overloader;\n }\n\n /* initialize node and return */\n $type = getNodeType($node);\n $node = new $type();\n $node->m_module = $module;\n return $node;\n }", "public function add_child(\\WP_Comment $child)\n {\n }", "public function addChild(ThemeMenuItem $child)\n {\n }", "abstract protected function addNode(\\DOMNode $target, \\DOMNode $source);", "function appendChild(&$treeItem, $parentItem) {\n\t\t$this->trackItem($treeItem);\n\n\t\tif ($parentItem == null) {\n\t//\t\t$parentItem =& $this->_rootNode;\n\t\t\t$this->rootItem->children[] = $treeItem->getId();\n\t\t} else {\n\t\t\t//get the global reference\n\t\t\t$parentItem =& $this->getItem($parentItem);\n\t\t\tif ($treeItem->_expanded) {\n\t\t\t\t$this->expandBranch($parentItem);\n\t\t\t}\n\t//\t\t$parentItem->appendChild($treeItem);\n\t\t\t$parentItem->children[] = $treeItem->getId();\n\t\t\t$treeItem->_parentPointer = $parentItem->getId();\n\t\t}\n\t}", "public function appendChild($childNode)\r\n {\r\n $this->_childNodes[$childNode->id] = $childNode;\r\n $childNode->setParentNode($this);\r\n }", "abstract protected function getNewChildren(): array ;", "abstract public function addItemChild($itemName, $childName);", "public function enterNode(Node $node)\n {\n }", "public function beginChildren()\n {\n parent::beginChildren();\n\n $this->call($this->descendCallback);\n }", "public function getLastChild();", "public function getLastChild();", "function insert_as_last_child_of($parent_node) \n\t{\n\t\t$lft_col = $this->left_column;\n\t\t$rgt_col = $this->right_column;\n\t\t$scp_col=$this->scope_column; \n\t\t$parent_column=$this->parent_column; \n\t\t\n\t\t//Set parent id (id of the parent, is childs parent id) \n\t\t//$this->$parent_column=$parent_node->id;\n\t\t\n\t\t$this->model->$lft_col=$parent_node->$rgt_col;\n\t\t$this->model->$rgt_col=$parent_node->$rgt_col+1;\n\t//\t$this->$scp_col=$this->get_scope(); \n\t\t\n\t\t$this->lock_tree();\t\t\n\t\t$this->modify_node($this->model->$lft_col,2);\n\t\t//$this->save_node();\n\t\t$this->model->save();\n\t\t$this->unlock_tree();\n\t\t\n\t\treturn $this;\n\t}", "private function _setUpNewNode(Node $node)\n {\n $node->setContainer($this->_container);\n\n return $node;\n }", "public function addChild(PlaceholderInterface $child);", "public function hasChildNodes() {}", "function insertChildBefore (&$node, &$reference) {\r\n if (!is_object ($node)) {\r\n return false;\r\n }\r\n \r\n // root nodes may not be children of other nodes!\r\n if ($node->_type == STRINGPARSER_NODE_ROOT) {\r\n return false;\r\n }\r\n \r\n // is the reference node a child?\r\n $child = $this->_findChild ($reference);\r\n \r\n if ($child === false) {\r\n return false;\r\n }\r\n \r\n // if node already has a parent\r\n if ($node->_parent !== null) {\r\n // remove node from there\r\n $parent =& $node->_parent;\r\n if (!$parent->removeChild ($node, false)) {\r\n return false;\r\n }\r\n unset ($parent);\r\n }\r\n \r\n $index = count ($this->_children) - 1;\r\n // move all nodes to a new index\r\n while ($index >= $child) {\r\n // save object\r\n $object =& $this->_children[$index];\r\n // we have to unset it because else it will be\r\n // overridden in in the loop\r\n unset ($this->_children[$index]);\r\n // put object to new position\r\n $this->_children[$index+1] =& $object;\r\n $index--;\r\n }\r\n $this->_children[$child] =& $node;\r\n return true;\r\n }", "private function insertNode($child, $parent)\n {\n $this->db->beginTransaction();\n $sql = \"UPDATE \" . $this->table . \" SET rgt = rgt + 2 WHERE rgt >= ?\";\n $this->modify($sql, [$parent->rgt]);\n\n $sql = \"UPDATE \" . $this->table . \" SET lft = lft + 2 WHERE lft > ?\";\n $this->modify($sql, [$parent->rgt]);\n\n $sql = \"UPDATE \" . $this->table . \" SET lft = ?, rgt = ?, parent_id = ?, lvl = ? WHERE id = ?\";\n $level = $parent->lvl+1;\n $this->modify($sql, [$parent->rgt, $parent->rgt+1, $parent->id, $level, $child]);\n\n return $this->db->commit();\n }", "#[\\ReturnTypeWillChange]\n\tfunction addChild($name, $value = null, $namespace = null):CX {/** @var CX $r */\n\t\ttry {$r = parent::addChild($this->k($name), $value, $namespace);}\n\t\tcatch (Th $th) {df_error(\"Tag <{$name}>. Value: «{$value}». Error: «%s».\", df_xts($th));}\n\t\treturn $r;\n\t}", "public function insertChildNode($child, $parent)\n {\n $parent = $this->getNode($parent);\n return $this->insertNode($child, $parent);\n }", "public function completeNode() {\n $this->current = $this->current->parent();\n }", "public function enterNode(Node $node)\n {\n if ($node instanceof StaticCall\n && $node->class instanceof FullyQualified\n && $node->class->toString() === 'TYPO3\\CMS\\Core\\Utility\\GeneralUtility'\n && $node->name->name === 'makeInstance'\n && isset($node->args[0]->value)\n && $node->args[0]->value instanceof String_\n ) {\n $newSubNode = new FullyQualified($node->args[0]->value->value, $node->args[0]->value->getAttributes());\n $node->args[0]->value = $newSubNode;\n }\n }", "public function addLine($line) {\n\t\t$this->children[] = $line;\n\t\treturn $this;\n\t}", "public function testAddChild_Simple()\n\t{\n\t\t$this->object->AddChild($this->child);\n\t\t$this->assertType(\"child\", $this->object->childList[0]);\n\t\t$this->assertEquals(1, sizeof($this->object->childList));\n\t}", "public function setHasChildren($value)\n {\n $this->_has_children = (boolean)$value;\n return $this;\n }", "public function Append($value = 0, $column = 0) {\n\t\t// if the list is empty\n\t\tif ($this->isEmpty()) {\n\t\t\t$this->tail = new Node($value, $column, null);\n\t\t\t$this->head = $this->tail;\n\t\t\t$this->count++;\n\t\t} else {\n\t\t\t// make a new node assigning to the newest node\n\t\t\t$this->head->SetNext(new Node($value, $column, null));\n\t\t\t$this->head = $this->head->Next();\n\t\t\t$this->count++;\n\t\t}\n\t}", "private function createRootNode()\n {\n $this->_rootNode = $this->_dom->createElement($this->_rootElement, '');\n $this->_dom->appendChild($this->_rootNode);\n }", "function createHTTPChild($parent, $action, $name=\"noname\") {\n\tglobal $sugar_domain, $sugar_path;\n\t$node = $parent->addChild('http', '');\n\t$node->addChild('name', $name);\n\t$node->addChild('domain', $sugar_domain);\n\t$node->addChild('path', $sugar_path);\n\t$node->addChild('method', $action);\n\t$node->addChild('data', '');\n\treturn $node;\n}" ]
[ "0.7203511", "0.6351661", "0.6155289", "0.6129545", "0.6093489", "0.60223854", "0.5939296", "0.59257823", "0.5920227", "0.5849091", "0.5835997", "0.5831631", "0.58312815", "0.5830525", "0.5802936", "0.5786045", "0.57746196", "0.5759919", "0.5758656", "0.57143307", "0.5708681", "0.57025975", "0.56894284", "0.56781083", "0.5653549", "0.5640731", "0.5593801", "0.55770797", "0.55367655", "0.5526409", "0.55053765", "0.5497529", "0.54745644", "0.5473855", "0.54668325", "0.54588026", "0.5420286", "0.5395212", "0.5358813", "0.5350379", "0.5298636", "0.52892184", "0.5284085", "0.52803063", "0.5217978", "0.52157915", "0.51984125", "0.51732457", "0.5173175", "0.5172211", "0.51701236", "0.5162781", "0.5162026", "0.516137", "0.51481485", "0.51388246", "0.5136062", "0.51354355", "0.51317877", "0.5100965", "0.5100032", "0.50771356", "0.50747234", "0.50677466", "0.50568146", "0.504946", "0.50238293", "0.50182915", "0.501733", "0.50107926", "0.5006664", "0.5000553", "0.49942037", "0.49796757", "0.4973692", "0.49650297", "0.49587438", "0.49487543", "0.4947797", "0.4936355", "0.49281764", "0.49134496", "0.49132255", "0.49132255", "0.49123478", "0.4908072", "0.4904172", "0.4897977", "0.4892461", "0.48753285", "0.4864149", "0.48556384", "0.48468813", "0.48398018", "0.482761", "0.48201454", "0.4819075", "0.48161906", "0.4814436", "0.48016357" ]
0.5160123
54
Adds raw content to the children of this node.
final public function addContent($content = '') { throw new CakeException(sprintf('Cannot add children to %s', get_class($this))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function collectChildren(): void\n {\n $this->collection = new Collection();\n foreach ($this->rawResults as $blockChildContent) {\n $this->collection->add(Block::fromResponse($blockChildContent));\n }\n }", "public function setRawContent($content);", "function append($content) {\r\n\t\tif (is_string($content)) {\r\n\t\t\t$this->append($this->domFragment->createTextNode($content));\r\n\t\t} else {\r\n\t\t\t$this->root->appendChild($content);\r\n\t\t}\r\n\t}", "public function addRawContent($words);", "public function addChildren(array $children);", "protected function addContent()\n {\n $this->content .= $this->parse($this->template);\n return $this;\n }", "function addChildren(array $children) : void;", "public function renderChildren() {}", "public function addChildren(array $children): self\n {\n foreach ($children as $child) {\n if (is_string($child)) {\n $child = new TextNode([\n 'node' => $child,\n ]);\n }\n\n $this->addChild($child);\n }\n\n return $this;\n }", "public function appendChild(Pagemill_Node $node) {\r\n\t\t$tmp = new Pagemill_Stream(true);\r\n\t\t$node->rawOutput($tmp);\r\n\t\t$this->_text .= $tmp->peek();\r\n\t}", "public function add_children(HTMLCollection $collection){\n $this -> children = $collection;\n }", "private function processContent(){\n\t\t$this->textEnd = strpos($this->raw,\"</{$this->tag}\");\n\t\t$this->text = trim(substr($this->raw, $this->textStart, $this->textEnd - $this->textStart));\n\t}", "public function addChildren(BlockInterface $children)\n {\n return $this->addChild($children);\n }", "final public function addContent($content){\n\t\t$this->content.=$content;\n\t\treturn $this;\n\t}", "protected function actionPostLoadingEvent()\n {\n if (self::$child_data === null) {\n self::$child_data = [];\n foreach ($this->getParentModel()->children->child->iterateItems() as $node_uuid => $node) {\n if (empty((string)$node->enabled)) {\n continue;\n }\n $conn_uuid = (string)$node->connection;\n if (!isset(self::$child_data[$conn_uuid])) {\n self::$child_data[$conn_uuid] = [];\n }\n foreach (self::$child_attrs as $key) {\n if (!isset(self::$child_data[$conn_uuid][$key])) {\n self::$child_data[$conn_uuid][$key] = [];\n }\n self::$child_data[$conn_uuid][$key][] = (string)$node->$key;\n }\n }\n }\n foreach ($this->internalChildnodes as $node) {\n if (!$node->getInternalIsVirtual()) {\n $extra_attr = ['local_ts' => '', 'remote_ts' => ''];\n $conn_uuid = (string)$node->getAttribute('uuid');\n foreach (self::$child_attrs as $key) {\n $child_node = new TextField();\n $child_node->setInternalIsVirtual();\n if (isset(self::$child_data[$conn_uuid]) && !empty(self::$child_data[$conn_uuid][$key])) {\n $child_node->setValue(implode(',', array_unique(self::$child_data[$conn_uuid][$key])));\n }\n $node->addChildNode($key, $child_node);\n }\n }\n }\n return parent::actionPostLoadingEvent();\n }", "function addContent($content)\n {\n $this->content .= $content;\n }", "public function getChildren() {}", "public function getChildren() {}", "public function getChildren() {}", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "function register_block_core_post_content()\n {\n }", "public function get_children();", "public function appendContent($content);", "public function appendContent ($content) {\r\n\t\t$this->content .= (string)$content;\r\n\t}", "public function setRawContent(mixed $content = null): void\n {\n $this->content = $content;\n }", "public function renderChildren(): string\n {\n $html = [];\n\n foreach ($this->children as $child) {\n $html[] = $child->render();\n }\n\n $html = implode('', $html);\n\n if ($this instanceof HasTextChild && $this->escapeHtml) {\n $html = htmlspecialchars($html);\n }\n\n return $html;\n }", "public function onContentLoaded(&$rawContent)\n {\n $this->triggerEvent('after_load_content', array(&$this->requestFile, &$rawContent));\n }", "public function getRawContent();", "public function addContent($content);", "protected function setContent() {}", "function content() {\r\n\t\t/* Reimplement this function in subclasses. */\r\n\t}", "public function setRawContent(string $rawContent): self\n {\n $this->postFields = [];\n $this->files = [];\n $this->rawContent = $rawContent;\n\n return $this;\n }", "function serializeChildren()\r\n {\r\n //Calls children's serialize recursively\r\n reset($this->components->items);\r\n while (list($k,$v)=each($this->components->items))\r\n {\r\n $v->serialize();\r\n }\r\n }", "protected function createContents(Array $rawContents)\n {\n $contents = array();\n foreach ($rawContents as $rawContent) {\n $content = new Content;\n $content->name = $rawContent->name;\n $content->text = $rawContent->text;\n $attachments = array();\n foreach ($rawContent->photos as $filepath) {\n $attachemnt = $this->createAttachment($filepath);\n array_push($attachments, $attachemnt);\n }\n $content->save();\n $content->attachments()->saveMany($attachments);\n array_push($contents, $content);\n }\n return $contents;\n }", "function add_children(){\n\t\t\t\t\t//if the array has a parent add it to the parents child array\n\t\tforeach ($this->nodes as $node){\n\t\t\tif($node->parent!=-1){\n\t\t\t\tif(isset($this->nodes[$node->parent])){\n\t\t\t\t\t$parent=$this->nodes[$node->parent];\n\t\t\t\t\t$parent->add_child($node->id);\n\t\t\t\t}else{\n\t\t\t\t\tprint_error('nonode','socialwiki');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function addRawPostData($raw_post_data) {}", "final public function renderChildren() {\n\t\treturn '';\n\t}", "public function append ($content) {\r\n\t\t\r\n\t\tif ($this->length < 1) return null;\r\n\t\t\r\n\t\t$args = func_get_args();\r\n\t\tforeach ($args as $offset => $value) \r\n\t\t\tif ($value = $this->process($value)) \r\n\t\t\t\tforeach ($this as $node) \r\n\t\t\t\t\tif (get_class($value) === 'XDTNodeList') $node->appendChild($value[0]);\r\n\t\t\t\t\telse $node->appendChild($value);\r\n\t\t\t\t\r\n\t\treturn $this;\r\n\t}", "public function beginChildren()\n {\n parent::beginChildren();\n\n $this->call($this->descendCallback);\n }", "function AddContent(Content $content)\n {\n $this->contents[] = $content;\n }", "public function append($content)\n {\n $this->contents[] = $content;\n\n return $this;\n }", "public function onPageContentRaw(Event $e)\n {\n // Get the current raw content.\n $content = $e['page']->getRawContent();\n\n // Convert `mermaid` code blocks to `[mermaid][/mermaid]`.\n // (?<!.) is a negative lookbehind to ensure we're at the beginning of a line.\n $content = $this->replaceBlockIn($content,\n '/(?<!.)``` *mermaid/i',\n '/(?<!.)```/',\n '[mermaid]',\n '[/mermaid]'\n );\n\n // Convert `math` code blocks to `$$ … $$`.\n // (?<!.) is a negative lookbehind to ensure we're at the beginning of a line.\n $content = $this->replaceBlockIn($content,\n '/(?<!.)``` *maths?/i',\n '/(?<!.)```/',\n '$$', '$$'\n );\n\n // Convert $`…`$ to $…$\n $content = $this->replaceBlockIn($content,\n '/[$][`]/',\n '/[`][$]/',\n '$', '$'\n );\n\n //file_put_contents('TEST.LOG', $content);\n\n // Finally, set the new raw content.\n $e['page']->setRawContent($content);\n }", "public function __construct($children = array()) {\n $this->tagName = 'div';\n foreach($children as $c) {\n $this->appendChild($c);\n }\n }", "public function encode(array $rawContent);", "public function add($content) {\n $this->body .= (string)$content;\n }", "public function append($content)\n {\n $this->_contents .= (string) $content;\n\n return $this;\n }", "public function addContentItems($items = [])\n {\n //Loop on each item\n collect($items)->each(function ($item) {\n //Add each content to the Container\n $this->addSingleContentItem($item);\n });\n //Return object\n return $this;\n }", "public function getChildren()\n {\n }", "public function getChildren()\n {\n }", "public function getContent(){\n $table = new Application_Model_Table_Content();\n $content = array();\n \n \n $rowset = $table->fetchAll(\"parent = {$this->id}\");\n foreach($rowset as $row){\n $content[] = new Application_Model_Content($row);\n }\n return $content;\n }", "function addContent($content) {\n\t\t$this->_items[] = array('content', $content);\n\t}", "public function setChildren(array $children);", "public function publishWithChildren()\n {\n $workflow = $this->getWorkflow();\n if ($workflow->can($this->getNode(), 'publish')) {\n $workflow->apply($this->getNode(), 'publish');\n }\n\n /** @var Node $node */\n foreach ($this->getNode()->getChildren() as $node) {\n $handler = $this->createSelf();\n $handler->setNode($node);\n $handler->publishWithChildren();\n }\n return $this;\n }", "protected abstract function renderContent();", "protected function listChildren()\n {\n $this->children = new ArrayObject();\n if ($this->cursor instanceof DOMNode) {\n $childrenNodes = $this->cursor->childNodes;\n foreach ($childrenNodes as $child) {\n switch ($child->nodeName) {\n case 'text:p':\n $element = new OpenDocument_Element_Paragraph($child, $this);\n break;\n case 'text:h':\n $element = new OpenDocument_Element_Heading($child, $this);\n break;\n default:\n $element = false;\n }\n if ($element) {\n $this->children->append($element);\n }\n }\n }\n }", "public function archiveWithChildren()\n {\n $workflow = $this->getWorkflow();\n if ($workflow->can($this->getNode(), 'archive')) {\n $workflow->apply($this->getNode(), 'archive');\n }\n\n /** @var Node $node */\n foreach ($this->getNode()->getChildren() as $node) {\n $handler = $this->createSelf();\n $handler->setNode($node);\n $handler->archiveWithChildren();\n }\n\n return $this;\n }", "public function renderChildren()\n\t{\n\t\t$children = '';\n\t\t\n\t\tforeach($this->_children as $child)\n\t\t{\n\t\t\t$children .= \"$child\";\n\t\t}\n\t\t\n\t\treturn $children;\n\t}", "public function addContent( string $content );", "public function render_content_items() {\n\t\tforeach ( (array) $this->get_content_items() as $content_item ) {\n\t\t\t$content_item->render();\n\t\t}\n\t}", "function addContent($content)\n {\n $this->page .= $content;\n }", "function add_to_file_contents($content) {\n\t\t$this->contents .= $content;\n\t}", "public function add_content($type=\"div\",$content=\"\",$attr=array(),$unique_id=False,$self_closing=False){\n\t\tarray_push($this->content,new elem($type,$content,$attr,$unique_id,$self_closing));\t\n\t\treturn $this->content[sizeof($this->content)-1];// \n\t}", "protected function setPlainContent() {}", "public function addChildren(array $items)\n {\n $this->children->addItems($items);\n\n return $this;\n }", "public function append($content)\n {\n $this->content .= $content;\n }", "function render_block_core_post_content($attributes, $content, $block)\n {\n }", "public function getChildNodes() {}", "public function getChildNodes() {}", "public function getContent()\n {\n $content = $this->get()->post_content;\n $content = apply_filters('the_content', $content);\n $content = str_replace(']]>', ']]&gt;', $content);\n\n return $this->content = $content;\n }", "public function setChildrenFromDOMNodes(array $children): void\n {\n foreach ($children as $node) {\n if ($node instanceof DOMText) {\n // TODO: we are skipping the actual text inside the Node.. is this useful?\n continue;\n }\n\n switch ($node->localName) {\n case Payment::NODE_NAME:\n $payment = Payment::createFromDomNode($node);\n $this->addPayment($payment);\n break;\n default:\n throw new CFDIException(sprintf(\"Unknown children node '%s' in %s\", $node->nodeName, self::NODE_NS_NAME));\n }\n }\n }", "public function add_content($content) {\n if (!is_string($content)) { return false; }\n $this->_content .= $content;\n return true;\n }", "function populate() {\n $this->populateInputElements($this->children);\n }", "public function set_content() {\n\n\t\t$this->content = get_the_term_list( $this->data, $this->taxonomy, $this->prepend, $this->delimiter, $this->append );\n\t}", "public function append($content)\n\t{\n\t\t$this->content .= $content;\n\t}", "public function append() {\n $num_of_args = func_num_args();\n if ( $num_of_args == 1 && gettype( func_get_arg( 0 ) ) == \"array\" ) {\n $args = func_get_arg( 0 );\n $num_of_args = count( $args );\n } else {\n $args = func_get_args();\n }\n for ( $i = 0; $i < $num_of_args; $i++ ) {\n $arg = $args[$i];\n if ( $arg instanceof AbstractHTMLElement ) {\n $this->content .= $arg->asHTML();\n } else {\n $this->content .= $arg;\n }\n }\n return $this;\n }", "private function setContent()\n {\n $this->setTag();\n $this->openRoot();\n $this->setParam(ModulesInterface::KEY_NAME, ApiInterface::RAML_TYPE_STRING, ucfirst($this->generator->version));\n $this->setParam(ConfigInterface::ATTRIBUTES_CASE, ApiInterface::RAML_TYPE_STRING, ConfigInterface::DEFAULT_CASE);\n $this->setQueryParams();\n $this->setTrees();\n $this->setJwtContent();\n $this->setConfigEntities();\n $this->closeRoot();\n }", "function toBuffer()\n {\n foreach ($this->children as $child) {\n $child->toBuffer();\n }\n return $this;\n }", "function unserializeChildren()\r\n {\r\n reset($this->components->items);\r\n while (list($k,$v)=each($this->components->items))\r\n {\r\n $v->unserialize();\r\n }\r\n }", "function RenderChildren() {\n if ($this->HasControls()) {\n foreach($this->Controls as $control) {\n $control->Render();\n }\n }\n }", "function loadedChildren()\r\n {\r\n //Calls childrens loaded recursively\r\n reset($this->components->items);\r\n while (list($k,$v)=each($this->components->items))\r\n {\r\n $v->loaded();\r\n }\r\n }", "function add_child( $child ) {\n\t\tif( $child instanceof ModularPost ) {\n\t\t\t$this->children[] = $child;\n\t\t}\n\t}", "public function setChildren(Collection $children): void\n {\n $this->children = $children;\n }", "public function contents()\n {\n return $this\n ->morphToMany('App\\Models\\Content', 'owner', 'content_group')\n ->withTimestamps()\n ->withPivot('sequence', 'created_by', 'updated_by')\n ->orderBy('sequence');\n }", "public function raw($data)\n {\n $this->result .= $data;\n return $this;\n }", "function prepend($content) {\n\t\t$this->write($content . $this->read());\n\t}", "public function getChildNodes();", "function children() {\n\t\t$this->load_children();\n\t\treturn $this->_children;\n\t}", "public static function renderContent() {}", "public function __clone()\n\t{\n\t\t$this->children=[];\n\t}", "abstract function setContent();", "abstract protected function RenderContent();", "public function removeChildNodes() {}" ]
[ "0.5742958", "0.5548387", "0.5508129", "0.5469732", "0.5444319", "0.5350477", "0.53329", "0.5244999", "0.5228491", "0.51884985", "0.51321983", "0.51147246", "0.5066204", "0.50396997", "0.5034574", "0.50275093", "0.5021501", "0.5021501", "0.5021501", "0.5017015", "0.5017015", "0.5017015", "0.5017015", "0.5017015", "0.5017015", "0.5017015", "0.5017015", "0.5017015", "0.49631393", "0.4960639", "0.49281222", "0.49230012", "0.49022663", "0.4894155", "0.4892252", "0.48775327", "0.48597664", "0.4855189", "0.48485526", "0.4845794", "0.48406443", "0.4827495", "0.48177645", "0.48152643", "0.4804594", "0.47992393", "0.47975716", "0.4795162", "0.47895756", "0.47870573", "0.47849405", "0.47846553", "0.47726724", "0.4771627", "0.47481605", "0.47361577", "0.47361577", "0.4734478", "0.47230923", "0.47209162", "0.47024965", "0.46857974", "0.4680943", "0.4676537", "0.46728325", "0.46646884", "0.46567628", "0.46446538", "0.46414065", "0.4640169", "0.46389866", "0.46309748", "0.46254915", "0.46250665", "0.46226522", "0.46225613", "0.46212548", "0.46201628", "0.4609983", "0.4609565", "0.46016532", "0.459802", "0.45919073", "0.45894697", "0.45832184", "0.4580599", "0.4576605", "0.45756546", "0.45651224", "0.45644036", "0.4561058", "0.456016", "0.4554727", "0.45539707", "0.45489326", "0.45481408", "0.45427918", "0.4522075", "0.45156", "0.45138586" ]
0.5305827
7
Replaces the specified node with the given node.
final public function replaceChild(CtkBuildable $node, CtkBuildable $replace) { throw new CakeException(sprintf('Unknown child %s', get_class($replace))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function replace(Node $node)\n {\n }", "public function replaceValue(&$node, $name, $value) {\n\t\t$domElement = $this->getChildNode($node, $name);\n\t\tif (!is_null($domElement)) {\n\t\t\t$node->removeChild($domElement);\n\t\t\t$this->setValue($node, $value, $name, true);\n\t\t}\n\t}", "public function replaceNode(Node $node, $replacement)\n {\n list($start, $length) = $this->nodeRange($node);\n\n # make sure we don't remove the semicolon\n if ($replacement instanceof Property) {\n $length -= 1;\n }\n\n $this->replace($start, $length, $replacement);\n }", "public static function setNode($node) {\r\n static::$node = $node;\r\n }", "public function applyToNode(Node $node);", "protected static function replaceContent($node)\n {\n self::setter($node, 'firstName', Faker::getName());\n self::setter($node, 'lastName', Faker::getSurname());\n self::setter($node, 'sdnType', Faker::randomElement(['Entity', 'Individual']));\n self::setter($node, 'uid', mt_rand(10000, 900000));\n self::setter($node, 'title', Faker::randomElement(['Aerospace Engineer', 'Agricultural Engineer', 'Automotive Engineer', 'Biological Engineer', 'Biomedical Engineer']));\n }", "private function _replacementNode($old_node, $value)\n {\n $new_node = $this->_xml->createElementNS(\n self::XMLNAMESPACE, $old_node->tagName\n );\n $text = $this->_xml->createTextNode($value);\n $new_node->appendChild($text);\n return $new_node;\n }", "public function setNode($pageId, $node, $value)\n\t{\n\t\t//fetch row if exists\n\t\t$select = $this->select();\n\t\t$select->where(\"page_id=?\", $pageId)->\n\t\t\twhere(\"node=?\", $node);\n\t\t$row = $this->fetchRow($select);\n\t\t\n\t\t//if it doesn't exist, create it\n\t\tif(!$row)\n\t\t{\n\t\t\t$row = $this->createRow();\n\t\t\t$row->page_id = $pageId;\n\t\t\t$row->node = $node;\n\t\t}\n\t\t\n\t\t//set the node contents\n\t\t$row->content = $value;\n\t\t$row->save();\n\t}", "function change_node_content(&$dom, &$node, $new_txt_content){\n\t\t// to accomplish changing the content\n\t\t// of a node, we delete the child\n\t\t// text node of the node passed in and\n\t\t// add a new text node with the given value\n\t\t$txt_node = $node->child_nodes();\n\t\t$txt_node = $txt_node[0];\n\t\t$node->remove_child($txt_node);\n\t\t// now create the new node\n\t\t$new_txt = $dom->create_text_node($new_txt_content);\n\t\t$node->append_child($new_txt);\n\t}", "public function replace( $old, $new );", "public function set(string $name, string $value = null): NodeInterface;", "function load($node) {\n if (method_exists($node, 'valueOf')) {\n $this->set($node->valueOf());\n } else {\n $this->set($node->nodeValue);\n }\n }", "public function setCurrentNode(Node $node) : Node\n {\n $this->currentNode = $node;\n\n return $this->currentNode;\n }", "public function edit(Node $node)\n {\n //\n }", "public function replace(string $key, $element): void;", "public function replaceDomElement(\\DOMElement &$element, string $new_xml): void\n {\n // create a blank document fragment\n $fragment = $this->dom->createDocumentFragment();\n $fragment->appendXML($new_xml);\n\n // replace parent nodes child element with new fragment\n $element->parentNode->replaceChild($fragment, $element);\n }", "function SetOriginalNode($node)\r\n\t{\r\n\t\tparent::SetOriginalNode($node);\r\n\t\t\r\n\t\t//now load controls for this row element\r\n\t\tParser::ParseForControls($this, $node);\r\n\t\t\r\n\t\t\r\n\t}", "public function setNamedItem($node) { }", "public function unshiftNode( $node );", "public function replaceWith ($content) {\r\n\t\t\r\n\t\tif ($this->length === 0) return null;\r\n\t\t\r\n\t\t$content = $this->process($content);\r\n\t\t\r\n\t\tif (!isset($content)) return null;\r\n\t\t\r\n\t\tif (get_class($content) === 'XDTNodeList') {\r\n\t\t\t$clone = $content[0]->cloneNode(true);\r\n\t\t\t$content->remove();\r\n\t\t} else {\r\n\t\t\t$clone = $content->cloneNode(true);\r\n\t\t\tif (get_class($content) === 'DOMElement') $content->parentNode->removeChild($content);\r\n\t\t}\r\n\t\t\r\n\t\tforeach ($this as $node) \r\n\t\t\t$node->parentNode->replaceChild($clone->cloneNode(true), $node);\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function replaceTextNode($path, $value)\n {\n if ($node = $this->findNode($path)) {\n $this->_xml->documentElement->replaceChild(\n $this->_replacementNode($node, $value), $node\n );\n }\n }", "public function pushNode( $node );", "public function setNodeValue($value) {\n $this->nodeValue = $value;\n }", "protected function setNodeId($node): void\n {\n $elementId = $this->getNodeId($node);\n\n $this->nodeId = $elementId;\n }", "public function replace($selector, $replacement);", "public function removeNode( $node )\n\t{\n\t\t$this->nodes_to_remove[] = $node;\n\t}", "function setInnerXML($node,$xml) {\n\t\t$doc=$node->ownerDocument;\n\t\t$f = $doc->createDocumentFragment();\n\t\t$f->appendXML($xml);\n\t\t$node->parentNode->replaceChild($f,$node);\n\t}", "public function updateNode($type) {\n $this->current->updateType($type);\n }", "protected function acceptAndUpdate( ezcTemplateTstNode &$node )\n {\n $ret = $node->accept( $this );\n if ( $ret !== null )\n {\n $node = $ret;\n }\n }", "public function replace($key, $value, $replacement);", "protected function setElementContent($node, $value)\n\t{\n\t\tif ($node->tagName == 'input') {\n\t\t\t$node->setAttribute('value', $value);\n\t\t} else if ($node->tagName == 'img') {\n\t\t\t$node->setAttribute('src', $value);\n\t\t} else if ($node->tagName == 'a') {\n\t\t\t$node->setAttribute('href', $value);\n\t\t} else if ($node->tagName == 'meta') {\n\t\t\t$node->setAttribute('content', $value);\n\t\t} else {\n\t\t\t$node->nodeValue = htmlentities($value);\n\t\t}\n\t}", "public static function fromNode(Node $node);", "public function shiftNode();", "public function setNodeOriginalRoute($route);", "public function enterNode(Node $node)\n {\n }", "private function setNode(\n SimpleXMLElement $rootNode,\n $nodeName,\n $value = null,\n $attributes = array(),\n $cnss = array(),\n $anss = array(),\n $position = null\n ) {\n $node = $this->findNode($rootNode, $nodeName, $attributes, array_merge($cnss, $anss));\n\n if (isset($node)) {\n if ($value !== null) {\n $node[0] = $value;\n }\n\n return $node;\n }\n\n return $this->addNode($rootNode, $nodeName, $value, $attributes, $cnss, $anss, $position);\n }", "public function setRootNode( ezcTreeNode $node )\n {\n $db = $this->dbh;\n\n $q = $db->createDeleteQuery();\n $q->deleteFrom( $db->quoteIdentifier( $this->indexTableName ) );\n $s = $q->prepare();\n $s->execute();\n $this->store->deleteDataForAllNodes();\n\n $q = $db->createInsertQuery();\n $q->insertInto( $db->quoteIdentifier( $this->indexTableName ) )\n ->set( 'parent_id', \"null\" )\n ->set( 'id', $q->bindValue( $node->id ) );\n $s = $q->prepare();\n $s->execute();\n\n $this->store->storeDataForNode( $node, $node->data );\n }", "public function setAsShadowOf(NodeData $nodeData = NULL) {\n\t\t$this->setMovedTo($nodeData);\n\t\t$this->setRemoved(($nodeData !== NULL));\n\t\t$this->addOrUpdate();\n\t}", "public function setValue(&$node, $value, $name = null, $asNode = false) {\n\t\tif (!($node instanceof \\DOMElement)) {\n\t\t\tthrow new ArgumentException($node, '\\DOMElement', 1);\n\t\t}\n\t\tif ($value instanceof \\DOMNode) {\n\t\t\tif ($node->ownerDocument !== $value->ownerDocument) {\n\t\t\t\t$value = $node->ownerDocument->importNode($value, true);\n\t\t\t}\n\t\t\t$node->appendChild($value);\n\t\t} else {\n\t\t\tif ($asNode) {\n\t\t\t\t$childNode = $node->appendChild($node->ownerDocument->createElement($name));\n\t\t\t\tif (is_null($value)) {\n\t\t\t\t\t$this->setNodeAsNull($childNode);\n\t\t\t\t} else {\n\t\t\t\t\t$childNode->appendChild($childNode->ownerDocument->createTextNode($value));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (is_null($value)) {\n\t\t\t\t\t$childNode = $node->appendChild($node->ownerDocument->createElement($name));\n\t\t\t\t\t$this->setNodeAsNull($childNode);\n\t\t\t\t} else {\n\t\t\t\t\t$node->setAttribute($name, $value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function setLeagueNode(string $nodename, LeagueInterface $node)\n {\n $bag = $this->getOrCreateLeagueBag();\n\n return $bag->setLeagueNode($nodename, $node);\n }", "function setOperationnode($node){\n\t\t$this->operationNode = $node;\n\t}", "public function setNodeAsNull(\\DOMElement $node) {\n\t\t$node->setAttributeNS(self::NIL_URI, self::NULL_VALUE, 'true');\n\t}", "public function setOriginalNode(array $originalNode)\n {\n $this->originalNode = $originalNode;\n }", "public static function update($nodeId,$value){\n global $pdo;\n if(self::getType($nodeId) != 'pattern'){\n $query = $pdo\n ->update(array('node_value' => $value))\n ->table('node')\n ->where('node_id', '=', $nodeId);\n }else{\n $query = $pdo\n ->update(array(\n 'node_value' => $value,\n 'node_pattern'=> IrinLang::toRegex($value)\n ))\n ->table('node')\n ->where('node_id', '=', $nodeId);\n }\n $result = $query->execute();\n }", "public function removeChild (DOMNode $oldnode ) {}", "public function setCurrentNode(NavigationNode $node)\n\t{\n\t\tif (isset($this->current)) {\n\t\t\t$this->current->isCurrent = false;\n\t\t}\n\t\t$node->isCurrent = true;\n\t\t$this->current = $node;\n\t}", "public function setFormNode($formIdentifier, \\Neos\\ContentRepository\\Domain\\Model\\NodeInterface $node)\n {\n $this->formNodes[$formIdentifier] = $node;\n }", "function setTo(& $node)\n {\n $node->setFirstName('Lukas');\n\n $this->to = $node;\n }", "public function insertToHead($node)\n {\n $node->setNext($this->head);\n $this->head = $node;\n }", "private function _setUpNewNode(Node $node)\n {\n $node->setContainer($this->_container);\n\n return $node;\n }", "function update_node( $node_id, $data )\n\t{\n\t\t$data = $this->_sanitize_data($data);\n\n\t\t// no custom field data, set to null\n\t\t// fixes bug when only checkboxes are used and no\n\t\t// data is submitted.\n\t\tif(!isset($data['field_data']))\n\t\t{\n\t\t\t$data['field_data'] = '';\n\t\t}\n\n\t\t// Make the update\n\t\tee()->db->where( 'node_id', $node_id );\n\t\tee()->db->update( $this->tree_table, $data );\n\t\treturn true;\n\t}", "public function to(NodeInterface $node);", "public function resolveNextNode(NodeContract $node, NodeContract $new_node)\n {\n // Nothing to resolve...\n }", "public function unsetValue(&$node, $name, $asNode = false) {\n\t\tif ($asNode) {\n\t\t\t$domElement= $this->getChildNode($node, $name);\n\t\t\tif (!is_null($domElement)) {\n\t\t\t\t$node->removeChild($domElement);\n\t\t\t}\n\t\t} else {\n\t\t\t$node->removeAttribute($name);\n\t\t}\n\t}", "private function renameElement(&$node, $name, $ns=NULL, $prefix=NULL) {\r\n //create new node\r\n if ($ns) {\r\n $newNode=$node->ownerDocument->createElementNS($ns, ($prefix ? $prefix.':' : '').$name);\r\n } else {\r\n $newNode=$node->ownerDocument->createElement($name);\r\n }\r\n\r\n //copy attributes\r\n foreach($node->attributes as $attribute) {\r\n $newNode->setAttributeNode($attribute->cloneNode(true));\r\n }\r\n\r\n //copy child nodes\r\n foreach($node->childNodes as $childNode) {\r\n $newNode->appendChild($childNode->cloneNode(true));\r\n }\r\n\r\n //replace nodes\r\n $node->parentNode->replaceChild($newNode, $node);\r\n\r\n return $node=$newNode;\r\n }", "public function transferFromDOM($node)\n {\n $this->_ccrDom = $node;\n }", "private function pushNode(\\DOMElement $node)\r\n {\r\n $this->currentNode = $this->currentNode->appendChild($node);\r\n }", "public function insertBefore (DOMNode $newnode , $refnode = null) {}", "private function popNode()\r\n {\r\n $this->currentNode = $this->currentNode->parentNode;\r\n }", "public static function removeNode()\n {\n }", "public function moveNode(?PhpcrChildrenInterface $newParent = null, ?string $newNodename = null);", "function domRenameElement(DOMElement $node, $name)\n {\n $renamed = $node->ownerDocument->createElement($name);\n \n foreach ($node->attributes as $attribute) {\n $renamed->setAttribute($attribute->nodeName, $attribute->nodeValue);\n }\n \n while ($node->firstChild) {\n $renamed->appendChild($node->firstChild);\n }\n \n return $node->parentNode->replaceChild($renamed, $node);\n }", "public function remove($node) {\n // scratch, in order to reassign possible hashes with collisions to the \n // right node according to the order in which they were added in the \n // first place.\n for ($i = 0; $i < count($this->_nodes); ++$i) {\n if ($this->_nodes[$i]['object'] === $node) {\n array_splice($this->_nodes, $i, 1);\n $this->reset();\n break;\n }\n }\n }", "public function replace($path);", "private function rename(NodeInterface $node, $name)\n {\n $names = (array) $node->getParent()->getNodeNames();\n $pos = array_search($node->getName(), $names);\n $next = isset($names[$pos + 1]) ? $names[$pos + 1] : null;\n\n $node->rename($name);\n\n if ($next) {\n $node->getParent()->orderBefore($name, $next);\n }\n }", "private function replace($old_xpath, $new_xml, $insert_ns = FALSE) {\n $hits = $this->xpath->query($old_xpath, null, false);\n if ($hits && count($hits) > 0) {\n if ($insert_ns) {\n $new_xml = XMLPatcher::insert_namespaces($new_xml, $this->namespaces);\n }\n foreach ($hits as $hit) {\n $parent = $hit->parentNode;\n //error_log('new_xml is ' . $new_xml);\n $replace = dom_import_simplexml(simplexml_load_string($new_xml));\n if ($replace !== FALSE) {\n $replace = $this->dom->importNode($replace, TRUE);\n $parent->replaceChild($replace, $hit);\n $this->changed = TRUE;\n }\n }\n }\n }", "public function replace($identifier, $value)\n {\n if (!$this->isRegistered($identifier)) {\n throw new RegistryException(\n $this->drupalCommonConnector->t(RegistryException::MODIFICATION_ATTEMPT_FAILED_TEXT),\n RegistryException::MODIFICATION_ATTEMPT_FAILED_CODE\n );\n }\n\n $this->adaptor->updateDocument($identifier, array('doc' => $value), $this->section);\n }", "function apply($node)\r\n\t\t{\r\n\t\t\t$this->address = $node->address;\r\n\t\t\t$this->elements = $node->elements;\r\n\t\t\t$this->size = $node->size;\r\n\t\t\t$this->parent = $node->parent;\r\n\t\t\t$this->less = $node->less;\r\n\t\t\t$this->previous = $node->previous;\r\n\t\t\t$this->next = $node->next;\r\n\t\t}", "public function enterNode(Node $node)\n {\n if ($node instanceof StaticCall\n && $node->class instanceof FullyQualified\n && $node->class->toString() === 'TYPO3\\CMS\\Core\\Utility\\GeneralUtility'\n && $node->name->name === 'makeInstance'\n && isset($node->args[0]->value)\n && $node->args[0]->value instanceof String_\n ) {\n $newSubNode = new FullyQualified($node->args[0]->value->value, $node->args[0]->value->getAttributes());\n $node->args[0]->value = $newSubNode;\n }\n }", "function replace($widget = null)\n {\n if (func_num_args() > 0) {\n if (is_string($widget) == false && ($widget instanceof Element) == false) {\n throw new \\InvalidArgumentException('In class <b>' . get_class($this) . '</b> in method <b>replace($widget)</b>: Argument <b>$widget</b> MUST BE String or subclass of S_Widget - <b style=\"color:red\">' . (is_object($widget) ? get_class($widget) : gettype($widget)) . '</b> given!');\n }\n ($widget instanceof Element) ? $id = $widget->getId() : $id = $widget;\n $this->property(\"replace\", $id);\n return $this;\n } else {\n return $this->property(\"replace\");\n }\n }", "public function setNode($node)\n {\n parent::setNode($node);\n\n $defaultsize = config('elasticblue.pagination');\n\n foreach ($node->relationTypes as $rel) {\n\n $rel->relations['in'] = array_slice($rel->relations['in'], 0, $defaultsize);\n $rel->relations['out'] = array_slice($rel->relations['out'], 0, $defaultsize);\n }\n $this->relationTypes = $node->relationTypes;\n $this->nodeTypes = $node->nodeTypes;\n\n $this->timestamp = now()->toIso8601String();\n\n return $this;\n }", "public function modifyNode($dn, $newParams) {\n if(isset($newParams[\"id\"]))\n $newParams = array($newParams);\n\n $connId = $this->getConnection();\n $properties = $this->getNodeProperties($dn);\n $properties = $this->helper->formatToPropertyArray($properties);\n\n $idRegexp = \"/^(.*)_(\\d*)$/\";\n $affectsDN = false;\n\n foreach($newParams as $parameter) {\n\n // ignore inherited params\n if(isset($parameter[\"parent\"]))\n if($parameter[\"parent\"] != \"\")\n continue;\n\n $idElems = array();\n preg_match($idRegexp,$parameter[\"id\"],$idElems);\n if(count($idElems) != 3) {\n throw new AppKitException(\"Invalid ID given to modifyNode \".$parameter[\"id\"]);\n }\n $curProperty = $idElems[1];\n $curIndex = $idElems[2];\n if(!isset($properties[$curProperty]))\n continue;\n if(is_array($properties[$curProperty])) {\n\n $properties[$curProperty][$curIndex] = $parameter[\"value\"];\n if(in_array($curProperty,self::$dnDescriptors))\n $affectsDN = $curProperty.\"=\".$parameter[\"value\"];\n } else {\n $properties[$curProperty] = $parameter[\"value\"];\n if(in_array($curProperty,self::$dnDescriptors))\n $affectsDN = $curProperty.\"=\".$parameter[\"value\"];\n }\n }\n // if the dn is affected, the node must be moved instead of being modified\n if($affectsDN) {\n $dnToPreserve = explode(\",\",$dn,2);\n $dnToPreserve = $dnToPreserve[1];\n // add new node and remove old\n $newDN = $affectsDN.\",\".$dnToPreserve;\n\n\n \n if(!@ldap_add($connId,$newDN,$properties)) {\n throw new AgaviException(\"Could not modify \".$dn. \":\".$this->getError());\n }\n // recursive clone\n if($childs = $this->listDN($dn)) {\n foreach($childs as $key=>$child) {\n if(!is_int($key))\n continue;\n\n $this->moveNode((isset($child[\"aliasdn\"]) ? $child[\"aliasdn\"] : $child[\"dn\"]),$newDN);\n }\n }\n $this->rechainAliasesForNode($dn,$newDN);\n $this->removeNodes($dn, false); // leave broken aliases for safety\n } else {\n\n if(!@ldap_modify($connId,$dn,$properties)) {\n throw new AgaviException(\"Could not modify \".$dn. \":\".$this->getError());\n }\n }\n return $dn;\n }", "public function setNodeId($id);", "public function remove(Module_Node_Model $node) {\n if (!$node->haveChild(Module_Node_Model::POSITION_LEFT) || !$node->haveChild(Module_Node_Model::POSITION_RIGHT)) {\n $tmp = $node;\n } else {\n $tmp = $this->findRelative($node, null === $node->getPosition() ?\n Module_Node_Model::POSITION_RIGHT : $node->getPosition()\n );\n }\n\n $alt = $tmp->getChild(Module_Node_Model::POSITION_LEFT) ?: $tmp->getChild(Module_Node_Model::POSITION_RIGHT);\n\n if (null === $alt) {\n $alt = $tmp;\n }\n\n $alt->setParent($tmp->getParent());\n\n if (null === $node->getParent()) {\n $this->root = $alt;\n } elseif (null !== $tmp->getParent()) {\n $tmp->getParent()->setChild($tmp->getPosition(), $alt);\n }\n\n if ($tmp !== $node) {\n if ($tmp !== $alt && Module_Node_Model::COLOR_BLACK === $tmp->getColor()) {\n $this->deleteSort($alt);\n }\n\n if (null !== $tmp->getParent()) {\n $tmp->getParent()->setChild($tmp->getPosition(), $tmp->getChild($tmp->getPosition()));\n }\n\n $tmp\n ->setChild(Module_Node_Model::POSITION_LEFT, $node->getChild(Module_Node_Model::POSITION_LEFT))\n ->setChild(Module_Node_Model::POSITION_RIGHT, $node->getChild(Module_Node_Model::POSITION_RIGHT))\n ->setParent($node->getParent())\n ->setColor($node->getColor());\n\n if ($node->haveChild(Module_Node_Model::POSITION_LEFT)) {\n $node->getChild(Module_Node_Model::POSITION_LEFT)->setParent($tmp);\n }\n if ($node->haveChild(Module_Node_Model::POSITION_RIGHT)) {\n $node->getChild(Module_Node_Model::POSITION_RIGHT)->setParent($tmp);\n }\n\n if (null !== $node->getParent()) {\n $node->getParent()->setChild($node->getPosition(), $tmp);\n }\n } else {\n if (Module_Node_Model::COLOR_BLACK === $node->getColor()) {\n $this->deleteSort($node);\n }\n }\n\n // Make original node orphan\n if (null !== $node->getParent() && $node === $node->getParent()->getChild($node->getPosition())) {\n $node->getParent()->setChild($node->getPosition(), null);\n }\n\n $node\n ->setPosition(null)\n ->setParent(null)\n ->setChild(Module_Node_Model::POSITION_LEFT, null)\n ->setChild(Module_Node_Model::POSITION_RIGHT, null);\n\n return $this;\n }", "private function replicateNodeTree(Node $node): Node\n {\n /** @var Node $new */\n $new = $node->copy();\n\n $this->copyChildren($node, $new);\n\n return $new;\n }", "public function setToNode(int $toNode): void {\n $this->toNode = $toNode;\n }", "protected function replaceField(Field $field){\n }", "public function invalidateNodeTag(NodeEvent $event)\n {\n $node = $event->getNode();\n\n $this->cacheableManager->invalidateTags(\n array(\n $this->tagManager->formatNodeIdTag($node->getNodeId())\n )\n );\n }", "public function ReplaceTaxonomy(\\Google\\Cloud\\DataCatalog\\V1\\ReplaceTaxonomyRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.datacatalog.v1.PolicyTagManagerSerialization/ReplaceTaxonomy',\n $argument,\n ['\\Google\\Cloud\\DataCatalog\\V1\\Taxonomy', 'decode'],\n $metadata, $options);\n }", "public function insert(Node $node)\n {\n $this->root->insert($node);\n }", "public function update($data)\n {\n\n// $this->node->getF\n }", "function setNodeHtml($node, $content) {\n\t\twhile ($node->childNodes->length) $node->removeChild($node->childNodes->item(0));\n\t\tlibxml_use_internal_errors(true);\n\t\t$nodeXml = new DOMDocument('1.0', 'UTF-8');\n\t\tif(!$nodeXml->loadHTML('<?xml encoding=\"UTF-8\"><html><body><div xml:id=\"hyphaImport\">'.preg_replace('/\\r/i', '', $content).'</div></body></html>')) return __('error-loading-html');\n\t\tlibxml_clear_errors();\n\t\tlibxml_use_internal_errors(false);\n\t\tforeach($nodeXml->getElementById('hyphaImport')->childNodes as $child) $node->appendChild($node->ownerDocument->importNode($child, true));\n\t}", "public function update(Request $request, Node $node)\n {\n $langcode = langcode('request') ?? $node->getOriginalLangcode();\n\n $node->translateTo($langcode);\n\n if ($node->isTranslated()) {\n $node->update($request->all());\n } else {\n $changed = (array) $request->input('_changed');\n if ($changed) {\n $node->update($request->only($changed));\n }\n }\n\n return response('');\n }", "public function setNodeRoute($route);", "public function replace($key, $data) {\n\t\tif ($this->isValidKey($key) && $this->isValidData($data)) {\n\t\t\treturn $this->replaceKey($key, $data);\n\t\t}\n\t}", "function cheffism_admin_bar_replace_howdy($wp_admin_bar) {\n $account = $wp_admin_bar->get_node('my-account');\n $replace = str_replace('Howdy,', 'Welcome,', $account->title); \n $wp_admin_bar->add_node(array('id' => 'my-account', 'title' => $replace));\n}", "function deleteNode($content, $delete_node = '', $preserve_node = '')\n {\n if (!empty($this->config[$delete_node])) {\n $delete = preg_quote($this->config[$delete_node]);\n $pattern = \"#<{$delete}>(.*)</{$delete}>#Usi\";\n $content = preg_replace($pattern, '', $content);\n }\n if (!empty($this->config[$preserve_node])) {\n $preserve = preg_quote($this->config[$preserve_node]);\n $pattern = \"#<(?:/|){$preserve}>#Usi\";\n $content = preg_replace($pattern, '', $content);\n }\n\n return $content;\n }", "function upm_replace_howdy( $wp_admin_bar ) {\r\n $my_account=$wp_admin_bar->get_node('my-account');\r\n $new_title = str_replace( 'Howdy,', 'Welcome,', $my_account->title );\r\n $wp_admin_bar->add_node( array(\r\n 'id' => 'my-account',\r\n 'title' => $new_title,\r\n ) );\r\n}", "public function insert($val) {\n // Make sure element being inserted is type of Node.\n if (!is_object($val) || getclass($val) !== \"Node\") {\n $node = new Node($val);\n } else {\n $node = $val;\n }\n\n $this->_head->setPrev($node);\n\n $node->setNext($this->_head);\n $node->setPrev($this->_sentinel);\n $this->_head = $node;\n }", "public function replace(string $text, int $line = -1): void\n {\n $this->replaceLine($text, $line);\n }", "function replace($table='', $keyandvalue) {\n return $this->_query_insert_replace($table, $keyandvalue, 'REPLACE');\n }", "public function replaceChild($old, Element $new): Element\n {\n if (!is_int($old) && !($old instanceof Element)) {\n throw new \\InvalidArgumentException(\n 'argument one must be an index or element'\n );\n }\n\n $index = is_int($old) ? $old : $this->getChildIndex($old);\n\n if ($index === false || !array_key_exists($index, $this->children)) {\n throw new \\OutOfBoundsException(\n 'argument one must be a valid key or child element'\n );\n }\n\n $this->beforeInsert($new);\n\n $slice = array_splice($this->children, $index, 1, [$new]);\n\n $replaced = reset($slice);\n\n $this->afterDelete($replaced);\n\n return $replaced;\n }", "public function update(Request $request, Graph $graph, Node $node)\n {\n //\n }", "function addNode( $nodeValue, $nodeName)\n\t{\n\t\t$GLOBALS['xml_api']->AttachToXml( $nodeValue, $nodeName);\n\t}", "function deleteNode(DOMElement $node)\n{\n deleteChildren($node);\n /**\n * @var DOMElement $parent\n */\n $parent = $node->parentNode;\n $parent->removeChild($node);\n}", "private function removeNode(?Node $node, string $bidId): ?Node\n {\n // Bail if the node doesn't exist\n if ($node === null) {\n return null;\n }\n\n // Check the left subtree first\n if (strcmp($bidId, $node->bid->bidId) < 0) {\n // Set the node's left node to the value remainder of the tree\n // that's returned from removing the left's children\n $node->left = $this->removeNode($node->left, $bidId);\n\n // Our work is done, exit the function\n return $node;\n }\n\n // Check the right subtree\n if (strcmp($bidId, $node->bid->bidId) > 0) {\n // Set the node's right node to the value remainder of the tree\n // that's returned from removing the right's children\n $node->right = $this->removeNode($node->right, $bidId);\n\n // Our work is done, exit the function\n return $node;\n }\n\n // If this is a leaf node\n if ($node->left === null && $node->right === null) {\n // Setting the node to null will clear its value from memory\n $node = null;\n\n $this->size--;\n\n // One child to the left\n } elseif ($node->left !== null && $node->right === null) {\n // Overwrite the node with the value of the right subtree\n $node = $node->right;\n\n $this->size--;\n\n // One child to the right\n } elseif ($node->right !== null && $node->left === null) {\n // Overwrite the node with the value of the left subtree\n $node = $node->left;\n\n $this->size--;\n\n // Two children\n } else {\n // Create a temp node referencing/storing the right subtree\n $tempNode = $node->right;\n\n // Loop through the left subtree all the way down continuing left\n // to find the last instance of the left child\n while ($tempNode->left !== null) {\n $tempNode = $tempNode->left;\n }\n\n // Override the current node's bid with that of the last child's\n $node->bid = $tempNode->bid;\n\n // Overwrite the right subtree\n $node->right = $this->removeNode($node->right, $tempNode->bid->bidId);\n }\n\n return $node;\n }", "public function testReplace()\n {\n // test data\n $this->fixture->query('INSERT INTO <http://original/> {\n <http://s> <http://p1> \"baz\" .\n <http://s> <http://xmlns.com/foaf/0.1/name> \"label1\" .\n }');\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n $this->assertEquals(2, \\count($res['result']['rows']));\n\n $this->assertEquals(\n [\n 'http://original/'\n ],\n $this->getGraphs()\n );\n\n // replace graph\n $returnVal = $this->fixture->replace(false, 'http://original/', 'http://replacement/');\n\n // check triples\n $res = $this->fixture->query('SELECT * FROM <http://original/> WHERE {?s ?p ?o.}');\n $this->assertEquals(0, \\count($res['result']['rows']));\n\n // get available graphs\n $this->assertEquals(0, \\count($this->getGraphs()));\n\n $res = $this->fixture->query('SELECT * FROM <http://replacement/> WHERE {?s ?p ?o.}');\n // TODO this does not makes sense, why are there no triples?\n $this->assertEquals(0, \\count($res['result']['rows']));\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n // TODO this does not makes sense, why are there no triples?\n $this->assertEquals(0, \\count($res['result']['rows']));\n\n // check return value\n $this->assertEquals(\n [\n [\n 't_count' => 2,\n 'delete_time' => $returnVal[0]['delete_time'],\n 'index_update_time' => $returnVal[0]['index_update_time']\n ],\n false\n ],\n $returnVal\n );\n }", "function replace($data, &$element, $c)\r\n \t{\r\n \t\treturn $data;\r\n \t}", "public function testSetNode()\n {\n $node = new Fluent();\n $node->test = 'test';\n $this->response->setNode($node);\n $this->assertEquals($this->response->test, $node->test);\n $this->assertEquals([\n 'test' => 'test'\n ], $this->response->toArray());\n }", "public function setRoot(&$node):RootedGraph;" ]
[ "0.83052725", "0.7239726", "0.70015186", "0.6607099", "0.64231855", "0.6258045", "0.6227687", "0.6186882", "0.6178768", "0.5861413", "0.5789779", "0.5759568", "0.5748731", "0.5746", "0.5729402", "0.57170993", "0.5703546", "0.56936246", "0.56610006", "0.5636171", "0.56270844", "0.56095797", "0.55876404", "0.55658096", "0.55587274", "0.5540985", "0.5500365", "0.54936713", "0.5441047", "0.54341245", "0.5413246", "0.54094285", "0.53949404", "0.53601015", "0.53585184", "0.53294426", "0.53238124", "0.53027767", "0.5302424", "0.52483094", "0.5246792", "0.5235262", "0.5228045", "0.5225064", "0.5225005", "0.52219546", "0.5216256", "0.52083457", "0.51973605", "0.5176126", "0.5160091", "0.51551473", "0.51469254", "0.51442415", "0.513905", "0.5137533", "0.51321983", "0.5130463", "0.5129388", "0.51206595", "0.5114723", "0.5111807", "0.5110262", "0.51101226", "0.5098736", "0.5090369", "0.5071051", "0.50571454", "0.5034497", "0.5029624", "0.50216067", "0.50115746", "0.500751", "0.49933314", "0.4982783", "0.49741477", "0.49691966", "0.49668992", "0.49466032", "0.49409366", "0.4881192", "0.4875323", "0.48626593", "0.48578456", "0.4845782", "0.4838586", "0.48330602", "0.4830376", "0.4829942", "0.48260075", "0.48005897", "0.479705", "0.47601822", "0.47583005", "0.4744641", "0.47375894", "0.47356072", "0.47238338", "0.4723121", "0.4721564" ]
0.5873422
9
Removes and returns a child node from this node.
final public function removeChild(CtkBuildable $node) { throw new CakeException(sprintf('Unknown child %s', get_class($node))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeChild($child)\n {\n $child = $this->index($child);\n if ($child >= 0) {\n $this->nodes[$child]->parent = null;\n array_splice($this->nodes, $child, 1);\n if (!empty($this->indexes)) {\n foreach ($this->indexes as $id => $index) {\n if ($index >= $child) {\n $this->indexes[$id] = $index - 1;\n }\n }\n }\n }\n\n return $this;\n }", "public function removeChild(Node $child)\n {\n foreach ($this->getChildren() as $index => $oneChild) {\n if ($oneChild === $child) {\n array_splice($this->children, $index, 1);\n break;\n }\n }\n\n return $this;\n }", "public function removeChild($child)\n {\n $this->children->removeElement($child);\n\n return $this;\n }", "public function removeChild($node) {\n if($node instanceof Node) {\n foreach($this->nodes as $key => $value) {\n if($value === $node) {\n $node = $key;\n break;\n }\n }\n }\n\n $this->nodes->offsetUnset($node);\n\n return $this->clearFindCache();\n }", "public function removeChild(CategoryTreeNodeInterface $child);", "public function removeChild (DOMNode $oldnode ) {}", "public function get_child($position) : HTMLNode\n {\n return $this -> children -> get($position);\n }", "public function popNode();", "public function getUncle()\r\n {\r\n if (null !== $this->getGrandParent()) {\r\n return $this->getGrandParent()->getChild(-$this->getParent()->getPosition());\r\n }\r\n\r\n return null;\r\n }", "public function getChild()\n {\n return $this->child;\n }", "final public function removeChild ()\n {\n throw new ChildException('Trying to remove child from self closing HTML element');\n }", "public function down(): ?Node\n {\n return $this->down;\n }", "public function remove () {\r\n\t\t\r\n\t\tforeach ($this as $node) \r\n\t\t $node->parentNode->removeChild($node);\r\n\t}", "public function removeChild($childNode)\r\n {\r\n unset($this->_childNodes[$childNode->id]);\r\n $childNode->setParentNode(null);\r\n }", "public function remove_child(SBBCodeParser_Node $child)\r\n\t{\r\n\t\t$key = array_search($what, $this->children);\r\n\r\n\t\tif($key === false)\r\n\t\t\treturn false;\r\n\r\n\t\t$this->children[$key]->set_parent();\r\n\t\tunset($this->children[$key]);\r\n\t\treturn true;\r\n\t}", "public function removeChild($arg): Element\n {\n if (!($arg instanceof Element) && !is_int($arg)) {\n throw new \\InvalidArgumentException(\n 'argument must be an integer or element'\n );\n }\n\n $index = is_int($arg) ? $arg : $this->getChildIndex($arg);\n\n if ($index === false || !array_key_exists($index, $this->children)) {\n throw new \\OutOfBoundsException(\n 'argument must be a valid child element or key'\n );\n }\n\n $this->beforeDelete();\n\n $slice = array_splice($this->children, $index, 1);\n\n $removed = reset($slice);\n\n $this->afterDelete($removed);\n\n return $removed;\n }", "public static function removeNode()\n {\n }", "public function remove()\n {\n $root = $this->heap_Array[0];\n // put last element into root\n $this->heap_Array[0] = $this->heap_Array[--$this->_current_Size];\n $this->bubbleDown(0);\n return $root;\n }", "public function removeChildNodes() {}", "public function getLastChild()\n\t{\n\t\treturn $this->children[count($this->children)-1];\n\t}", "public function end()\n {\n # attach internal tree to parent\n $this->parentNode->getNode()->addChild($this->getNode());\n \n return $this->parentNode; \n }", "function removeChild (&$child, $destroy = false) {\r\n if (is_object ($child)) {\r\n // if object: get index\r\n $object =& $child;\r\n unset ($child);\r\n $child = $this->_findChild ($object);\r\n if ($child === false) {\r\n return false;\r\n }\r\n } else {\r\n // remove reference on $child\r\n $save = $child;\r\n unset($child);\r\n $child = $save;\r\n \r\n // else: get object\r\n if (!isset($this->_children[$child])) {\r\n return false;\r\n }\r\n $object =& $this->_children[$child];\r\n }\r\n \r\n // store count for later use\r\n $ccount = count ($this->_children);\r\n \r\n // index out of bounds\r\n if (!is_int ($child) || $child < 0 || $child >= $ccount) {\r\n return false;\r\n }\r\n \r\n // inkonsistency\r\n if ($this->_children[$child]->_parent === null ||\r\n $this->_children[$child]->_parent->_id != $this->_id) {\r\n return false;\r\n }\r\n \r\n // $object->_parent = null would equal to $this = null\r\n // as $object->_parent is a reference to $this!\r\n // because of this, we have to unset the variable to remove\r\n // the reference and then redeclare the variable\r\n unset ($object->_parent); $object->_parent = null;\r\n \r\n // we have to unset it because else it will be overridden in\r\n // in the loop\r\n unset ($this->_children[$child]);\r\n \r\n // move all remaining objects one index higher\r\n while ($child < $ccount - 1) {\r\n // save object\r\n $obj =& $this->_children[$child+1];\r\n // we have to unset it because else it will be\r\n // overridden in in the loop\r\n unset ($this->_children[$child+1]);\r\n // put object to new position\r\n $this->_children[$child] =& $obj;\r\n // UNSET THE OBJECT!\r\n unset ($obj);\r\n $child++;\r\n }\r\n \r\n if ($destroy) {\r\n return StringParser_Node::destroyNode ($object);\r\n unset ($object);\r\n }\r\n return true;\r\n }", "public function deleteNode()\n {\n \n $arra_sub_tree=$this->getSubTree($this->int_my_position);\n \n $this->setPositionToParent();\n \n foreach($arra_sub_tree as $node)\n { \n $index=$this->getIndexById($node['my_id']);\n $this->arra_node_to_delete[]=$node['my_id'];\n unset($this->arra_tree[$index]);\n }\n\n }", "public function removeChild($name)\n\t{\n\t\treturn $this->_auth->removeItemChild($this->_calendarId,$this->_name,$name);\n\t}", "public function remove(Node $node)\n {\n\n if (!is_array($this->_children)) {\n return $this;\n }\n\n unset($this->_children[$this->indexOf($node)]);\n $this->_children = array_values($this->_children);\n return $this;\n }", "public function getChild($c){\n if($this->childNodes[$c] != NULL){\n return $this->childNodes[$c];\n }\n else{\n return NULL;\n }\n }", "public function detach()\r\n {\r\n $this->_parentNode->removeChild($this);\r\n }", "public function removeChild($position = null, $forceDelete = false);", "public function removeLastChild();", "public function lastChild()\n {\n $node = $this->node->lastChild;\n\n if ($node === null) {\n return null;\n }\n\n return new Element($node);\n }", "public function getChild($id){\n foreach ($this->children as $node){\n if($node->itemID === $id){\n return $node;\n }\n }\n return null;\n }", "public function delete()\n {\n $this->changeChildrenParent();\n $this->removeFromCache();\n return parent::delete();\n }", "public function actionRemoveChild()\n\t{\n\t\t// We only allow deletion via POST request\n\t\tif( Yii::app()->request->isPostRequest===true )\n\t\t{\n\t\t\t$itemName = $this->getItemName();\n\t\t\t$childName = $this->getChildName();\n\t\t\t\n\t\t\t// Remove the child and load it\n\t\t\t$this->_authorizer->authManager->removeItemChild($itemName, $childName);\n\t\t\t$child = $this->_authorizer->authManager->getAuthItem($childName);\n\t\t\t$child = $this->_authorizer->attachAuthItemBehavior($child);\n\n\t\t\t// Set a flash message for removing the child\n\t\t\tYii::app()->user->setFlash($this->module->flashSuccessKey,\n\t\t\t\tRights::t('core', 'Child :name removed.', array(':name'=>$child->getNameText()))\n\t\t\t);\n\n\t\t\t// If AJAX request, we should not redirect the browser\n\t\t\tif( isset($_POST['ajax'])===false )\n\t\t\t\t$this->redirect(array('authItem/update', 'name'=>urlencode($itemName)));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new CHttpException(400, Rights::t('core', 'Invalid request. Please do not repeat this request again.'));\n\t\t}\n\t}", "private function popNode()\r\n {\r\n $this->currentNode = $this->currentNode->parentNode;\r\n }", "public function removeChild(Request $request)\n {\n if (config('simpleMenu.clearNestDescendants')) {\n $this->clearSelfAndNests($request->child_id);\n } else {\n $page = $this->findPage($request->child_id);\n $page->makeRoot();\n $page->touch();\n }\n\n return response()->json(['done'=>true]);\n }", "#[Route(path: '/{id}/removeChild/{child}', name: 'lsitem_remove_child', methods: ['POST'])]\n #[IsGranted(Permission::ITEM_EDIT, 'lsItem')]\n public function removeChild(LsItem $parent, LsItem $child): Response\n {\n $command = new RemoveChildCommand($parent, $child);\n $this->sendCommand($command);\n\n return $this->render('framework/ls_item/remove_child.html.twig', []);\n }", "abstract public function removeItemChild($itemName, $childName);", "function rm_child($child_id) {\n $t = @$this->triples[$child_id];\n if($t) {\n unset($this->children[$t->parent_id][$child_id]);\n unset($this->triples[$child_id]);\n }\n }", "public function dissociate()\n {\n $this->farChild->setAttribute($this->firstKey, null);\n\n return $this->farChild->setRelation($this->relation, null);\n }", "private function removeNode(?Node $node, string $bidId): ?Node\n {\n // Bail if the node doesn't exist\n if ($node === null) {\n return null;\n }\n\n // Check the left subtree first\n if (strcmp($bidId, $node->bid->bidId) < 0) {\n // Set the node's left node to the value remainder of the tree\n // that's returned from removing the left's children\n $node->left = $this->removeNode($node->left, $bidId);\n\n // Our work is done, exit the function\n return $node;\n }\n\n // Check the right subtree\n if (strcmp($bidId, $node->bid->bidId) > 0) {\n // Set the node's right node to the value remainder of the tree\n // that's returned from removing the right's children\n $node->right = $this->removeNode($node->right, $bidId);\n\n // Our work is done, exit the function\n return $node;\n }\n\n // If this is a leaf node\n if ($node->left === null && $node->right === null) {\n // Setting the node to null will clear its value from memory\n $node = null;\n\n $this->size--;\n\n // One child to the left\n } elseif ($node->left !== null && $node->right === null) {\n // Overwrite the node with the value of the right subtree\n $node = $node->right;\n\n $this->size--;\n\n // One child to the right\n } elseif ($node->right !== null && $node->left === null) {\n // Overwrite the node with the value of the left subtree\n $node = $node->left;\n\n $this->size--;\n\n // Two children\n } else {\n // Create a temp node referencing/storing the right subtree\n $tempNode = $node->right;\n\n // Loop through the left subtree all the way down continuing left\n // to find the last instance of the left child\n while ($tempNode->left !== null) {\n $tempNode = $tempNode->left;\n }\n\n // Override the current node's bid with that of the last child's\n $node->bid = $tempNode->bid;\n\n // Overwrite the right subtree\n $node->right = $this->removeNode($node->right, $tempNode->bid->bidId);\n }\n\n return $node;\n }", "public function getFChild()\n {\n return $this->f_child;\n }", "public function remove_child(int $position){\n $this -> children -> delete($position);\n }", "public function closeChild()\n\t{\n\t\t$this->_lastChild = null;\n\t}", "public function removeChild( Component $child ) {\n\t\tparent::removeChild( $child );\n\t\t$child->setOrphan();\n\t}", "public function _unset() {\r\n\t\t$index = 0;\r\n\t\t$children = $this->_parent()->_children();\r\n\t\tforeach ($children as $child) {\r\n\t\t\tif ($child->identifier() == $this->identifier()) {\r\n\t\t\t\t$this->_parent()->_removeChildAtIndex($index);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$index++;\r\n\t\t}\r\n\t\t\r\n\t\treturn $index;\r\n\t}", "function &lastChild () {\r\n $ret = null;\r\n $c = count ($this->_children);\r\n if (!$c) {\r\n return $ret;\r\n }\r\n return $this->_children[$c-1];\r\n }", "public function getPChild()\n {\n return $this->p_child;\n }", "public function removeNode(Node $node): ?Node\n {\n if (!$this->exists($node)) {\n return null;\n }\n\n // Remove $node with all its sub-nodes\n $nodesToRemove = array_merge([$node], $this->getSubNodes($node));\n $this->nodes = array_diff($this->nodes, $nodesToRemove);\n\n // Recalculate left and right values\n $width = $node->getRight() - $node->getLeft() + 1;\n foreach ($this->nodes as $currentNode) {\n if ($currentNode instanceof Node) {\n if ($currentNode->getLeft() > $node->getRight()) {\n $currentNode->setLeft($currentNode->getLeft() - $width);\n }\n if ($currentNode->getRight() > $node->getRight()) {\n $currentNode->setRight($currentNode->getRight() - $width);\n }\n }\n }\n\n // Reindex array\n $this->nodes = array_values($this->nodes);\n\n return $node;\n }", "public function getLastChild();", "public function getLastChild();", "private function removeNode($key)\n {\n $node = $this->getNode($key);\n if ($node != null) {\n $prev = $node->prev;\n $next = $node->next;\n if ($prev != null) {\n $prev->next = $next;\n } else {\n $this->first = $next;\n }\n if ($next != null) {\n $next->prev = $prev;\n } else {\n $this->last = $prev;\n }\n $this->size--;\n return $node;\n }\n return null;\n }", "public function removeChild(CustomDefAbstract $def)\n\t{\n\t\t$this->children->removeElement($def);\n\t\t$this->_onPropertyChanged('children', $this->children, $this->children);\n\t}", "public function firstChild()\n {\n $node = $this->node->firstChild;\n\n if ($node === null) {\n return null;\n }\n\n return new Element($node);\n }", "public function downStep()\n {\n if ($this->current !== null) {\n $this->currentParent = $this->current;\n $this->current = null;\n }\n\n return $this;\n }", "public function remove($key)\n {\n return (($e = $this->removeNode($key)) == null) ? null : $e->getValue();\n }", "function find($child_id): ?tree_node {\n return @$this->triples[$child_id];\n }", "public function getParentNode() {}", "public function softRemoveWithChildren()\n {\n $workflow = $this->getWorkflow();\n if ($workflow->can($this->getNode(), 'delete')) {\n $workflow->apply($this->getNode(), 'delete');\n }\n\n /** @var Node $node */\n foreach ($this->getNode()->getChildren() as $node) {\n $handler = $this->createSelf();\n $handler->setNode($node);\n $handler->softRemoveWithChildren();\n }\n\n return $this;\n }", "private function removeChildren()\n {\n /** @var Node $node */\n foreach ($this->getNode()->getChildren() as $node) {\n $handler = $this->createSelf();\n $handler->setNode($node);\n $handler->removeWithChildrenAndAssociations();\n }\n\n return $this;\n }", "public function pop()\n {\n if (null !== $this->getDraft()) {\n return $this->getDraft()->pop();\n }\n\n $last = $this->last();\n\n if (null === $last) {\n return;\n }\n\n array_pop($this->_data);\n $content = null;\n if (isset($this->subcontentmap[$last->getUid()])) {\n $content = $this->_subcontent->get($this->subcontentmap[$last->getUid()]);\n $this->_subcontent->removeElement($content);\n unset($this->subcontentmap[$last->getUid()]);\n }\n\n $this->rewind();\n\n return $content;\n }", "public function &lastChild()\n {\n $ret = null;\n $c = count($this->_children);\n if (! $c) {\n return $ret;\n }\n return $this->_children[$c-1];\n }", "final public function clearChildren() {\n\t\treturn $this;\n\t}", "protected function getChild(string $nodename): ?NodeInterface\n {\n $children = $this->getComposedCollection();\n\n return $children->get($nodename);\n }", "public function deleteHead()\n {\n $tmp = $this->head;\n $this->head = $this->head->getNext();\n $tmp->setNext(null);\n return $tmp;\n }", "public function removeChild(&$child, $destroy = false)\n {\n if (is_object($child)) {\n // if object: get index\n $object =& $child;\n unset($child);\n $child = $this->_findChild($object);\n if ($child === false) {\n return false;\n }\n } else {\n // remove reference on $child\n $save = $child;\n unset($child);\n $child = $save;\n\n // else: get object\n if (! isset($this->_children[$child])) {\n return false;\n }\n $object =& $this->_children[$child];\n }\n\n // store count for later use\n $ccount = count($this->_children);\n\n // index out of bounds\n if (! is_int($child) || $child < 0 || $child >= $ccount) {\n return false;\n }\n\n // inkonsistency\n if ($this->_children[$child]->_parent === null ||\n $this->_children[$child]->_parent->_id != $this->_id) {\n return false;\n }\n\n // $object->_parent = null would equal to $this = null\n // as $object->_parent is a reference to $this!\n // because of this, we have to unset the variable to remove\n // the reference and then redeclare the variable\n unset($object->_parent); $object->_parent = null;\n\n // we have to unset it because else it will be overridden in\n // in the loop\n unset($this->_children[$child]);\n\n // move all remaining objects one index higher\n while ($child < $ccount - 1) {\n // save object\n $obj =& $this->_children[$child+1];\n // we have to unset it because else it will be\n // overridden in in the loop\n unset($this->_children[$child+1]);\n // put object to new position\n $this->_children[$child] =& $obj;\n // UNSET THE OBJECT!\n unset($obj);\n $child++;\n }\n\n if ($destroy) {\n return Node::destroyNode($object);\n unset($object);\n }\n return true;\n }", "public function parentNode()\n {\n return new Element($this->node->parentNode);\n }", "public function remove(Node $node)\n {\n\n // Collect the parentId to correct the positions of its old ancestors\n $parentId = $node->getParentId();\n $position = $node->getPosition();\n\n $this->performRemove($node);\n\n if($parentId){\n $this->decrementOrderAfter($parentId, $position);\n }\n\n return $this;\n }", "public function removeChild($idx) {\n\t\tif (isset($this->children[$idx])) {\n\t\t\tarray_splice($this->children, $idx, 1);\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function remove()\n\t{\n\t\treturn $this->delete();\n\t}", "public function parentNode()\n {\n return null;\n }", "public function deleteNode(){\n\t\tparent::deleteNode();\n\n\t\t//Delete Langs\n\t\t$relMetaLang = new XlyreRelMetaLangs();\n\t\t$results = $relMetaLang->find(\"IdRel\", \"IdNode=%s\", array($this->nodeID), MONO);\n\t\tif ($results) {\n\t\t\tforeach ($results as $idRel) {\n\t\t\t\t$objectToDelete = new XlyreRelMetaLangs($idRel);\n\t\t\t\t$objectToDelete->delete();\n\t\t\t}\n\t\t}\n\n\t\t//Delete Tags\n\t\t$relMetaLang = new XlyreRelMetaTags();\n\t\t$results = $relMetaLang->find(\"IdRel\", \"IdNode=%s\", array($this->nodeID), MONO);\n\t\tif ($results) {\n\t\t\tforeach ($results as $idRel) {\n\t\t\t\t$objectToDelete = new XlyreRelMetaTags($idRel);\n\t\t\t\t$objectToDelete->delete();\n\t\t\t}\n\t\t}\n\n\t\t//Delete dataset\n\t\t$dataset = new XlyreDataset($this->nodeID);\n\t\treturn $dataset->delete();\n\t}", "protected function getChildNodeData() {\n\t\treturn $this->nodeDataRepository->findByParentWithoutReduce($this->path, $this->workspace);\n\t}", "public function getRemoveChildLink()\n\t{\n\t\treturn CHtml::linkButton(Menus::t('core', 'Remove'), array(\n\t\t\t'submit'=>array('tab/removeChild', 'id'=>urlencode($this->parent->id), 'child'=>urlencode($this->owner->id)),\n\t\t\t'class'=>'remove-link',\n\t\t\t'csrf'=>Yii::app()->request->enableCsrfValidation,\n\t\t));\n\t}", "public function addChild(Node $child);", "public function remove() {\n if ( is_null( $this->id ) )\n return;\n\n $this->prepare(\n 'DELETE FROM `categories` WHERE `category_id` = :category_id OR `parent_category_id` = :parent_category_id'\n , 'ii'\n , array( ':category_id' => $this->id, ':parent_category_id' => $this->id )\n )->query();\n }", "public function testRemoveNode()\n {\n $parentPath = '/tests_write_manipulation_delete_sns/testRemoveSnsByNode';\n $childNames = ['child', 'child[2]', 'child[3]'];\n\n $parent = $this->getParentNode($this->session, $parentPath);\n\n foreach ($childNames as $childName) {\n $this->assertTrue($parent->hasNode($childName));\n $child = $parent->getNode($childName);\n $this->assertInstanceOf('PHPCR\\NodeInterface', $child);\n $child->remove();\n $this->assertFalse($parent->hasNode($childName), 'Node was not removed');\n }\n\n $this->saveAndRenewSession();\n\n foreach ($childNames as $childName) {\n $this->assertFalse($this->session->nodeExists($parentPath.'/'.$childName));\n }\n }", "private function getChildNode($node, $name) {\n\t\tforeach ($node->childNodes as $child) {\n\t\t\tif ($child->nodeName === $name) {\n\t\t\t\treturn $child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public function deleteNode() {\n if ($this->getIsNewRecord())\n throw new CDbException(Yii::t('ext.NestedDynaTree.message', 'The node cannot be deleted because it is new.'));\n\n if ($this->getIsDeletedRecord())\n throw new CDbException(Yii::t('yiiext', 'The node cannot be deleted because it is already deleted.'));\n\n $db = $this->getDbConnection();\n $extTransFlag = $db->getCurrentTransaction();\n\n if ($extTransFlag === null)\n $transaction = $db->beginTransaction();\n\n try {\n if ($this->isLeaf()) {\n $this->_ignoreEvent = true;\n $result = $this->delete();\n $this->_ignoreEvent = false;\n } else {\n $condition = $db->quoteColumnName($this->leftAttribute) . '>=' . $this->{$this->leftAttribute} . ' AND ' .\n $db->quoteColumnName($this->rightAttribute) . '<=' . $this->{$this->rightAttribute};\n\n $params = array();\n\n if ($this->hasManyRoots) {\n $condition.=' AND ' . $db->quoteColumnName($this->rootAttribute) . '=' . CDbCriteria::PARAM_PREFIX . CDbCriteria::$paramCount;\n $params[CDbCriteria::PARAM_PREFIX . CDbCriteria::$paramCount++] = $this->{$this->rootAttribute};\n }\n\n $result = $this->deleteAll($condition, $params) > 0;\n }\n\n if (!$result) {\n if ($extTransFlag === null)\n $transaction->rollBack();\n\n return false;\n }\n\n $this->shiftLeftRight($this->{$this->rightAttribute} + 1, $this->{$this->leftAttribute} - $this->{$this->rightAttribute} - 1);\n\n if ($extTransFlag === null)\n $transaction->commit();\n\n $this->correctCachedOnDelete();\n } catch (Exception $e) {\n if ($extTransFlag === null)\n $transaction->rollBack();\n\n throw $e;\n }\n\n return true;\n }", "function firstChild() {\n\t\t$children = $this->children();\n\t\tif (sizeof($children>0)) {\n\t\t\treturn $children[0];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "function &firstChild () {\r\n $ret = null;\r\n if (!count ($this->_children)) {\r\n return $ret;\r\n }\r\n return $this->_children[0];\r\n }", "public static function detachChild(object $parent, string $key) : ?object\n {\n $existing_child = @ self::children($parent)[$key];\n if ($existing_child) {\n $parent_id = spl_object_id($parent);\n $child_id = spl_object_id($existing_child);\n unset(self::$children_index[$parent_id][$key]);\n self::$parents_index[$child_id] = null;\n self::$keys_index[$child_id] = null;\n }\n return $existing_child;\n }", "public function remove($value){\n\t\t$this->queried = false;\n\t\t\n\t\tHash::remove($this->Data, $value);\n\t\t\n\t\treturn $this;\n\t}", "protected function RemovalObject()\n {\n $id = Request::PostData('delete');\n return $id ? new Container($id) : null;\n }", "public function end(): self\n {\n // Remove last element from stack.\n foreach ($this->stack as $stack) {\n \\array_pop($stack);\n }\n\n return $this->parent ?? $this;\n }", "public function getChild ( $nodeId ) {\n\n if(false === $this->childExists($nodeId))\n throw new Exception(\n 'Child %s does not exist.', 0, $nodeId);\n\n return $this->_childs[$nodeId];\n }", "public function remove()\n\t{\n\t\t$this->status = false;\n\n\t\treturn $this;\n\t}", "public function appendChild($child = NULL)\n\t{\n\t\tif ($child instanceof DOMNode) {\n\t\t\tparent::appendChild($child);\n\t\t}\n\t\treturn $this;\n\t}", "public function getChildByIndex($index)\n {\n $index = intval($index);\n\n return ((null !== $this->children) && array_key_exists($index, $this->children)) ? $this->children[$index] : null;\n }", "public function softUnremoveWithChildren()\n {\n $workflow = $this->getWorkflow();\n if ($workflow->can($this->getNode(), 'undelete')) {\n $workflow->apply($this->getNode(), 'undelete');\n }\n\n /** @var Node $node */\n foreach ($this->getNode()->getChildren() as $node) {\n $handler = $this->createSelf();\n $handler->setNode($node);\n $handler->softUnremoveWithChildren();\n }\n\n return $this;\n }", "public function delete()\n {\n return $this;\n }", "public function &firstChild()\n {\n $ret = null;\n if (! count($this->_children)) {\n return $ret;\n }\n return $this->_children[0];\n }", "public function getChild($parentId, $childName, $getDeleted = false, $throw = true)\n {\n $parentId = $parentId instanceof Node ? $parentId->getId() : $parentId;\n $childName = $childName instanceof Node ? $childName->name : $childName;\n \n $searchFilter = new Node_Filter(array(\n array(\n 'field' => 'parent_id',\n 'operator' => $parentId ? 'equals' : 'isnull',\n 'value' => $parentId\n ),\n array(\n 'field' => 'name',\n 'operator' => 'equals',\n 'value' => $childName\n )\n ), Tinebase_Model_Filter_FilterGroup::CONDITION_AND, array('ignoreAcl' => true));\n if (true === $getDeleted) {\n $searchFilter->addFilter(new Tinebase_Model_Filter_Bool('is_deleted', 'equals',\n Tinebase_Model_Filter_Bool::VALUE_NOTSET));\n }\n $child = $this->search($searchFilter)->getFirstRecord();\n \n if (!$child) {\n if (true === $throw) {\n throw new Tinebase_Exception_NotFound('child: ' . $childName . ' not found!');\n }\n return null;\n }\n \n return $child;\n }", "public function removeTreeName(string $nodename)\n {\n return $this->removeChildKey($nodename);\n }", "function &getRightSibling()\n\t{\n\t\tif (!is_object($this->_item)) {\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\treturn $this->_rightsibling;\n\t}", "public function cloneNode() {\n return clone $this;\n }", "function &getRightSibling()\n\t{\n\t\tif (!is_object($this->_item))\n\t\t{\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\treturn $this->_rightsibling;\n\t}", "public function pop()\n {\n $this->update();\n if (isset($this->data[0])) {\n $this->updateValueIfNeeded($this->data, sizeof($this->data) - 1);\n return array_pop($this->data);\n }\n return null;\n }", "public function popNodeFromStack() {}", "public function getParentNode()\r\n {\r\n return $this->_parentNode ? $this->_parentNode : false;\r\n }", "protected function deleteChildren() {}" ]
[ "0.71099144", "0.6816529", "0.67181706", "0.66345996", "0.64185786", "0.6307472", "0.6117607", "0.6117501", "0.6114836", "0.61138725", "0.6066455", "0.5985873", "0.59855413", "0.59137124", "0.59124845", "0.58872694", "0.5883162", "0.58308214", "0.5822515", "0.58078706", "0.5659047", "0.56411374", "0.5626394", "0.5610913", "0.5594282", "0.55922645", "0.5587585", "0.55762225", "0.5575494", "0.5568135", "0.5561394", "0.552803", "0.5527253", "0.55223995", "0.5519355", "0.5518352", "0.5510581", "0.55083823", "0.55068904", "0.5493971", "0.54759574", "0.54699105", "0.5448231", "0.5446301", "0.54255575", "0.5419655", "0.54137444", "0.54117227", "0.53975683", "0.53975683", "0.5395765", "0.5367702", "0.53594863", "0.5344241", "0.5343363", "0.5320558", "0.5313482", "0.5297612", "0.52943987", "0.5277934", "0.5253412", "0.5203383", "0.51815975", "0.51686794", "0.5155395", "0.5142236", "0.51219153", "0.5119795", "0.511684", "0.5114161", "0.5112641", "0.5106258", "0.5101229", "0.50736624", "0.50600845", "0.50593853", "0.5048488", "0.50383985", "0.5024146", "0.50202554", "0.50173664", "0.50170946", "0.50144076", "0.49983886", "0.499594", "0.49822217", "0.49762198", "0.49642017", "0.49604335", "0.49576256", "0.4939778", "0.49271318", "0.49210256", "0.49176857", "0.49121565", "0.49111876", "0.48762643", "0.48748887", "0.48707384", "0.4844382" ]
0.60962963
10
Removes all children from this node.
final public function clearChildren() { return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clearChildren(): void\n {\n if ($this->children instanceof Collection) {\n $this->children = new Collection;\n return;\n }\n\n $this->children = [];\n }", "public function removeChildNodes() {}", "protected function deleteChildren() {}", "private function removeChildren()\n {\n /** @var Node $node */\n foreach ($this->getNode()->getChildren() as $node) {\n $handler = $this->createSelf();\n $handler->setNode($node);\n $handler->removeWithChildrenAndAssociations();\n }\n\n return $this;\n }", "public function remove () {\r\n\t\t\r\n\t\tforeach ($this as $node) \r\n\t\t $node->parentNode->removeChild($node);\r\n\t}", "public function removeAll()\n {\n if ($this->nodes !== null) {\n foreach ($this->nodes as $node) {\n $node->parent = null;\n }\n }\n $this->nodes = [];\n\n return $this;\n }", "public function prune()\n {\n if (!$this->isEmpty()) {\n $this->root->prune();\n $this->root = null;\n }\n }", "public function deleteChildren(BaseObject $node)\n {\n // array_reverse() call is necessary for root node properties to be correctly updated\n foreach (array_reverse($node->getChildren()) as $child)\n {\n $child->delete();\n }\n }", "function remove_children(&$node) {\n\twhile ($node->firstChild) {\n\t\twhile ($node->firstChild->firstChild) {\n\t\t\tremove_children($node->firstChild);\n\t\t}\n\t\t$node->removeChild($node->firstChild);\n\t}\n}", "protected function removeChildren($node)\n {\n while ($node->hasChildNodes()) {\n $node->removeChild($node->childNodes->item(0));\n }\n }", "public function softUnremoveWithChildren()\n {\n $workflow = $this->getWorkflow();\n if ($workflow->can($this->getNode(), 'undelete')) {\n $workflow->apply($this->getNode(), 'undelete');\n }\n\n /** @var Node $node */\n foreach ($this->getNode()->getChildren() as $node) {\n $handler = $this->createSelf();\n $handler->setNode($node);\n $handler->softUnremoveWithChildren();\n }\n\n return $this;\n }", "public function softRemoveWithChildren()\n {\n $workflow = $this->getWorkflow();\n if ($workflow->can($this->getNode(), 'delete')) {\n $workflow->apply($this->getNode(), 'delete');\n }\n\n /** @var Node $node */\n foreach ($this->getNode()->getChildren() as $node) {\n $handler = $this->createSelf();\n $handler->setNode($node);\n $handler->softRemoveWithChildren();\n }\n\n return $this;\n }", "public function clear(): void\n {\n unset($this->root);\n unset($this->nodes);\n\n $this->root = null;\n $this->nodes = [];\n }", "public function removeChildren($from, $to = null, $forceDelete = false);", "public function removeWithChildrenAndAssociations()\n {\n $this->removeChildren();\n $this->removeAssociations();\n $this->objectManager->remove($this->getNode());\n\n return $this;\n }", "public function unlinkAll()\n {\n return $this->pivotTable()->delete($this->wherePivot($this->parentKey(), null))->run();\n }", "public function unset_children($element, &$children_elements)\n {\n }", "public function removeAll()\n {\n foreach ($this->findAll() as $object) {\n $this->remove($object);\n }\n }", "function deleteChildren($node)\n{\n while (isset($node->firstChild)) {\n deleteChildren($node->firstChild);\n $node->removeChild($node->firstChild);\n }\n}", "public function children()\n {\n $this->buildTree();\n return $this->childrenInternal();\n }", "public function deleteChildren(){\n $this->publicEnvironments()->delete();\n $this->privateEnvironments()->delete();\n $collections = Collection::where('project_id', $this->id)->get();\n\n foreach($collections as $collection){\n $collection->items()->delete();\n $collection->delete();\n }\n }", "function clear_subtags()\n {\n $numtags = sizeof($this->tags);\n $keys = array_keys( $this->tags );\n foreach( $keys as $k ) {\n $this->tags[$k]->clear_subtags();\n unset($this->tags[$k]->parent);\n }\n\n # Clear the tags array\n $this->tags = array();\n unset( $this->curtag );\n }", "public function childrenRecursive()\n\t\t{\n\t\t\treturn $this->children()->with('childrenRecursive');\n\t\t}", "public function childrenRecursive()\n {\n return $this->children()->with('childrenRecursive');\n }", "public function childrenRecursive()\n {\n return $this->children()->with('childrenRecursive');\n }", "function children() {\n\t\t$this->load_children();\n\t\treturn $this->_children;\n\t}", "public function removeAllSubGroups() {}", "public function children() {\n return $this->descendants(1);\n }", "public function detach()\r\n {\r\n $this->_parentNode->removeChild($this);\r\n }", "public function allChildrenElements() {\n\t\treturn $this->childrenElements()->with('allChildrenElements');\n\t}", "private function _prune()\n {\n if (empty($this->_files) && empty($this->_subdirectories)) {\n $this->_element->delete();\n if ($this->_parent instanceOf Horde_Pear_Package_Xml_Directory) {\n $this->_parent->_deleteSubdirectory($this->_element->getName());\n }\n }\n }", "public function unsetAll() {\n\t\tparent::unsetAll();\n\t}", "public function updateChildren(Collection $children)\n {\n foreach ($children as $child) {\n $this->update($child, ['parent_slug' => null]);\n }\n }", "public function children()\n {\n if (is_a($this->children, 'Kirby\\Cms\\Pages') === true) {\n return $this->children;\n }\n\n return $this->children = Pages::factory($this->inventory()['children'], $this);\n }", "public function children()\n {\n $children = $this->getAttribute('children') ?: [];\n\n if ($children && ! is_array($children) && ! ($children instanceof Collection)) {\n return (array) $children;\n }\n\n return $children;\n }", "public function getChildren(): Collection\n {\n return $this->children;\n }", "public function getChildren(): Collection\n {\n return $this->children;\n }", "public function children()\n\t{\n\t\treturn $this->descendants(1);\n\t}", "public function clear () {\n\t\t$this->root = null;\n\t}", "public function get_children() {\n\t\treturn $this->children;\n\t}", "public function _unset() {\r\n\t\t$index = 0;\r\n\t\t$children = $this->_parent()->_children();\r\n\t\tforeach ($children as $child) {\r\n\t\t\tif ($child->identifier() == $this->identifier()) {\r\n\t\t\t\t$this->_parent()->_removeChildAtIndex($index);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$index++;\r\n\t\t}\r\n\t\t\r\n\t\treturn $index;\r\n\t}", "public function setChildren(Collection $children): void\n {\n $this->children = $children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function children()\r\n\t{\r\n\t\treturn $this->children;\r\n\t}", "public function getChildren()\r\n\t{\r\n\t\treturn $this->childrenNodes;\r\n\t}", "public function setChildren(array $children)\n {\n $this->children = [];\n foreach ($children as $child) {\n if ($child instanceof Node) {\n $this->addChild($child);\n }\n }\n }", "public function removeAll()\n {\n foreach ($this->items as $item) {\n $this->items->remove($item);\n }\n }", "public function setChildren(array $children);", "public function getChildren() \n {\n return $this->children;\n }", "#[ReturnTypeWillChange]\n public function getChildren()\n {\n return new self($this->iterator->getChildren(), $this->excluded);\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->_children;\n }", "public function removeAll($rewriteXml = true)\n\t{\n\n\t\tif( $this->isDynamic )\n\t\t\tderr('cannot be called on Dynamic Address Group');\n\n\t\tforeach( $this->members as $a)\n\t\t{\n\t\t\t$a->removeReference($this);\n\t\t}\n\t\t$this->members = Array();\n\n\n\t\tif( $rewriteXml )\n\t\t{\n\t\t\t$this->rewriteXML();\n\t\t}\n\n\t}", "public function getChildren() {\n\t\treturn $this->children;\n\t}", "public function getChildren() {\n\t\treturn $this->children;\n\t}", "public function getChildren() {}", "public function getChildren() {}", "public function getChildren() {}", "public function children()\n {\n return (array) $this->children;\n }", "public function detachAll() {}", "public function clear()\n {\n if (null !== $this->getDraft()) {\n $this->getDraft()->clear();\n } else {\n $this->_subcontent->clear();\n $this->subcontentmap = array();\n $this->_data = array();\n $this->index = 0;\n }\n }", "public function removeAllRelatedPosts() {}", "public function setChildren($children) {\n $this->children = $children;\n\n return $this;\n }", "public function getAllChildNode()\r\n {\r\n return $this->_childNodes;\r\n }", "public function getChildNodes()\n {\n return array_values($this->getChildNodesById());\n }", "public function getChildren()\n {\n return $this\n ->hasMany(MenuItem::class, ['menuId' => 'id'])\n ->andWhere(['is', 'parentId', null])\n ->orderBy(['order' => SORT_ASC]);\n }", "public function removeAll()\n {\n if(sizeof($this->_data)) {\n $this->_removeShadowCopy(null, true);\n }\n $this->_data = array();\n \n return $this;\n }", "#[\\ReturnTypeWillChange]\n public function getChildren()\n {\n $element = $this->current();\n $childContext = $this->elementProcessor->processElementChildren(\n $element,\n $this->contexts[$this->contextMap[$this->key()]]\n );\n return new static($element->childNodes, $childContext, $this->elementProcessor);\n }", "function cleanup()\n {\n if (is_object( $this->roottag )) {\n $this->roottag->clear_subtags();\n }\n }", "public function endChildren()\n {\n parent::endChildren();\n\n $this->call($this->ascendCallback);\n }", "public function getChildren() {\n\t\treturn $this->_children;\n\t}", "public function getChildren()\n\t{\n\t\treturn $this->children;\n\t}", "public function getChildren()\n\t{\n\t\treturn $this->children;\n\t}", "function delete($deleteChildren = true)\n\t{\n\t\t$sections = $this->getSections();\n\t\t\n\t\tforeach($sections as $section)\n\t\t{\n\t\t\t$this->detach($section);\n\t\t}\n\t\t\n\t\t$this->destroy();\n\t}", "public function __construct()\n {\n $this->children = [];\n }", "public function setChildren(ArrayCollection $children)\n {\n $this->children = $children;\n\n return $this;\n }", "function deleteChilds(){\n\t\t$this->db->query(\"SELECT ID FROM \" . EXPORT_TABLE . ' WHERE ParentID=' . intval($this->ID));\n\t\twhile($this->db->next_record()){\n\t\t\t$child = new we_export_export($this->db->f(\"ID\"));\n\t\t\t$child->delete();\n\t\t}\n\t}", "function rm_subtree($parent_id, $include_parent = false) {\n $children = $this->children($parent_id);\n foreach($children as $c) {\n $this->rm_subtree($c);\n $this->rm_child($c);\n }\n if($include_parent) {\n $this->rm_child($parent_id);\n }\n }", "public function getChildren(): array {\n return iterator_to_array(clone $this->children);\n }", "public function childrenElements() {\n\t\treturn $this->hasMany('\\App\\Hierarchy', 'parent_id', 'id');\n\t}", "public function removeAllTags() {}", "function CleanUp () {\n global $zOLDAPPLE;\n\n $criteria = array (\"groupInformation_tID\" => $this->tID,\n \"Body\" => DELETED_GROUP_ENTRY);\n $this->groupContent->SelectByMultiple ($criteria);\n\n // Break out if no deleted posts left. \n if ($this->groupContent->CountResult() == 0) return (TRUE);\n\n while ($this->groupContent->FetchArray ()) {\n $CHILDREN = new cGROUPCONTENT ();\n $childcriteria = array (\"parent_tID\" => $this->groupContent->tID,\n \"groupInformation_tID\" => $this->tID,\n \"Context\" => $zOLDAPPLE->Context);\n $CHILDREN->SelectByMultiple ($childcriteria);\n\n // If no children, delete.\n if ($CHILDREN->CountResult () == 0) {\n $this->groupContent->Delete ();\n $this->CleanUp ();\n } // if\n unset ($CHILDREN);\n } // while\n }", "public function clear()\n {\n if ($this->first != null) {\n if (($e = $this->first->next) != null) {\n do {\n $e->setValue(null);\n $e->prev = null;\n } while (($e = $e->next) != null);\n }\n }\n $this->last = null;\n $this->first = null;\n $this->size = 0;\n }", "public function deleteChildren(Varien_Object $object){\n\t\t$adapter = $this->_getWriteAdapter();\n\t\t$pathField = $adapter->quoteIdentifier('path');\n\t\t$select = $adapter->select()\n\t\t\t->from($this->getMainTable(), array('entity_id'))\n\t\t\t->where($pathField . ' LIKE :c_path');\n\t\t$childrenIds = $adapter->fetchCol($select, array('c_path' => $object->getPath() . '/%'));\n\t\tif (!empty($childrenIds)) {\n\t\t\t$adapter->delete(\n\t\t\t\t$this->getMainTable(),\n\t\t\t\tarray('entity_id IN (?)' => $childrenIds)\n\t\t\t);\n\t\t}\n\t\t/**\n\t\t * Add deleted children ids to object\n\t\t * This data can be used in after delete event\n\t\t */\n\t\t$object->setDeletedChildrenIds($childrenIds);\n\t\treturn $this;\n\t}", "public function getChildren() {\n\t\t$children = $this->categoryRepository->findAllChildren($this);\n\t\treturn $children;\n\t}", "public function GetChildren() {\n\t\treturn $this->Children;\n\t}", "public function removeAllCategories()\n {\n return $this->unlinkAll('categories', true);\n }", "public function remove() {\n if ( is_null( $this->id ) )\n return;\n\n $this->prepare(\n 'DELETE FROM `categories` WHERE `category_id` = :category_id OR `parent_category_id` = :parent_category_id'\n , 'ii'\n , array( ':category_id' => $this->id, ':parent_category_id' => $this->id )\n )->query();\n }", "public function loadChildNodes()\n {\n $ids = $this->_cache->getBackend()->getChildNodeIds($this);\n return $this->setChildNodeIds($ids);\n }", "public function childrens()\n {\n return $this->hasMany(self::class, 'parent_id');\n }", "public function __clone()\n\t{\n\t\t$this->children=[];\n\t}", "public function detachAllRoles()\n {\n $this->roles()->detach();\n\n $this->clearCache();\n }", "private function removeIrrelevantChildren(\\DOMNode $node)\n {\n if ($node->hasChildNodes()) {\n foreach ($node->childNodes as $child) {\n if (is_a($child, \\DOMText::class) && strlen(trim($child->wholeText)) === 0) {\n $node->removeChild($child);\n $this->removeIrrelevantChildren($node);\n }\n }\n }\n }" ]
[ "0.7502292", "0.7184683", "0.70725316", "0.6909457", "0.66480285", "0.6436955", "0.6329638", "0.62436664", "0.6186484", "0.6150926", "0.60017306", "0.59897685", "0.59644026", "0.5884285", "0.5877814", "0.586493", "0.58552337", "0.5749035", "0.5636031", "0.55647415", "0.55604523", "0.54986304", "0.54918146", "0.54867864", "0.54867864", "0.54602087", "0.54543287", "0.54208726", "0.5344878", "0.5303794", "0.530113", "0.529918", "0.52811897", "0.5258913", "0.5242679", "0.5230771", "0.5230771", "0.5221222", "0.5217213", "0.51898897", "0.51812816", "0.51801467", "0.5161274", "0.5161274", "0.5161274", "0.5161274", "0.5161274", "0.5161274", "0.5161274", "0.5161274", "0.5157852", "0.5148925", "0.5115663", "0.5113145", "0.5105949", "0.5101696", "0.50994307", "0.50831944", "0.5082429", "0.50822145", "0.5076035", "0.5076035", "0.50696385", "0.50696385", "0.50696385", "0.50689435", "0.506559", "0.50576115", "0.5028904", "0.50287086", "0.50210845", "0.50185", "0.5017508", "0.501179", "0.5006027", "0.5003606", "0.5002787", "0.50007343", "0.49951336", "0.49951336", "0.49852192", "0.49826658", "0.4978803", "0.49762094", "0.4967892", "0.49572456", "0.49567074", "0.49547827", "0.4952444", "0.49519587", "0.4946982", "0.49451935", "0.4936794", "0.49360424", "0.4926219", "0.4922541", "0.49146932", "0.49143636", "0.4911945", "0.4904014" ]
0.6882512
4
Determines if the node is allowed events.
final public function allowsEvents() { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function allowedEvents()\n\t{\n\t\treturn array();\n\t}", "protected static function allowedEvents()\n\t{\n\t\treturn array(\n\t\t\t\t\t\t'onclick',\n\t\t\t\t\t\t'ondblclick',\n\t\t\t\t\t\t'onmousedown',\n\t\t\t\t\t\t'onmouseup',\n\t\t\t\t\t\t'onmouseover',\n\t\t\t\t\t\t'onmousemove',\n\t\t\t\t\t\t'onmouseout',\n\t\t\t\t\t\t'onkeypress',\n\t\t\t\t\t\t'onkeydown',\n\t\t\t\t\t\t'onkeyup'\n\t\t\t\t\t);\n\t}", "public function hasEvents()\n {\n return count($this->events) > 0 ? true : false;\n }", "public function isEvent()\n {\n return isset($this->status_changed) && ! is_null($this->status_changed);\n }", "public function isAppEventEnabled()\n {\n return true;\n }", "public function hasNetworkEvent(){\n return $this->_has(3);\n }", "public function hasListeners($event): bool;", "public function hasEventListeners($event);", "public function isUserEvent()\n {\n return $this->baseEvent->isUserEvent();\n }", "public function allowedForOvertime()\n { return (($this->esgrp == 'ES') || ($this->esgrp == 'EF') || ($this->esgrp == 'F')) ? true : false;\n }", "public function isAccessAllowed()\n\t{\n\t\t$returnValue \t=\tFALSE;\n\n\t\tif($this->isUserIPAddressAllowedAccess())\n\t\t{\n\t\t\t$returnValue\t=\tTRUE;\n\t\t}\n\n\t\treturn $returnValue;\n\t}", "public function hasListeners($eventName): bool;", "function canUpdateBGEvents() {\n if ($this->fields[\"background\"]\n && !Session::haveRight(self::$rightname, self::MANAGE_BG_EVENTS)) {\n return false;\n }\n\n return true;\n }", "public function checkOnAccess() : bool\r\n {\r\n if (empty($this->gates)){\r\n return true;\r\n }\r\n\r\n foreach ($this->gates as $gate) {\r\n\r\n if(Gate::allows($gate)){\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }", "public function valid()\n {\n return (false !== \\next($this->events)) ? current($this->events) : false;\n }", "public function isRoomEvent()\n {\n return $this->baseEvent->isRoomEvent();\n }", "public function allowedToSubmitSubordinateOvertime()\n { return (($this->esgrp != 'ES') && ($this->esgrp != 'EF') && ($this->esgrp != 'F')) ? true : false;\n }", "public function shouldDiscoverEvents(): bool\n {\n return false;\n }", "protected function isAllowed() {\n\t\treturn $this->allowedActions == array('*') ||\n\t\t\t\tin_array($this->_request->params['action'], array_map('strtolower', $this->allowedActions));\n\t}", "public function hasListeners($eventName);", "private function isAllowed() {\n $allowed = array(\n \"rss\" => array(\"feed\"),\n \"torrent\" => array(\"download\"),\n \"user\" => array(\"login\", \"register\", \"confirm\", \"recover\", \"invite\")\n );\n if (!isset($allowed[$this->data['url']['application']]))\n return false;\n if (in_array($this->data['url']['action'], $allowed[$this->data['url']['application']]))\n return true;\n else\n return false;\n }", "public function checkSecurity($xml) \n {\n //public function!\n // Be sure they've given us an event ID\n if (!isset($xml->action->event_id)) {\n return false;\n }\n\n return true;\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_sched/schedule');\n }", "public static function event_method()\n {\n return true;\n }", "protected function _isAllowed()\n {\n return $this->_getAclHelper()->isActionAllowed($this->_aclSection);\n }", "public function hasWildcardListeners($eventName): bool;", "public function isEventRecurs() {\n\t\treturn ($this->eventRecurs);\n\t}", "private function _checkAccessPermitted ()\r\n {\r\n $this->_getPermitedScripts();\r\n if (array_search(basename($_SERVER['PHP_SELF']), $this->_scriptAccess) === false) {\r\n $ip = (getenv('HTTP_X_FORWARDED_FOR') ? getenv('HTTP_X_FORWARDED_FOR') : getenv('REMOTE_ADDR'));\r\n $sql = \"INSERT INTO `_log` (`date`, `activity`, `info`) VALUES ('$date', 'admin_access_not_granted', 'user={$this->_username};IP={$ip};script=\" . basename($_SERVER['PHP_SELF']) . \"')\";\r\n mysql_query($sql, db_c());\r\n \r\n $this->_dispatchError('zoneError');\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "public function canBeEnabled();", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Rapidmage_Firewall::manage_rules');\n }", "public function hasTimeEvents(){\n return $this->_has(8);\n }", "function canHandleRequest() ;", "public function isAllowed()\n {\n $result = new \\Magento\\FrameWork\\DataObject(['is_allowed' => true]);\n $this->_eventManager->dispatch(\n 'ves_vendor_menu_check_acl',\n [\n 'resource' => $this->_resource,\n 'result' => $result\n ]\n );\n $permission = new \\Vnecoms\\Vendors\\Model\\AclResult();\n $this->_eventManager->dispatch(\n 'ves_vendor_check_acl',\n [\n 'resource' => $this->_resource,\n 'permission' => $permission\n ]\n );\n return $result->getIsAllowed() && $permission->isAllowed();\n }", "public function isAllow() {\n return !$this->isEnabled();\n }", "public function is_accessible() {\n $available = $this->properties->available;\n $deadline = $this->properties->deadline;\n return (($available == 0 || time() >= $available) && ($deadline == 0 || time() < $deadline));\n }", "private function hasEventLinks()\n {\n return !empty($this->eventlinks);\n }", "function canProcessRequests()\n\t{\n\t\tif ($this->getRequestMode() != -1) return true;\n\t\treturn false;\n\t}", "public function check_access() {\n\n\t\tif (isset($this->current_entity_allowed)) {\n\t\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t\t}\n\n\t\t$this->current_entity_allowed = MKB_Options::option('restrict_on') ?\n\t\t\t(bool) $this->check_entity_access($this->get_current_entity()) :\n\t\t\ttrue; // always allowed if restriction is off\n\n\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t}", "public function canDelegate()\n { return (($this->esgrp == 'CS') || ($this->esgrp == 'BS') || ($this->esgrp == 'AS'))\n ? true : false;\n }", "public function can_activate(): bool;", "protected function _canRun()\r\n\t{\r\n\t\t$start\t= strtotime($this->_scheduleStart);\r\n\t\t$stop\t= strtotime($this->_scheduleStop);\r\n\t\t$now\t= time();\r\n\t\t\r\n\t\tif($now > $start && $now < $stop) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function canProcessRequest(Request $request)\n {\n $hasEventKey = $request->has($this->eventKey);\n if ($hasEventKey === false) {\n return false;\n }\n\n $isCorrectEvent = $request->get($this->eventKey) == $this->eventValue;\n\n return $isCorrectEvent;\n }", "function getHasEvent() {\n\t\treturn $this->_HasEvent;\n\t}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Ceneo_Feeds::module');\n }", "public function allows(): bool\n {\n try {\n $this->ensure();\n return true;\n } catch (ForbiddenException $e) {\n return false;\n }\n }", "public function canFlag()\n {\n return in_array('flag', $this->actions);\n }", "public function isLimitReached(Event $event) :bool\n {\n return $event->is_limit_reached;\n }", "public function getValidEvents()\n\t{\n\t\treturn array();\n\t}", "public static function hasAccess(): bool\n {\n return in_array(Helper::getClientIP(), self::$ips);\n }", "public function hasActions();", "public function checkAccess() {\n\t\t$conf = $GLOBALS['BE_USER']->getTSConfig('backendToolbarItem.tx_newsspaper_role.disabled');\n\t\treturn ($conf['value'] == 1 ? false : true);\n\t}", "abstract public function canHandle(): bool;", "public function hasAccess() {\n return $this->_has(16);\n }", "public function shouldLogEvent()\n {\n return config('ldap.logging', false);\n }", "public function isAllowed(): bool\n {\n foreach ($this->rights as $rights) {\n [$module, $action] = explode('/', $rights);\n\n // check action rights\n if ($module !== '' && $action !== '' && !BackendAuthentication::isAllowedAction($action, $module)) {\n return false;\n }\n }\n\n return true;\n }", "public function isEventManager($aEventId)\n\t{\n\n\t\t$q = new Bn_query('rights');\n\t\t$q->addField('rght_status');\n\t\t$q->addWhere('rght_userid=' . $this->getVal('id', -1));\n\t\t$q->addWhere('rght_theme=' . THEME_EVENT);\n\t\t$q->addWhere('rght_themeid=' . $aEventId);\n\t\t$q->addWhere(\"rght_status='\" . AUTH_MANAGER . \"'\");\n\t\t$right = $q->getFirst();\n\t\treturn (!empty($right));\n\t}", "public static function listeners($event) {\n return isset(static::$events[$event]);\n }", "public function enable(int $events): bool {}", "protected function mustTakeAction(string $eventName): bool\n {\n }", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "function isActionAllowed($controller_id = null, $action_id = null, $event_id = null, $model_id = null, $group_id = null)\n {\n\t\t$actionAllowed = parent::isActionAllowed($controller_id, $action_id, $event_id, $model_id, $group_id);\n\n\t\t$hikeStatus = EventNames::model()->getStatusHike($event_id);\n\t\t$rolPlayer = DeelnemersEvent::model()->getRolOfPlayer($event_id, Yii::app()->user->id);\n\t\treturn $actionAllowed;\n\t}", "public function getEventTypeAllowableValues()\r\n {\r\n return [\r\n self::EVENT_TYPE__DEFAULT,\r\n ];\r\n }", "public function hasAccess()\n {\n return $this->access !== null;\n }", "public function isAllow()\n {\n return $this->allow;\n }", "public function canManagePermissions()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn ( static::$permApp !== NULL and static::$permType !== NULL and static::restrictionCheck( 'permissions' ) );\n\t}", "function can_manage(){\r\n\t\treturn ( $this->get_booking()->can_manage() );\r\n\t}", "public function isValidFor(Event $event)\n {\n return $this->getEventName() === $event->getName();\n }", "public function canHandleRequest();", "public function canHandleRequest();", "public function hasAutoaccept(){\n return $this->_has(6);\n }", "public function shouldDiscoverEvents()\n {\n return true;\n }", "public function matchesRequest(): bool\n {\n return $this->validateSignature() && $this->payload->get('webhook_event_type') === static::EVENT_TYPE;\n }", "public function canAccess($request) {\n if($this->access_level === self::ROOT_LEVEL) {\n return true;\n }\n if(!empty($this->permissions)) {\n if(in_array($request, $this->permissions[$this->access_level], true)) {\n return true;\n }\n }\n return false;\n }", "abstract protected function canAccess();", "function event_guard_log_allowed($ip_address) {\n\n\t\t//invalid ip address\n\t\tif (!filter_var($ip_address, FILTER_VALIDATE_IP)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t//get the access control allowed nodes\n\t\t$sql = \"select count(event_guard_log_uuid) \";\n\t\t$sql .= \"from v_event_guard_logs \";\n\t\t$sql .= \"where ip_address = :ip_address \";\n\t\t$sql .= \"and log_status = 'unblocked' \";\n\t\t$parameters['ip_address'] = $ip_address; \n\t\t$database = new database;\n\t\t$user_log_count = $database->select($sql, $parameters, 'column');\n\t\tunset($database);\n\n\t\t//debug info\n\t\tif ($debug) {\n\t\t\techo \"address \".$ip_address.\" count \".$user_log_count.\"\\n\";\n\t\t}\n\n\t\t//default authorized to false\n\t\t$allowed = false;\n\n\t\t//use the ip address to get the authorized nodes\n\t\tif ($user_log_count > 0) {\n\t\t\t$allowed = true;\n\t\t}\n\n\t\t//return\n\t\treturn $allowed;\n\t}", "public function matchesRequest()\n {\n return $this->event->get('token') === $this->config->get('token') && ($this->event->get('type') === 'MESSAGE' || $this->event->get('type') === 'CARD_CLICKED');\n }", "protected function isAllowed()\n {\n return $this->_authorization->isAllowed('Amasty_XmlSitemap::sitemap');\n }", "public function hasDataCollectionEvents() {\n return $this->_has(8);\n }", "function is_event($p = null) {\n\tglobal $post;\n\t$p = ($p == null) ? $post : $p;\n\t$cat = get_the_category($p->ID);\n\t$option_category = get_it_option('event_category');\n\t\n\treturn $cat[0]->cat_ID == $option_category ||\n\t\t\tget_top_parent_cat_ID($cat[0]) == $option_category;\n}", "private function checkEventNotBookedByCreator(){\n $event = Event::find($this->id);\n\n return($event->host != Auth::id());\n }", "public static function isAllowed() {\r\n\t\treturn TodoyuAuth::isAdmin();\r\n\t}", "protected function _isAllowed()\n {\n return parent::_isAllowed() && $this->_authorization->isAllowed('Vnecoms_VendorsProfileNotification::manage_process');\n }", "public function allowRegistrations($varEvent)\n {\n $time = time();\n $objEvent = $this->Database->prepare(\"SELECT * FROM tl_calendar_events WHERE id=? OR alias=?\" . (!BE_USER_LOGGED_IN ? \" AND (start='' OR start<$time) AND (stop='' OR stop>$time) AND published=1\" : \"\"))\n ->limit(1)\n ->execute((is_numeric($varEvent) ? $varEvent : 0), $varEvent);\n \n if ($objEvent->numRows && $objEvent->register)\n {\n // Check seat limits\n if ($objEvent->register_limit > 0)\n {\n $objRegistrations = $this->Database->execute(\"SELECT COUNT(*) AS total FROM tl_calendar_memberregistration WHERE disable='' AND pid=\".$objEvent->id);\n \n if ($objRegistrations->total >= $objEvent->register_limit)\n {\n return false;\n }\n }\n \n if (is_array($GLOBALS['TL_HOOKS']['calendarRegistration']) && count($GLOBALS['TL_HOOKS']['calendarRegistration']))\n {\n foreach( $GLOBALS['TL_HOOKS']['calendarRegistration'] as $callback )\n {\n $this->import($callback[0]);\n \n if ($this->$callback[0]->$callback[1]($objEvent->row(), $intMember, $blnActivate) === false)\n {\n return false;\n }\n }\n }\n \n return true;\n }\n \n return false;\n }", "public static function can($what)\n\t{\n\t\treturn (devMode() || isset(self::accesslist()[$what]));\n\t}", "public function canUserAssignUsage()\n {\n $user = $this->getUser();\n\n return $user->isAdmin || \\in_array('tl_news::usage', $user->alexf, true);\n }", "public function hasAccessRestrictions() {\n\t\tif (!is_array($this->accessRoles) || empty($this->accessRoles)) {\n\t\t\treturn FALSE;\n\t\t}\n\t\tif (count($this->accessRoles) === 1 && in_array('TYPO3.Flow:Everybody', $this->accessRoles)) {\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "protected function allow() {\n\t\t\n\t\treturn true;\n\t}", "public function canSetControllablePolicy();", "protected function _isAllowed()\n {\n $aclResource = 'admin/system/salesblock';\n\n return $this->getAdminSession()->isAllowed($aclResource);\n }", "public function canBeDisabledAndEnabled() {}", "public function allowRequest(): bool\n {\n return true;\n }", "static public function hasListeners($eventName) {\n return !empty(self::$listeners[$eventName]);\n }", "public function valid()\n {\n $allowed_values = [\"CREDIT_CARD\", \"CASH\", \"THIRD_PARTY_CARD\", \"NO_SALE\", \"SQUARE_WALLET\", \"SQUARE_GIFT_CARD\", \"UNKNOWN\", \"OTHER\"];\n if (!in_array($this->container['event_type'], $allowed_values)) {\n return false;\n }\n $allowed_values = [\"OTHER_BRAND\", \"VISA\", \"MASTERCARD\", \"AMERICAN_EXPRESS\", \"DISCOVER\", \"DISCOVER_DINERS\", \"JCB\", \"CHINA_UNIONPAY\", \"SQUARE_GIFT_CARD\"];\n if (!in_array($this->container['card_brand'], $allowed_values)) {\n return false;\n }\n $allowed_values = [\"MANUAL\", \"SCANNED\", \"SQUARE_CASH\", \"SQUARE_WALLET\", \"SWIPED\", \"WEB_FORM\", \"OTHER\"];\n if (!in_array($this->container['entry_method'], $allowed_values)) {\n return false;\n }\n return true;\n }", "protected function _isAllowed() {\r\n return Mage::getSingleton('admin/session')->isAllowed('sales/bookme/reseauchx_reservationreseau/siege');\r\n }", "public function isEnabled()\n {\n\t\tif($this->actif == 1) return true;\n \telse return false;\n }", "public function has_access() { \n\n\t\tif (!Access::check('interface','25')) { \n\t\t\treturn false; \n\t\t} \n\t\tif ($this->user == $GLOBALS['user']->id) { \n\t\t\treturn true; \n\t\t} \n\t\telse {\n\t\t\treturn Access::check('interface','100'); \n\t\t} \t\n\n\t\treturn false; \n\n\t}", "public function isListened()\n {\n return !empty($this->socket);\n }" ]
[ "0.6507748", "0.61673623", "0.61363316", "0.6070249", "0.6053544", "0.59942406", "0.5910554", "0.58316106", "0.5809283", "0.58078367", "0.5785749", "0.57683766", "0.57584107", "0.5697767", "0.56874067", "0.56789976", "0.5611035", "0.56024045", "0.55912614", "0.55571294", "0.5535597", "0.55191016", "0.55140185", "0.5512599", "0.5510791", "0.5503341", "0.54986393", "0.5497471", "0.5460361", "0.5447756", "0.54411244", "0.54226786", "0.541165", "0.540734", "0.5403899", "0.5402048", "0.5393232", "0.5385624", "0.53821343", "0.535703", "0.5354717", "0.53517044", "0.5346308", "0.5341013", "0.5339463", "0.5337364", "0.53351134", "0.53280777", "0.5326122", "0.53197795", "0.531336", "0.5313006", "0.5312249", "0.53064007", "0.5291159", "0.5288986", "0.52844274", "0.5270061", "0.5265327", "0.5245419", "0.5245419", "0.5245419", "0.5245419", "0.5244345", "0.523895", "0.5236671", "0.52365494", "0.5228165", "0.5225591", "0.5221627", "0.5218728", "0.5218728", "0.5217441", "0.5212841", "0.521075", "0.5206117", "0.5205566", "0.52029645", "0.52027255", "0.51996845", "0.51920235", "0.5188384", "0.51856035", "0.51854295", "0.5181795", "0.51816803", "0.5180716", "0.51804644", "0.5176425", "0.5172932", "0.51724684", "0.517182", "0.5171776", "0.51659787", "0.5159044", "0.51589906", "0.51495034", "0.5145682", "0.51431954", "0.5140475" ]
0.71755666
0
Parses the template for the node.
final public function template($path) { return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _parseTemplate() {}", "private function _processTemplate(\\DOMNode $node, array $path = [/** value is missing */], array &$dataPathCache = [/** value is missing */], $currentDataPath = '') {}", "function parseTemplate() {\n $this->initParsing();\n $this->beginMainBlock();\n if (!$this->parseTemplateCommands()) return false;\n $this->endMainBlock();\n if (!$this->checkBlockDefinitionsComplete()) return false;\n if (!$this->parseTemplateVariables()) return false;\n $this->associateVariablesWithBlocks();\n return true; }", "protected function parse($template)\n {\n if ($template) {\n $regex = $this->getTag()->getTagRegex();\n // check if template has cached\n $md5 = md5($template);\n if (!in_array($md5, $this->hashes)) {\n $matches = null;\n preg_match_all($regex, $template, $matches, PREG_PATTERN_ORDER);\n $this->matches[$md5] = $matches;\n $this->hashes[] = $md5;\n } else {\n $matches = $this->matches[$md5];\n }\n // scan for EACH tags\n $eachs = $this->parseEach($template, $matches);\n // scan for TBL tags\n $tables = $this->parseTable($template, $matches);\n // parse regular tags\n for ($i = 0; $i < count($matches[1]); $i ++) {\n $match = $matches[0][$i];\n $tag = $matches[1][$i];\n // ignore non exist match\n if (false === strpos($template, $match)) {\n continue;\n }\n if (false !== ($tag = $this->parseTag($tag))) {\n if ($tag instanceof \\DateTime) {\n $tag = $tag->format(\\DateTime::ISO8601);\n }\n $template = str_replace($match, $tag, $template);\n }\n }\n // process EACH\n foreach ($eachs as $tag => $params) {\n $content = $this->parseSub($params['content'], $params['expr']);\n $template = str_replace('%%EACH:'.$tag.'%%', $content, $template);\n }\n // process TBL\n foreach ($tables as $tag => $params) {\n $content = $this->parseSub($params['content'], $params['expr'], \"\\n\");\n $template = str_replace('%%TBL:'.$tag.'%%', $content, $template);\n }\n }\n return $template;\n }", "private function _Parsing($template)\n {\n // ДИРЕКТИВЫ\n // Literal\n preg_match_all(\"~{literal}(.+?){/literal}~si\", $template, $match);\n foreach ($match[0] as $key => $val)\n {\n $template = str_replace($val, \"<LITERAL{$key}LITERAL>\", $template);\n }\n\n // подключение шаблонов директивой инклуде {инклуде \"дирнаме/филенаме\"}\n $template = preg_replace_callback(self::PATTERN_INCLUDE, [$this, '_Parsing_Include'], $template);\n // парсинг языковых конструкций\n $template = preg_replace_callback(self::PATTERN_TRANSLATION1, [$this, '_Parsing_Translation1'], $template);\n $template = preg_replace_callback(self::PATTERN_TRANSLATION2, [$this, '_Parsing_Translation2'], $template);\n // парсинг плагинов\n $template = preg_replace_callback(self::PATTERN_PLUGIN, [$this, '_Parsing_Controller'], $template);\n //\n\n // Вырезаем служебные комментарии\n $template = preg_replace('~{#(.*?)#}~s', '', $template);\n\n //\tциклы и логика\n $template = preg_replace('~{((foreach|for|while|if|switch|case|default) .+?)}~si', '<' . '?php $1 { ?' . '>', $template);\n $template = preg_replace('~{(/|/foreach|/for|/while|/if|/switch|/case|/default)}~si', '<' . '?php } ?' . '>', $template);\n $template = preg_replace('~{else if (.+?)}~si', '<' . '?php } else if $1 { ?' . '>', $template);\n $template = preg_replace('~{else}~si', '<' . '?php } else { ?' . '>', $template);\n $template = preg_replace('~{(break|continue)}~si', '<' . '?php $1; ?' . '>', $template);\n //\tпеременные установка\n $template = preg_replace('~{set ([^}]{1,255})}~si', '<' . '?php $1; ?' . '>', $template);\n\n //\tпеременные вывод\n $template = preg_replace('~{(\\$[^}]{1,255})}~si', '<' . '?php echo $1; ?' . '>', $template);\n //\tфункции и константы\n $template = preg_replace('~{([a-z]{1}[^}]{0,150})}~si', '<' . '?php echo $1; ?' . '>', $template);\n\n // Literal\n foreach ($match[1] as $key => $val)\n {\n $template = str_replace(\"<LITERAL{$key}LITERAL>\", trim($val), $template);\n }\n\n // ////\tпеременные вывод\n // $template = preg_replace('~([^{]?){(\\$[^}]{1,255})}([^}]?)~si', '$1<' . '?php echo $2; ?' . '>$3', $template);\n // ////\tфункции и константы\n // $template = preg_replace('~([^{]?){([a-z]{1}[^}]{0,150})}([^}]?)~si', '$1<' . '?php echo $2; ?' . '>$3', $template);\n\n //\n return $template;\n }", "public function getTemplateNode($fieldName) {}", "protected function getCurrentParsedTemplate() {}", "protected function parse($template) {\n return (new MustacheParser())->parse(new StringTokenizer($template));\n }", "function parseTemplateText()\r\n\t{\r\n\t\t$buf = '';\r\n\t\t// we only need this if we are going to use JSP tags for wrapping\r\n\t\t// scriptlet blocks\r\n\t\t//if ($this->reader->matches('<' . '\\\\%'))\r\n\t\t//{\r\n\t\t//\t$buf .= '<' . '%';\r\n\t\t//}\r\n\r\n\t\t$buf .= $this->reader->nextContent();\r\n\r\n\t\t// don't output meaningless whitespace\r\n\t\tif (trim($buf) == '')\r\n\t\t{\r\n\t\t\treturn '';\r\n\t\t}\r\n\t\telseif ($this->ctxt->options->isElIgnored() || strpos($buf, '${') === false)\r\n\t\t{\r\n\t\t\treturn $buf;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn '<?php echo $pageContext->evaluateTemplateText(' . StringUtils::quote($buf) . ');?>';\r\n\t\t}\r\n\t}", "public function parse($template)\n\t{\n\t\t$dom = TemplateLoader::load($template);\n\n\t\t$ir = new DOMDocument;\n\t\t$ir->loadXML('<template/>');\n\n\t\t$this->createXPath($dom);\n\t\t$this->parseChildren($ir->documentElement, $dom->documentElement);\n\t\t$this->normalizer->normalize($ir);\n\n\t\treturn $ir;\n\t}", "function parse(){ // parsing template\n\t$loop_count = -1;\n\tif (func_num_args()>= 1){\n\t\t$proc_type = func_get_arg(0);\n\t\t//if (!in_array($proc_type, array(PT_ROOT, PT_IF, PT_FOR, PT_SILENT_IF, PT_SILENT_FOR, PT_FALSE_IF))) system_die('Invalid process type', 'Template->parse');\n\t} else {\n\t\tif ( (PT_COMPILE) && (isset($this->filename)) ) // file parsing\n\t\t{\n\t\t\tif (file_exists($this->filename . '.php'))\n\t\t\t\tif (filemtime($this->filename . '.php') > filemtime($this->filename))\n\t\t\t\t{\n\t\t\t\t\tinclude($this->filename . '.php');\n\t\t\t\t\t$this->result = $r;\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t$nesting = 0;\n\t\t\t$tplc = '<?$r=\\'\\';';\n\t\t\tfor ($i=0; $i<count($this->template); $i++)\n\t\t\t{\n\t\t\t\t// process\n\t\t\t\t$line = trim($this->template[$i]);\n\t\t\t\t$line = preg_replace(PT_COMMENT_TAGS, '', $line); // Remove comments\n\t\t\t\t$result = array();\n\t\t\t\tif (preg_match(PT_START_TAGS, $line, $result))\n\t\t\t\t{\n\t\t\t\t\tif (strcasecmp($result[1], 'FOR') == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$tplc .= 'for ($i' . $nesting . '=0;$i' . $nesting . '<intval(' . $this->get_var_ref($result[3], $nesting) . ');$i' . $nesting . '++){' . \"\\n\";\n\t\t\t\t\t\t$nesting++;\n\t\t\t\t\t}\n\t\t\t\t\telse // this line is IF opening tag\n\t\t\t\t\t{\n\t\t\t\t\t\t$tplc .= 'if ('.$result[2].'(bool)('.$this->get_var_ref($result[3], $nesting).')){' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t} elseif (preg_match(PT_END_TAGS, $line, $result))\n\t\t\t\t{\n\t\t\t\t\t$tplc .= '}' . \"\\n\";\n\t\t\t\t\tif (strcasecmp($result[1], 'FOR') == 0)\n\t\t\t\t\t\t$nesting--;\n\t\t\t\t} elseif (preg_match(PT_MIDDLE_TAGS, $line, $result))\n\t\t\t\t{\n\t\t\t\t\t$tplc .= '}else{' . \"\\n\";\n\t\t\t\t} elseif (preg_match('/<%/', $line, $result))\n\t\t\t\t{\n\t\t\t\t\t$j = 0;\n\t\t\t\t\t$tmp_str = '';\n\t\t\t\t\twhile ($j<strlen($line))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( ($line[$j] == '<') && ($line[$j+1] == '%') )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (strlen($tmp_str))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_unk_value($tmp_str, $nesting, $dw) . \";\\n\";\n\t\t\t\t\t\t\t\t$tmp_str = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_f_value(substr($line, $j), $nesting, $dw) . \";\\n\";\n\t\t\t\t\t\t\t$j += $dw;\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$tmp_str .= $line[$j];\n\t\t\t\t\t\t\t$j++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (strlen($tmp_str))\n\t\t\t\t\t{\n\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_unk_value($tmp_str, $nesting, $dw) . \";\\n\";\n\t\t\t\t\t}\n\t\t\t\t\tif (strlen($line))\n\t\t\t\t\t\t$tplc .= '$r.=\"\\\\n\";';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (strlen($line))\n\t\t\t\t\t{\n\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_unk_value($line, $nesting, $dw) . \".\\\"\\\\n\\\";\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$tplc .= '?>';\n\t\t\t\n\t\t\t$fh = fopen($this->filename . '.php', 'wt');\n\t\t\tif ($fh)\n\t\t\t{\n\t\t\t\tfwrite($fh, $tplc);\n\t\t\t\tfclose($fh);\n\t\t\t}\n\t\t\telse\n\t\t\t\tsystem_die('Cannot save compiled template');\n\t\t\tinclude($this->filename . '.php');\n\t\t\t$this->result = $r;\n\t\t\treturn 0;\n\t\t} // if compile and filename\n\t\t$proc_type = PT_ROOT;\n\t\tunset($this->result);\n\t}\n\tif (func_num_args()> 1){\n\t\t$curr_pos = intval(func_get_arg(1));\n\t\tif (($proc_type == PT_FOR) && (func_num_args() < 3)) system_die('Undefined loop count (FOR process)', 'Template->parse');\n\t\tif (func_num_args()> 2) $loop_count = intval(func_get_arg(2));\n\t}\n\telse\n\t\t$curr_pos = 0;\n\t$succ_mode = false;\n\twhile ($curr_pos < sizeof($this->template)){\n\t\t$line = $this->template[$curr_pos]; // current line\n\t\t$line = preg_replace(PT_COMMENT_TAGS, '', $line); // Remove comments\n\t\tif (preg_match(PT_START_TAGS, $line, $result)){ // this line contains one of the START tags\n\t\t\t$result[1] = strtoupper($result[1]);\n\t\t\tif ($result[1] == 'FOR'){\n\t\t\t\tif (!$this->in_vars($result[3]) && ($proc_type < PT_SILENT_IF)){ // invalid FOR variable\n\t\t\t\t\t$error_msg = 'Invalid FOR statement counter named \"'.$result[3].'\"';\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tif ($proc_type <= PT_FOR) $count = intval($this->get_var_val($result[3]));\n\t\t\t\t\t$this->system_vars['cycle_nesting']++;\n\t\t\t\t\t$nesting_saver = $this->system_vars['cycle_nesting'];\n\t\t\t\t\tif ($proc_type> PT_FOR) $last_pos = $this->parse(PT_SILENT_FOR, $curr_pos + 1, 0); // create invisible FOR process\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ($count == 0) $last_pos = $this->parse(PT_SILENT_FOR, $curr_pos + 1, 0); // create invisible FOR process\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tfor ($c = 0; $c < $count; $c++){\n\t\t\t\t\t\t\t\t$this->system_vars['cycle_counters'][$nesting_saver] = $c;\n\t\t\t\t\t\t\t\t$this->system_vars['cycle_nesting'] = $nesting_saver;\n\t\t\t\t\t\t\t\t$last_pos = $this->parse(PT_FOR, $curr_pos + 1, $c); // create visible FOR process in loop\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$curr_pos = $last_pos;\n\t\t\t\t}\n\t\t\t} else { // this line is IF opening tag\n\t\t\t\tif (!$this->in_vars($result[3]) && ($proc_type < PT_SILENT_IF)){\n\t\t\t\t\t$error_msg = 'Invalid IF statement variable named \"'.$result[3].'\"';\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tif ($proc_type>PT_FOR) $curr_type = PT_SILENT_IF;\n\t\t\t\t\telse {\n\t\t\t\t\t\t$var = (bool)$this->get_var_val($result[3]);\n\t\t\t\t\t\tif (strlen($result[2])> 0) $var = !$var;\n\t\t\t\t\t\t$curr_type = ($var)?PT_IF:PT_FALSE_IF;\n\t\t\t\t\t}\n\t\t\t\t\tif ($loop_count!=-1) $curr_pos = $this->parse($curr_type, $curr_pos+1, $loop_count); // create new IF process inside the loop\n\t\t\t\t\telse $curr_pos = $this->parse($curr_type, $curr_pos+1); // create new IF process\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif(preg_match(PT_END_TAGS, $line, $result)){\n\t\t\t$result[1] = strtoupper($result[1]);\n\t\t\tif (((($proc_type == PT_FOR) || ($proc_type == PT_SILENT_FOR)) && ($result[1] == 'FOR')) || ((($proc_type == PT_IF) || ($proc_type == PT_SILENT_IF) || ($proc_type == PT_FALSE_IF)) && ($result[1] == 'IF'))) {\n\t\t\t\tif (($proc_type == PT_FOR) || ($proc_type == PT_SILENT_FOR)) $this->system_vars['cycle_nesting']--; // this one was the end of loop block\n\t\t\t\t$succ_mode = true;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t$error_msg = 'Unexpected end of '.$result[1].' statement';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} elseif(preg_match(PT_MIDDLE_TAGS, $line, $result)){ // this line contains one of the MIDDLE tags (ELSE probably)\n\t\t\t$result[1] = strtoupper($result[1]);\n\t\t\tif (($proc_type == PT_FALSE_IF) && ($result[1] == 'ELSE')) {\n\t\t\t\t$proc_type = PT_IF;\n\t\t\t} elseif (($proc_type == PT_IF) && ($result[1] == 'ELSE')) {\n\t\t\t\t$proc_type = PT_FALSE_IF;\n\t\t\t} elseif($proc_type != PT_SILENT_IF) { // ELSE inside non IF process or so\n\t\t\t\t$error_msg = 'Unexpected '.$result[1].' statement '.$proc_type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} elseif ($proc_type <= PT_FOR){ // processing of visible contents\n\t\t\tif (!isset($this->result)) $this->result = '';\n\t\t\t\t$matches = array();\n\t\t\t\t$line_is_control = false;\n\n\t\t\t\tif (preg_match_all(PT_COUNTER_TAGS, $line, $matches)){ // We have counter tags inside\n\t\t\t\t\t$replace = array();\n\t\t\t\t\tforeach ($matches[0] as $key => $val){ // process counters\n\t\t\t\t\t\tif ($loop_count >= 0) $replace[$key] = $loop_count + 1;\n\t\t\t\t\t\telse $replace[$key] = '';\n\t\t\t\t\t}\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace'em all\n\t\t\t\t}\n\t\t\t\t// processing variables\n\n\t\t\t\tif (preg_match_all(PT_VARIABLE_TAGS, $line, $matches)){ // Yes! We have some tags inside\n\t\t\t\t\t$replace = array();\n\t\t\t\t\tforeach ($matches[2] as $key => $val){ // go thru the matches\n\t\t\t\t\t\tif (strlen($matches[4][$key])> 0){ // process array variables\n\t\t\t\t\t\t\tif (isset($this->vars[$val]) && is_array($this->vars[$val]) && array_key_exists($matches[4][$key], $this->vars[$val])){\n\t\t\t\t\t\t\t\t\t$replace[$key] = $this->vars[$val][$matches[4][$key]];\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '#')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = htmlspecialchars($replace[$key]); // escape html entries for # tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '+')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace('+', '%20', urlencode($replace[$key])); // url escape for + tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '^')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\\\\", \"\\\\\\\\\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"'\", \"\\\\'\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\r\", \"\\\\r\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\n\", \"\\\\n\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"</script>\", \"</'+'script>\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} elseif (isset($this->vars[$val]) && is_object($this->vars[$val])) {\n\t\t\t\t\t\t\t\t \t$_obj = &$this->vars[$val];\n\t\t\t\t\t\t\t\t\t$_name = $matches[4][$key];\n\t\t\t\t\t\t\t\t\t$replace[$key] = $_obj->$_name;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '#')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = htmlspecialchars($replace[$key]); // escape html entries for # tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '+')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace('+', '%20', urlencode($replace[$key])); // url escape for + tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '^')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\\\\", \"\\\\\\\\\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"'\", \"\\\\'\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\r\", \"\\\\r\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\n\", \"\\\\n\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"</script>\", \"</'+'script>\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif ($this->debug_mode) $this->show_notice($val.$matches[3][$key], 4); // show stupid notice\n\t\t\t\t\t\t\t\t$replace[$key] = ''; // and insert complete emptyness\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else{ // process common variables\n\t\t\t\t\t\t\tif (isset($this->vars[$val]))\n\t\t\t\t\t\t\t\t$replace[$key] = $this->get_var_val($val);\n\t\t\t\t\t\t\telseif (preg_match('/\\\\//', $val))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$v_row = $this->Registry->_internal_get_value($val);\n\t\t\t\t\t\t\t\tif ( ($v_row !== false) && (!$v_row->eof()) ) {\n\t\t\t\t\t\t\t\t\t$out = $v_row->Rows[0]->Fields['value'];\n\t\t\t\t\t\t if ($v_row->Rows[0]->Fields['key_type'] == KEY_TYPE_IMAGE)\n\t\t\t\t\t\t\t\t\t\t$out = $GLOBALS['app']->template_vars['REGISTRY_WEB'] . $v_row->Rows[0]->Fields['id_path'] . '/' . $out;\n\t\t\t\t\t\t\t\t\t$replace[$key] = $out;\n\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\t$replace[$key] = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$replace[$key] = '';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($matches[1][$key] == '#')\n\t\t\t\t\t\t\t\t$replace[$key] = htmlspecialchars($replace[$key]); // escape html entries for # tag\n\t\t\t\t\t\t\tif ($matches[1][$key] == '+')\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace('+', '%20', urlencode($replace[$key])); // url escape for + tag\n\t\t\t\t\t\t\tif ($matches[1][$key] == '^')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\\\\", \"\\\\\\\\\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"'\", \"\\\\'\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\r\", \"\\\\r\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\n\", \"\\\\n\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"</script>\", \"</'+'script>\", $replace[$key]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace'em all\n\t\t\t\t}\n\n\t\t\t\t// processing ternary operators\n\n\t\t\t\tif (preg_match_all(PT_TERNARY_TAGS, $line, $matches)){ // Yes! We have some tags inside\n\t\t\t\t\tforeach ($matches[2] as $key => $val){ // go thru the matches\n\t\t\t\t\t\tif (isset($this->vars[$val])){\n\t\t\t\t\t\t\t$var = (bool)$this->get_var_val($val);\n\t\t\t\t\t\t\tif (strlen($matches[1][$key])> 0) $var = !$var;\n\t\t\t\t\t\t\t$res_num = ($var)?4:6;\n\t\t\t\t\t\t\tif (isset($this->vars[$matches[$res_num][$key]])) {\n\t\t\t\t\t\t\t\t$replace[$key] = $this->get_var_val($matches[$res_num][$key]);\n\t\t\t\t\t\t\t\tif (strlen($matches[$res_num - 1][$key])> 0) $replace[$key] = htmlspecialchars($replace[$key]); // escape html entries\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif ($this->debug_mode) $this->show_notice($res_var, 1);\n\t\t\t\t\t\t\t\t$result[$key] = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else { // we have tag but haven't got variable\n\t\t\t\t\t\t\tif ($this->debug_mode) $this->show_notice($val, 1); // curse them out in debug mode\n\t\t\t\t\t\t\t$replace[$key] = ''; // and insert pretty nothing\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace'em all\n\t\t\t\t}\n\n\t\t\t\t// processing controls\n\t\t\t\tif (preg_match_all(PT_CONTROL_TAGS, $line, $matches)){ // Yes! This line contains control definition\n\t\t\t\t\t$replace = array();\n\t\t\t\t\tforeach ($matches[1] as $key => $name){ // go through the matches\n\t\t\t\t\t\tif (strlen($matches[3][$key])> 0) $tcontrol = &$GLOBALS['pt_template_factory']->get_object(strtolower($name), strtolower($matches[3][$key])); // here is control with id\n\t\t\t\t\t\telse $tcontrol = &$GLOBALS['pt_template_factory']->get_object(strtolower($name)); // here is control without id\n\t\t\t\t\t\tif (!is_null($tcontrol)){\n\t\t\t\t\t\t\t$tcontrol->parse_vars($matches[5][$key]);\n\t\t\t\t\t\t\tif (!$tcontrol->is_inited)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$tcontrol->on_page_init();\n\t\t\t\t\t\t\t\t$tcontrol->is_inited = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$replace[$key] = $tcontrol->process($loop_count);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t$replace[$key] = '';\n\t\t\t\t\t}\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace control statements with control results\n\t\t\t\t}\n\n\t\t\t\t// compress and delete blank lines\n\t\t\t\t$line = preg_replace('/[\\r\\n]*$/', '', trim($line));\n\t\t\t\tif (strlen($line)> 0) $this->result .= $line . \"\\n\";\n\t\t\t}\n\t\t\t$curr_pos++;\n\t\t}\n\n// And what we have here?\n\t\tif (!isset($error_msg) && ($proc_type != PT_ROOT) && !$succ_mode) $error_msg = 'Unexpected end of file'; // invalid template - show error\n\t\tif (isset($error_msg)){\n\t\t\t$error_txt = 'Template parsing error on line '.($curr_pos + 1);\n\t\t\tif (isset($this->filename))\t$error_txt .= ' of file \"'.$this->filename.'\"';\n\t\t\t$error_txt .= ' - '.$error_msg;\n\t\t\tsystem_die($error_txt, 'Template->parse'); // invalid template - show error\n\t\t}\n\t\tif ($proc_type == PT_ROOT)\n\t\t\tif (!isset($this->result))\n\t\t\t\t$this->result = ''; // probably there were one big false IF?\n\t\treturn $curr_pos; // HURRA! HURRA! This one is successfully completed!\n\t}", "public function parse_template($template, $vars = array())\n\t{\n\t\t$this->EE->load->library('template_helper');\n\t\treturn $this->EE->template_helper->fetch_and_parse($template, $vars); \n\t}", "protected function parse(): void\n {\n parent::parse();\n $this->template->assign('dataGrid', (string) $this->dataGrid->getContent());\n }", "protected function parsedTemplateData(){\n if( $this->_parsedTemplateData === null ){\n $this->_parsedTemplateData = $this->getHelper('json')->decode( $this->templateData );\n }\n return $this->_parsedTemplateData;\n }", "protected function parseTemplate($template)\n\t{\n\t\t$this->references = [\n\t\t\t'anywhere' => [],\n\t\t\t'asUrl' => [],\n\t\t\t'inText' => []\n\t\t];\n\n\t\tpreg_match_all($this->referencesRegexp, $template, $matches);\n\t\tforeach ($matches[0] as $match)\n\t\t{\n\t\t\t$key = trim($match, '\\\\${}');\n\t\t\t$this->references['anywhere'][$key] = $key;\n\t\t}\n\n\t\t$dom = TemplateLoader::load($template);\n\t\t$xpath = new DOMXPath($dom);\n\t\tforeach ($xpath->query('//text()') as $node)\n\t\t{\n\t\t\tpreg_match_all($this->referencesRegexp, $node->textContent, $matches);\n\t\t\tforeach ($matches[0] as $match)\n\t\t\t{\n\t\t\t\t$key = trim($match, '\\\\${}');\n\t\t\t\t$this->references['inText'][$key] = $key;\n\t\t\t}\n\t\t}\n\n\t\tforeach (NodeLocator::getURLNodes($dom) as $node)\n\t\t{\n\t\t\t// We only bother with literal attributes that start with a capture\n\t\t\tif ($node instanceof DOMAttr\n\t\t\t && preg_match('(^(?:[$\\\\\\\\]\\\\d+|\\\\$\\\\{\\\\d+\\\\}))', trim($node->value), $m))\n\t\t\t{\n\t\t\t\t$key = trim($m[0], '\\\\${}');\n\t\t\t\t$this->references['asUrl'][$key] = $key;\n\t\t\t}\n\t\t}\n\n\t\t$this->removeUnknownReferences();\n\t}", "public function parse ($template, $text = null)\n\t{\n\t\t$this->set ('STATIC_URL', TEMPLATE_DIR);\n\t\t\n\t\t// SEt unique id\n\t\t$this->set ('templateID', self::getUniqueId ());\n\n\t\tob_start ();\n\t\t\n\t\tif (! $filename = $this->getFilename ($template))\n\t\t{\n\t\t\techo '<h1>Template not found</h1>';\n\t\t\techo '<p>The system could not find template \"'.$template.'\"</p>';\n\t\t\t\n\t\t\t$filename = null;\n\t\t}\n\t\t\n\t\tforeach ($this->values as $k => $v)\n\t\t{\n\t\t\t$$k = $v;\n\t\t}\n\t\t\n\t\tforeach ($this->lists as $k => $v)\n\t\t{\n\t\t\t$n = 'list_'.$k;\t\n\t\t\t$$n = $v;\n\t\t}\n\t\t\n\t\t\n\t\tif (isset ($filename))\n\t\t{\n\t\t\tinclude $filename;\n\t\t}\n\t\t\n\t\t$val = ob_get_contents();\n\t\tob_end_clean();\n\n\t\treturn $val;\n\t}", "protected function parseXTemplate(XTemplate $xtpl){\n\t\t//$this->fillInput(\"nombre\", $this->getInitialText() );\n\t\t\n\t\tparent::parseXTemplate($xtpl);\n\t\t\n\t\t$xtpl->assign(\"lbl_mes\", $this->localize(\"criteria.mes\") );\n\t\t\n\t\t//$xtpl->assign(\"linkSeleccionar\", LinkBuilder::getPageUrl( \"HistoriaClinica\") );\n\t\t//$xtpl->assign(\"linkSeleccionar\", LinkBuilder::getPageUrl( \"InformeSemanalModificar\") );\n\t\t\n\t\t\n\t}", "function Get($template)\r\n\t{\r\n\t\t$this->template = $template;\r\n\t\t$this->out = \"\";\r\n\t\tif (!file_exists($template)) { trigger_error(\"Template not found (\" . $template . \")\", E_USER_ERROR); return NULL; }\r\n\t\t$parser = xml_parser_create_ns();\r\n\t\t$data = array();\r\n\t\t$index = array();\r\n\t\txml_set_object($parser, $this);\r\n\t\txml_set_element_handler($parser, \"Start_Tag\", \"End_Tag\");\r\n\t\txml_set_character_data_handler($parser, \"CData\");\r\n \t\txml_set_default_handler($parser, \"CData\");\r\n \t\txml_set_processing_instruction_handler($parser, \"Process\");\r\n\r\n\t\t$lines = file($template);\r\n\t\tforeach ($lines as $line)\r\n\t\t{\r\n\t\t\tif (!xml_parse($parser, $line))\r\n\t\t\t{\r\n\t\t\t\techo \"XML Error: \" . xml_error_string(xml_get_error_code($parser)) .\r\n\t\t\t\t\" on line \" . xml_get_current_line_number($parser) .\r\n\t\t\t\t\" of file \" . $template . \"<br/>\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t\txml_parser_free($parser);\r\n\t\treturn preg_replace_callback(\"/\\{{([^}]+)\\}}/\", array($this, \"parse_vars\"), $this->out);\r\n\t}", "public function parse(SpoonTemplate $template)\n {\n $this->form->parse($template);\n }", "public function processaTemplate() {\n return $this->fetch('ricerca_'.$this->_layout.'.tpl');\n }", "function parse($template, $data, $return = FALSE)\n\t{\n\t\tglobal $OUT;\n\n\t\t$template = $this->object->load->view($template, '', TRUE);\n\t\t\n\t\tif ($template == '')\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tforeach ($data as $key => $val)\n\t\t{\n\t\t\tif ( ! is_array($val))\n\t\t\t{\n\t\t\t\t$template = $this->_parse_single($key, $val, $template);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$template = $this->_parse_pair($key, $val, $template);\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($return == FALSE)\n\t\t{\n\t\t\t$OUT->final_output = $template;\n\t\t}\n\t\t\n\t\treturn $template;\n\t}", "function _parse($template, $data, $return = FALSE)\n\t{\n\t\tif ($template == '')\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tforeach ($data as $key => $val)\n\t\t{\n\t\t\tif (is_array($val))\n\t\t\t{\n\t\t\t\t$template = $this->_parse_pair($key, $val, $template);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$template = $this->_parse_single($key, (string)$val, $template);\n\t\t\t}\n\t\t}\n\t\t\n\t\t#$template = preg_replace('/\\{.*\\}/','',$template);\n\t\t$patron = '/\\\\'.$this->l_delim.'.*\\\\'.$this->r_delim.'/';\n\t\t#die($patron);\n\t\t$template = preg_replace($patron,'',$template);\n\t\tif ($return == FALSE)\n\t\t{\n\t\t\t$CI =& get_instance();\n\t\t\t$CI->output->append_output($template);\n\t\t}\n\n\t\treturn $template;\n\t}", "public function processaTemplate() {\n return $this->fetch('partita_'.$this->_layout.'.tpl');\n }", "public function parse_template ($val) {\n\t\t$val = str_replace (\n\t\t\tarray (\n\t\t\t\t'\\\\{{', '\\\\}}', '\\\\{%', '\\\\%}', '\\\\{\"', '\\\\\"}', '\\\\{\\'', '\\\\\\'}',\n\t\t\t\t'\\\\{!', '\\\\!}', '\\\\{#', '\\\\#}'\n\t\t\t),\n\t\t\tarray (\n\t\t\t\t'#EOBRACE#', '#ECBRACE#', '#EOBLOCK#', '#ECBLOCK#', '#EOQUOTE#', '#ECQUOTE#',\n\t\t\t\t'#EOQUOTE#', '#ECQUOTE#', '#EOINCLUDE#', '#ECINCLUDE#', '#EOHARDCODE#',\n\t\t\t\t'#ECHARDCODE#'\n\t\t\t),\n\t\t\t$val\n\t\t);\n\t\t$val = preg_replace_callback ('/\\{\\{ ?(.*?) ?\\}\\}/', array ($this, 'replace_vars'), $val);\n\t\t$val = preg_replace_callback ('/\\{[\\'\"] ?(.*?) ?[\\'\"]\\}/', array ($this, 'replace_strings'), $val);\n\t\t$val = preg_replace_callback ('/\\{\\% ?(.*?) ?\\%\\}/', array ($this, 'replace_blocks'), $val);\n\t\t$val = preg_replace_callback ('/\\{\\! ?(.*?) ?\\!\\}/s', array ($this, 'replace_includes'), $val);\n\t\t$val = preg_replace_callback ('/\\{# ?(.*?) ?#\\}/s', array ($this, 'hard_codes'), $val);\n\t\t$val = str_replace (\n\t\t\tarray (\n\t\t\t\t'#EOBRACE#', '#ECBRACE#', '#EOBLOCK#', '#ECBLOCK#', '#EOQUOTE#', '#ECQUOTE#',\n\t\t\t\t'#EOINCLUDE#', '#ECINCLUDE#', '#EOHARDCODE#', '#ECHARDCODE#'),\n\t\t\tarray (\n\t\t\t\t'{{', '}}', '{%', '%}', '{\"', '\"}', '{!', '!}', '{#', '#}'\n\t\t\t),\n\t\t\t$val\n\t\t);\n\t\treturn $val;\n\t}", "protected function ParseTemplate($template, $return = false)\n\t{\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate(\"../includes/converter/templates/\".$template);\n\t\treturn $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate($return);\n\t}", "public function parse()\n\t{\t\n\t if(isset($this->_cache))\n\t {\n\t $identifier = md5($this->_path);\n\t \n\t if (!$template = $this->_cache->get($identifier)) \n\t {\n\t $template = parent::parse();\n\t \n\t //Store the object in the cache\n\t\t \t $this->_cache->store($template, $identifier);\n\t }\n\t \n\t return $template;\n\t }\n\t \n\t return parent::parse();\n\t}", "function parse($template, $data = array(), $return = FALSE)\n\t{\n\t\t$string = $this->ci->load->view($template, $data, TRUE);\n\t\t\n\t\treturn $this->_parse($string, $data, $return);\t\n\t}", "protected function parse() {}", "protected function parseNoParse($template) {\n\t\t$template = preg_replace_callback (\n\t\t\t'/\\{noparse\\}(.*?)\\{\\/noparse\\}/is',\n\t\t\tfunction ($matches) {\n\t\t\t\treturn $this->assignNoParse($matches[1]);\n\t\t\t},\n\t\t\t$template\n\t\t); // {noparse} {/noparse}\n\t\treturn $template;\n\t}", "public function fnTryReadTemplateToken() \n {\n $this->bInTemplateElement = true;\n \n try {\n $this->fnReadTmplToken();\n } catch (InvalidTemplateEscapeError $oException) {\n $this->fnReadInvalidTemplateToken();\n }\n\n $this->bInTemplateElement = false;\n }", "public function getTemplate()\n {\n return isset($this->parseTemplate)?$this->parseTemplate:false;\n }", "public static function parse($template)\n\t{\n\t\t$xsl = '<xsl:template xmlns:xsl=\"' . self::XMLNS_XSL . '\">' . $template . '</xsl:template>';\n\n\t\t$dom = new DOMDocument;\n\t\t$dom->loadXML($xsl);\n\n\t\t$ir = new DOMDocument;\n\t\t$ir->loadXML('<template/>');\n\n\t\tself::parseChildren($ir->documentElement, $dom->documentElement);\n\t\tself::normalize($ir);\n\n\t\treturn $ir;\n\t}", "protected function parseVars($template) {\n\t\t$template = preg_replace_callback(\n\t\t\t'/\\{\\$(.*?)\\}/is',\n\t\t\tfunction ($matches) {\n\t\t\t\treturn $this->assignVar($matches[1]);\n\t\t\t},\n\t\t\t$template\n\t\t); // {$var}\n\t\treturn $template;\n\t}", "public function parse($template, $vars)\n {\n $old_TMPL = FALSE;\n\n if( !isset(ee()->TMPL))\n {\n ee()->load->library('template');\n ee()->TMPL = new EE_Template();\n }\n else\n {\n $old_TMPL = ee()->TMPL;\n }\n\n $template = ee()->functions->prep_conditionals($template, array($vars));\n $template = ee()->TMPL->parse_variables($template, array($vars));\n\n ee()->TMPL->template = '';\n ee()->TMPL->parse($template);\n ee()->TMPL->template = ee()->TMPL->parse_globals(ee()->TMPL->template);\n\n $template = ee()->TMPL->template;\n\n if($old_TMPL)\n {\n ee()->TMPL = $old_TMPL;\n }\n\n return $template;\n }", "function get_template()\n {\n }", "private function _parse_template($extra = null)\n\t\t{\n\t\t\t// Create an alias of the template file property to save space\n\t\t\t$template = $this->_template;\n\n\t\t\t// Remove any PHP-style comments from the template\n\t\t\t$comment_pattern = ['#/\\*.*?\\*/#s','#(?<!:)//.*#'];\n\t\t\t$template = preg_replace($comment_pattern, NULL, $template);\n\n\t\t\t// Extract the main entry loop from the file\n\t\t\t$pattern = '#.*{loop}(.*){/loop}.*#is';\n\t\t\t$entry_template = preg_replace($pattern, \"$1\", $template);\n\n\t\t\t// Extract the header from the template if one exists\n\t\t\t$header = trim(preg_replace('/^(.*)?{loop.*$/is', \"$1\", $template));\n\n\t\t\t if( $header===$template )\n\t {\n\t $header = NULL;\n\t }\n\n\t // Extract the footer from the template if one exists\n\t $footer = trim(preg_replace('#^.*?{/loop}(.*)$#is', \"$1\", $template));\n\t if( $footer===$template )\n\t {\n\t $footer = NULL;\n\t }\n\n\t // Define a regex to match any template tag\n \t\t$tag_pattern = '/{(\\w+)}/';\n\n \t\t//Curry the function that will replace the tags with entry data\n \t\t$callback = $this->_curry('Template::replace_tags',2);\n\n \t\t// Process each entry and insert its values into the loop\n \t\t$markup = NULL;\n\n \t\tfor($i=0, $c = count($this->entries); $i<$c; ++$i)\n \t\t{\n \t\t\t$markup.=preg_replace_callback($tag_pattern, $callback(serialize($this->entries[$i])), $entry_template);\n \t\t}\n\n \t\t//If extra data was passed to fill the header/footer, parse it here\n \t\tif(is_object($extra))\n \t\t{\n \t\t\tforeach ($extra as $key => $props) {\n \t\t\t\t$$key = preg_replace_callback($tag_pattern, $callback(serialize($extra->$key)), $$key);\n \t\t\t}\n \t\t}\n\n \t\t// Return the formatted entries with the header and footer reattached\n\t\t\treturn $header . $markup . $footer;\n\t\t}", "private function _prepareTemplate()\r\n {\r\n $this->_template = array();\r\n $this->_prepareTemplateDirectory($this->_templateXml->children(), $this->_template);\r\n }", "protected function _run() {\n $tmpContent = $this->_content;\n $this->_content = $this->_getCurrentTemplateContent();\n $spaceContent = $this->_parse();\n $this->_content = $tmpContent;\n $content = '';\n\n if(!$spaceContent) {\n $spaceContent = $this->_parse();\n }\n\n $this->_parseParams();\n $news = Newslog_Models_Mapper_NewsMapper::getInstance()->fetchAll(null, array('created_at ' . $this->_orderDirection), $this->_limit, 0);\n\n if(!is_array($news) || empty($news)) {\n return 'You don\\'t have news yet.';\n }\n\n $this->_spaceContent = $spaceContent;\n foreach($news as $newsItem) {\n if(Tools_Security_Acl::isAllowed(Tools_Security_Acl::RESOURCE_ADMINPANEL)) {\n $spaceContent = '<input type=\"hidden\" class=\"news-list-hidden news-list-hidden-' . $newsItem->getId() . '\" />' . $this->_spaceContent;\n }\n $content .= preg_replace('~{\\$' . self::NEWS_WIDGET_NAME . ':(.+)}~uU', '{$' . self::NEWS_WIDGET_NAME . ':' . $newsItem->getPageId() . ':$1}', $spaceContent);\n }\n $parser = new Tools_Content_Parser($content, array());\n return $parser->parseSimple();\n }", "public function processTemplate($template = '') {\n\t\tif(is_object($this->registry->get('config')) && $this->registry->get('config')->get('embed_mode') == true ){\n\t\t \t//get template if it was set earlier\n\t\t\tif (empty($template)) {\n\t\t\t\t$template = $this->view->getTemplate();\n\t\t\t}\n\t\t\t//only substitute the template for page templates\n\t\t\tif(substr($template, 0, 6) == 'pages/' && substr($template, 0, 6) != 'embed/'){\n\t\t \t//load special headers for embed as no page/layout needed\n\t \t\t$this->addChild('responses/embed/head', 'head');\n\t \t$this->addChild('responses/embed/footer', 'footer');\n\t \t$template = preg_replace('/pages\\//', 'embed/', $template);\t\t\t\n\t\t\t}\n\t\t}\n\t\n\t\tif (!empty($template)) {\n\t\t\t$this->view->setTemplate($template);\n\t\t}\n\t\t$this->view->assign('block_details',$this->block_details);\n\t\t$this->view->assign(\"children_blocks\", $this->getChildrenBlocks());\n\t\t$this->view->enableOutput();\n\t}", "abstract public function getTemplate();", "public function template();", "public function constructTemplate(){\n try {\n // Sparql11query.g:251:3: ( OPEN_CURLY_BRACE ( constructTriples )? CLOSE_CURLY_BRACE ) \n // Sparql11query.g:252:3: OPEN_CURLY_BRACE ( constructTriples )? CLOSE_CURLY_BRACE \n {\n $this->match($this->input,$this->getToken('OPEN_CURLY_BRACE'),self::$FOLLOW_OPEN_CURLY_BRACE_in_constructTemplate870); \n // Sparql11query.g:252:20: ( constructTriples )? \n $alt32=2;\n $LA32_0 = $this->input->LA(1);\n\n if ( (($LA32_0>=$this->getToken('TRUE') && $LA32_0<=$this->getToken('FALSE'))||$LA32_0==$this->getToken('IRI_REF')||$LA32_0==$this->getToken('PNAME_NS')||$LA32_0==$this->getToken('PNAME_LN')||($LA32_0>=$this->getToken('VAR1') && $LA32_0<=$this->getToken('VAR2'))||$LA32_0==$this->getToken('INTEGER')||$LA32_0==$this->getToken('DECIMAL')||$LA32_0==$this->getToken('DOUBLE')||($LA32_0>=$this->getToken('INTEGER_POSITIVE') && $LA32_0<=$this->getToken('DOUBLE_NEGATIVE'))||($LA32_0>=$this->getToken('STRING_LITERAL1') && $LA32_0<=$this->getToken('STRING_LITERAL_LONG2'))||$LA32_0==$this->getToken('BLANK_NODE_LABEL')||$LA32_0==$this->getToken('OPEN_BRACE')||$LA32_0==$this->getToken('OPEN_SQUARE_BRACE')) ) {\n $alt32=1;\n }\n switch ($alt32) {\n case 1 :\n // Sparql11query.g:252:20: constructTriples \n {\n $this->pushFollow(self::$FOLLOW_constructTriples_in_constructTemplate872);\n $this->constructTriples();\n\n $this->state->_fsp--;\n\n\n }\n break;\n\n }\n\n $this->match($this->input,$this->getToken('CLOSE_CURLY_BRACE'),self::$FOLLOW_CLOSE_CURLY_BRACE_in_constructTemplate875); \n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "function show_parsed(){ // parsing template (if needed) and showing the result of parsing\n\tif (isset($this->result)) echo $this->result;\n\telse {\n\t\t$this->parse();\n\t\techo $this->result;\n\t}\n}", "function templateToUse() {\n\t\t// loop until templateType = name | custom\n\t\t$templateType = $this->getTemplateType();\n\t\t$templateCustom = $this->getTemplateCustom();\n\t\t$templateName = $this->getTemplateName();\n\t\t$articleName = $this->getTitleArticle();\n\t\t$articleId = $this->getId();\n\t\t$parent = $this->parent();\n\t\t\n\t\t$i = 0;\n\t\twhile ($templateType != 'name' && $templateType != 'custom' && $parent !== null) {\n\t\t\t$templateType = $parent->getTemplateType();\n\t\t\t$templateCustom = $parent->getTemplateCustom();\n\t\t\t$templateName = $parent->getTemplateName();\n\t\t\t$articleName = $parent->getTitleArticle();\n\t\t\t$articleId = $parent->getId();\n\t\t\t$parent = $parent->parent();\n\t\t}\n\t\t\n\t\t/*\n\t\techo \"<br><br>templateType: \" . $templateType;\n\t\techo \"<br>templateCustom: \" . $templateCustom;\n\t\techo \"<br>templateName: \" . $templateName;\n\t\techo \"<br>articleName: \" . $articleName;\n\t\techo \"<br>articleID: $articleId\";\n\t\t// */\n\t\t\n\t\t$templates = polarbear_getTemplates();\n\t\t\n\t\tpb_pqp_log_speed(\"article templateToUse\");\n\t\t\n\t\tif ($templateType == 'custom') {\n\t\t\treturn $templateCustom;\n\t\t} else if (isset($templates[$templateName])) {\n\t\t\treturn $templates[$templateName]['file'];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t}", "public function fnReadInvalidTemplateToken() \n {\n for (; $this->iPos < mb_strlen($this->sInput); $this->iPos++) {\n switch (Utilities::fnGetCharAt($this->sInput, $this->iPos)) {\n case \"\\\\\":\n ++$this->iPos;\n break;\n\n case \"$\":\n if (Utilities::fnGetCharAt($this->sInput, $this->iPos + 1) != \"{\") {\n break;\n }\n // falls through\n\n case \"`\":\n return $this->fnFinishToken(\n TokenTypes::$aTypes['invalidTemplate'], \n mb_substr($this->sInput, $this->iStart, $this->iPos - $this->iStart)\n );\n\n // no default\n }\n }\n $this->fnRaise($this->iStart, \"Unterminated template\");\n }", "public function getTemplate() {}", "public function get_template()\n {\n }", "public function get_template()\n {\n }", "public function parse($template, $defaultExtension = false): string\n {\n return $this->twigEnv->render($template . ($defaultExtension ? self::DEFAULT_EXTENSION : ''), $this->variables);\n }", "protected function parse($template, $data = array())\n {\n $view = $this->app['view'];\n\n return $view->renderAsStr($template, $data);\n }", "public function parse($template, $data, $return = FALSE)\r\n\t{\r\n\t\t$template = $this->CI->load->view($template, $data, TRUE);\r\n\t\t$template = $this->_parse_double($template, $data);\r\n\t\treturn $this->_parse($template, $data, $return);\r\n\t}", "public function initTemplate() {}", "protected function compile()\n\t{\n\t\t$lexer = new Lexer($this->template->getEnvironment());\n\t\t$stream = $lexer->tokenize(file_get_contents($this->filename), basename($this->filename));\n\n\t\t// unique class based on the filename\n\t\t// @todo fix problem with '-' in classes\n\t\t$class = $this->template->getEnvironment()->getCacheFilename($this->filename);\n\t\t$class = 'S' . substr($class, 0, -8) . '_Template';\n\n\t\t// writer object which contains the parsed PHP code\n\t\t$writer = new Writer();\n\t\t$writer->write(\"<?php\\n\");\n\t\t$writer->write(\"\\n\");\n\t\t$writer->write('namespace Spoon\\Template;' . \"\\n\");\n\t\t$writer->write(\"\\n\");\n\t\t$writer->write('/* ' . $this->filename . ' */' . \"\\n\");\n\t\t$writer->write(\"class $class extends Renderer\\n\");\n\t\t$writer->write(\"{\\n\");\n\t\t$writer->indent();\n\t\t$writer->write('protected function display(array $context)' . \"\\n\");\n\t\t$writer->write(\"{\\n\");\n\t\t$writer->indent();\n\n\t\t$tags = $this->template->getEnvironment()->getTags();\n\n\t\t$token = $stream->getCurrent();\n\t\twhile(!$stream->isEof())\n\t\t{\n\t\t\tswitch($token->getType())\n\t\t\t{\n\t\t\t\tcase Token::TEXT:\n\t\t\t\t\t$text = new TextNode($stream, $this->template->getEnvironment());\n\t\t\t\t\t$text->compile($writer);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Token::VAR_START:\n\t\t\t\t\t$stream->next();\n\t\t\t\t\t$variable = new VariableNode($stream, $this->template->getEnvironment());\n\t\t\t\t\t$variable->compile($writer);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Token::BLOCK_START:\n\t\t\t\t\t$token = $stream->next();\n\n\t\t\t\t\t// validate tag existence\n\t\t\t\t\tif(!isset($tags[$token->getValue()]))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\tsprintf('There is no such template tag \"%s\"', $token->getValue()),\n\t\t\t\t\t\t\t$token->getLine(),\n\t\t\t\t\t\t\t$this->filename\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$node = new $tags[$token->getValue()]($stream, $this->template->getEnvironment());\n\t\t\t\t\t$node->compile($writer);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif($token->getType() !== Token::EOF)\n\t\t\t{\n\t\t\t\t$token = $stream->next();\n\t\t\t}\n\n\t\t\telse break;\n\t\t}\n\n\t\t$writer->outdent();\n\t\t$writer->write(\"}\\n\");\n\t\t$writer->outdent();\n\t\t$writer->write(\"}\\n\");\n\t\treturn $writer->getSource();\n\t}", "public function parse($params = [])\n {\n if (empty($params))\n {\n return;\n }\n\n foreach($params as $key => $value)\n {\n $this->template = str_replace('{$' . $key . '}', $value, $this->template);\n }\n }", "protected function content_template() {}", "protected function content_template() {}", "protected function _parseTemplate($key)\n {\n $data = array(\n '{:class}' => $this->_class,\n '{:extends}' => $this->_extends,\n '{:model_name}' => $this->_model_name,\n );\n \n return str_replace(\n array_keys($data),\n array_values($data),\n $this->_tpl[$key]\n );\n }", "private function parseStatus($data, $template) {\n\n /* replace all {tags} */\n preg_match_all('/{(.+)}/U', $template, $m);\n\n for($i=0,$j=count($m[0]);$i<$j;$i++) {\n \n $name = $m[1][$i];\n \n /* twitter value found */ \n $d = false;\n if(isset($data[$name])) {\n $d = $data[$name]; \n } else if(isset($data['user'][$name])) {\n $d = $data['user'][$name]; \n }\n\n /* replace data */\n if($d) {\n\n switch($name) {\n\n /* parse status links */\n case 'text': \n if($this->parseLink) {\n $d = ($this->parseLinks($d));\n }\n break;\n\n case 'created_at':\n $d = \"{DATE:$d}\";\n break;\n } \n\n $template = str_replace($m[0][$i], $d, $template);\n }//endif\n }//endfor\n\n return $template;\n }", "public function loadTemplate()\n\t\t{\n\t\t}", "abstract public function getTemplate($tpl);", "public function replace_structure_variables($template)\n {\n // url, uri, and slug are handled by Structure\n $variables = array(\n // 'structure:page_url_for:',\n // 'structure:page_uri_for:',\n 'structure:page_title_for:',\n // 'structure:page_slug_for:'\n );\n\n $this->tagdata = $template;\n\n foreach ($variables as $var)\n {\n $this->structure_variable = $var;\n\n preg_replace_callback(\"/\".LD. preg_quote($var) .\"(.*?)\".RD.\"/\", array(&$this, '_replace_structure_variables'), $this->tagdata);\n }\n\n return $this->tagdata;\n }", "protected function content_template()\n\t{\n\t\t//\n\t}", "public static function parse()\n\t{\n\t\t// get the template\n\t\t$tpl = Spoon::get('template');\n\n\t\t// logged in\n\t\tif(FrontendProfilesAuthentication::isLoggedIn())\n\t\t{\n\t\t\t// get profile\n\t\t\t$profile = FrontendProfilesAuthentication::getProfile();\n\n\t\t\t// display name set?\n\t\t\tif($profile->getDisplayName() != '') $tpl->assign('profileDisplayName', $profile->getDisplayName());\n\n\t\t\t// no display name -> use email\n\t\t\telse $tpl->assign('profileDisplayName', $profile->getEmail());\n\n\t\t\t// show logged in\n\t\t\t$tpl->assign('isLoggedIn', true);\n\t\t}\n\n\t\t// ignore these url's in the querystring\n\t\t$ignoreUrls = array(\n\t\t\tFrontendNavigation::getURLForBlock('profiles', 'login'),\n\t\t\tFrontendNavigation::getURLForBlock('profiles', 'register'),\n\t\t\tFrontendNavigation::getURLForBlock('profiles', 'forgot_password')\n\t\t);\n\n\t\t// querystring\n\t\t$queryString = (isset($_GET['queryString'])) ? SITE_URL . '/' . urldecode($_GET['queryString']) : SELF;\n\n\t\t// check all ignore urls\n\t\tforeach($ignoreUrls as $url)\n\t\t{\n\t\t\t// querystring contains a boeboe url\n\t\t\tif(stripos($queryString, $url) !== false)\n\t\t\t{\n\t\t\t\t$queryString = '';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// no need to add this if its empty\n\t\t$queryString = ($queryString != '') ? '?queryString=' . urlencode($queryString) : '';\n\n\t\t// useful urls\n\t\t$tpl->assign('loginUrl', FrontendNavigation::getURLForBlock('profiles', 'login') . $queryString);\n\t\t$tpl->assign('registerUrl', FrontendNavigation::getURLForBlock('profiles', 'register'));\n\t\t$tpl->assign('forgotPasswordUrl', FrontendNavigation::getURLForBlock('profiles', 'forgot_password'));\n\t}", "public static function parse(): void\n {\n // get the template\n $tpl = FrontendModel::getContainer()->get('templating');\n\n // logged in\n if (FrontendProfilesAuthentication::isLoggedIn()) {\n // get profile\n $profile = FrontendProfilesAuthentication::getProfile();\n\n // display name set?\n if ($profile->getDisplayName() != '') {\n $tpl->assign('profileDisplayName', $profile->getDisplayName());\n } else {\n // no display name -> use email\n $tpl->assign('profileDisplayName', $profile->getEmail());\n }\n\n // show logged in\n $tpl->assign('isLoggedIn', true);\n }\n\n // ignore these urls in the query string\n $ignoreUrls = [\n FrontendNavigation::getUrlForBlock('Profiles', 'Login'),\n FrontendNavigation::getUrlForBlock('Profiles', 'Register'),\n FrontendNavigation::getUrlForBlock('Profiles', 'ForgotPassword'),\n ];\n\n // query string\n $queryString = FrontendModel::getRequest()->query->has('queryString')\n ? SITE_URL . '/' . urldecode(FrontendModel::getRequest()->query->get('queryString'))\n : SITE_URL . FrontendModel::get('url')->getQueryString();\n\n // check all ignore urls\n foreach ($ignoreUrls as $url) {\n // query string contains a boeboe url\n if (mb_stripos($queryString, $url) !== false) {\n $queryString = '';\n break;\n }\n }\n\n // no need to add this if its empty\n $queryString = ($queryString !== '') ? '?queryString=' . rawurlencode($queryString) : '';\n\n // useful urls\n $tpl->assign('loginUrl', FrontendNavigation::getUrlForBlock('Profiles', 'Login') . $queryString);\n $tpl->assign('registerUrl', FrontendNavigation::getUrlForBlock('Profiles', 'Register'));\n $tpl->assign('forgotPasswordUrl', FrontendNavigation::getUrlForBlock('Profiles', 'ForgotPassword'));\n }", "private function parse()\n\t{\n\t\t// parse datagrids\n\t\tif(!empty($this->datagrids)) $this->tpl->assign('datagrids', $this->datagrids);\n\t}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "function parsePost($uname,$ulink,$umail,$datetime,$gravUrl,$body,$nametmpl) {\n\t\t//first parse the name template\n $tags = array(\"<%user-name%>\",\"<%user-link%>\",'<%user-email%>'); \n $values = array($uname,$ulink,$umail);\n\t\t$nametmpl = $this->_parse($tags,$values,$nametmpl);\n\t\t\n\t\t//now parse the postbody template\n $tags = array(\"<%name%>\",\"<%date%>\",\"<%time%>\",\"<%gravatar%>\",\"<%body%>\");\n $values = \tarray(\t$nametmpl,\n\t\t\t\t\t\tdate($this->date,$datetime),\n\t\t\t\t\t\tdate($this->time,$datetime),\n\t\t\t\t\t\t$gravUrl,\n\t\t\t\t\t\t$body);\n\t\t\t\t\t\t\n\t\treturn $this->_parse($tags,$values,$this->postBody);\t\t\t\t\t\t\n\t}", "function prepareTemplate (\n\t$filepath,\t//template file to load\n\t$canonical='',\t//the canonical URL for the page, so that search engines can ignore querystring spam from links\n\t$title=NULL\t//HTML title to use, if NULL, existing `<title>` is kept\n) {\n\tglobal $LANG, $MODS, $MEMBERS;\n\t\n\t//load the template into DOM for manipulation. see 'domtemplate.php' for code and\n\t//<camendesign.com/dom_templating> for documentation of this object\n\t$template = new DOMTemplate (file_get_contents ($filepath));\n\t\n\t//fix all absolute URLs (i.e. if NNF is running in a folder):\n\t//(this also fixes the forum-title home link \"/\" when NNF runs in a folder)\n\tforeach ($template->query ('//*/@href, //*/@src, //*/@content') as $node) if ($node->nodeValue[0] == '/')\n\t\t//prepend the base path of the forum ('/' if on root, '/folder/' if running in a sub-folder)\n\t\t$node->nodeValue = FORUM_PATH.ltrim ($node->nodeValue, '/')\n\t;\n\t\n\t/* translate!\n\t ---------------------------------------------------------------------------------------------------------------*/\n\t//before we start changing element content, we run through the language translation, if necessary;\n\t//if the current user-chosen language is in the list of available language translations for this theme,\n\t//execute the array of XPath string replacements in the translation. see the 'lang.*.php' files for details\n\tif (isset ($LANG[LANG]['strings'])) $template->set ($LANG[LANG]['strings'], true)->setValue ('/html/@lang', LANG);\n\t//template the language chooser\n\tif (THEME_LANGS) {\n\t\t$item = $template->repeat ('.nnf_lang');\n\t\t//build the list for each additional language\n\t\tforeach ($LANG as $code => $lang) $item->set (array (\n\t\t\t'./@value'\t=> $code,\n\t\t\t'.'\t\t=> $lang['name']\n\t\t))->remove (array (\n\t\t\t'./@selected'\t=> !($code == LANG)\n\t\t))->next ();\n\t} else {\n\t\t$template->remove ('#nnf_lang');\n\t}\n\t\n\t/* HTML <head>\n\t -------------------------------------------------------------------------------------------------------------- */\n\t//if no title is provided, the one already in the template remains (likely for translation purposes)\n\tif (!is_null ($title)) $template->setValue ('/html/head/title', $title);\n\t//remove 'custom.css' stylesheet if 'custom.css' is missing\n\tif (!file_exists (THEME_ROOT.'custom.css')) $template->remove ('//link[contains(@href,\"custom.css\")]');\n\t//set the canonical URL\n\tif ($canonical) $template->setValue ('/html/head/meta[@rel=\"canonical\"]/@href', $canonical);\n\t\n\t/* site header\n\t -------------------------------------------------------------------------------------------------------------- */\n\t//site title\n\t$template->setValue ('.nnf_forum-name', FORUM_NAME);\n\t\n\t//are we in a sub-folder? if so, build the breadcrumb navigation\n\tif (PATH) for (\n\t\t//split the path by '/' to get each sub-forum\n\t\t$items = explode ('/', trim (PATH, '/')), $item = $template->repeat ('.nnf_breadcrumb'),\n\t\t$i = 0; $i < count ($items); $i++\n\t) $item->set (array (\n\t\t'a.nnf_subforum-name'\t\t=> $items[$i],\n\t\t'a.nnf_subforum-name@href'\t=> url (\n\t\t\t//reconstruct the URL from each sub-forum up to the current one\n\t\t\timplode ('/', array_map ('safeURL', array_slice ($items, 0, $i+1))).'/'\n\t\t)\n\t))->next ();\n\t//not in a sub-folder? remove the breadcrumb navigation\n\tif (!PATH) $template->remove ('.nnf_breadcrumb');\n\t\n\t/* site footer\n\t -------------------------------------------------------------------------------------------------------------- */\n\t//are there any local mods?\tcreate the list of local mods\n\tif (!empty ($MODS['LOCAL'])):\t$template->setValue ('#nnf_mods-local-list', theme_nameList ($MODS['LOCAL']), true);\n\t\t\t\telse:\t$template->remove ('#nnf_mods-local');\t//remove the local mods list section\n\tendif;\n\t//are there any site mods?\tcreate the list of mods\n\tif (!empty ($MODS['GLOBAL'])):\t$template->setValue ('#nnf_mods-list', theme_nameList ($MODS['GLOBAL']), true);\n\t\t\t\t else:\t$template->remove ('#nnf_mods');\t\t//remove the mods list section\n\tendif;\n\t//are there any members?\tcreate the list of members\n\tif (!empty ($MEMBERS)):\t\t$template->setValue ('#nnf_members-list', theme_nameList ($MEMBERS), true);\n\t\t\t else:\t\t$template->remove ('#nnf_members');\t\t//remove the members list section\n\tendif;\n\t\n\t//set the name of the signed-in user\n\t$template->setValue ('.nnf_signed-in-name', NAME)->remove (\n\t\t//remove the relevant section for signed-in / out\n\t\tAUTH_HTTP ? '.nnf_signed-out' : '.nnf_signed-in'\n\t);\n\t\n\treturn $template;\n}", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "protected function content_template() {\n\t}", "public function render($template)\n {\n $filter = $this->escape;\n $delims = $this->delimiters();\n\n // The substitution handler:\n $callback = function ($matches) use ($filter) {\n $key = trim($matches[1]);\n if (substr($key, 0, 1) == '&') {\n $key = trim(substr($key, 1));\n $content = $this->node($key)->toString();\n } else {\n $content = $filter($this->node($key)->toString());\n }\n return $content;\n };\n\n // Substitute the template\n $start = preg_quote($delims[0]);\n $end = preg_quote($delims[1]);\n $content = preg_replace_callback(\"/{$start}(.+?){$end}/s\", $callback, (string) $template);\n\n return $content;\n }", "protected static function parse_start(nodes\\Tag $node) {\n\t\t\n\t $text_handler = '\\phphaml\\haml\\handlers\\Text';\n\t \n\t\tif($node->content[0] == '%') {\n\t\t\tif(!preg_match(self::RE_TAG, substr($node->content, 1), $match)) {\n\t\t\t static::$parser->force_handler($text_handler);\n\t\t\t return static::$parser->handle();\n\t\t\t}\n\t\t\t\n\t\t\t$node->content = substr($node->content, strlen($match[0]) + 1);\n\t\t\t$node->tag_name = $match[0];\n\t\t}\n\t\t\n\t\t$id = false;\n\t\t$classes = array();\n\t\twhile($node->content[0] == '.' or $node->content[0] == '#') {\n\t\t\t$type = $node->content[0] == '.' ? 'class' : 'id';\n\t\t\t\n\t\t\tif(!preg_match($type == 'id' ? self::RE_ID : self::RE_CLASS, substr($node->content, 1), $match)) {\n\t\t\t $node->remove();\n\t\t\t throw new NotHandledException();\n\t\t }\n\t\t\t\n\t\t\t$node->content = substr($node->content, strlen($match[0]) + 1);\n\t\t\t\n\t\t\tif($type == 'class')\n\t\t\t $classes[] = '\\'' . $match[0] . '\\'';\n\t\t\telse\n\t\t\t $id = $match[0];\n\t\t}\n\t\t\n\t\tif($classes)\n\t\t $node->attributes[] = array('\\'class\\'', $classes);\n\t\tif($id)\n\t\t $node->attributes[] = array('\\'id\\'', '\\'' . $id . '\\'');\n\t\t\n\t\tstatic::parse_html_attributes($node);\n\t\t\n\t}", "protected function parseLoop($template) {\n\t\t$template = preg_replace_callback(\n\t\t\t'/\\{loop \\$(.*?)\\}(.*?)\\{\\/loop\\}/is',\n\t\t\tfunction ($matches) {\n\t\t\t\treturn $this->assignLoop($matches[1], $matches[2]);\n\t\t\t},\n\t\t\t$template\n\t\t); // {loop $myloop} $myloop_loop['test'] {/loop}\n\t\treturn $template;\n\t}", "protected function _content_template() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore \n\t\t$this->content_template();\n\t}", "public function template_post_parse($template, $sub)\n {\n /** @var \\EE_Template $eeTemplateService */\n $eeTemplateService = ee()->TMPL;\n\n /** @var \\EE_Config $eeConfigService */\n $eeConfigService = ee()->config;\n\n /** @var \\EE_Extensions $eeExtensionsService */\n $eeExtensionsService = ee()->extensions;\n\n $type = $eeTemplateService->template_type;\n\n $groupName = $eeTemplateService->group_name;\n $templateName = $eeTemplateService->template_name;\n\n $currentTemplate = \"{$groupName}/{$templateName}\";\n $notFoundTemplate = $eeConfigService->item('site_404');\n\n if ($type === 'webpage' ||\n $type === '404' ||\n $currentTemplate === $notFoundTemplate\n ) {\n // Play nice with other extensions\n if (isset($eeExtensionsService->last_call) &&\n $eeExtensionsService->last_call\n ) {\n $template = $eeExtensionsService->last_call;\n }\n\n // Do nothing if not final template\n if ($sub !== false) {\n return $template;\n }\n\n // Is HTML minification disabled\n if ($eeConfigService->item('marksmin_enabled') !== true) {\n return $template;\n }\n\n $options = array(\n 'xhtml' => ee()->config->item('marksmin_xhtml')\n );\n\n return \\Minify_HTML::minify($template, $options);\n }\n\n return $template;\n }", "protected function _content_template() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore\n\t\t$this->content_template();\n\t}", "protected function _content_template() {\n\t}", "function parseLetterTemplate($template_name, $param=NULL) {\n global $dbAccess;\n $this->db = $dbAccess;\n $data = $this->db->SimpleQuery(\"SELECT * FROM \" . TBL_LETTER_TEMPLATES . \" WHERE letter_pseudo_name=\\\"\" . $template_name . \"\\\"\");\n\n $tmpl_data = $data[0];\n if (count($tmpl_data) > 0) {\n if (isset($param[\"mail_vars\"])) {\n $vars = $param[\"mail_vars\"];\n } else {\n $vars = array();\n }\n\n $message = $this->srepltags_array($vars, $tmpl_data[\"body\"]);\n return $message;\n } else {\n return false;\n }\n }", "protected function parse($data)\n {\n $base = dirname(__FILE__) . '/Templates';\n\n $root = (string) $this->path;\n\n $callback = function (&$value) use ($base, $root)\n {\n $value = str_replace('$BASE$', $base, $value);\n\n $value = str_replace('$ROOT$', $root, $value);\n };\n\n array_walk_recursive($data, $callback);\n\n return $data;\n }", "abstract public function parse ();", "function readTemplates( $input )\n\t{\n\t\t$this->_currentInput = $input;\n\n\t\t$templates\t=\t$this->parseString( $input );\n\t\t\n\t\treturn\t$templates;\n\t}", "protected function initTemplate()\n {\n /** @var WorldState $state */\n /** @var ExecHelper $exec */\n $tplPhp = <<<EOS\nWorld. From: <?=\\$state->name?>\n\nExec URL: <?=\\$exec->url( 'someExec', ['a'=>1] )?><?php \\$formBody = \"<input type=\\\"text\\\" name=\\\"someInput\\\" value=\\\"2\\\">\\n\"?>\n\nExec Form:\n<?=\\$exec->wrapForm( 'otherExec', 'POST', \\$formBody ) ?>\nEOS;\n $this->template = new PhpTemplate( $this, null, $tplPhp );\n }", "public static function handle() {\n\t\t\n\t\tif(!static::$multiline) {\n\t\t\t$node = nodes\\Tag::new_from_parser(static::$parser);\n\t\t\tstatic::parse_start($node);\n\t\t\t\n\t\t\tif(static::$multiline) {\n\t\t\t\tstatic::$parser->force_handler(get_called_class());\n\t\t\t\tstatic::$parser->expect_indent(Parser::EXPECT_MORE);\n\t\t\t}\n\t\t} else {\n\t\t\t$node = static::$parser->context();\n\t\t\t$node->content .= ' ' . static::$parser->content();\n\t\t\t\n\t\t\tswitch(static::$multiline) {\n\t\t\t\tcase self::MULTILINE_HTML_ATTRIBUTES:\n\t\t\t\t\tstatic::$multiline = false;\n\t\t\t\t\tstatic::parse_html_attributes($node);\n\t\t\t\tbreak;\n\t\t\t\tcase self::MULTILINE_RUBY_ATTRIBUTES:\n\t\t\t\t\tstatic::$multiline = false;\n\t\t\t\t\tstatic::parse_ruby_attributes($node);\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$node->exception('Sanity error: unknown multiline modifier');\n\t\t\t}\n\t\t\t\n\t\t\tif(static::$multiline)\n\t\t\t static::$parser->force_handler(get_called_class());\n\t\t}\n\t\t\n\t}", "protected function content_template()\n {\n }" ]
[ "0.7963959", "0.67730635", "0.6405399", "0.6391035", "0.6383359", "0.6292401", "0.6166923", "0.6120286", "0.60562384", "0.6001131", "0.59994847", "0.595612", "0.58189416", "0.5811472", "0.58111817", "0.5807173", "0.5764626", "0.5761209", "0.5728857", "0.5715737", "0.56773466", "0.56754076", "0.5618272", "0.5561507", "0.55496067", "0.5534281", "0.54830086", "0.5459896", "0.5407958", "0.5406892", "0.5402595", "0.54014033", "0.53754216", "0.5373069", "0.5361788", "0.53377974", "0.53300035", "0.53276503", "0.5297831", "0.5289173", "0.52794987", "0.5249152", "0.5248508", "0.5244696", "0.521661", "0.5208065", "0.51979405", "0.51953334", "0.5193991", "0.5186883", "0.51866686", "0.51701033", "0.51600915", "0.51491", "0.51403886", "0.51403886", "0.51396054", "0.51243913", "0.5119641", "0.51105607", "0.51081496", "0.5108073", "0.50986123", "0.50627875", "0.50550807", "0.50546354", "0.5052993", "0.5052993", "0.5052321", "0.5052321", "0.5052321", "0.5052321", "0.50520223", "0.50520223", "0.50475997", "0.50301003", "0.5021745", "0.5021745", "0.5021745", "0.5021745", "0.50151956", "0.50151956", "0.50151956", "0.50151956", "0.50151956", "0.50151956", "0.5013767", "0.5007589", "0.5003676", "0.4987694", "0.49745682", "0.49668828", "0.49538383", "0.49383307", "0.4930312", "0.49299198", "0.4928941", "0.49244356", "0.49236003", "0.49178803", "0.49098277" ]
0.0
-1
Renders the node using the the view renderer.
final public function render() { return $this->_view->getBaseView()->element($this->_name, $this->_data, $this->_options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function renderView();", "protected function render()\n {\n $this->renderer->exec();\n }", "protected function render(){\n //render view\n \n }", "protected function _render()\n {\n }", "function Render() {\n $this->RenderChildren();\n }", "private function renderView()\n\t{\n\t\tff_renderView(substr(__CLASS__, 7));\n\t}", "private function renderView()\n\t{\n\t\tff_renderView(substr(__CLASS__, 7));\n\t}", "public abstract function render();", "public abstract function render();", "public function render() {\r\n\t\t\r\n\t}", "public function render() {\n\t\t$this->rendered = false;\n\t\tob_start();\n\t\t\t//RENDERING VIEW HERE\n\t\t\trequire_once(\"pages/View/\" . $this->_view);\n\t\t\t$this->content = ob_get_contents();\n\t\tob_end_clean();\n\t\t$this->rendered = true;\n\t\treturn ($this->content);\n\t}", "abstract public function render();", "abstract public function render();", "abstract public function render();", "abstract public function render();", "abstract public function render();", "abstract public function render();", "function render()\n\t{\n\t}", "public function render()\n {\n $loggedUser = Auth::guard('moonlight')->user();\n $site = App::make('site');\n\n $currentClassId = $this->currentElement ? $site->getClassId($this->currentElement) : null;\n $parentClassId = $this->parentNode ? $site->getClassId($this->parentNode) : null;\n\n $bindings = $this->parentNode\n ? $this->rubric->getBindingsByClass($site->getClass($this->parentNode))\n : $this->rubric->getRootBindings();\n $elements = [];\n\n foreach ($bindings as $binding) {\n $item = $site->getItemByClassName($binding->className);\n $mainProperty = $item->getMainProperty();\n $rubricElements = $this->rubric->getElements($binding->className, $this->parentNode, $binding->clause);\n\n foreach ($rubricElements as $element) {\n $elementClassId = $site->getClassId($element);\n $open = Cache::get(\"rubric_node_{$loggedUser->id}_{$this->rubric->getName()}_{$elementClassId}\", false);\n $count = $this->getCount($element);\n\n $children = $open && $count\n ? (new RubricNode($this->rubric, $element, $this->currentElement))->render()\n : null;\n\n $elements[] = (object) [\n 'item_name' => $item->getName(),\n 'item_title' => $item->getTitle(),\n 'browse_url' => $site->getBrowseUrl($element),\n 'edit_url' => $site->getEditUrl($element),\n 'class_id' => $site->getClassId($element),\n 'name' => $element->{$mainProperty},\n 'children' => $children,\n 'has_children' => $count,\n ];\n }\n }\n\n return view('moonlight::components.rubrics.node', [\n 'elements' => $elements,\n 'name' => $this->rubric->getName(),\n 'bind' => 0,\n 'currentClassId' => $currentClassId,\n 'parentClassId' => $parentClassId,\n ]);\n }", "function render ()\n {\n parent::render();\n }", "public function render()\n\t{\n\t\treturn $this->viewFactory->make($this->view)\n\t\t\t->with( 'presenter', $this )\n\t\t\t->render();\n\t}", "function render() {}", "abstract function render();", "public function render()\n {\n \n }", "public function render() {\n\t\t\n\t\tif(!$this->line_number)\n\t\t\t$this->parse();\n\t\t\n\t\t$result = $this->root->render();\n\t\t\n\t\tob_start();\n\t\t\n\t\tStringStream::add_string('result', $result);\n\t\textract($this->variables);\n\t\t$__options = $this->options;\n\t\t$__render_attributes = function($attributes) use ($__options) {\n\t\t nodes\\Tag::render_attributes_html($__options['format'], $__options['attr_wrapper'], $attributes);\n\t\t};\n\t\tinclude 'StringStream://result';\n\t\tStringStream::clear('result');\n\t\t\n\t\treturn rtrim(ob_get_clean());\n\t\t\n\t}", "function render(){\n\t\t\n\t}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {\n\t\tW2P::getInstance()->debug()->_debug_add_content ( \"Executing all modules methods.\" );\n\t\tW2P::getInstance()->modules()->exec_all_functions();\n\t\t\n\t\tW2P::getInstance()->debug()->_debug_add_content ( \"Generating rendering of the view: {$this->view}\" );\n\t\t\n\t\tob_start ();\n\t\tinclude_once (W2P_INCLUDE . W2P::getInstance()->configuration()->layout_path . '/views/' . $this->view . '.phtml');\n\t\t$this->content = ob_get_clean ();\n\t\t\n\t\tW2P::getInstance()->debug()->_debug_add_content ( \"Content of the rendered view\" );\n\t\tW2P::getInstance()->debug()->_debug_add_content ( \"Adding to the project layout\" );\n\t\t\n\t\tinclude (W2P_INCLUDE . W2P::getInstance()->configuration()->layout_path . '/' . $this->layout . '.phtml');\n\t\t\n\t\tW2P::getInstance()->debug()->_debug_add_content ( \"Layout successfully mastered\" );\n\t\t\n\t\tif (W2P::getInstance()->configuration()->debug)\n\t\t\tW2P::getInstance()->debug()->save_debug ( W2P::getInstance()->configuration()->debug_format );\n\t}", "function render() {\n }", "function render() {\n }", "public function render()\n {\n return $this->getRenderer()->render($this);\n }", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();" ]
[ "0.69817185", "0.6945028", "0.6757159", "0.65225804", "0.6485945", "0.6441403", "0.6441403", "0.64333695", "0.64333695", "0.63641447", "0.63601077", "0.6354301", "0.6354301", "0.6354301", "0.6354301", "0.6354301", "0.6354301", "0.63515127", "0.6349761", "0.6346712", "0.6345074", "0.6343263", "0.63333523", "0.63057554", "0.62903327", "0.62835735", "0.62737435", "0.62737435", "0.62737435", "0.62737435", "0.62737435", "0.62737435", "0.62737435", "0.62737435", "0.62737435", "0.62737435", "0.62737435", "0.62737435", "0.62737435", "0.62737435", "0.62737435", "0.62737435", "0.62737435", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.62729186", "0.6249336", "0.624094", "0.624094", "0.6234781", "0.62318474", "0.62318474", "0.62318474", "0.62318474", "0.62318474", "0.62318474", "0.62318474", "0.62318474", "0.62318474", "0.62318474", "0.62318474", "0.62318474", "0.62318474", "0.62318474", "0.62318474", "0.62318474", "0.62318474", "0.62318474" ]
0.64232635
9
Renders the child nodes of this node.
final public function renderChildren() { return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function renderChildren() {}", "function Render() {\n $this->RenderChildren();\n }", "function RenderChildren() {\n if ($this->HasControls()) {\n foreach($this->Controls as $control) {\n $control->Render();\n }\n }\n }", "public function renderChildren()\n\t{\n\t\t$children = '';\n\t\t\n\t\tforeach($this->_children as $child)\n\t\t{\n\t\t\t$children .= \"$child\";\n\t\t}\n\t\t\n\t\treturn $children;\n\t}", "public function renderChildren(): string\n {\n $html = [];\n\n foreach ($this->children as $child) {\n $html[] = $child->render();\n }\n\n $html = implode('', $html);\n\n if ($this instanceof HasTextChild && $this->escapeHtml) {\n $html = htmlspecialchars($html);\n }\n\n return $html;\n }", "public function render()\n {\n return $this->renderChildren();\n }", "public function render( ){\n\t\treturn $this->__childWidget->render();\n\t}", "public function getChildNodes() {}", "public function getChildNodes() {}", "public function getChildNodes();", "protected function renderThenChild() {}", "public function getChildren() {}", "public function getChildren() {}", "public function getChildren() {}", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "private function rec_renderChildren(array $nodes)\n\t{\n\t\tforeach($nodes AS $v)\n\t\t{\n\t\t\tif($v instanceof Component)\n\t\t\t{\n\t\t\t\techo $v->render();\n\t\t\t}\n\t\t\telse\n\t\t\t// Standard HTML\n\t\t\tif(is_array($v))\n\t\t\t{\n\t\t\t\tif(strncmp($v['name'], '{}', 2) != 0)\n\t\t\t\t{\n\t\t\t\t\tthrow new \\Exception('Unrecognized component namespace ' . $v['name']);\n\t\t\t\t}\n\n\t\t\t\t$markup = preg_replace('/{(.*)}/', '', $v['name']);\n\n\t\t\t\tif($markup == 'br')\n\t\t\t\t{\n\t\t\t\t\techo '<br/>';\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\techo '<', $markup;\n\t\t\t\tif(!empty($v['attributes']))\n\t\t\t\t{\n\t\t\t\t\t$attributes = array();\n\t\t\t\t\tforeach($v['attributes'] AS $attr => $value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$attributes[] = $attr . '=\"' . $value . '\"';\n\t\t\t\t\t}\n\t\t\t\t\techo ' ', join(' ', $attributes);\n\t\t\t\t}\n\t\t\t\techo '>';\n\n\t\t\t\tif(is_array($v['value']))\n\t\t\t\t{\n\t\t\t\t\t$this->rec_renderChildren($v['value']);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo $v['value'];\n\t\t\t\t}\n\n\t\t\t\techo '</', $markup, '>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo $v;\n\t\t\t}\n\t\t}\n\t\treturn TRUE;\n\t}", "public function getChildren()\n {\n }", "public function getChildren()\n {\n }", "public function evaluateChildNodes();", "public function getChildElements() {}", "public function beginChildren()\n {\n parent::beginChildren();\n\n $this->call($this->descendCallback);\n }", "function render()\n {\n $res = \"\";\n foreach($this->m_childs as $abstractframe)\n {\n $res.=$abstractframe->render(false);\n }\n return $res;\n }", "public function get_children();", "function getChildNodes() ;", "protected function buildRenderChildrenClosure() {}", "public function iterateChildren();", "public function renderAll() {\n return $this->render($this->getElements());\n }", "function child_div()\r\n {\r\n \r\n $display_content = '<div class=\"opml-browser-children\" id=\"opml-browser-children' . $this->name . $this->nextid;\r\n if ($this->margin != '')\r\n $display_content .= '\" style=\"margin-left:' . $this->margin . ';'; // Indent with a margin\r\n $display_content .= '\">';\r\n return $display_content;\r\n }", "protected function children($item)\n {\n if ($item instanceof Item && $item->hasChildren()) {\n $this->render($item->getChildren());\n }\n }", "public function Children()\n {\n return $this->childrenOfSection('');\n }", "public function render()\n {\n $loggedUser = Auth::guard('moonlight')->user();\n $site = App::make('site');\n\n $currentClassId = $this->currentElement ? $site->getClassId($this->currentElement) : null;\n $parentClassId = $this->parentNode ? $site->getClassId($this->parentNode) : null;\n\n $bindings = $this->parentNode\n ? $this->rubric->getBindingsByClass($site->getClass($this->parentNode))\n : $this->rubric->getRootBindings();\n $elements = [];\n\n foreach ($bindings as $binding) {\n $item = $site->getItemByClassName($binding->className);\n $mainProperty = $item->getMainProperty();\n $rubricElements = $this->rubric->getElements($binding->className, $this->parentNode, $binding->clause);\n\n foreach ($rubricElements as $element) {\n $elementClassId = $site->getClassId($element);\n $open = Cache::get(\"rubric_node_{$loggedUser->id}_{$this->rubric->getName()}_{$elementClassId}\", false);\n $count = $this->getCount($element);\n\n $children = $open && $count\n ? (new RubricNode($this->rubric, $element, $this->currentElement))->render()\n : null;\n\n $elements[] = (object) [\n 'item_name' => $item->getName(),\n 'item_title' => $item->getTitle(),\n 'browse_url' => $site->getBrowseUrl($element),\n 'edit_url' => $site->getEditUrl($element),\n 'class_id' => $site->getClassId($element),\n 'name' => $element->{$mainProperty},\n 'children' => $children,\n 'has_children' => $count,\n ];\n }\n }\n\n return view('moonlight::components.rubrics.node', [\n 'elements' => $elements,\n 'name' => $this->rubric->getName(),\n 'bind' => 0,\n 'currentClassId' => $currentClassId,\n 'parentClassId' => $parentClassId,\n ]);\n }", "public function getChilds();", "public function getAllChildNode()\r\n {\r\n return $this->_childNodes;\r\n }", "public function toHtml() {\n\t\techo '<pre '.$this->getAttributes().'>'.$this->renderChildren().'</pre>';\n\t}", "public function renderTree()\n {\n $structure = $this->_module->treeStructure + $this->_module->dataStructure;\n extract($structure);\n $nodeDepth = $currDepth = $counter = 0;\n $jsSelect = '$('.$this->id.').treeview(\"collapseAll\");';\n $out = Html::beginTag('ul', ['class' => 'kv-tree']) . \"\\n\";\n foreach ($this->_nodes as $node) {\n /**\n * @var Tree $node\n */\n if (!$this->isAdmin && !$node->isVisible() || !$this->showInactive && !$node->isActive()) {\n continue;\n }\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeDepth = $node->$depthAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeLeft = $node->$leftAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeRight = $node->$rightAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeKey = $node->$keyAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeName = $node->$nameAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeIcon = $node->$iconAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeIconType = $node->$iconTypeAttribute;\n\n $isChild = ($nodeRight == $nodeLeft + 1);\n $indicators = '';\n\n if (isset($this->nodeLabel)) {\n $label = $this->nodeLabel;\n $nodeName = is_callable($label) ? $label($node) :\n (is_array($label) ? ArrayHelper::getValue($label, $nodeKey, $nodeName) : $nodeName);\n }\n if ($nodeDepth == $currDepth) {\n if ($counter > 0) {\n $out .= \"</li>\\n\";\n }\n } elseif ($nodeDepth > $currDepth) {\n $out .= Html::beginTag('ul') . \"\\n\";\n $currDepth = $currDepth + ($nodeDepth - $currDepth);\n } elseif ($nodeDepth < $currDepth) {\n $out .= str_repeat(\"</li>\\n</ul>\", $currDepth - $nodeDepth) . \"</li>\\n\";\n $currDepth = $currDepth - ($currDepth - $nodeDepth);\n }\n if (trim($indicators) == null) {\n $indicators = '&nbsp;';\n }\n $nodeOptions = [\n 'data-key' => $nodeKey,\n 'data-lft' => $nodeLeft,\n 'data-rgt' => $nodeRight,\n 'data-lvl' => $nodeDepth,\n 'data-readonly' => static::parseBool($node->isReadonly()),\n 'data-movable-u' => static::parseBool($node->isMovable('u')),\n 'data-movable-d' => static::parseBool($node->isMovable('d')),\n 'data-movable-l' => static::parseBool($node->isMovable('l')),\n 'data-movable-r' => static::parseBool($node->isMovable('r')),\n 'data-removable' => static::parseBool($node->isRemovable()),\n 'data-removable-all' => static::parseBool($node->isRemovableAll()),\n ];\n\n $css = [];\n if (!$isChild) {\n $css[] = 'kv-parent ';\n }\n if (!$node->isVisible() && $this->isAdmin) {\n $css[] = 'kv-invisible';\n }\n if ($this->showCheckbox && in_array($node->id, $this->selected)) {\n $css[] = 'kv-selected ';\n $jsSelect .= '$('.$this->id.').treeview(\"checkNode\", \"'.$node->id.'\");';\n }\n if ($node->isCollapsed()) {\n $css[] = 'kv-collapsed ';\n }\n if ($node->isDisabled()) {\n $css[] = 'kv-disabled ';\n }\n if (!$node->isActive()) {\n $css[] = 'kv-inactive ';\n }\n $indicators .= $this->renderToggleIconContainer(false) . \"\\n\";\n $indicators .= $this->showCheckbox ? $this->renderCheckboxIconContainer(false) . \"\\n\" : '';\n if (!empty($css)) {\n Html::addCssClass($nodeOptions, $css);\n }\n $out .= Html::beginTag('li', $nodeOptions) . \"\\n\" .\n Html::beginTag('div', ['tabindex' => -1, 'class' => 'kv-tree-list']) . \"\\n\" .\n Html::beginTag('div', ['class' => 'kv-node-indicators']) . \"\\n\" .\n $indicators . \"\\n\" .\n '</div>' . \"\\n\" .\n Html::beginTag('div', ['tabindex' => -1, 'class' => 'kv-node-detail']) . \"\\n\" .\n $this->renderNodeIcon($nodeIcon, $nodeIconType, $isChild) . \"\\n\" .\n Html::tag('span', $nodeName, ['class' => 'kv-node-label']) . \"\\n\" .\n '</div>' . \"\\n\" .\n '</div>' . \"\\n\";\n ++$counter;\n }\n if (isset($jsSelect)) {\n $this->view->registerJs(\n $jsSelect,\n View::POS_READY,\n 'treeviewinput-selected'\n );\n }\n $out .= str_repeat(\"</li>\\n</ul>\", $nodeDepth) . \"</li>\\n\";\n $out .= \"</ul>\\n\";\n return Html::tag('div', $this->renderRoot() . $out, $this->treeOptions);\n }", "public function getChildren() \n {\n return $this->children;\n }", "public function getChildren()\r\n\t{\r\n\t\treturn $this->childrenNodes;\r\n\t}", "public function render_content_items() {\n\t\tforeach ( (array) $this->get_content_items() as $content_item ) {\n\t\t\t$content_item->render();\n\t\t}\n\t}", "public function children()\n {\n $this->buildTree();\n return $this->childrenInternal();\n }", "public function loadChildNodes()\n {\n $ids = $this->_cache->getBackend()->getChildNodeIds($this);\n return $this->setChildNodeIds($ids);\n }", "function beginChildren()\n {\n echo \"<tr>\";\n }", "public function show() {\n // abre tag\n $this->open();\n echo \"\\n\";\n // si tiene contenido\n if ($this->children) {\n \n \n // recorre todos los objetos hijos\n foreach ($this->children as $child) {\n // si es objeto\n if (is_object($child)) {\n $child->show();\n }\n elseif ((is_string($child)) or (is_numeric($child))) {\n // si es texto\n echo $child;\n }\n }\n // cierra la tag\n $this->close();\n }\n }", "public function toHtml() {\n\t\techo '<em '.$this->getAttributes().'>'.$this->renderChildren().'</em>';\n\t}", "public function ajax_callback()\n {\n echo $this->get_children();\n exit;\n }", "function render ()\n {\n parent::render();\n }", "public function toHtml() {\n\t\techo '<mark '.$this->getAttributes().'>'.$this->renderChildren().'</mark>';\n\t}", "public function getChildren()\n {\n return $this->children;\n }", "public function displayChildren($selector = 'all') {\r\n\t\t$children = $this->getChildren($selector);\r\n\t\tif(is_array($children)) {\r\n\t\t\tforeach($children as $child) {\r\n\t\t\t\t$child->display();\r\n\t\t\t}\r\n\t\t} else $children->display();\r\n\t}", "public function toHtml() {\n\t\techo '<ol '.$this->getAttributes().'>'.$this->renderChildren().'</ol>';\n\t}", "abstract protected function RenderContent();", "public function removeChildNodes() {}", "public function render() {\n echo $this->getHtml();\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function showData(){\n echo \"<li>Data: \";\n if(gettype($this->data) == \"array\"){\n print_r(implode(', ', $this->data));\n }\n else{\n print_r($this->data);\n }\n echo \"</li>\";\n\n echo \"<ul><li>is a \".$this->type.\"</li>\"; // Print the type of the node\n\n if($this->parentNode != NULL){\n echo \"<li>Parent: \";\n if(gettype($this->parentNode->getData()) == \"array\"){\n print_r(implode(', ', $this->parentNode->getData()));\n }\n else{\n print_r($this->parentNode->getData());\n }\n\n echo \"</li>\";\n }\n else{\n echo \"<li>has no parent node.</li>\";\n }\n\n // echo \"<li>Children: </li>\";\n // // Show left child\n // if($this->childNodes[\"left\"] != NULL){\n // $d = $this->childNodes[\"left\"]->getData();\n //\n // if(gettype($d) == \"array\"){\n // echo \"L: \".implode(', ', $d).\"\\t\";\n // }\n // else{\n // echo \"L: \".$d.\"\\t\";\n // }\n //\n // }\n // // Show left-right child if we have it\n // if($this->childNodes[\"LR\"] != NULL){\n // $d = $this->childNodes[\"LR\"]->getData();\n //\n // if(gettype($d) == \"array\"){\n // echo \"LR: \".implode(', ', $d).\"\\t\";\n // }\n // else{\n // echo \"LR: \".$d.\"\\t\";\n // }\n // }\n //\n // // ... middle child\n // if($this->childNodes[\"mid\"] != NULL){\n // $d = $this->childNodes[\"mid\"]->getData();\n //\n // if(gettype($d) == \"array\"){\n // echo \"M: \".implode(', ', $d).\"\\t\";\n // }\n // else{\n // echo \"M: \".$d.\"\\t\";\n // }\n // }\n // // ... middle-right child\n // if($this->childNodes[\"MR\"] != NULL){\n // $d = $this->childNodes[\"MR\"]->getData();\n //\n // if(gettype($d) == \"array\"){\n // echo \"MR: \".implode(', ', $d).\"\\t\";\n // }\n // else{\n // echo \"MR: \".$d.\"\\t\";\n // }\n // }\n //\n // // ... right child\n // if($this->childNodes[\"right\"] != NULL){\n // $d = $this->childNodes[\"right\"]->getData();\n // if(gettype($d) == \"array\"){\n // echo \"R: \".implode(', ', $d).\"\\t\";\n // }\n // else{\n // echo \"R: \".$d.\"\\t\";\n // }\n // }\n // // ... right-right child\n // if($this->childNodes[\"RR\"] != NULL){\n // $d = $this->childNodes[\"RR\"]->getData();\n //\n // if(gettype($d) == \"array\"){\n // echo \"RR: \".implode(', ', $d).\"\\t\";\n // }\n // else{\n // echo \"RR: \".$d.\"\\t\";\n // }\n // }\n\n echo \"</ul>\";\n }", "public function getChildren() {\n\t\treturn $this->children;\n\t}", "public function getChildren() {\n\t\treturn $this->children;\n\t}", "public function getChildren()\n {\n return $this->_children;\n }", "public function drawContent()\n\t\t{\n\t\t}", "public function renderChild($name)\n {\n if ($child = $this->getChild($name)) {\n return $child->render();\n } else {\n return \"\";\n }\n }", "public function combine_child(){\n\t\t\t\techo 'Child begin-> '.parent::combine_parent().' <-Child end. ';\n\t\t\t}", "protected function actionPostLoadingEvent()\n {\n if (self::$child_data === null) {\n self::$child_data = [];\n foreach ($this->getParentModel()->children->child->iterateItems() as $node_uuid => $node) {\n if (empty((string)$node->enabled)) {\n continue;\n }\n $conn_uuid = (string)$node->connection;\n if (!isset(self::$child_data[$conn_uuid])) {\n self::$child_data[$conn_uuid] = [];\n }\n foreach (self::$child_attrs as $key) {\n if (!isset(self::$child_data[$conn_uuid][$key])) {\n self::$child_data[$conn_uuid][$key] = [];\n }\n self::$child_data[$conn_uuid][$key][] = (string)$node->$key;\n }\n }\n }\n foreach ($this->internalChildnodes as $node) {\n if (!$node->getInternalIsVirtual()) {\n $extra_attr = ['local_ts' => '', 'remote_ts' => ''];\n $conn_uuid = (string)$node->getAttribute('uuid');\n foreach (self::$child_attrs as $key) {\n $child_node = new TextField();\n $child_node->setInternalIsVirtual();\n if (isset(self::$child_data[$conn_uuid]) && !empty(self::$child_data[$conn_uuid][$key])) {\n $child_node->setValue(implode(',', array_unique(self::$child_data[$conn_uuid][$key])));\n }\n $node->addChildNode($key, $child_node);\n }\n }\n }\n return parent::actionPostLoadingEvent();\n }", "public function getChilds() {\n return $this->__childs;\n }", "public function getChildren()\n\t{\n\t\treturn $this->children;\n\t}", "public function getChildren()\n\t{\n\t\treturn $this->children;\n\t}", "public function getChildren() {\n\t\treturn $this->_children;\n\t}", "protected function listChildren()\n {\n $this->children = new ArrayObject();\n if ($this->cursor instanceof DOMNode) {\n $childrenNodes = $this->cursor->childNodes;\n foreach ($childrenNodes as $child) {\n switch ($child->nodeName) {\n case 'text:p':\n $element = new OpenDocument_Element_Paragraph($child, $this);\n break;\n case 'text:h':\n $element = new OpenDocument_Element_Heading($child, $this);\n break;\n default:\n $element = false;\n }\n if ($element) {\n $this->children->append($element);\n }\n }\n }\n }", "function children() {\n\t\t$this->load_children();\n\t\treturn $this->_children;\n\t}", "public function render()\n {\n parent::render();\n\n $myConfig = $this->getConfig();\n $oParentView = $this->getParent();\n\n // add content for main menu\n $oContentList = oxNew('oxcontentlist');\n $oContentList->loadMainMenulist();\n $oParentView->setMenueList($oContentList);\n\n return;\n }", "public function get_children() {\n\t\treturn $this->children;\n\t}", "public function render()\n {\n echo $this->__toString();\n\n }", "public function render ()\r\n\t{\r\n\t\t$this->decorate(); // decorate bofore render\r\n\t\treturn parent::render();\r\n\t}", "protected function renderElseChild() {}", "public function render()\n\t{\n\t\treturn '<li>'.$this->html->link($this->link, $this->title, $this->attributes).$this->renderNestedMenu().'</li>';\n\t}", "protected abstract function renderContent();", "public function render()\n {\n \n }", "public function render() {\n\t\t$this->render_page_content();\n\t}", "protected function render()\n {\n }", "protected function render()\n {\n }", "protected function render()\n {\n }", "public function getChildNodes()\n {\n return array_values($this->getChildNodesById());\n }", "function writeHTML()\n\t{\n\t\tglobal $_activeTree;\n\t\t\n\t\t$c = count($this->children);\n\n\t\tif ($this->link)\n\t\t{\n\t\t\t$title = \"<a href='{$this->link}' target='{$this->target}'>{$this->title}</a>{$this->extras}\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$title = \"<a href='#' onclick='\";\n\t\t\t\n\t\t\tif ($_activeTree->onSelect)\n\t\t\t{\n\t\t\t\t$title .= \"{$_activeTree->onSelect}(\\\"{$this->value}\\\");\";\n\t\t\t}\n\t\t\t\n\t\t\t$title .= \"; return false'>{$this->title}</a>{$this->extras}\";\n\t\t}\n\t\t\n\t\tif ($c == 0 && !$this->onDemand)\n\t\t{\n\t\t\t// Leaf node\n\t\t\techo \"<div class='{$this->leafStyle}'>\";\n\n\t\t\tif (isset($this->value) && $this->value !== \"\" && $_activeTree->selectMode != 'navigation')\n\t\t\t{\n?>\n\t\t\t<input type=\"checkbox\" class=\"checkbox\" name=\"<? echo $this->id?>\" value=\"<? echo $this->value?>\"<? \n\t\t\t\tif ($this->checked) echo \" checked\";\n\t\t\t\tif ($this->disabled) echo \" disabled\";\n\t\t\t\tif ($_activeTree->selectMode == \"single\") \n\t\t\t\t{\n\t\t\t\t\techo \" onclick=\\\"Tree.clearCheckBoxes('{$_activeTree->id}', this);\";\n\t\t\t\t\tif ($_activeTree->onSelect)\n\t\t\t\t\t{\n\t\t\t\t\t\techo \" {$_activeTree->onSelect}('{$this->value}');\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"\\\"\";\n\t\t\t\t}\n\t\t\t\telse if ($_activeTree->onSelect)\n\t\t\t\t{\n\t\t\t\t\techo \" onclick=\\\"{$_activeTree->onSelect}('{$this->value}');\\\"\";\n\t\t\t\t}\n\t\t\t\t ?>/>\n<?\n\t\t\t}\n\t\t\n\t\t\techo \"$title</div>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($this->open)\n\t\t\t{\n\t\t\t\t$style = $this->openStyle;\n\t\t\t\t$display = \"block\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$style = $this->closedStyle;\n\t\t\t\t$display = \"none\";\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\tif ($this->onDemand)\n\t\t\t{\n\t\t\t\t$cmd = \"Tree.loadOnDemand('{$this->id}', '{$this->onDemand}');\";\n\t\t\t\t\n\t\t\t\tif ($this->open)\n\t\t\t\t{\n?>\n<script type=\"text/javascript\">\n\twindow.addEvent('domready', function() {Tree.loadOnDemand('<?echo $this->id?>', '<?echo $this->onDemand?>');});\n</script>\n<?\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$cmd = \"\";\n\t\t\t}\n\t\t\t\n\t\t\t$cmd .= \"Tree.toggleFolder('{$this->id}', '{$this->openStyle}', '{$this->closedStyle}');\";\n?>\n\t\t<div id='<?echo $this->id?>' class='<?echo $style?>' onclick=\"<?echo $cmd ?>\">\n<?\n\t\t\tif (isset($this->value) && $this->value !== \"\")\n\t\t\t{\n?>\n\t\t\t<input type=\"checkbox\" class=\"checkbox\" name=\"<? echo $this->id?>\" value=\"<? echo $this->value?>\" <? \n\t\t\t\tif ($this->checked) echo \" checked\";\n\t\t\t\tif ($this->disabled) echo \" disabled\";\n\t\t\t\tif ($_activeTree->selectMode == \"single\") \n\t\t\t\t{\n\t\t\t\t\techo \" onclick=\\\"Tree.clearCheckBoxes('{$_activeTree->id}', this);\";\n\t\t\t\t\tif ($_activeTree->onSelect)\n\t\t\t\t\t{\n\t\t\t\t\t\techo \" {$_activeTree->onSelect}('{$this->value}');\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"\\\"\";\n\t\t\t\t}\n\t\t\t\telse if ($_activeTree->onSelect)\n\t\t\t\t{\n\t\t\t\t\techo \" onclick=\\\"{$_activeTree->onSelect}('{$this->value}');\\\"\";\n\t\t\t\t}\n\t\t\t\t ?>/>\n<?\n\t\t\t}\n?>\n\t\t<?echo $title?></div>\n\t\t<div id='<?echo $this->id?>_contents' style='padding-left: <?echo $_activeTree->indent ?>; display: <? echo $display?>'>\n\t\t\t\n<?\t\t\t\n\t\t\tfor($i = 0; $i < $c; ++$i)\n\t\t\t{\n\t\t\t\t$this->children[$i]->writeHTML();\n\t\t\t}\n?>\n\t\t</div>\n<?\n\t\t}\n\t}", "protected function render()\n {\n }", "function serializeChildren()\r\n {\r\n //Calls children's serialize recursively\r\n reset($this->components->items);\r\n while (list($k,$v)=each($this->components->items))\r\n {\r\n $v->serialize();\r\n }\r\n }", "public function children()\r\n\t{\r\n\t\treturn $this->children;\r\n\t}", "protected function RenderComponents() {\n \t foreach($this->_components as $compontent) {\n \t \tif($compontent instanceof Writable) {\n \t \t\t$compontent->Render();\n \t \t}\n \t }\t\n \t}" ]
[ "0.78030807", "0.77022815", "0.7259376", "0.7007551", "0.685497", "0.67571235", "0.6616756", "0.6612959", "0.66128385", "0.6441183", "0.6433968", "0.6402696", "0.6402696", "0.6402696", "0.6340813", "0.6340813", "0.6340813", "0.6340813", "0.6340813", "0.6340813", "0.6340813", "0.6340813", "0.6340813", "0.63173354", "0.63060033", "0.63060033", "0.6234083", "0.617326", "0.6147493", "0.6030403", "0.60292923", "0.6005859", "0.6004834", "0.5979606", "0.58746886", "0.5870774", "0.5844779", "0.58077407", "0.5783301", "0.57765675", "0.5759172", "0.5724723", "0.57113105", "0.5691583", "0.5688566", "0.5674707", "0.5668467", "0.5665236", "0.56515145", "0.56355494", "0.5614109", "0.5613467", "0.5610314", "0.5609993", "0.56078255", "0.5596799", "0.5588948", "0.55761206", "0.55733824", "0.5565121", "0.55623686", "0.55623686", "0.55623686", "0.55623686", "0.55623686", "0.55623686", "0.55623686", "0.55623686", "0.5538712", "0.5516344", "0.5516344", "0.55159295", "0.5514306", "0.55099666", "0.5497074", "0.5496021", "0.5484864", "0.5484858", "0.5484858", "0.5482842", "0.5452804", "0.54316664", "0.54223764", "0.54191196", "0.54124314", "0.5412226", "0.5397854", "0.53798765", "0.5374541", "0.5373519", "0.53541297", "0.53515536", "0.53515536", "0.5351223", "0.5350604", "0.53500724", "0.53496367", "0.5338359", "0.53374785", "0.53346556" ]
0.68691784
4
Id Unittest with Regular expression Check digits because Id consist of only Digits
public function testThatWeCanGetTheId() { $ads = new Cities; $ads->setId('1'); //$this->assertEquals($ads->getId(), '1'); $this->assertEquals(1 , preg_match( '/^[0-9]+$/', $ads->getId() ), $ads->getId() . ' is not a set of digits' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function idFormat($value){\n \n if(!preg_match(VALID_INT_FORMAT,$value)){\n return false;\n }\n \n return true;\n\n}", "function isValidStudentID($id){\n if(preg_match('/^\\d+$/', $id) && strlen($id) == 8){\n return true;\n }\n else{\n return false;\n }\n }", "function checkId($input){\n\n $output = preg_match('/^[0-9]+$/', $input);\n if(!$output){\n echo json_encode(\n array(\n \"errorMsg\" => \"ID can only contain numbers\"\n )\n );\n die();\n }\n\n return null;\n }", "function sanitizer($inputId)\n {\n preg_match(\"/([0-9]{6})(_)([a-zA-Z]{1,})/\", $inputId, $inputId2);\n\n if ( !empty($inputId2) and is_numeric($inputId2[1]) and $inputId2[2] == '_' and is_string($inputId2[3]) )\n {\n return TRUE;\n }\n else\n {\n echo \"<strong style='color: red'>Error: </strong>Please enter an ID which starts with six numeric values followed by underscore followed by string in the format example as shown --> 123456_ABC\";\n return FALSE;\n }\n }", "function is_id($str)\n{\n $regex = \"/([a-f0-9]{8}\\-[a-f0-9]{4}\\-4[a-f0-9]{3}\\-[8|9|a|b][a-f0-9]{3}\\-[a-f0-9]{12})/\";\n\n return preg_match($regex, $str) === 1;\n}", "public static function isValidId(string $id) : bool {\n\t\treturn strlen($id) <= 5 && preg_match('/^[0-9]+$/', $id) === 1;\n\t}", "private static function isValidID($id) {\n\t\tif(!is_string($id)) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif(strlen($id) < 1) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif(preg_match('/[^0-9a-z]/', $id)) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\t}", "function isPartID($input) {\n return (preg_match(\"/(^(?:[1-9][0-9]+?)(?:[a-z]*\\\\d*[a-z]*\\\\d*)?$)/\", $input));\n }", "private function validateId()\n {\n return is_numeric($this->id) && (int)$this->id >= 1;\n }", "public function isValidId($id) {\n // In NCTU, student id is 7 digits\n if (strlen($id) != 7) return FALSE;\n if (!ctype_digit($id)) return FALSE;\n return TRUE;\n }", "public function isValidId($id);", "protected function shouldBeNumber($id)\r\n {\r\n $pattern = \"/^[0-9]+?$/\";\r\n\r\n if (preg_match($pattern, $id)) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "function testIfmatch(){\n\t\t#mdx:ifmatch\n\t\tParam::get('name')\n\t\t\t->filters()\n\t\t\t->ifmatch('/\\d/', 'Name cannot contain digits');\n\n\t\t$error = Param::get('name')->process(['name'=>'M4ry'])->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Name cannot contain digits\", $error);\n\n\t}", "public function validateId($value)\n {\n $value = $this->validateValue($value);\n\n $pattern = '/^[0-9]{0,10}$/';\n if (preg_match($pattern, $value)) {\n return $value;\n } else {\n $this->addMessage($this->textMessages[3]);\n return false;\n }\n }", "function parse_id($id) {\n\n }", "function testIdGetter(){\n\t\t#mdx:idGetter\n\t\t$field = new MyField('email');\n\t\t$field->attrs(['id'=>'email_field']);\n\t\t#/mdx echo $field->id()\n\t\t$this->assertEquals('email_field',$field->id());\n\t}", "public function testInteger() {\n $this->assertEquals(1292932, Sanitize::integer('129sdja2932'));\n $this->assertEquals(-1275452, Sanitize::integer('-12,754.52'));\n $this->assertEquals(18840, Sanitize::integer('+18#840'));\n }", "public static function parseID($id){ }", "public function id_test($id) {\r\n\r\n $error_msg = \"\";\r\n $errors = 0;\r\n\r\n if(isset($id)) {\r\n $identifiant = trim($id);\r\n $identifiant = htmlentities($identifiant, ENT_NOQUOTES, 'utf-8');\r\n $identifiant = preg_replace('#&([A-za-z])(?:acute|cedil|circ|grave|orn|ring|slash|th|tilde|uml);#', '\\1', $identifiant);\r\n $identifiant = preg_replace('#&([A-za-z]{2})(?:lig);#', '\\1', $identifiant); // pour les ligatures e.g. '&oelig;'\r\n $identifiant = preg_replace('#&[^;]+;#', '', $identifiant);\r\n $identifiant = str_replace(';', '', $identifiant);\r\n $identifiant = str_replace(' ', '', $identifiant);\r\n $identifiant = str_replace('php', '', $identifiant);\r\n\r\n if($identifiant == '') {\r\n $error_msg .= \"Vous devez spécifier un identifiant. <br/>\";\r\n $errors++;\r\n } else if(strlen($identifiant) < 3) {\r\n $error_msg .= \"Votre identifiant est trop court. <br/>\";\r\n $errors++;\r\n } else if(strlen($identifiant) > 24) {\r\n $error_msg .= \"Votre identifiant est trop long. <br/>\";\r\n $errors++;\r\n } else {\r\n\r\n if(Model::getModel(\"Session\\\\User\")->exists($identifiant)) {\r\n $error_msg .= \"Cet identifiant est déjà utilisé. <br/>\";\r\n $errors++;\r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n return array(\r\n \"value\" => $identifiant,\r\n \"error_msg\" => $error_msg,\r\n \"errors\" => $errors\r\n );\r\n\r\n }", "function isValidId($type) {\n\tif (strlen($type) > 3) {\n\t\tif (substr($type, -3) === \"_id\") {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "protected function validateId($id) {\n // check blacklist\n if (in_array($id,$this->blackList)) {\n $this->isBlackListed = true;\n $this->valid = false;\n\n return false;\n }\n\n // check string length\n // GLN Numbers are 14 characters long\n // FN Numbers (with or without FN prefix) are at least 5 characters long\n // GKZ Numbers are 5 characters long\n $this->valid = strlen($id) > 4;\n\n return $this->valid;\n }", "private static function verifyID($entry, $id)\n {\n $idhtml = htmlspecialchars($id);\n //$idpattern = (isset($entry['id_pattern']) ? $entry['id_pattern'] : '%[^A-Za-z0-9_\\\\-]%');\n //if ($idhtml == null || preg_match($idpattern, $idhtml)) {\n return ($idhtml != null);\n }", "public function testGetId()\n {\n $name = \"Computer Harry Potter\";\n $player = new ComputerPlayer($name);\n $res = $player -> getId();\n $this->assertSame($name, $res);\n }", "public function isValidId($id)\n\t{\n\t\t//return is_string($id) && preg_match('/^[a-f0-9]{40}$/', $id);\n\n\t\t// overload this checking\n\t\t// check that session id has enough characters\n\t\treturn strlen($id) == 64;\n\t}", "function int1 ($var){\n\tif (preg_match(\"|^[\\(\\)\\-+\\ 0-9]+$|\",$var)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t\t}\n\t}", "function test_getId()\n {\n //Arrange\n $id = null;\n $description = \"Wash the dog\";\n $test_task = new Task($description, $id);\n $test_task->save();\n\n //Act\n $result = $test_task->getId();\n\n //Assert\n $this->assertEquals(true, is_numeric($result));\n\n }", "public static function _assertId( $mId ) {\n\t\t\n\t\tif ( !preg_match( '/^[0-9]+$/', $mId ) ) {\n\t\t\t\n\t\t\t// $mId is a slug\n\t\t\treturn self::_getId( $mId );\n\t\t}\n\t\t\n\t\treturn $mId;\n\t}", "function next_id($id=\"\") {\n if (ereg(\"^[0-9]+$\",$id)) {\n $id++;\n return $id;\n }\n $id2=1; \n if(ereg(\"[0-9]+$\",$id)==true){\n $id1=ereg_replace(\"[0-9]+$\",\"\",$id);\n preg_match(\"/([0-9]+)$/\",$id,$matches);\n $id2=$matches[1];\n $id2++;\n return $id2;\n } else { \n if (empty($liczba)) $liczba='';\n return $id.$liczba; \n }\n }", "function testChangeId(){\n\t\t#mdx:changeId\n\t\t$field = new MyField('email');\n\t\t$field->attrs(['id'=>'email_field']);\n\t\t#/mdx echo $field\n\t\t$this->expectOutputRegex(\"/input.*email_field/\");\n\t\techo $field;\n\t}", "public function testUuid(): void\n {\n $regex = '/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i';\n $this->assertTrue((bool) preg_match($regex, $this->user->getUuid()));\n }", "public static function validId($input)\n\t{\n\t\treturn (isset($input) && is_numeric($input) && $input > 0);\n\t}", "private function validateAndSanitizeId($id) {\n if (!filter_var($id, FILTER_VALIDATE_INT)) {\n\tthrow new InvalidArgumentException('Invalid parameter for id');\n }\n $sanitized = filter_var($id, FILTER_SANITIZE_NUMBER_INT);\n return $sanitized;\n }", "function test_getIdByName() {\r\n\t\t$myName = \"moderator\";\r\n $myId = MemberClassesDB::getIdByName($myName);\r\n\t\t$this->assertEqual($myId, \"3\",\r\n\t\t\t\t\"Should return 3 for name moderator but returned \".$myId);\r\n\t}", "public function testID() {\n $this->assertFalse($this->object->isset_id());\n\n $id = 'test';\n $this->object->set_id($id);\n $this->assertEquals($id, $this->object->get_id());\n $this->assertTrue($this->object->isset_id());\n }", "function checkTWId($twid)\n{\n $ret = false;\n if (preg_match(\"/^[A-Z][12]\\d{8}$/\", $twid)) {\n $letters = 'ABCDEFGHJKLMNPQRSTUVXYWZIO';\n\n $c1 = substr($twid, 0, 1); //'A'\n $n12 = strpos($letters, $c1) + 10;\n// echo $n12 . '<hr>';\n $n1 = (int)($n12 / 10);\n $n2 = $n12 % 10;\n $n3 = substr($twid, 1, 1);\n $n4 = substr($twid, 2, 1);\n $n5 = substr($twid, 3, 1);\n $n6 = substr($twid, 4, 1);\n $n7 = substr($twid, 5, 1);\n $n8 = substr($twid, 6, 1);\n $n9 = substr($twid, 7, 1);\n $n10 = substr($twid, 8, 1);\n $n11 = substr($twid, 9, 1);\n\n $sum = $n1 * 1 + $n2 * 9 + $n3 * 8 + $n4 * 7 + $n5 * 6 + $n6 * 5 + $n7 * 4 + $n8 * 3 + $n9 * 2 + $n10 * 1 + $n11 * 1;\n $ret = ($sum % 10 == 0);\n\n\n }\n return $ret;\n\n}", "public static function isID($may_id) {\n\n $res = ctype_digit((string)$may_id); // TRUE | FALSE\n \n return $res;\n \n }", "public function is_id($id) {\n return is_numeric($id);\n }", "function safeId($string) {\r\n //Lower case everything\r\n $string = strtolower($string);\r\n //Make alphanumeric (removes all other characters)\r\n $string = preg_replace(\"/[^a-z0-9_\\s-]/\", \"\", $string);\r\n //Clean up multiple dashes or whitespaces\r\n $string = preg_replace(\"/[\\s-]+/\", \" \", $string);\r\n //Convert whitespaces and underscore to dash\r\n $string = preg_replace(\"/[\\s_]/\", \"-\", $string);\r\n return $string;\r\n}", "public function testStatusInvalidId()\n {\n\n }", "public function isValidId($id) {\n\t\treturn (is_numeric($id) && $id > 0) ? true : false;\n\t}", "public static function validate_id($value){\n\t\treturn (int)$value > 0;\n\t}", "public function test_getUID_withNoPrefix_returnA23CharacterLong()\r\n\t{\r\n\t\t$result = UniqueIdentifier::get();\r\n\t\t$this->assertEquals(2, count(explode(\"-\", $result)));\r\n\t\t\r\n\t}", "public static function isId($id) {\n return preg_match('/^\\d+$/', $id) ? true : false;\n }", "protected function isDigitIdentifier(ObjectIdentityInterface $oid)\n {\n return is_int($oid->getIdentifier()) || ctype_digit($oid->getIdentifier());\n }", "public function testOfferId()\n {\n $value = '99 ';\n\n $model = $this->getOfferModel();\n\n $model->setOfferId($value);\n\n $this->assertSame(intval($value), intval($model->getOfferId()));\n }", "public function testRegistrationPasswordOnlyNumbers(): void { }", "public static function validateNationalIdNumber($input)\n {\n $input = trim($input);\n $prepared_input = preg_replace(\"^\\\\s^\", \"\", $input);\n if ((preg_match(\"[^\\\\d{2}-?\\\\d{6,7}-?[A-Za-z]{1}-?\\\\d{2}$]\", $prepared_input) == FALSE) || strlen($prepared_input) < 12 || strlen($prepared_input) > 16) {\n return FALSE;\n } else {\n return TRUE;\n }\n }", "function clean_id($text) {\n $text = strtolower($text);\n $text = str_replace('/', '-', $text);\n $text = preg_replace('/[^0-9a-zA-Z-_]/', '', $text);\n return $text;\n}", "public function testGenerateID()\n {\n $this->assertStringStartsWith('_', SimpleSAML\\Utils\\Random::generateID());\n\n // check the length\n $this->assertEquals(SimpleSAML\\Utils\\Random::ID_LENGTH, strlen(SimpleSAML\\Utils\\Random::generateID()));\n }", "public static function checkId($id){\n return (!empty($id) && $id != NULL && is_numeric($id));\n }", "public function get_reg_id($character, $id_type) {\n\n $fields = array(\"*\");\n $whereArr = array(\"id_type\" => $id_type);\n $id_number = $this->db_model->getData($fields, 'id_numbers_m_tbl', $whereArr);\n\n $int = intval(preg_replace('/[^0-9]+/', '', $id_number[0]->id_number), 10);\n $id = \"$character\" . ($int + 1);\n return $id;\n\n}", "public function testRegistrationValuesContainNumbers(): void { }", "public function isValid($id);", "public function testUniqueId() {\n\t\t$result = _::uniqueId();\n\t\t$this->assertEquals(1, $result);\n\t\t$result = _::uniqueId();\n\t\t$this->assertEquals(2, $result);\n\n\t\t// test getting a unique id with a prefix\n\t\t$result = _::uniqueId('test');\n\t\t$this->assertEquals('test3', $result);\n\t\t$result = _::uniqueId('another');\n\t\t$this->assertEquals('another4', $result);\n\t}", "public function testid() {\n $tiempo = new TiempoFalso();\n $tarjeta = new Tarjeta( $tiempo );\n $colectivo = new Colectivo(NULL, NULL, NULL);\n\t$id=$tarjeta->obtenerID();\n $boleto = new Boleto(NULL, NULL, $tarjeta, $tarjeta->obtenerID(),NULL, NULL, NULL, NULL, $tiempo);\n\n $this->assertEquals($boleto->obteneriID(), $id);\n }", "private function _IdRegex($type = 'sfobcrv', $n = null)\r\n {\r\n $max = strlen(PHP_INT_MAX)-1; // defined maximum lenght of an array, is the maximum number of var to be can stored.\r\n /*\r\n $n = ($n === true)\r\n ? '(\\d{'.$max.'})'\r\n :( isset($n)\r\n ? str_pad($n, $max, '0', STR_PAD_LEFT)\r\n : '\\d{'.$max.'}'\r\n );\r\n /*/\r\n if(isset($n)){\r\n if($n === true){\r\n $n = '(\\d{'.$max.'})';\r\n } else {\r\n $n = str_pad($n, $max, '0', STR_PAD_LEFT);\r\n }\r\n } else {\r\n $n = '\\d{'.$max.'}';\r\n }\r\n /*/\r\n $n = isset($n)\r\n ?($n === true // store data id in result of return regexp\r\n ? '(\\d{'.$max.'})'\r\n : str_pad($n, $max, '0', STR_PAD_LEFT) // select one data id\r\n ) : '\\d{'.$max.'}';\r\n /**/\r\n \r\n if (strlen($type) != 1) {\r\n $type = '['.$type.']';\r\n }\r\n \r\n return '@'.$type.$n.'@';\r\n }", "public function validateIDNo($idNo)\n {\n\t $validateId=preg_match(\"/^[0-9]{13}+$/\",$idNo);\n \n\t if(!$validateId)\n\t {\n\t $err=\"<li><font color='#FF0000'>ERROR :Enter digits,and length must be 13<br/></li>\";\n\t array_push($err_array,$err);\n\t\t return $err_array;\n\t }\n\t //validate year born\n\t if($idNo[0]<4 || $idNo[1]<0)\n\t {\n\t $err=\"<li><font color='#FF0000'>ERROR,born year is invalid<br/></li>\";\n\t array_push($err_array,$err);\n\t\t return $err_array;\n\t }\n\t //validate month\n\t if($idNo[2]!=1 ||$idNo[2]!=2 && $idNo[3]!=1 || $idNo[3]!=2)\n\t {\n\t $err=\"<li><font color='#FF0000'>ERROR,born month is invalid<br/></li>\";\n\t array_push($err_array,$err);\n\t\t return $err_array;\n\t }\n\t //validate born day\n\t if(($idNo[4]!=0 ||$idNo[4]!=1 || $idNo[4]!=2 && $idNo[5]!=1) && ($idNo[4]==3 && $idNo[5]>1))\n\t {\n\t $err=\"<li><font color='#FF0000'>ERROR,born day is invalid<br/></li>\";\n\t array_push($err_array,$err);\n\t\t return $err_array;\n\t }\n\t \n }", "public static function isId($token) {\n\t\t\treturn is_string($token) && preg_match('/^[a-z0-9_]+$/i', $token);\n\t\t}", "public static function isValidSessionId($id) {\n\t\tif(empty($id) || !($id = trim($id)))\n\t\t\treturn false;\n\t\t\n\t\treturn preg_match('/^[a-f0-9]{40}$/', $id);\n\t}", "public function test_getUID_withPrefixWithDashes_returnA23CharacterLong()\r\n\t{\r\n\t\t$expected = \"aDummyPrefix\";\r\n\t\t$prefix = \"aDu-m-my-Prefix-\";\r\n\t\t$result = UniqueIdentifier::get($prefix);\r\n\t\t\r\n\t\t$partsResults = explode(\"-\", $result);\r\n\t\t$this->assertEquals(3, count($partsResults));\r\n\t\t$this->assertEquals($expected, $partsResults[0]);\r\n\t}", "public function testGetIDValue()\n {\n $this->fixture->query('INSERT INTO <http://example.com/> {\n <http://p1> <http://www.w3.org/2000/01/rdf-schema#range> <http://foobar> .\n }');\n\n $res = $this->fixture->getIDValue(1);\n\n $this->assertEquals('http://example.com/', $res);\n }", "public function validateUid ($uid) {\n if ((strlen($uid) > 11) &&\n (strlen($uid) < 100) &&\n preg_match('/^[a-z]+-\\d+-\\d+/', $uid)){\n return true;\n }\n return false;\n }", "function validateIdNumber($idNumber, $name)\n\t\t{\n\t\t\t// include the Id Number Validator Class and validate the id number\n\t\t\tinclude(\"class_libraries/IdNumberValidator.php\");\n\t\t\t$idValidator = new IdNumberValidator();\n\t\t\t\n\t\t\t// validate the id number\n\t\t\t$result = $idValidator -> validateIdNumber($idNumber, $name);\n\t\t\t\n\t\t\t// check the result\n\t\t\tif($result == false)\n\t\t\t{\n\t\t\t\t// get the error and return it\n\t\t\t\treturn $idValidator -> getErrors();\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t}", "public function test_getUID_withPrefix_returnA23CharacterLong()\r\n\t{\r\n\t\t$prefix = \"aDummyPrefix\";\r\n\t\t$result = UniqueIdentifier::get($prefix);\r\n\t\t$this->assertEquals(3, count(explode(\"-\", $result)));\r\n\t}", "private function verifyID($urlID) {\n\t\t# However, returns true if the url is a valid custom-one\n\t\t# Note that the ID must ALWAYS be in base10\n\t\tif(!isset($urlID)) {\n\t\t\tthrow new Exception(\"Missing parameter, aborting.\", 0);\n\t\t}\n\n\t\tif(preg_match(\"/^[0-9]+$/\", $urlID)) {\n\t\t\t# The id submitted seems to be a normal int'y id\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\t$this->log->logInfo(\"Invalid ID submitted - {$urlID}\");\n\t\t\theader(\"Location:{$this->siteURL}error/201\");\n\t\t\tdie;\n\t\t}\n\t}", "function atwork_id_safe($string) {\n // Replace with dashes anything that isn't A-Z, numbers, dashes, or underscores.\n $string = strtolower(preg_replace('/[^a-zA-Z0-9_-]+/', '-', $string));\n // If the first character is not a-z, add 'n' in front.\n if (!ctype_lower($string{0})) { // Don't use ctype_alpha since its locale aware.\n $string = 'id'. $string;\n }\n return $string;\n}", "public function validate_ohloh_id($id)\n\t{\n\t\tif (empty($id) || !is_numeric($id) || $id < 0 || (false !== strpos($id, '.'))) {\n\t\t\treturn array(_t('A numeric ohloh id is required', $this->class_name));\n\t\t}\n\t\treturn array();\n\t}", "public function testValidateStringNumber(): void\n {\n $this->assertFalse($this->validate('1'));\n }", "public function test_create_called_shouldReturnAnUniqueIdentificator()\n {\n $expected = 10;\n $actual = CastilloTicketId::create();\n $this->assertEquals($expected,strlen($actual->id()));\n }", "function validatePhone($id){\n global $isValidSSWelcome;\n //remove basic phone characters\n $id = str_replace(\" \",\"\",$id);\n $id = preg_replace('/-/',\"\",$id);\n $id = preg_replace('/\\(/',\"\",$id);\n $id = preg_replace('/\\)/',\"\",$id);\n $id = preg_replace('/_/',\"\",$id);\n //echo \"<p>$id</p>\"; for de-bugging purposes\n if (is_numeric($id) && strlen($id)===10){\n return;\n }\n else{\n echo \"<p>Valid Phone Number must be entered</p>\";\n $isValidSSWelcome = false;\n }\n}", "function buildValidIDFrom($text)\n{\n $text = preg_replace('/^[^a-zA-Z0-9\\.-]/','p',$text);\n $text = preg_replace('/[^a-zA-Z0-9\\.-]/','-',$text);\n return $text;\n}", "public function verifyElementId($element){}", "public function set_id($id) {\n $this->_newid = preg_replace(\"/[^a-zA-Z0-9]/\", '', $id);\n }", "function n_checkID($genid, $parms=NULL)\r\n{\r\n if (empty($genid)) return FALSE;\r\n if (preg_match('%^([a-z\\d]{6,8})$%i', $genid, $matches)) // base32 code\r\n $genid = base32_float($matches);\r\n\r\n if (is_array($parms)) {\r\n $service = trim($parms['service']);\r\n $timeAt = trim($parms['timeAt']);\r\n }\r\n else if (is_string($parms))\r\n $service = $parms;\r\n $service = preg_match(\"%^([a-z][a-z_]{2,})%i\", $service, $matches) ? strtoupper($matches[1]) : '';\r\n\r\n if (preg_match('%^([0]{0,1})([\\d])([\\d]{6})([\\d]{2})$%', $genid, $matcharr)\r\n || preg_match('%^([1])([\\d])([\\d]{5})([\\d][\\d]{2})$%', $genid, $matcharr)\r\n || preg_match('%^([2])([\\d])([\\d]{7})([\\d]{2})$%', $genid, $matcharr)\r\n || preg_match('%([3])([\\d])([\\d]{7})([\\d][\\d]{2})$%', $genid, $matcharr)) {\r\n $ntype = intval($matcharr[1]);\r\n $rn = intval($matcharr[2]);\r\n $id = $matcharr[3];\r\n $s2 = $matcharr[4];\r\n //if ($cf_debug) echo (\"n_checkID: ntype=$ntype, rn=$rn, id=$id\\n\");\r\n }\r\n\r\n if (strlen($s2)==3) { // with day-check\r\n $t = $s2{0};\r\n if ($timeAt!=='0' && $t!='0') {\r\n $time = strlen($timeAt) ? strtotime($timeAt) : time();\r\n if ($time <= 0) $time = time(); // invalid time\r\n $numTry = 0;\r\n while ($numTry < 2) {\r\n $parmarr = array(\r\n 'service' => $service,\r\n 'rn' => $rn,\r\n 'timeAt' => date('Y-m-d H:i:s', $time - 43200*$numTry),\r\n );\r\n $s = n_makeID($id, $parmarr, $ntype);\r\n //if ($cf_debug) echo (\"n_checkID: s=$s, msig=\".-strlen($s).\"\\n\");\r\n if ($s && preg_match(\"%\".substr($genid, -strlen($s)).\"$%\", $s))\r\n return $id;\r\n $numTry++;\r\n }\r\n return FALSE;\r\n }\r\n }\r\n\r\n $parmarr = array(\r\n 'service' => $service,\r\n 'rn' => $rn,\r\n 'timeAt' => '0',\r\n );\r\n $s = n_makeID($id, $parmarr, $ntype);\r\n //if ($cf_debug) echo (\"n_checkID: s=$s, msig=\".-strlen($s).\"\\n\");\r\n if (($ntype==0 && intval($s)==intval($genid))\r\n || ($s && preg_match(\"%\".substr($genid, -strlen($s)).\"$%\", $s)))\r\n return $id;\r\n\r\n return FALSE;\r\n}", "public function testGetID() {\r\n\t\t$this->assertTrue ( self::TEST_CONTROL_ID == $this->testObject->getID (), 'control ID was incorrectly identified' );\r\n\t}", "public function edp_api_user_id_test( $input )\n\t{\n\t\t$field_name = 'User ID (demo)';\n\t\t$constraints = array(\n\t\t\tnew Length(array(\n\t\t\t\t'min' => 5,\n\t\t\t\t'max' => 64,\n\t\t\t\t'minMessage' => $field_name . ' is too short.',\n\t\t\t\t'maxMessage' => $field_name . ' is too long.'\n\t\t\t)),\n\t\t\tnew NotBlank(array(\n\t\t\t\t'message' => $field_name . ' cannot be blank.'\n\t\t\t))\n\t\t);\n\n\t\treturn sanitize_text_field($this->validate(get_option('edp_api_user_id_test'), $input, $constraints));\n\n\t}", "function isValidPassportId($passportId) {\n\n $passportId = trim($passportId);\n\n // check length\n if (strlen($passportId) != 9) {\n return 0;\n }\n\n // check that $passportId only contains digits\n $digits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];\n for ($i = 0; $i < 9; ++$i) {\n $currentCharacter = substr($passportId, $i, 1);\n if (!in_array($currentCharacter, $digits)) {\n return 0;\n }\n }\n\n // if we've fallen through, the passport is valid\n return 1;\n}", "public static function isValidId($id) {\n if ($id != null && is_numeric($id) && $id > 0) {\n return true;\n }\n return false;\n }", "public function test_usermoodlepreventsduplicateidnumber() {\n $this->load_csv_data();\n $usermoodle = new usermoodle(array('cuserid' => 2, 'muserid' => 2, 'idnumber' => '__idnumber__phpunit_test2__'));\n $usermoodle->save();\n }", "function checkVatID_si($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\t\tif ((int) $vat_id[2] == 0)\n\t\t\treturn 0;\n\n\t\t$checksum = (int) $vat_id[9];\n\t\t$checkval = 0;\n\n\t\tfor ($i = 2; $i <= 8; $i ++)\n\t\t\t$checkval += (int) $vat_id[10 - $i] * $i;\n\t\t$checkval = $this->modulo($checkval, 11) == 10 ? 0 : 11 - $this->modulo($checkval, 11);\n\t\tif ($checksum != $checkval)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t}", "function isLegalPhoneNum($test)\n{\n\tif(preg_match(\"/^\\([0-9]{3}\\) [0-9]{4}-[0-9]{4}$/\", $test))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "function checkVatID_ie_new($vat_id) {\n\t\t$checksum = strtoupper(substr($vat_id, -1));\n\t\t$checkval = 0;\n\t\t$checkchar = 'A';\n\t\tfor ($i = 2; $i <= 8; $i ++)\n\t\t\t$checkval += (int) $vat_id[10 - $i] * $i;\n\t\t$checkval = $this->modulo($checkval, 23);\n\t\tif ($checkval == 0) {\n\t\t\t$checkchar = 'W';\n\t\t} else {\n\t\t\tfor ($i = $checkval -1; $i > 0; $i --)\n\t\t\t\t$checkchar ++;\n\t\t}\n\t\tif ($checkchar != $checksum)\n\t\t\treturn false;\n\n\t\treturn true;\n\t}", "function checkVatID_c($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\n\t\t// LUHN-10 code http://www.ee.unb.ca/tervo/ee4253/luhn.html\n\n\t\t$id = substr($vat_id, 1);\n\t\t$checksum = 0;\n\t\tfor ($i = 9; $i > 0; $i --) {\n\t\t\t$digit = $vat_id {\n\t\t\t\t$i};\n\t\t\tif ($i % 2 == 1)\n\t\t\t\t$digit *= 2;\n\t\t\tif ($digit >= 10) {\n\t\t\t\t$checksum += $digit -10 + 1;\n\t\t\t} else {\n\t\t\t\t$checksum += $digit;\n\t\t\t}\n\t\t}\n\t\tif ($this->modulo($checksum, 10) == 0)\n\t\t\treturn 1;\n\n\t\treturn 0;\n\t} // Canada\n\n\t// belgien\n\tfunction checkVatID_be($vat_id) {\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\n\t\t$checkvals = (int) substr($vat_id, 2, -2);\n\t\t$checksum = (int) substr($vat_id, -2);\n\n\t\tif (97 - $this->modulo($checkvals, 97) != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end belgien\n\n\t// daenemark\n\tfunction checkVatID_dk($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\n\t\t$weights = array (2, 7, 6, 5, 4, 3, 2, 1);\n\t\t$checksum = 0;\n\n\t\tfor ($i = 0; $i < 8; $i ++)\n\t\t\t$checksum += (int) $vat_id[$i +2] * $weights[$i];\n\t\tif ($this->modulo($checksum, 11) > 0)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end daenemark\n\n\t// deutschland\n\tfunction checkVatID_de($vat_id) {\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\n\t\t$prod = 10;\n\t\t$checkval = 0;\n\t\t$checksum = (int) substr($vat_id, -1);\n\n\t\tfor ($i = 2; $i < 10; $i ++) {\n\t\t\t$checkval = $this->modulo((int) $vat_id[$i] + $prod, 10);\n\t\t\tif ($checkval == 0)\n\t\t\t\t$checkval = 10;\n\t\t\t$prod = $this->modulo($checkval * 2, 11);\n\t\t} // end for($i = 2; $i < 10; $i++)\n\t\t$prod = $prod == 1 ? 11 : $prod;\n\t\tif (11 - $prod != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end deutschland\n\n\t// estland\n\tfunction checkVatID_ee($vat_id) {\n\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end estland\n\n\t// finnland\n\tfunction checkVatID_fi($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\n\t\t$weights = array (7, 9, 10, 5, 8, 4, 2);\n\t\t$checkval = 0;\n\t\t$checksum = (int) substr($vat_id, -1);\n\n\t\tfor ($i = 0; $i < 8; $i ++)\n\t\t\t$checkval += (int) $vat_id[$i +2] * $weights[$i];\n\n\t\tif (11 - $this->modulo($checkval, 11) != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end finnland\n\n\t// frankreich\n\tfunction checkVatID_fr($vat_id) {\n\t\tif (strlen($vat_id) != 13)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id), 4))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\n\t} // end frankreich\n\n\t// griechenland\n\tfunction checkVatID_el($vat_id) {\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\n\t\t$checksum = substr($vat_id, -1);\n\t\t$checkval = 0;\n\n\t\tfor ($i = 1; $i <= 8; $i ++)\n\t\t\t$checkval += (int) $vat_id[10 - $i] * pow(2, $i);\n\t\t$checkval = $this->modulo($checkval, 11) > 9 ? 0 : $this->modulo($checkval, 11);\n\t\tif ($checkval != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end griechenland\n\n\t// grossbrittanien\n\tfunction checkVatID_gb($vat_id) {\n\t\tif (strlen($vat_id) != 11 && strlen($vat_id) != 14)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\n\t} // end grossbrittanien\n\n\t/********************************************\n\t* irland *\n\t********************************************/\n\t// irland switch\n\tfunction checkVatID_ie($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\t\tif (!checkVatID_ie_new($vat_id) && !checkVatID_ie_old($vat_id))\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end irland switch\n\n\t// irland alte methode\n\tfunction checkVatID_ie_old($vat_id) {\n\t\t// in neue form umwandeln\n\t\t$transform = array (substr($vat_id, 0, 2), '0', substr($vat_id, 4, 5), $vat_id[2], $vat_id[9]);\n\t\t$vat_id = join('', $transform);\n\n\t\t// nach neuer form pruefen\n\t\treturn checkVatID_ie_new($vat_id);\n\t} // end irland alte methode\n\n\t// irland neue methode\n\tfunction checkVatID_ie_new($vat_id) {\n\t\t$checksum = strtoupper(substr($vat_id, -1));\n\t\t$checkval = 0;\n\t\t$checkchar = 'A';\n\t\tfor ($i = 2; $i <= 8; $i ++)\n\t\t\t$checkval += (int) $vat_id[10 - $i] * $i;\n\t\t$checkval = $this->modulo($checkval, 23);\n\t\tif ($checkval == 0) {\n\t\t\t$checkchar = 'W';\n\t\t} else {\n\t\t\tfor ($i = $checkval -1; $i > 0; $i --)\n\t\t\t\t$checkchar ++;\n\t\t}\n\t\tif ($checkchar != $checksum)\n\t\t\treturn false;\n\n\t\treturn true;\n\t} // end irland neue methode\n\t/* end irland\n\t********************************************/\n\n\t// italien\n\tfunction checkVatID_it($vat_id) {\n\t\tif (strlen($vat_id) != 13)\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end italien\n\n\t// lettland\n\tfunction checkVatID_lv($vat_id) {\n\n\t\tif (strlen($vat_id) != 13)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end lettland\n\n\t// litauen\n\tfunction checkVatID_lt($vat_id) {\n\n\t\tif ((strlen($vat_id) != 13) || (strlen($vat_id) != 11))\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end litauen\n\n\t// luxemburg\n\tfunction checkVatID_lu($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\n\t\t$checksum = (int) substr($vat_id, -2);\n\t\t$checkval = (int) substr($vat_id, 2, 6);\n\t\tif ($this->modulo($checkval, 89) != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // luxemburg\n\n\t// malta\n\tfunction checkVatID_mt($vat_id) {\n\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end malta\n\n\t// niederlande\n\tfunction checkVatID_nl($vat_id) {\n\t\tif (strlen($vat_id) != 14)\n\t\t\treturn 0;\n\t\tif (strtoupper($vat_id[11]) != 'B')\n\t\t\treturn 0;\n\t\tif ((int) $vat_id[12] == 0 || (int) $vat_id[13] == 0)\n\t\t\treturn 0;\n\n\t\t$checksum = (int) $vat_id[10];\n\t\t$checkval = 0;\n\n\t\tfor ($i = 2; $i <= 9; $i ++)\n\t\t\t$checkval += (int) $vat_id[11 - $i] * $i;\n\t\t$checkval = $this->modulo($checkval, 11) > 9 ? 0 : $this->modulo($checkval, 11);\n\n\t\tif ($checkval != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end niederlande\n\n\t// oesterreich\n\tfunction checkVatID_at($vat_id) {\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\t\tif (strtoupper($vat_id[2]) != 'U')\n\t\t\treturn 0;\n\n\t\t$checksum = (int) $vat_id[10];\n\t\t$checkval = 0;\n\n\t\tfor ($i = 3; $i < 10; $i ++)\n\t\t\t$checkval += $this->cross_summa((int) $vat_id[$i] * ($this->is_even($i) ? 2 : 1));\n\t\t$checkval = substr((string) (96 - $checkval), -1);\n\n\t\tif ($checksum != $checkval)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end oesterreich\n\n\t// polen\n\tfunction checkVatID_pl($vat_id) {\n\t\tif (strlen($vat_id) != 12)\n\t\t\treturn 0;\n\n\t\t$weights = array (6, 5, 7, 2, 3, 4, 5, 6, 7);\n\t\t$checksum = (int) $vat_id[11];\n\t\t$checkval = 0;\n\t\tfor ($i = 0; $i < count($weights); $i ++)\n\t\t\t$checkval += (int) $vat_id[$i +2] * $weights[$i];\n\t\t$checkval = $this->modulo($checkval, 11);\n\n\t\tif ($checkval != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end polen\n\n\t// portugal\n\tfunction checkVatID_pt($vat_id) {\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\n\t\t$checksum = (int) $vat_id[10];\n\t\t$checkval = 0;\n\n\t\tfor ($i = 2; $i < 10; $i ++) {\n\t\t\t$checkval += (int) $vat_id[11 - $i] * $i;\n\t\t}\n\t\t$checkval = (11 - $this->modulo($checkval, 11)) > 9 ? 0 : (11 - $this->modulo($checkval, 11));\n\t\tif ($checksum != $checkval)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end portugal\n\n\t// schweden\n\tfunction checkVatID_se($vat_id) {\n\t\tif (strlen($vat_id) != 14)\n\t\t\treturn 0;\n\t\tif ((int) substr($vat_id, -2) < 1 || (int) substr($vat_id, -2) > 94)\n\t\t\treturn 0;\n\t\t$checksum = (int) $vat_id[11];\n\t\t$checkval = 0;\n\n\t\tfor ($i = 0; $i < 10; $i ++)\n\t\t\t$checkval += $this->cross_summa((int) $vat_id[10 - $i] * ($this->is_even($i) ? 2 : 1));\n\t\tif ($checksum != ($this->modulo($checkval, 10) == 0 ? 0 : 10 - $this->modulo($checkval, 10)))\n\t\t\treturn 0;\n\n\t\t$checkval = 0;\n\t\tfor ($i = 0; $i < 13; $i ++)\n\t\t\t$checkval += (int) $vat_id[13 - $i] * ($this->is_even($i) ? 2 : 1);\n\t\tif ($this->modulo($checkval, 10) > 0)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end schweden\n\n\t// slowakische republik\n\tfunction checkVatID_sk($vat_id) {\n\t\tif (strlen($vat_id) != 12)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\n\t} // end slowakische republik\n\n\t// slowenien\n\tfunction checkVatID_si($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\t\tif ((int) $vat_id[2] == 0)\n\t\t\treturn 0;\n\n\t\t$checksum = (int) $vat_id[9];\n\t\t$checkval = 0;\n\n\t\tfor ($i = 2; $i <= 8; $i ++)\n\t\t\t$checkval += (int) $vat_id[10 - $i] * $i;\n\t\t$checkval = $this->modulo($checkval, 11) == 10 ? 0 : 11 - $this->modulo($checkval, 11);\n\t\tif ($checksum != $checkval)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end slowenien\n\n\t// spanien\n\tfunction checkVatID_es($vat_id) {\n\t\t// Trim country info\n\t\t$vat_id = substr($vat_id, 2);\n\n\t\t// Is it a naturalized foreigner?\n\t\tif (strtoupper($vat_id[0]) == 'X')\n\t\t\t$vat_id = substr($vat_id, 1); // Truncated $vat_id is validated as a regular one\n\n\t\t// Length check \n\t\tif (strlen($vat_id) > 9) // $vat_id at this point should be 9 chars at most\n\n\n\n\t\t\treturn 0;\n\n\t\t// Is it a company?\n\t\tif (!is_numeric($vat_id[0])) {\n\t\t\t$allowed = array ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H');\n\t\t\t$checkval = false;\n\n\t\t\tfor ($i = 0; $i < count($allowed); $i ++) {\n\t\t\t\tif (strtoupper($vat_id[0]) == $allowed[$i])\n\t\t\t\t\t$checkval = true;\n\t\t\t} // end for($i=0; $i<count($allowed); $i++)\n\t\t\tif (!$checkval)\n\t\t\t\treturn 9; // Few more letters are allowed, but not likely to happen\n\n\t\t\t$vat_len1 = strlen($vat_id) - 1;\n\n\t\t\t$checksum = (int) $vat_id[$vat_len1];\n\t\t\t$checkval = 0;\n\n\t\t\tfor ($i = 1; $i < $vat_len1; $i ++)\n\t\t\t\t$checkval += $this->cross_summa((int) $vat_id[$i] * ($this->is_even($i) ? 1 : 2));\n\n\t\t\tif ($checksum != 10 - $this->modulo($checkval, 10))\n\t\t\t\treturn 0;\n\n\t\t\treturn 1;\n\t\t} // end Is it a company?\n\n\t\t// Is it an Individual? (or naturalized foreigner)\n\t\tif (!is_numeric($vat_id[strlen($vat_id) - 1])) {\n\t\t\t$allowed1 = \"TRWAGMYFPDXBNJZSQVHLCKE\";\n\n\t\t\t$vat_len1 = strlen($vat_id) - 1;\n\n\t\t\t$checksum = strtoupper($vat_id[$vat_len1]);\n\t\t\t$checkval = $this->modulo((int) substr($vat_id, 0, $vat_len1), 23);\n\n\t\t\tif ($checksum != $allowed1[$checkval])\n\t\t\t\treturn 0;\n\n\t\t\t$this->vat_mod = array ('status' => $allowed1[$checkval]);\n\n\t\t\treturn 1;\n\t\t} // end Is it an Individual?\n\n\t\treturn 0; // No match found\n\t} // end spanien\n\n\t// tschechien\n\tfunction checkVatID_cz($vat_id) {\n\n\t\tif ((strlen($vat_id) != 10) || (strlen($vat_id) != 11) || (strlen($vat_id) != 12))\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end tschechien\n\n\t// ungarn\n\tfunction checkVatID_hu($vat_id) {\n\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end ungarn\n\n\t// zypern\n\tfunction checkVatID_cy($vat_id) {\n\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end zypern\n\n\t/*******************************************************************/\n\n\t/********************************************************************\n\t* mathematische Hilfsfunktionen *\n\t********************************************************************/\n\t// modulo berechnet den rest einer division von $val durch $param\n\tfunction modulo($val, $param) {\n\t\treturn $val - (floor($val / $param) * $param);\n\t} // end function modulo($val, $param)\n\n\t// stellt fest, ob eine zahl gerade ist\n\tfunction is_even($val) {\n\t\treturn ($val / 2 == floor($val / 2)) ? true : false;\n\t} // end function is_even($val)\n\n\t// errechnet die quersumme von $val\n\tfunction cross_summa($val) {\n\t\t$val = (string) $val;\n\t\t$sum = 0;\n\t\tfor ($i = 0; $i < strlen($val); $i ++)\n\t\t\t$sum += (int) $val[$i];\n\t\treturn $sum;\n\t} // end function cross_summa((string) $val)\n\t/*******************************************************************/\n\n\t/********************************************************************\n\t* Live Check *\n\t********************************************************************/\n\t// Live Check überprüft die USTid beim Bundesamt für Finanzen\n\tfunction live($abfrage_nummer) {\n\n\t\t$eigene_nummer = STORE_OWNER_VAT_ID;\n\n\t\t/* Hier wird der String für den POST per URL aufgebaut */\n\t\t$ustid_post = \"eigene_id=\".$eigene_nummer.\"&abfrage_id=\".$abfrage_nummer.\"\";\n\n\t\t/* Zur Verbindung mit dem Server wird CURL verwendet */\n\t\t/* mit curl_init wird zunächst die URL festgelegt */\n\n\t\t$ch = curl_init(\"http://wddx.bff-online.de//ustid.php?\".$ustid_post.\"\");\n\n\t\t/* Hier werden noch einige Parameter für CURL gesetzt */\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0); /* Header nicht in die Ausgabe */\n\t\tcurl_setopt($ch, CURLOPT_NOBODY, 0); /* Ausgabe nicht in die HTML-Seite */\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); /* Umleitung der Ausgabe in eine Variable ermöglichen */\n\n\t\t/* Aufruf von CURL und Ausgabe mit WDDX deserialisieren */\n\n\t\t$des_out = wddx_deserialize(curl_exec($ch));\n\t\tcurl_close($ch);\n\n\t\t/* Die deserialisierte Ausgabe in ein Array schreiben */\n\n\t\twhile (list ($key, $val) = each($des_out)) {\n\t\t\t$ergebnis[$key] = $val;\n\t\t}\n\n\t\tif ($ergebnis[fehler_code] == '200') {\n\t\t\treturn 1;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '201') {\n\t\t\treturn 0;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '202') {\n\t\t\treturn 0;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '203') {\n\t\t\treturn 0;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '204') {\n\t\t\treturn 0;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '205') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '206') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '207') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '208') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '209') {\n\t\t\treturn 0;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '210') {\n\t\t\treturn 0;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '666') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '777') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '888') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '999') {\n\t\t\treturn 9;\n\t\t} else {\n\t\t\treturn 9;\n\t\t}\n\n\t} // end function Live\n\t/*******************************************************************/\n}", "public static function isDummyId($id): bool {\n return is_string($id) && (strlen($id) == 36 && strpos($id, 'wcmf') === 0);\n }", "function validateIdNumber($idNumber, $name)\n {\n //include the id number validator class to validate the id number and the name of the student if it matches\n include(\"../includes/class_libraries/IdNumberValidator.php\");\n $idNumberValidator = new IdNumberValidator();\n \n // validate the id number\n $result = $idNumberValidator -> validateIdNumber($idNumber, $name);\n \n // check the result if there is an error committed\n if($result == false)\n {\n // get the error and and return the error\n return $idNumberValidator -> getErrors();\n }\n \n return;\n }", "function clean_id($id)\n{\n\t$id = str_replace('-', '_', $id);\n\treturn $id;\n}", "private function validateCacheId($id)\n\t{\n\t\tif (strlen($id) > self::CACHE_ID_MAX_LENGTH) {\n\t\t\tthrow InvalidCacheId::exceedsMaxLength($id, self::CACHE_ID_MAX_LENGTH);\n\t\t}\n\n\t\tif (preg_match('/[\\t\\r\\n]/', $id) === 1) {\n\t\t\tthrow InvalidCacheId::containsControlCharacter($id);\n\t\t}\n\t}", "function id_casteo($id){\n\treturn (int)trim(stripslashes(htmlspecialchars($id)));\n}", "function validar_dni($dni){\n $letra = substr($dni, -1);\n $numeros = substr($dni, 0, -1);\n if ( substr(\"TRWAGMYFPDXBNJZSQVHLCKE\", $numeros%23, 1) == $letra && strlen($letra) == 1 && strlen ($numeros) == 8 ){\n echo 'valido';\n }else{\n echo 'no valido';\n }\n}", "public function testValidCustomerIdTest()\n {\n $customerId = '10';\n $expected_customer_first_Name = 'Juanita';\n $customer = $this->customerOrderService->getCustomer($customerId);\n\n $this->assertTrue($expected_customer_first_Name == $customer->first_name);\n }", "function cp_str_isInt($str){\r\n return preg_match('/^[[:digit:]]+$/',$str);\r\n}", "function IsUuid($data)\n{\n return preg_match('/^[a-f\\d]{8}-(?:[a-f\\d]{4}-){3}[a-f\\d]{12}$/i', $data);\n}", "public function setId($id){\n $intVal = filter_var($id, FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE);\n if(isset($intVal)){\n $this->id = $intVal;\n return true;\n } \n return false; \n }", "function isUid($input)\n{\n $pattern = \"/^[a-zA-Z0-9]{64}$/\";\n return preg_match($pattern, $input);\n}", "protected function checkID(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_numeric($this->_ID) && $this->_ID !== 0 ) {\n\t\t\t$inMessage .= \"{$this->_ID} is not a valid value for ID\";\n\t\t\t$isValid = false;\n\t\t}\n\t\treturn $isValid;\n\t}", "protected function checkID(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_numeric($this->_ID) && $this->_ID !== 0 ) {\n\t\t\t$inMessage .= \"{$this->_ID} is not a valid value for ID\";\n\t\t\t$isValid = false;\n\t\t}\n\t\treturn $isValid;\n\t}", "protected function checkID(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_numeric($this->_ID) && $this->_ID !== 0 ) {\n\t\t\t$inMessage .= \"{$this->_ID} is not a valid value for ID\";\n\t\t\t$isValid = false;\n\t\t}\n\t\treturn $isValid;\n\t}", "public function testIsIdFieldFunction(?string $input, ?array $result): void\n {\n $this->assertEquals($result, FieldsManager::isIdField($input));\n }", "public function getStrId();", "private static function parseId($string) {\n\t\t$string = preg_replace('/[^a-zA-Z0-9]/', '-', $string);\n\t\t$string = strtolower(trim($string, '-'));\n\n\t\tif (self::$model) {\n\t\t\t$string = 'sq-form-'.self::$mark.'-'.$string;\n\t\t}\n\n\t\treturn $string;\n\t}" ]
[ "0.7301074", "0.70989186", "0.7034525", "0.6836522", "0.6819846", "0.67861956", "0.66976845", "0.6664169", "0.6619569", "0.6570407", "0.65465444", "0.64891106", "0.64370906", "0.6389786", "0.6352944", "0.62604386", "0.62125146", "0.62057936", "0.62054217", "0.6114142", "0.6112091", "0.6104911", "0.60988057", "0.60867614", "0.607373", "0.60614747", "0.6037453", "0.60019743", "0.5977781", "0.597236", "0.59643555", "0.59614617", "0.5958641", "0.5956056", "0.5947669", "0.5938556", "0.5928188", "0.5913782", "0.58874893", "0.5857104", "0.5850948", "0.58241117", "0.5792547", "0.5779829", "0.5749932", "0.5749095", "0.5744221", "0.57422525", "0.57415664", "0.57409346", "0.5737069", "0.5727607", "0.572096", "0.57132107", "0.57091165", "0.5699386", "0.5698324", "0.5694127", "0.5691282", "0.56878006", "0.5687099", "0.567775", "0.56762046", "0.566946", "0.56673336", "0.56480134", "0.56438226", "0.5640283", "0.5632976", "0.5631447", "0.563089", "0.5628234", "0.5619641", "0.5608187", "0.5606044", "0.5597114", "0.55786544", "0.5569793", "0.5569545", "0.5564519", "0.55616075", "0.5559118", "0.55533975", "0.55517644", "0.5549417", "0.55455625", "0.55438066", "0.55240077", "0.5521077", "0.5520709", "0.5516773", "0.5515991", "0.55126876", "0.55116475", "0.5505675", "0.5505675", "0.5505675", "0.5469789", "0.54688", "0.54674953" ]
0.75277257
0
Cities Unittest with Regular expression Check String(Lowercase, Uppercase) and Digits because Ac_Id consist of String & Digits
public function testThatWeCanGetTheCategories() { $ads = new Cities; $ads->setCities('Waterloo'); $this->assertEquals(1 , preg_match( '/^[a-zA-Z]{3,30}$/', $ads->getCities() ), $ads->getCities() . ' is less 3 or more 31' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testThatWeCanGetTheId()\n {\n $ads = new Cities;\n \n $ads->setId('1');\n \n \n //$this->assertEquals($ads->getId(), '1');\n $this->assertEquals(1 , preg_match( '/^[0-9]+$/', $ads->getId() ), $ads->getId() . ' is not a set of digits' );\n\n\n }", "public function is_valid_city($str) {\n\n $result = $this->ci->generic_model->retrieve_one(\"lib_city\",\n array(\n \"id_provinsi\" => $this->ci->input->post(\"province\"),\n \"id\" => $str\n )\n );\n\n if ($result) {\n return TRUE;\n } else {\n return FALSE;\n }\n\n return $result;\n }", "function sanitizer($inputId)\n {\n preg_match(\"/([0-9]{6})(_)([a-zA-Z]{1,})/\", $inputId, $inputId2);\n\n if ( !empty($inputId2) and is_numeric($inputId2[1]) and $inputId2[2] == '_' and is_string($inputId2[3]) )\n {\n return TRUE;\n }\n else\n {\n echo \"<strong style='color: red'>Error: </strong>Please enter an ID which starts with six numeric values followed by underscore followed by string in the format example as shown --> 123456_ABC\";\n return FALSE;\n }\n }", "function isAddress($input)\n{\n $pattern = \"/^[a-zA-Z0-9]{33,34}$/\";\n return preg_match($pattern, $input);\n}", "public function testValidAlphanumString()\n {\n $string = 'dfasfa5425423frg890';\n $this->assertTrue($this->alphanum->execute($string));\n }", "public function testAddress()\n {\n $this->assertTrue(RuValidation::address1('Московский пр., д. 100'));\n $this->assertTrue(RuValidation::address1('Moskovskiy ave., bld. 100'));\n\n $this->assertFalse(RuValidation::address1('I would not tell'));\n }", "function validaAlfa ($Cad) {\n// prueba si la entrada es una cadena alfabetica\nreturn preg_match(\"/^[a-z]+$/i\", $Cad );\n}", "function abc($str)\n\t{\t\t\n\t\t$this->CI->form_validation->set_message('abc', \"El campo %s debe contener uno de los siguientes valores A,B,C,a,b,c\");\n\t\treturn (bool) preg_match(\"/(^[abcABC]$)|^$/\", $str);\n\t}", "function verifyAlphaNum ($testString)\n\t{\n return (preg_match(\"/^([[:alnum:]]|-|\\.| |')+$/\", $testString));\n }", "public function testCharacterFieldValidation()\n {\n // Field should only allow 50 characters\n $field = $this->table->getField('stringone');\n\n $testStr = str_repeat('x', 56);\n $this->assertEquals(56, strlen($testStr));\n $cleanStr = $field->getPHPValue($testStr);\n $this->assertEquals(50, strlen($cleanStr));\n\n\n $testStr = str_repeat('z', 50);\n\n $fieldVal = $field->getSqlBoundValue($testStr);\n $key = $fieldVal->getValueMarker();\n\n $this->assertEquals($key, $fieldVal->getValueMarker());\n $this->assertEquals($testStr, $fieldVal->getBoundValues()[$key]);\n }", "public function test_example()\n {\n $this->assertTrue( (new PassPhrase('abcde fghij'))->validate());\n $this->assertTrue( (new PassPhrase('a ab abc abd abf abj'))->validate());\n $this->assertTrue( (new PassPhrase('iiii oiii ooii oooi oooo'))->validate());\n $this->assertFalse( (new PassPhrase('abcde xyz ecdab'))->validate());\n $this->assertFalse( (new PassPhrase('oiii ioii iioi iiio'))->validate());\n }", "function fixCity($str = \"\") {\n\tif ( preg_match(\"/[A-Z]{3}/\", $str) ) {\n\t\t$str = strtolower($str);\n\t}\n\t$str = ucwords($str);\n\t$str = str_replace(\"'\", \"''\", $str);\n\treturn($str);\n//fixCity\n}", "public function testRegistrationPasswordOnlyUpperCase(): void { }", "function testIfmatch(){\n\t\t#mdx:ifmatch\n\t\tParam::get('name')\n\t\t\t->filters()\n\t\t\t->ifmatch('/\\d/', 'Name cannot contain digits');\n\n\t\t$error = Param::get('name')->process(['name'=>'M4ry'])->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Name cannot contain digits\", $error);\n\n\t}", "function testIfmatchWithModifiers(){\n\t\t#mdx:ifmatch2\n\t\tParam::get('phone')\n\t\t\t->filters()\n\t\t\t->ifmatch('/[a-z]/i', 'Phone cannot contain letters');\n\n\t\t$error = Param::get('phone')->process(['phone'=>'9829574K'])->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Phone cannot contain letters\", $error);\n\n\t}", "public function testValidCustomerIdTest()\n {\n $customerId = '10';\n $expected_customer_first_Name = 'Juanita';\n $customer = $this->customerOrderService->getCustomer($customerId);\n\n $this->assertTrue($expected_customer_first_Name == $customer->first_name);\n }", "public function testRegistrationValuesContainSpecialCharacters(): void { }", "public function testIsString()\n {\n $animalName = $this->faker->animal();\n\n $this->assertRegExp('/^[\\wñ-]+$/', $animalName);\n }", "function is_id($str)\n{\n $regex = \"/([a-f0-9]{8}\\-[a-f0-9]{4}\\-4[a-f0-9]{3}\\-[8|9|a|b][a-f0-9]{3}\\-[a-f0-9]{12})/\";\n\n return preg_match($regex, $str) === 1;\n}", "public function testCreditCardIsValid($data)\n {\n $pattern = \"/^([0-9]{4}[\\s]?){3}([0-9]{4})$/\";\n\n $this->assertMatchesRegularExpression($pattern,$data);\n\n }", "public function cityname_validation($city) {\n $this->form_validation->set_message('cityname_validation', 'The %s field is not valid City or Destination Code');\n\n preg_match_all('/\\(([A-Za-z0-9 ]+?)\\)/', $city, $out);\n $cityCode = $out[1];\n\n if (!empty($cityCode))\n return TRUE;\n else\n return FALSE;\n }", "function validaAlfaNum ($Cad) {\n// prueba si la entrada es una cadena alfanumerica\nreturn preg_match(\"/^[a-z 0-9]*$/i\", $Cad );\n}", "static function checkAddress($input)\r\n {\r\n if (preg_match('/^[\\W\\w\\d,][\\W\\w\\d\\s,]{1,40}$/', $input)) {\r\n return true; //Illegal Character found!\r\n }\r\n else{\r\n echo PageBuilder::printError(\"Please enter alphabets and numbers with comma seperation, maximum of 40 characters.\");\r\n return false;\r\n }\r\n }", "function verifyAlphaNum ($testString) {\n\t// Check for letters, numbers and dash, period, space and single quote only. \n\treturn (preg_match (\"/^([[:alnum:]]|-|\\.| |')+$/\", $testString));\n}", "function verifyAlphaNum($testString) {\r\n return (preg_match (\"/^([[:alnum:]]|-|\\.| |\\'|&|;|#)+$/\", $testString));\r\n}", "function number_car($number){\n$regexp = '/[a-ż][0-9][0-9][0-9][a-ż][a-ż]/ui';\n//$regexp = '/^[a-ż][0-9][0-9][0-9][a-ż][a-ż]$/ui'; //^$ only reads in between\n//$regexp = '/\\\\w\\\\w\\\\w\\\\w\\\\w\\\\w/ui'; // \\\\w looks for each letter a numeric and underscore\n$matches = array();\nif (preg_match($regexp, $number, $matches)) {\n echo\"number car is {$matches[0]}<br>\";\n //print_r($matches);\n}else {\n echo\"enter the correct car number\\n\";\n}\n\nreturn $matches;\n}", "function validateDCI($str){\n if((strlen($str)>10) || (strlen($str)<4) || (!ctype_digit($str)) )\n return false;\n else\n return true;\n}", "public function dataValidCases()\n {\n return array(\n array('65 02 53 00 00', RegionCode::US),\n array('6502 538365', RegionCode::US),\n array('650//253-1234', RegionCode::US), // 2 slashes are illegal at higher levels\n array('650/253/1234', RegionCode::US),\n array('9002309. 158', RegionCode::US),\n array('12 7/8 - 14 12/34 - 5', RegionCode::US),\n array('12.1 - 23.71 - 23.45', RegionCode::US),\n array('800 234 1 111x1111', RegionCode::US),\n array('1979-2011 100', RegionCode::US),\n array('+494949-4-94', RegionCode::DE), // National number in wrong format\n array('4156666-777', RegionCode::US),\n array('2012-0102 08', RegionCode::US), // Very strange formatting.\n array('2012-01-02 08', RegionCode::US),\n // Breakdown assistance number with unexpected formatting.\n array('1800-1-0-10 22', RegionCode::AU),\n array('030-3-2 23 12 34', RegionCode::DE),\n array('03 0 -3 2 23 12 34', RegionCode::DE),\n array('(0)3 0 -3 2 23 12 34', RegionCode::DE),\n array('0 3 0 -3 2 23 12 34', RegionCode::DE),\n // Fits an alternate pattern, but the leading digits don't match\n array('+52 332 123 23 23', RegionCode::MX),\n );\n }", "public function runAssert()\n {\n $reflected_data = $this->_getInnerPropertyValueByReflection(self::$TWStreet, 'city');\n $this->assertTrue(in_array('基隆市', $reflected_data));\n $this->assertTrue(in_array('連江縣', $reflected_data));\n // print_r($reflected_data);\n // $reflected_data = $this->_getInnerPropertyValueByReflection($this->TWStreet, 'cityArea');\n $reflected_data = $this->_getInnerPropertyValueByReflection(self::$TWStreet, 'cityArea');\n $this->assertTrue(in_array('仁愛區', $reflected_data));\n $this->assertTrue(in_array('東引鄉', $reflected_data));\n // print_r($reflected_data);\n // $reflected_data = $this->_getInnerPropertyValueByReflection($this->TWStreet, 'cityAreaCount');\n $reflected_data = $this->_getInnerPropertyValueByReflection(self::$TWStreet, 'cityAreaCount');\n $this->assertTrue(in_array(7, $reflected_data));\n $this->assertTrue(in_array(367, $reflected_data));\n // print_r($reflected_data);\n }", "public function testValidateSpecialChars(): void\n {\n $this->assertFalse($this->validate('some-text-123'));\n }", "function validateUname($data)\n{\n\t\t$pisahUnderscore = explode('_',$data);\n\t\t$str5=$pisahUnderscore[0];\n\t\t$int2=$pisahUnderscore[1];\n\n\t\tif ((str_word_count($str5) == 1) and (strlen((string) trim($str5)) == 5) and ((strlen((int) trim($int2)) == 2)))\n\t\t{\n\t\t\techo \"Terverifikasi\";\n\t\t} else {\n\t\t\techo \"Coba lagi\";\n\t\t}\n}", "function test_subcategory_input($data, $regex) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n if (preg_match($regex,$data)) {\n return $data;\n }else{\n return $data = \"\";\n } \n }", "function testFinalNomCoureur($str) {\n // ##### Test charactère par charactère ######\n $str = str_split($str);\n foreach($str as $char) {\n if(!preg_match(\"#[A-Z]|'|-|\\040#\", $char)) {\n //echo \"Charactère interdit : \" . utf8_encode($char) . \"<br>\";\n return false;\n }\n }\n $str = implode($str);\n // ##### Fin test charactère #####\n \n // ##### Test cas bizarre #####\n if(preg_match(\"#^'*$|''+|^' '$|' '$|^' '|^\\\"*$#\", $str) || preg_match(\"#(\\040\\\"\\040)|(\\040''\\040)|(\\040'\\040)#\", $str) || preg_match(\"#--.*--#\", $str)) {\n //echo \"Cas bizarre : \" . utf8_encode($str) . \"<br>\";\n return false;\n }\n // ##### Fin test cas bizarre\n return $str;\n }", "function isValidStudentID($id){\n if(preg_match('/^\\d+$/', $id) && strlen($id) == 8){\n return true;\n }\n else{\n return false;\n }\n }", "function catalogo($str, $parms)\n\t{\t\t\n\t\t//$CI =& get_instance();\n\t\tlist($min, $max) = explode(\"-\", $parms, 2);\n\t\t$this->CI->form_validation->set_message('catalogo', \"El campo %s debe contener un valor del cat&aacute;logo entre {$min} y {$max}.\");\n\t\treturn (bool) preg_match( \"/(^[{$min}-{$max}]$)|^$/\", $str);\n\t}", "public function testRegistrationPasswordOnlyLowerCase(): void { }", "function safeId($string) {\r\n //Lower case everything\r\n $string = strtolower($string);\r\n //Make alphanumeric (removes all other characters)\r\n $string = preg_replace(\"/[^a-z0-9_\\s-]/\", \"\", $string);\r\n //Clean up multiple dashes or whitespaces\r\n $string = preg_replace(\"/[\\s-]+/\", \" \", $string);\r\n //Convert whitespaces and underscore to dash\r\n $string = preg_replace(\"/[\\s_]/\", \"-\", $string);\r\n return $string;\r\n}", "function test_names($data){\n\tif (!preg_match(\"/^[a-zA-Z-' ]*$/\",$data)) {\n \t\treturn \"Only letters and white space allowed\";\n\t}\n\treturn $data;\n}", "public function testManyLowercaseCharacter ()\n {\n // Function parameters\n $length = 8;\n $minPasswordRequirements = [\n 'min' => 10,\n 'special' => 1,\n 'digit' => 1,\n 'upper' => 1,\n 'lower' => 5\n ];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A(?=(.*\\d){1})(?=(?:[^a-z]*[a-z]){5})(?=(?:[^A-Z]*[A-Z]){1})(?=(?:[0-9a-zA-Z]*[!#$%&*+,-.:;<=>?@_~]){1})[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{10,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "function fncValidaDI_59($IdEstado, $GestorErr, $NumReg, $Campo){\n\t \n\t$Bandera = CERO;\n\t$DI_58 = \"(59)Nombre del Producto\";\n\t$DI_58_ErrTam = \"Nombre del Producto debe ser de 11 caracteres/numeros\";\n\t$DI_58_Catalogo = \"No coincide con directiva de Calidad (Alfanumérico a 11)\";\n\t\n\t$LocCampo =$Campo;\n\tif (strlen($LocCampo) == 11){\n\t\tif(!preg_match(\"/[A-Z,a-z,0-9]{11}/\",$LocCampo))\n\t\t{\n\t\t\t$Error = $NumReg .\"|\".$DI_58.\"|\".$LocCampo.\"|\" . $DI_58_Catalogo.\"|\\n\";\n\t\t\tfwrite($GestorErr, $Error);\n\t\t\t$Bandera = UNO;\n\t\t}\t\n\t}\n\telse{\n\t\t$Error = $NumReg .\"|\".$DI_58.\"|\".$LocCampo.\"|\" . $DI_58_ErrTam.\"|\\n\";\n\t\tfwrite($GestorErr, $Error);\n\t\t$Bandera = UNO;\n\t}\n\treturn $Bandera;\n}", "public function testCheckIsCaseInsensitive()\n {\n $this->assertTrue($this->Acl->check('hardy', 'controllers/forms/new'));\n $this->assertTrue($this->Acl->check('Role/data_acquirer', 'controllers/forms/new'));\n $this->assertTrue($this->Acl->check('hardy', 'controllers/FORMS/NEW'));\n $this->assertTrue($this->Acl->check('Role/data_acquirer', 'controllers/FORMS/NEW'));\n }", "public static function validateEntidad($entidad){\n return preg_match('/^[A-Z0-9]{2,20}$/i', $entidad);\n }", "public function test_getByCustomerNo() {\n\n }", "static function validation(string $qth): bool\n {\n $qth = strtoupper($qth);\n return preg_match(\"{\" . self::PATTERN . \"+$}AD\", $qth) === 1;\n }", "function isSchoolYearinvalid($str = null){\n if ($str) {\n $year1 =substr($str,0 ,4);\n $year2 =substr($str,5 ,4);\n if ((strlen($str)==9) && ($str[4])==\"-\" && is_numeric($year1) && is_numeric($year2)){\n echo \"is valid<br>\";\n return false;\n }else\n echo \"invalid<br>\";\n return true;\n }\n}", "public function testCnh()\n {\n $this->assertTrue(BrValidation::cnh('01827854569'));\n\n $this->assertFalse(BrValidation::cnh('01827854568'));\n $this->assertFalse(BrValidation::cnh('12345678909'));\n $this->assertFalse(BrValidation::cnh('11111111111'));\n $this->assertFalse(BrValidation::cnh('018278545'));\n $this->assertFalse(BrValidation::cnh('abcdefghij'));\n }", "protected function testNameExp()\n {\n $exp = '/^([A-Z]+\\s[A-Z]+|[a-z]+\\s[a-z]+)$/';\n\n $names = array(\n 'Bill Smith','BILL SMITH','bILL SMITH',\n 'bill smith','von Richter',\"O'Rielly\",'Greg McReynold','Joe-Schmoe',\n 'JOE berthera',\n 'PRINCE', 'BILLY JOE JNR',\"PETER O'PETERSON\", // Should match but does not\n );\n foreach($names as $name)\n {\n $matched = preg_match($exp,$name);\n if ($matched) echo \"Matched: $name\\n\";\n else echo \"No Match: $name\\n\";\n }\n }", "function validaAlfaEsp ($Cad) {\n// prueba si la entrada son cadenas alfabeticas con espacio\n// preg_match realiza búsquedas en cadenas de texto mediante expresiones regulares. Devolverá el valor booleano.\nreturn preg_match(\"/^[a-z ]*$/i\", $Cad );\n}", "public function testGetHospitalbyCity(){\r\n\t\t$this->http = new Client(['base_uri' => 'http://localhost/casecheckapp/public/index.php/']);\r\n\t\r\n\t\t//Test HTTP status ok for city=Chicago\r\n\t\t$response= $this->http->request('GET','api/v1/hospitals/\"Chicago\"');//Change city here\r\n\t\t$this->assertEquals(200,$response->getStatusCode());\r\n\r\n\t\t//Test JSON content\r\n\t\t$contentType = $response->getHeaders()[\"Content-Type\"][0];\r\n\t\t$this->assertEquals(\"application/json\", $contentType);\r\n\r\n\t\t//Stopping the connexion with Guzzle\r\n\t\t$this->http = null;\r\n\t\t\r\n\t}", "public function testReplacer()\n {\n $request = ['postal_code' => 'Another random string'];\n $rules = ['postal_code' => 'postal_code:CO'];\n $validator = $this->factory->make($request, $rules);\n\n $this->assertEquals($validator->errors()->get('postal_code'), ['postal code CO ######']);\n }", "function isPostcodeValid($postcode)\n{\n //remove all whitespace\n $postcode = preg_replace('/\\s/', '', $postcode);\n \n //make uppercase\n $postcode = strtoupper($postcode);\n \n if(preg_match(\"/^[A-Z]{1,2}[0-9]{2,3}[A-Z]{2}$/\",$postcode)\n || preg_match(\"/^[A-Z]{1,2}[0-9]{1}[A-Z]{1}[0-9]{1}[A-Z]{2}$/\",$postcode)\n || preg_match(\"/^GIR0[A-Z]{2}$/\",$postcode))\n {\n return true;\n }\n else {\n return false;\n }\n}", "public function testCountryCodeWithIncorrectCasing()\n {\n $request = ['postal_code' => '12345'];\n $rules = ['postal_code' => 'postal_code:de'];\n $validator = $this->factory->make($request, $rules);\n\n $this->assertFalse($validator->fails());\n }", "private function cityName($input) {\n $regExString = '/'.$input.'/i'; \n $regExArray = preg_grep($regExString, $this->map); \n return $userCity = array_pop($regExArray);\n }", "public function validate_purpose($str) {\n if($this->labs_model->validate_purpose($str)) {\n return TRUE;\n } else {\n return FALSE;\n }\n\n }", "public function testValidPostalCode()\n {\n $request = ['postal_code' => '1000 AP'];\n $rules = ['postal_code' => 'postal_code:NL'];\n $validator = $this->factory->make($request, $rules);\n\n $this->assertFalse($validator->fails());\n }", "public function testValidate()\n {\n $this\n ->boolean(TestedClass::validatePattern('raoul'))\n ->isIdenticalTo(true)\n ->boolean(TestedClass::validatePattern('23'))\n ->isIdenticalTo(true)\n ->boolean(TestedClass::validatePattern('raoul.node.raoul'))\n ->isIdenticalTo(true)\n ->boolean(TestedClass::validatePattern('raoul.$\\\\'))\n ->isIdenticalTo(false)\n ->boolean(TestedClass::validatePattern('é'))\n ->isIdenticalTo(false)\n ->boolean(TestedClass::validatePattern('î'))\n ->isIdenticalTo(false)\n ;\n }", "public function testMatch10()\n {\n // too many test\n $cities = (new City())->match10('');\n $this->assertTrue(empty($cities));\n\n // test 10\n $firstPart = rand();\n for ($i=0; $i<10; $i++) {\n $this->createCity($firstPart.rand());\n }\n\n // 10 matches test\n $cities = (new City())->match10($firstPart);\n $this->assertFalse(empty($cities));\n $this->assertEquals(10, count($cities));\n }", "public function testValidateString(): void\n {\n $this->assertFalse($this->validate('some text'));\n }", "function verifyAlphaSpaces($testString) {\n $newTestString = str_replace(' ', '', $testString);\n return (ctype_alpha($newTestString));\n }", "public static function cc_number_exists_in_str( $str ) {\n\t\t$luhnRegex = <<<EOT\n/\n(?#amex)(3[47][0-9]{13})|\n(?#bankcard)(5610[0-9]{12})|(56022[1-5][0-9]{10})|\n(?#diners carte blanche)(300[0-5][0-9]{11})|\n(?#diners intl)(36[0-9]{12})|\n(?#diners US CA)(5[4-5][0-9]{14})|\n(?#discover)(6011[0-9]{12})|(622[0-9]{13})|(64[4-5][0-9]{13})|(65[0-9]{14})|\n(?#InstaPayment)(63[7-9][0-9]{13})|\n(?#JCB)(35[2-8][0-9]{13})|\n(?#Laser)(6(304|7(06|09|71))[0-9]{12,15})|\n(?#Maestro)((5018|5020|5038|5893|6304|6759|6761|6762|6763|0604)[0-9]{8,15})|\n(?#MasterCard)(5[1-5][0-9]{14})|\n(?#Solo)((6334|6767)[0-9]{12,15})|\n(?#Switch)((4903|4905|4911|4936|6333|6759)[0-9]{12,15})|((564182|633110)[0-9]{10,13})|\n(?#Visa)(4([0-9]{15}|[0-9]{12}))\n/\nEOT;\n\n\t\t$nonLuhnRegex = <<<EOT\n/\n(?#china union pay)(62[0-9]{14,17})|\n(?#diners enroute)((2014|2149)[0-9]{11})\n/\nEOT;\n\n\t\t// Transform the regex to get rid of the new lines\n\t\t$luhnRegex = preg_replace( '/\\s/', '', $luhnRegex );\n\t\t$nonLuhnRegex = preg_replace( '/\\s/', '', $nonLuhnRegex );\n\n\t\t// Remove common CC# delimiters\n\t\t$str = preg_replace( '/[\\s\\-]/', '', $str );\n\n\t\t// Now split the string on everything else and join again so the regexen have an 'easy' time\n\t\t$str = join( ' ', preg_split( '/[^0-9]+/', $str, PREG_SPLIT_NO_EMPTY ) );\n\n\t\t// First do we have any numbers that match a pattern but is not luhn checkable?\n\t\t$matches = array();\n\t\tif ( preg_match_all( $nonLuhnRegex, $str, $matches ) > 0 ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Find potential CC numbers that do luhn check and run 'em\n\t\t$matches = array();\n\t\tpreg_match_all( $luhnRegex, $str, $matches );\n\t\tforeach ( $matches[0] as $candidate ) {\n\t\t\tif ( DataValidator::luhn_check( $candidate ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// All our checks have failed; probably doesn't contain a CC number\n\t\treturn false;\n\t}", "protected static function _alphaNumeric(){\n if (self::$_ruleValue) {\n $str = trim(self::$_elementValue);\n if (!preg_match('/[a-zA-z0-9]/', $str)) {\n self:: setErrorMessage(\"Alphanumeric only\");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }", "public function testGenerateAddressAuthCodeById()\n {\n\n }", "private function isValid($input)\n {\n // replace german umlauts and whitespace cause only ascii allowed\n // german letters was requirement by prof\n $input = str_replace(self::$SEARCH, self::$REPLACE, $input);\n\n // more than one comma or other chars than a-z\n if (substr_count($input, \",\") > 1 || !preg_match(self::$REGEX, $input))\n return false;\n\n // split input in city and country if necessary\n if (strpos($input, ','))\n {\n $a = explode(',', $input);\n $this->city = $a[0];\n $this->country = $a[1];\n }\n else\n {\n $this->city = $input;\n $this->country = 'DE';\n }\n\n return true;\n }", "public function testInvalidAlphanumString()\n {\n $string = 'fda543*&^%$gfs';\n $this->assertFalse($this->alphanum->execute($string));\n }", "public function testCns()\n {\n $this->assertTrue(BrValidation::cns('702 5053 3246 4238'));\n $this->assertTrue(BrValidation::cns('898 0058 0155 2261'));\n $this->assertTrue(BrValidation::cns('706000307269748'));\n $this->assertTrue(BrValidation::cns('706902161943931'));\n\n $this->assertFalse(BrValidation::cns('702 5053 3246 4237'));\n $this->assertFalse(BrValidation::cns('111 1111 1111 1111'));\n $this->assertFalse(BrValidation::cns('9021 6194 0000'));\n $this->assertFalse(BrValidation::cns(['12345678909']));\n }", "function validateZipCode($string){\n\tif($string == '') {return 'Zip code is required </br>';}\n\tif(!preg_match(\"/^[A-Za-z]\\d[A-Za-z] \\d[A-Za-z]\\d$/\", $string)){\n\t\treturn 'Zip code is invalid </br>';\n\t}\n\treturn '';\n}", "function password_check($str)\n\t\t\t{\n\t\t\t\tif(preg_match('/[0-9]/', $str) && preg_match('/[a-zA-Z]/', $str))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t}", "function verifyPhone ($testString) {\n $regex = '/^(?:1(?:[. -])?)?(?:\\((?=\\d{3}\\)))?([2-9]\\d{2})(?:(?<=\\(\\d{3})\\))? ?(?:(?<=\\d{3})[.-])?([2-9]\\d{2})[. -]?(\\d{4})(?: (?i:ext)\\.? ?(\\d{1,5}))?$/';\n\treturn (preg_match($regex, $testString));\n}", "public function testValidGetByCity() {\n\t\t//create a new organization, and insert into the database\n\t\t$organization = new Organization(null, $this->VALID_ADDRESS1, $this->VALID_ADDRESS2, $this->VALID_CITY, $this->VALID_DESCRIPTION,\n\t\t\t\t$this->VALID_HOURS, $this->VALID_NAME, $this->VALID_PHONE, $this->VALID_STATE, $this->VALID_TYPE, $this->VALID_ZIP);\n\t\t$organization->insert($this->getPDO());\n\n\t\t//send the get request to the API\n\t\t$response = $this->guzzle->get('https://bootcamp-coders.cnm.edu/~bbrown52/bread-basket/public_html/php/api/organization/?\\'city\\'=\\'' . $this->VALID_CITY . '\\'', [\n\t\t\t\t'headers' => ['X-XSRF-TOKEN' => $this->token]\n\t\t]);\n\n\t\t//ensure the response was sent, and the api returned a positive status\n\t\t$this->assertSame($response->getStatusCode(), 200);\n\t\t$body = $response->getBody();\n\t\t$retrievedOrg = json_decode($body);\n\t\t$this->assertSame(200, $retrievedOrg->status);\n\n\t\t//ensure the returned values meet expectations just checking (enough to make sure the right thing was obtained)\n\t\t//0th entry is the organization for the volunteers, so need to check against the 1st\n\t\t$this->assertSame($retrievedOrg->data[1]->orgId, $organization->getOrgId());\n\t\t$this->assertSame($retrievedOrg->data[1]->orgCity, $this->VALID_CITY);\n\n\t}", "public function testGetRegex() {\n $p = Process::runOk($this->cv('ang:module:list'));\n $this->assertRegexp(';crmUi.*civicrm/a.*crmResource;', $p->getOutput());\n\n $p = Process::runOk($this->cv('ang:module:list \";crm;\"'));\n $this->assertRegexp(';crmUi.*civicrm/a.*crmResource;', $p->getOutput());\n\n $p = Process::runOk($this->cv('ang:module:list \";foo;\"'));\n $this->assertNotRegexp(';crmUi.*civicrm/a.*crmResource;', $p->getOutput());\n }", "function test_apos_before_digits( $input, $output ) {\n\t\treturn $this->assertEquals( $output, wptexturize( $input ) );\n\t}", "function isPartID($input) {\n return (preg_match(\"/(^(?:[1-9][0-9]+?)(?:[a-z]*\\\\d*[a-z]*\\\\d*)?$)/\", $input));\n }", "public function validate()\n {\n if (empty($this->outputString)) {\n return false;\n }\n \n if (ctype_alpha($this->outputString)) {\n return true;\n } else {\n if (ctype_digit(\"\".$this->outputString)) {\n return false;\n } else {\n if( strpos($this->outputString, 'I') === false && strpos($this->outputString, 'O') === false && strpos($this->outputString, '0') === false ) {\n return true;\n }\n return false;\n }\n }\n\n return false;\n }", "function character_validations($value, $isPhone, $isEmail, $isUsername){\n //Possible regex expressions for:\n //phone: -> '/^[0-9]{3}[-][0-9]{3}[-][0-9]{4}$/'\n //email: -> '/^[^0-9.\\_][A-Za-z0-9]+[@][A-Za-z0-9_]+[.][a-z]{3}'\n if($isPhone){\n //if the string mathces this pattern then it will return true or\n return preg_match('/^[0-9]{3}[-][0-9]{3}[-][0-9]{4}$/', $value);\n } elseif($isEmail){\n //this condition is if its for an email\n return preg_match(\"/^[A-Za-z0-9._\\%-]+@[A-Za-z0-9.-]+\\.[a-z]{3}$/\", $value);\n } elseif($isUsername){\n //check if username has proper characters\n return !(preg_match(\"/[\\W]/\", $value));\n }\n }", "public function testIsValidPassing()\n {\n $this->assertTrue($this->helper->isValid('s1', 'wala wala bing bang'));\n $this->assertTrue($this->helper->isValid('s2', 'wala wala bing bang'));\n $this->assertTrue($this->helper->isValid('i1', 12));\n $this->assertTrue($this->helper->isValid('i2', -11));\n $this->assertTrue($this->helper->isValid('i3', 116));\n $this->assertTrue($this->helper->isValid('i4', 916));\n $this->assertTrue($this->helper->isValid('i5', -83));\n $this->assertTrue($this->helper->isValid('i6', -99));\n $this->assertTrue($this->helper->isValid('f1', 12.53));\n $this->assertTrue($this->helper->isValid('f2', 1.5e5));\n $this->assertTrue($this->helper->isValid('f3', -22.79));\n $this->assertTrue($this->helper->isValid('b', true));\n $this->assertTrue($this->helper->isValid('b', false));\n $this->assertTrue($this->helper->isValid('a', [1, 2, 3]));\n $this->assertTrue($this->helper->isValid('m', true));\n $this->assertTrue($this->helper->isValid('m', 'false'));\n $this->assertTrue($this->helper->isValid('r', 'memberType'));\n }", "public function testPostal()\n {\n $this->assertTrue(RuValidation::postal('101135'));\n $this->assertTrue(RuValidation::postal('693000'));\n\n $this->assertFalse(RuValidation::postal('100123'));\n $this->assertFalse(RuValidation::postal('200321'));\n }", "public function testPhone()\n {\n $this->assertFalse(BrValidation::phone('teststring'));\n $this->assertFalse(BrValidation::phone('1-(33)-(333)-(4444)'));\n $this->assertFalse(BrValidation::phone('1-(33)-3333-4444'));\n $this->assertFalse(BrValidation::phone('1-(33)-33-4444'));\n $this->assertFalse(BrValidation::phone('1-(33)-3-44444'));\n $this->assertFalse(BrValidation::phone('1-(33)-3-444'));\n $this->assertFalse(BrValidation::phone('1-(33)-3-44'));\n $this->assertFalse(BrValidation::phone('2345678'));\n\n // with the wrong extra digit\n $this->assertFalse(BrValidation::phone('55 (48) 12345 6789'));\n $this->assertFalse(BrValidation::phone('+55 (48) 22345 6789'));\n $this->assertFalse(BrValidation::phone('+55 (048) 32345 6789'));\n $this->assertFalse(BrValidation::phone('+55 (48) 42345-6789'));\n $this->assertFalse(BrValidation::phone('+55 (48) 52345.6789'));\n $this->assertFalse(BrValidation::phone('(48) 12345 6789'));\n\n $this->assertTrue(BrValidation::phone('55 (48) 2345 6789'));\n $this->assertTrue(BrValidation::phone('+55 (48) 2345 6789'));\n $this->assertTrue(BrValidation::phone('+55 (048) 2345 6789'));\n $this->assertTrue(BrValidation::phone('+55 (48) 2345-6789'));\n $this->assertTrue(BrValidation::phone('+55 (48) 2345.6789'));\n $this->assertTrue(BrValidation::phone('(48) 2345 6789'));\n $this->assertTrue(BrValidation::phone('2345-6789'));\n $this->assertTrue(BrValidation::phone('2345.6789'));\n $this->assertTrue(BrValidation::phone('23456789'));\n\n // // with the extra digit\n $this->assertTrue(BrValidation::phone('55 (48) 92345 6789'));\n $this->assertTrue(BrValidation::phone('+55 (48) 92345 6789'));\n $this->assertTrue(BrValidation::phone('+55 (048) 92345 6789'));\n $this->assertTrue(BrValidation::phone('+55 (48) 92345-6789'));\n $this->assertTrue(BrValidation::phone('+55 (48) 92345.6789'));\n $this->assertTrue(BrValidation::phone('(48) 92345 6789'));\n $this->assertTrue(BrValidation::phone('92345-6789'));\n $this->assertTrue(BrValidation::phone('92345.6789'));\n $this->assertTrue(BrValidation::phone('923456789'));\n }", "public function letter_num_validation($input){\n\t\tif(!preg_match('/^[a-zA-Z0-9]*$/',$input)){ \n\t\t\treturn true;\n \t}\n }", "public function testPhone()\n {\n $this->assertTrue(RuValidation::phone('+7 (342) 1234567'));\n $this->assertTrue(RuValidation::phone('+7 (41144) 1234'));\n }", "function checkTWId($twid)\n{\n $ret = false;\n if (preg_match(\"/^[A-Z][12]\\d{8}$/\", $twid)) {\n $letters = 'ABCDEFGHJKLMNPQRSTUVXYWZIO';\n\n $c1 = substr($twid, 0, 1); //'A'\n $n12 = strpos($letters, $c1) + 10;\n// echo $n12 . '<hr>';\n $n1 = (int)($n12 / 10);\n $n2 = $n12 % 10;\n $n3 = substr($twid, 1, 1);\n $n4 = substr($twid, 2, 1);\n $n5 = substr($twid, 3, 1);\n $n6 = substr($twid, 4, 1);\n $n7 = substr($twid, 5, 1);\n $n8 = substr($twid, 6, 1);\n $n9 = substr($twid, 7, 1);\n $n10 = substr($twid, 8, 1);\n $n11 = substr($twid, 9, 1);\n\n $sum = $n1 * 1 + $n2 * 9 + $n3 * 8 + $n4 * 7 + $n5 * 6 + $n6 * 5 + $n7 * 4 + $n8 * 3 + $n9 * 2 + $n10 * 1 + $n11 * 1;\n $ret = ($sum % 10 == 0);\n\n\n }\n return $ret;\n\n}", "public function testPassport()\n {\n $this->assertTrue(RuValidation::passport('1234 123456'));\n\n $this->assertFalse(RuValidation::passport('1234 1234567'));\n $this->assertFalse(RuValidation::passport('1234123456'));\n $this->assertFalse(RuValidation::passport('1234 1x3456'));\n }", "public function globalStringConditionMatchesRegularExpression() {}", "public function globalStringConditionMatchesRegularExpression() {}", "function fixAddress($str = \"\") {\n\tif ( preg_match(\"/[A-Z]{3}/\", $str) ) {\n\t\t$str = strtolower($str);\n\t}\n\t$str = ucwords($str);\n\t$str = str_replace(\"'\", \"''\", $str);\n\treturn($str);\n//fixAddress\n}", "public function __invoke($str)\n {\n return (bool)preg_match( '/^[0-9]+$/', $str);\n }", "function is_upper($car ) {\nreturn ($car >= 'A' && $car <= 'Z');\n}", "public function alphaNumeric($str)\n {\n if ( !preg_match('/^[a-zA-Z0-9\\s]+$/i',$str) )\n {\n $this->form_validation->set_message('alphaNumeric', 'Please enter only alpha numeric characters.');\n return FALSE;\n }\n else\n {\n return TRUE;\n }\n }", "function upper( $str ) {\r\nreturn preg_match( \"/[A-Z]/\", $str );\r\n}", "function estUnCp($codePostal)\n{\n return strlen($codePostal)== 5 && estEntier($codePostal);\n}", "public function testContains1()\n {\n $this->assertTrue(Str::contains('foo', 'oo'));\n }", "public function testCreditCardIsNotValid($data)\n {\n $pattern = \"/^([0-9]{4}[\\s]?){3}([0-9]{4})$/\";\n\n $this->assertDoesNotMatchRegularExpression($pattern,$data);\n\n }", "function alpha_dash_diagonales($str)\n\t{\t\t\n\t\t$this->CI->form_validation->set_message('alpha_dash_diagonales', \"El campo %s debe contener una combinaci&oacute;n de caracteres alfanum&eacute;ricos, guiones (-) y diagonales (/ \\).\");\n\t\treturn (bool) preg_match(\"/(^[a-zA-Z0-9\\xF1\\xD1\\-\\/\\\\\\\\ñÑ]+$)|^$/\", $str);\n\t}", "public function testCamelCase4()\n {\n $this->assertEquals(Str::camelCase('foo_bar'), 'fooBar');\n }", "public function testStringResult()\n {\n $result = $this->searchResult->stringResult();\n\n $this->stringContains('location')->evaluate($result);\n $this->stringContains('\"status\":\"ok\"')->evaluate($result);\n }", "public function testContains4()\n {\n $this->assertFalse(Str::contains('foo', ['y', 'b']));\n }", "function idFormat($value){\n \n if(!preg_match(VALID_INT_FORMAT,$value)){\n return false;\n }\n \n return true;\n\n}", "public function testValidateStringNumber(): void\n {\n $this->assertFalse($this->validate('1'));\n }", "function validarNombre($variable, $pattern){\n if (preg_match($pattern, $variable)) {\n return \tTrue;\n }\n return false;\n }", "function iscivilstatvalid($str = null){\n if ($str) {\n if (!$str ==\"married\" || !$str == \"single\" || !$str == \"widowed\" || !$str == \"separated\"|| !$str == \"separated\") {\n echo \"input is invalid civil status<br>\";\n return true;\n }else\n echo \"is valid<br>\";\n return false;\n }\n}", "function strip_city($string) {\n\t$id = trim($string, 'city-');\n\treturn $id;\n}" ]
[ "0.6448094", "0.5794556", "0.56666297", "0.5577351", "0.5554657", "0.5548007", "0.5533867", "0.55268145", "0.541211", "0.53914994", "0.5359269", "0.5347262", "0.5345646", "0.5343187", "0.53343713", "0.5292221", "0.52845764", "0.5280481", "0.52538395", "0.5251958", "0.5250439", "0.523304", "0.52323925", "0.5227117", "0.5218823", "0.52128524", "0.51868945", "0.5175921", "0.51666903", "0.51607317", "0.5151715", "0.5150309", "0.5113697", "0.5104116", "0.5102441", "0.5099417", "0.5094068", "0.5093083", "0.50789696", "0.50697047", "0.5069533", "0.50685334", "0.5067426", "0.50433344", "0.5035769", "0.50266045", "0.5023004", "0.50147134", "0.50125045", "0.50111985", "0.50065136", "0.4994663", "0.49898526", "0.49722424", "0.49720824", "0.49703154", "0.49672562", "0.4952697", "0.4949138", "0.4945741", "0.49430096", "0.49404675", "0.49318057", "0.49283686", "0.49258065", "0.49250758", "0.4922761", "0.49084777", "0.4908363", "0.49069193", "0.49047503", "0.49030277", "0.49021354", "0.49014023", "0.48977005", "0.48908576", "0.4886904", "0.48826396", "0.48825836", "0.48819792", "0.4880868", "0.487652", "0.487242", "0.4870145", "0.48675233", "0.48610884", "0.48474956", "0.48458084", "0.48425317", "0.48383453", "0.48358396", "0.48245332", "0.48186034", "0.48085412", "0.48054552", "0.48041174", "0.48033655", "0.4799723", "0.47989455", "0.47984555" ]
0.6176894
1
TODO opportunity to fix
public function productPrices() { return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function fixSelf() {}", "protected function fixSelf() {}", "protected function __init__() { }", "public function helper()\n\t{\n\t\n\t}", "private function __construct()\t{}", "final private function __construct(){\r\r\n\t}", "private function __() {\n }", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "protected function _refine() {\n\n\t}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "final private function __construct() {}", "final private function __construct() {}", "private function __construct () {}", "private function _i() {\n }", "protected final function __construct() {}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "public function fix() {}", "public function fix() {}", "private function __construct() {\r\n\t\t\r\n\t}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {\r\n\t\r\n\t}", "protected function init() {return;}", "public function __init(){}", "private function __construct()\r\n {\r\n }", "private function __construct()\r\n {\r\n }", "protected function __construct() {}", "protected function __construct() {}" ]
[ "0.5706767", "0.5706767", "0.5576486", "0.54688895", "0.5390365", "0.5352551", "0.5351307", "0.5333488", "0.5333488", "0.5333488", "0.5333488", "0.53263783", "0.53209686", "0.53209686", "0.53209686", "0.53209686", "0.53209686", "0.53209686", "0.53207207", "0.53207207", "0.53207207", "0.53207207", "0.5320454", "0.5320454", "0.53001475", "0.53001475", "0.5238734", "0.5222884", "0.5219887", "0.52135074", "0.52135074", "0.52135074", "0.51965594", "0.5196305", "0.5185306", "0.5184441", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.5184403", "0.51812774", "0.51812774", "0.51733077", "0.51670516", "0.51615757", "0.51519555", "0.51519555", "0.51470834", "0.51470834" ]
0.0
-1
Returns the parsed upload_paths for $record's uploads
public static function determine_folder_path(\DataObject $record) { // Grab paths $paths = Config::inst()->get(__CLASS__, 'upload_paths'); // Grab ancestry from top-down $className = get_class($record); $classes = array_reverse(ClassInfo::ancestry($className)); $path = $className; // Loop over ancestry and break out if we have a match foreach($classes as $class) { if(array_key_exists($class, $paths)) { $path = $paths[$class]; break; } } // If there are any parameters which require matching, search for them $matches = array(); preg_match_all('/\$[a-zA-Z0-9\.]+?/U', $path, $matches); // Replace with field values foreach($matches[0] as $match) { $field = str_replace("$", "", $match); $value = FileNameFilter::create()->filter($record->relField($field)); $path = str_replace($match, $value, $path); } return $path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function uploadGetUploadedFilesList($fieldName)\n\t{\n\t\t$returnValue = [];\n\n\t\t$fileString = $this->getObjectData($fieldName);\n\t\tif (!empty($fileString)) {\n\t\t\t$filesArray = explode(\"#\", $fileString);\n\t\t\tforeach ($filesArray as $fullFilePath) {\n\t\t\t\tif (!empty($fullFilePath)) {\n\t\t\t\t\t// Prepare some infos to send back for a preview.\n\t\t\t\t\t$fileurl = $this->uploadGetRelativeFileIconPath('/' . str_replace(GLOBAL_FRONTEND_DIR, \"\", $fullFilePath));\n\t\t\t\t\t$filenamePieces = explode('/', $fullFilePath);\n\t\t\t\t\t$filename = $filenamePieces[count($filenamePieces) - 1]; // The last piece is the filename.\n\n\t\t\t\t\t// Add the preview infos to the array.\n\t\t\t\t\t$returnValue[] = [\n\t\t\t\t\t\t'filename' => $filename,\n\t\t\t\t\t\t'url' => $fileurl\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$uploadDirectoryTail = $this->uploadGetRelativeTempDir($fieldName);\n\t\t\t$uploadDirectory = GLOBAL_FRONTEND_DIR . $uploadDirectoryTail;\n\t\t\tif (is_dir($uploadDirectory)) {\n\t\t\t\t$files = scandir($uploadDirectory);\n\t\t\t\tif (!empty($files)) {\n\t\t\t\t\tforeach($files AS $file) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t$file !== \".\" AND\n\t\t\t\t\t\t\t$file !== \"..\"\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t$this->uploadSaveFile($_POST['fieldName'], $file, $uploadDirectory);\n\t\t\t\t\t\t\t$fileurl = $this->uploadGetRelativeFileIconPath('/' . $uploadDirectoryTail . $file);\n\t\t\t\t\t\t\t$returnValue[] = [\n\t\t\t\t\t\t\t\t'filename' => $file,\n\t\t\t\t\t\t\t\t'url' => $fileurl\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\n\t\treturn $returnValue;\n\t}", "public static function parseUploads() : array {\n\t\t$files = [];\n\t\t\n\t\tforeach ( $_FILES as $name => $file ) {\n\t\t\tif ( \\is_array($file['name']) ) {\n\t\t\t\tforeach ( $file['name'] as $n => $f ) {\n\t\t\t\t\t$files[$name][$n] = [];\n\t\t\t\t\t\n\t\t\t\t\tforeach ( $file as $k => $v ) {\n\t\t\t\t\t\t$files[$name][$n][$k] = \n\t\t\t\t\t\t\t$file[$k][$n];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n \t\t$files[$name][] = $file;\n\t\t}\n\t\treturn $files;\n\t}", "public function get_paths()\n\t{\n\t\tif ( ! ee()->session->cache(__CLASS__, 'paths'))\n\t\t{\n\t\t\t$paths = array();\n\t\t\t$upload_prefs = $this->get_file_upload_preferences(NULL, NULL, TRUE);\n\n\t\t\tif (count($upload_prefs) == 0)\n\t\t\t{\n\t\t\t\treturn $paths;\n\t\t\t}\n\n\t\t\tforeach ($upload_prefs as $row)\n\t\t\t{\n\t\t\t\t$paths[$row['id']] = $row['url'];\n\t\t\t}\n\n\t\t\tee()->session->set_cache(__CLASS__, 'paths', $paths);\n\t\t}\n\n\t\treturn ee()->session->cache(__CLASS__, 'paths');\n\t}", "public function getUploadedsPath()\n {\n return $this->uploadedsPath;\n }", "private function getUploadedFiles()\n {\n $list = array();\n \n if(isset($_REQUEST['files']))\n {\n $files = explode('::', $_REQUEST['files']);\n foreach($files as $index => $item)\n {\n list($name, $src, $size) = explode(':', $item);\n \n $list[] = array(\n 'name' => $name,\n 'src' => $src,\n 'size' => $size \n );\n }\n }\n \n return $list;\n }", "private function getPath($fieldName): array {\r\n\r\n //Check if the path is already known\r\n if(true === isset($this -> cachedValues[$fieldName])) {\r\n return $this -> cachedValues[$fieldName];\r\n }\r\n\r\n //Check if field is a combine instance\r\n if($combine = $this -> combine -> get($fieldName)) {\r\n $path = [['value' => $combine -> combine(), 'path' => explode('.', $fieldName)]];\r\n }\r\n else {\r\n\r\n $type = $this -> fieldNames[$fieldName] ?? null;\r\n $path = null;\r\n\r\n switch($type) {\r\n\r\n case FileCollection::class:\r\n\r\n $files = Request :: getUploadedFiles();\r\n $translator = new StringTranslator($files);\r\n $path = $translator -> path($fieldName);\r\n break;\r\n\r\n case FieldCollection::class:\r\n\r\n $path = $this -> translator -> path($fieldName);\r\n break;\r\n }\r\n }\r\n\r\n //Cache the path\r\n $this -> cachedValues[$fieldName] = $path;\r\n\r\n return $path ?? [['value' => null, 'path' => null]];\r\n }", "private function attachmentPaths(): array\n {\n $sql = \"SELECT meta_value FROM {$this->wpdb->postmeta} WHERE meta_key = %s\";\n /** @var \\stdClass[] $metadata */\n $metadata = $this->wpdb->get_results($this->wpdb->prepare($sql, '_wp_attachment_metadata'));\n\n if (!$metadata) {\n return [];\n }\n\n $paths = [];\n foreach ($metadata as $metadataValue) {\n list($dir, $files) = $this->attachmentPathFiles($metadataValue);\n if ($dir && $files) {\n array_key_exists($dir, $paths)\n ? $paths[$dir] = array_merge($paths[$dir], $files)\n : $paths[$dir] = $files;\n }\n }\n\n return $paths;\n }", "public function getFileUploads()\n {\n return $this->file_uploads;\n }", "public function getFiles()\n {\n return R::findAll('upload');\n }", "public static function convertPath($records){\n if(!empty($records)){\n foreach($records as $key => $value){\n $path = explode('public/', $value['path']);\n $records[$key]['path'] = $path[1];\n }\n }\n return $records;\n }", "public function getFilesPath() {\n\t\treturn $this->uploadPath;\n\t}", "public function paths(){\n\t\treturn array_map(function($item){ return $item[0];}, $this->added);\n\t}", "public function getUploadedFiles() {}", "public function getUploadedFiles()\n {\n return $this->uploadedFiles;\n }", "public function getUploadedFiles()\n {\n return $this->uploadedFiles;\n }", "private function parseFilesList($settings,$type,$key) {\n\t\tif (isset($settings[$key.'.']) && is_array($settings[$key.'.'])) {\n\t\t\t$parsed = $this->utilityFuncs->getSingle($settings,$key);\n\t\t\t$parsed = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::trimExplode(',',$parsed);\n\t\t} elseif ($settings[$key]) {\n\t\t\t$files = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::trimExplode(',',$settings[$key]);\n\t\t\t$parsed = array();\n\t\t\t$sessionFiles = \\Typoheads\\Formhandler\\Utility\\Globals::$session->get('files');\n\t\t\tforeach ($files as $idx => $file) {\n\t\t\t\tif (isset($sessionFiles[$file])) {\n\t\t\t\t\tforeach ($sessionFiles[$file] as $subIdx => $uploadedFile) {\n\t\t\t\t\t\tarray_push($parsed,$uploadedFile['uploaded_path'].$uploadedFile['uploaded_name']);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tarray_push($parsed,$file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $parsed;\n\t}", "public function uploads(): array;", "public function get_uploaded_files(/* ... */)\n {\n return $this->_uploaded;\n }", "public function uploadPath();", "public function uploaded_files()\n {\n\t\tif(Module::hasAccess(\"Uploads\", \"view\")) {\n\t\t\t$uploads = array();\n\t\n\t\t\t// print_r(Auth::user()->roles);\n\t\t\tif(Entrust::hasRole('SUPER_ADMIN')) {\n\t\t\t\t$uploads = Upload::all();\n\t\t\t} else {\n\t\t\t\tif(config('laraadmin.uploads.private_uploads')) {\n\t\t\t\t\t// Upload::where('user_id', 0)->first();\n\t\t\t\t\t$uploads = Auth::user()->uploads;\n\t\t\t\t} else {\n\t\t\t\t\t$uploads = Upload::all();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$uploads2 = array();\n\t\t\tforeach ($uploads as $upload) {\n\t\t\t\t$u = (object) array();\n\t\t\t\t$u->id = $upload->id;\n\t\t\t\t$u->name = $upload->name;\n\t\t\t\t$u->extension = $upload->extension;\n\t\t\t\t$u->public = $upload->public;\n\t\t\t\t\n\t\t\t\t$u->user = $upload->user->name;\n\t\t\t\t$u->url = $upload->url;\n\t\t\t\t$u->thumbnails = $upload->thumbnails;\n\t\t\t\t$u->path = $upload->path;\n\t\t\t\t$u->type = $upload->type;\n\n\t\t\t\t$uploads2[] = $u;\n\t\t\t}\n\t\t\treturn response()->json(['uploads' => $uploads2]);\n\t\t} else {\n\t\t\treturn response()->json([\n\t\t\t\t'status' => \"failure\",\n\t\t\t\t'message' => \"Unauthorized Access\"\n\t\t\t]);\n\t\t}\n }", "protected function retrieveConfigUploads(&$config) {\n // Defines array\n $config['uploads'] = array();\n\n // Executes query\n $uploads = $this->GenomeUpload->find('all', array(\n 'conditions' => array(\n 'config_id' => $config['id']\n )\n ));\n\n // Parses uploads retrieved\n foreach($uploads as $upload) {\n $upload = $upload['GenomeUpload'];\n $index = $upload['stored_as'];\n if($index) {\n $config['uploads'][$index] = $upload;\n }\n }\n }", "public function getAllUploads() {\n return Upload::all();\n }", "public function getFiles() {\r\n\r\n $files = array();\r\n\r\n $userId= $this->userId;\r\n $trackingId = $this->trackingFormId;\r\n $dir = FILEPATH . $userId. '/' . $trackingId;\r\n\r\n if (is_dir($dir)) {\r\n if ($dh = opendir($dir)) {\r\n while (($file = readdir($dh)) !== false) {\r\n if($file != '.' && $file != '..') {\r\n $size = $this->Size($dir . '/' . $file);\r\n array_push($files, array('name'=>$file,\r\n 'urlfilename'=>urlencode($file),\r\n 'size'=>$size));\r\n }\r\n }\r\n closedir($dh);\r\n }\r\n }\r\n\r\n return $files;\r\n }", "public function getUploadedFiles()\n {\n }", "private function _upload_files($field){\n\t\t$file_name = date('dmy_His');\n\t\t$config['upload_path'] ='./assets/files_document/';\n\t\t$config['allowed_types'] = 'pdf|';\n\t\t$config['max_size']\t= '0';\n\t\t$config['remove_spaces'] = TRUE;\n\t\t$config['file_name'] = $file_name;\n\n\t\t$this->load->library('upload');\n\t\t$this->upload->initialize($config);\n\t\t$files = array();\n\n\t\tif ($this->upload->do_upload($field)){\n\t\t\t$files_uploaded = $this->upload->data();\n\t\t}else{\n\t\t\t$files_uploaded = null;\n\t\t}\n\t\treturn $files_uploaded;\n\t}", "function getUploadUrls($mimeType) {\n\techo \"Getting upload urls. </br>\";\n\t$mimeParam = \"?mimeType=\" . $mimeType;\n\t$response = getRequestWithParam('/api/file/getpreupload', $mimeParam);\n\tprintInfo($response);\n}", "public function uploaded_files()\n {\n\t\tif(Module::hasAccess(\"Uploads\", \"view\")) {\n\t\t\t$uploads = array();\n\t\n\t\t\t// print_r(Auth::user()->roles);\n\t\t\tif(Entrust::hasRole('SUPER_ADMIN')) {\n\t\t\t\t$uploads = Upload::all();\n\t\t\t} else {\n\t\t\t\tif(config('laraadmin.uploads.private_uploads')) {\n\t\t\t\t\t// Upload::where('user_id', 0)->first();\n\t\t\t\t\t$uploads = Auth::user()->uploads;\n\t\t\t\t} else {\n\t\t\t\t\t$uploads = Upload::all();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$uploads2 = array();\n\t\t\tforeach ($uploads as $upload) {\n\t\t\t\t$u = (object) array();\n\t\t\t\t$u->id = $upload->id;\n\t\t\t\t$u->name = $upload->name;\n\t\t\t\t$u->extension = $upload->extension;\n\t\t\t\t$u->hash = $upload->hash;\n\t\t\t\t$u->public = $upload->public;\n\t\t\t\t$u->caption = $upload->caption;\n\t\t\t\t$u->user = $upload->user->name;\n\t\t\t\t\n\t\t\t\t$uploads2[] = $u;\n\t\t\t}\n\t\t\t\n\t\t\t// $folder = storage_path('/uploads');\n\t\t\t// $files = array();\n\t\t\t// if(file_exists($folder)) {\n\t\t\t// $filesArr = File::allFiles($folder);\n\t\t\t// foreach ($filesArr as $file) {\n\t\t\t// $files[] = $file->getfilename();\n\t\t\t// }\n\t\t\t// }\n\t\t\t// return response()->json(['files' => $files]);\n\t\t\treturn response()->json(['uploads' => $uploads2]);\n\t\t} else {\n\t\t\treturn response()->json([\n\t\t\t\t'status' => \"failure\",\n\t\t\t\t'message' => \"Unauthorized Access\"\n\t\t\t]);\n\t\t}\n }", "public function getUploadPath()\n {\n $reflect = new ReflectionClass($this);\n return $this->uploadPath . $reflect->getShortName() . '/' . $this->id . '/';\n }", "public function get_test_file_uploads()\n {\n }", "public static function getFiles($uploaded = true)\n {\n $files = array();\n\n if (!empty($_FILES)) {\n foreach ($_FILES as $element => $value) {\n if (is_array($value['tmp_name'])) {\n foreach ($value['tmp_name'] as $key => $value) {\n $file = array(\n 'name' => $_FILES[$element]['name'][$key],\n 'type' => $_FILES[$element]['type'][$key],\n 'tmp_name' => $_FILES[$element]['tmp_name'][$key],\n 'error' => $_FILES[$element]['error'][$key],\n 'size' => $_FILES[$element]['size'][$key],\n );\n\n if ($result = self::validateFile($file, $uploaded)) {\n $files[$element][$key] = $result;\n }\n }\n } else {\n if ($result = self::validateFile($value, $uploaded)) {\n $files[$element] = $result;\n }\n }\n }\n }\n\n return $files;\n }", "public static function upload_dir( $uploads ) {\n\t\t$form_id = FrmAppHelper::get_post_param( 'form_id', 0, 'absint' );\n\t\tif ( ! $form_id ) {\n\t\t\t$form_id = FrmAppHelper::simple_get( 'form', 'absint', 0 );\n\t\t}\n\n\t\t$relative_path = self::get_upload_dir_for_form( $form_id );\n\n\t\tif ( ! empty( $relative_path ) ) {\n\t\t\t$uploads['path'] = $uploads['basedir'] . '/' . $relative_path;\n\t\t\t$uploads['url'] = $uploads['baseurl'] . '/' . $relative_path;\n\t\t\t$uploads['subdir'] = '/' . $relative_path;\n\t\t}\n\n\t\treturn $uploads;\n\t}", "protected static function getPathsInternal() {}", "public function getUploadedFiles()\n {\n if (null === $this->uploadedFiles) {\n $this->uploadedFiles = UploadedFilesFactory::createFiles();\n }\n return $this->uploadedFiles;\n }", "public function listMultipartUploads($bucket)\n\t{\n\t\t$url = 'https://' . $bucket . '.' . $this->options->get('api.url') . '/?uploads';\n\n\t\t// Send the request and process the response\n\t\treturn $this->commonGetOperations($url);\n\t}", "public function getRelativeUploadPath(): string;", "public function getUploadedPath()\n {\n return $this->uploadedPath;\n }", "public function getUploadedFileInfo();", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/lots';\n }", "protected function findAssets(DataObject $record)\n {\n // Search for dbfile instances\n $files = [];\n $fields = DataObject::getSchema()->fieldSpecs($record);\n foreach ($fields as $field => $db) {\n $fieldObj = $record->$field;\n if (!($fieldObj instanceof DBFile)) {\n continue;\n }\n\n // Omit variant and merge with set\n $next = $record->dbObject($field)->getValue();\n unset($next['Variant']);\n if ($next) {\n $files[] = $next;\n }\n }\n\n // De-dupe\n return array_map(\"unserialize\", array_unique(array_map(\"serialize\", $files ?? [])));\n }", "private function getThumbnailBaseFolderPaths()\n {\n if (is_array($this->thumbnailBaseDir)) {\n return $this->thumbnailBaseDir;\n }\n\n $this->thumbnailBaseDir = [];\n\n if (null !== $baseFolder = $this->getBaseFolder()) {\n $thumbnailBaseDir = array_map(function ($directory) use ($baseFolder) {\n return str_replace(\n DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR,\n DIRECTORY_SEPARATOR,\n $directory.DIRECTORY_SEPARATOR.$baseFolder\n );\n }, $this->application->getResourceDir());\n\n foreach (array_unique($thumbnailBaseDir) as $directory) {\n if (is_dir($directory)) {\n $this->thumbnailBaseDir[] = $directory;\n }\n }\n }\n\n return $this->thumbnailBaseDir;\n }", "public static function getSendFilePaths() \n\t{\n\t\tif (!empty(MHTTPD::$send_file_paths)) {\n\t\t\treturn MHTTPD::$send_file_paths;\n\t\t}\n\t\t\n\t\t// Store the absolute paths\n\t\t$paths = listToArray(MHTTPD::$config['Paths']['send_file']);\n\t\t$real_paths = array();\n\t\tforeach ($paths as $path) {\n\t\t\tif (($rpath = realpath(MHTTPD::getInipath().$path)) || ($rpath = realpath($path))) {\n\t\t\t\t$real_paths[] = $rpath;\n\t\t\t}\n\t\t}\n\t\tMHTTPD::$send_file_paths = $real_paths;\n\t\treturn $real_paths;\n\t}", "public function getCopyFileUrls() {\n if (!$this->copyFilePaths) return [];\n\n $urls = [];\n\n foreach($this->copyFilePaths as $filePath) {\n $url = FileService::getInstance()->getUrlForPathUnderUploadsDir($filePath);\n if (!$url) continue;\n\n $urls[] = $url;\n }\n\n return $urls;\n }", "public function path()\n {\n return $this->fieldNames;\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/tracks';\n }", "private function getUploadUrl() {\n // Before anything else, we need the ID.\n $bucket_id = $this->getBucketId();\n\n // Grab the needed token, URLs etc\n list($api_url, $token, $download_url) = $this->authorizeAccount();\n $full_url = $api_url.'/b2api/v1/b2_get_upload_url';\n\n // Execute\n $response = self::execCurl(\n $full_url, 'POST', array(\n 'Authorization: '.$token,\n ),\n json_encode(array(\n 'bucketId' => $bucket_id,\n )));\n\n // Parse and get back a sane JSON value.\n $json = self::isValidJson($response);\n\n // Now, check the JSON map has every key-value pair we expect.\n self::jsonHasKeys(\n $json, array(\n 'bucketId',\n 'authorizationToken',\n 'uploadUrl',\n ));\n\n // And, just to be sure: make sure we get the right bucket ID back.\n self::jsonKeyIs($json, 'bucketId', $bucket_id);\n\n // Done: return the needed values\n return array(\n $json['uploadUrl'],\n $json['authorizationToken'],\n );\n }", "public function uploadPath()\n {\n return call_user_func($this->savePath, $this->basePath);\n }", "public function getMediaPath()\n {\n // should return an array of media handlers\n $query = $this->query()\n ->join('media_handlers', 'media_handlers.model_id', '=', 'upcoming_prokers.id')\n ->where('media_handlers.model_id', '=', $this->id)\n ->where('media_handlers.model_name', '=', $this->const_ModelName)\n ->where('media_handlers.deleted_at', '=', null)\n ->get();\n if (count($query) != 0) {\n // Add new sub attribute about preview and\n $item = $query[0];\n $item->imageUrl = $this->getUrlPath($item->path);\n $item->thumbnail = $this->getThumbnailUrlPath($item->path);\n $item->preview = $this->getPreviewUrlPath($item->path);\n return $item;\n }\n\n return null;\n }", "public function getUploadUrl()\n {\n if (array_key_exists(\"uploadUrl\", $this->_propDict)) {\n return $this->_propDict[\"uploadUrl\"];\n } else {\n return null;\n }\n }", "private function hc_portfolio_prepare_file_paths(&$array_of_file_data){\n\t\t$files = &$array_of_file_data;\n\n\t\tforeach($files as &$file){\n\t\t\t\n\t\t\tforeach($file as $field_name => &$field){\n\t\t\t\t//Is this an attachment field? Wouldn't want to accidentally just look up a random URL for what is supposed to actually be a number.\n\t\t\t\tif(!in_array($field_name, self::$file_field_names)) continue;\n\t\t\t\tif($field == 0) {\n\t\t\t\t\t//remove unused URL fields\n\t\t\t\t\tunset($file[$field_name]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$field = $this->un_ms_file_rewrite_path(wp_get_attachment_url($field));\n\t\t\t\t\n\t\t\t}\n\t\t}\t\t\t\n\t}", "function getuploaddir ( $path , $uploadpath = 'files' ) {\n\t\tdo {\n\t\t\tif (file_exists ( $path . 'config.php' ) && file_exists ( $path . 'start.php' )) {\n\t\t\t\t$root_path = $path ;\n\t\t\t} else {\n\t\t\t\t// On windows, it is not / but \\ in our path.\n\t\t\t\t$pos = (strrpos ( $path, '/' )) ? strrpos ( $path, '/' ) : strrpos ( $path, '\\\\' ) ; // We need to escape this\n\t\t\t\t$path = substr ( $path, 0, $pos - 1 ) ;\n\t\t\t\tcontinue ;\n\t\t\t}\n\t\t} while ( empty ( $root_path ) ) ;\n\t\t\n\t\treturn $root_path . '/' . $uploadpath . '/' ;\n\t}", "protected function getUploadDir() {\n return '/uploads';\n }", "public function uploads()\n {\n return $this->hasMany(Upload::class);\n }", "function getPaths()\n {\n $paths = array();\n foreach ($this->names as $name) {\n $paths[] = $this->dir.$name.$this->ext;\n }\n return $paths;\n }", "public static function SELECT_UPLOAD_PHOTO_LIST(){\n\t $SQL_String = \"SELECT * FROM task_upload WHERE user=:user AND folder=:folder AND flag=:flag AND _upload!='' AND _process='';\";\n\t return $SQL_String;\n\t}", "protected function getUploadPath()\n {\n return 'uploads/achtergrondfotos';\n }", "public static function upload ( $fieldname )\n {\n $r = array();\n $total_uploads = intval(@$_POST[\"{$fieldname}_count\"]);\n\n if ( $total_uploads > 0 ) {\n for ( $i = 0; $i < $total_uploads; $i++ ) {\n $r[] = array(\n 'tmp_name' => $_POST[\"{$fieldname}_{$i}_tmpname\"],\n 'name' => $_POST[\"{$fieldname}_{$i}_name\"]\n );\n }\n }\n\n return $r;\n\n }", "public function getUserUploads() {\n\t\tif (!self::COOKIES_ENABLED) {\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t/* load form database */\n\t\t$uploads = array();\n\t\t$delete_code = $this->getDeleteCode();\n\t\t$result = $this->db->query('\n\t\t\tSELECT *\n\t\t\tFROM image\n\t\t\tWHERE delete_code = \"'.SQLite3::escapeString($delete_code).'\"\n\t\t\t\tAND gallery_id = \"\"\n\t\t\tORDER BY ROWID DESC');\n\t\tif ($result) {\n\t\t\twhile ($entry = $result->fetchArray(SQLITE3_ASSOC)) {\n\t\t\t\t$uploads[$entry['id']] = $entry;\n\t\t\t}\n\t\t}\n\t\treturn $uploads;\n\t}", "public function upload_dir( $uploads ) {\n\t\t$lang = $this->get_language_from_url();\n\t\t$lang = $this->model->get_language( $lang );\n\t\t$uploads['url'] = $this->add_language_to_link( $uploads['url'], $lang );\n\t\t$uploads['baseurl'] = $this->add_language_to_link( $uploads['baseurl'], $lang );\n\t\treturn $uploads;\n\t}", "public static function filelist()\n\t{\n\t\tglobal $g_relative_file_directory;\t// '../../UPLOADS/';\n\t\tglobal $g_relative_root_directory;\t// 'UPLOADS/';\n\n\t\t$actualdirectory = $_POST['actualdir'];\n\t\tif(!$actualdirectory)\n\t\t\t$actualdirectory='';\n\n\t\t$result = [];\n\t\t$result['directory'] = $g_relative_root_directory;\n\t\t$result['actualdir'] = $actualdirectory;\n\n\t\tif(strlen($actualdirectory)>0)\n\t\t\t$actualdirectory.=\"/\";\n\n\t\t$reldir = $g_relative_file_directory.$actualdirectory;\n\t\t$dirs=[];\n\t\tforeach(glob($reldir.'*', GLOB_ONLYDIR) as $d)\n\t\t{\n\t\t\t$fn=str_replace($reldir,'',$d);\n\t\t\t$dirs[] = $fn;\n\t\t}\n\t\t$result['dirs']=$dirs;\n\t\t//$result['reldir']=$reldir;\n\n\t\t$filenames = [];\n\t\tforeach(array_filter(glob($reldir.'*.*'), 'is_file') as $file)\n\t\t{\n\t\t\t$farray = [];\n\t\t\t$fn=str_replace($reldir,'',$file);\n\n\t\t\t$f=filesize($file);\n\t\t\t$fe=\"bytes\";\n\t\t\tif($f/1024 > 1)\n\t\t\t{\n\t\t\t\t$f/=1024;\n\t\t\t\t$fe=\"kb\";\n\t\t\t\tif($f/1024 > 1)\n\t\t\t\t{\n\t\t\t\t\t$f/=1024;\n\t\t\t\t\t$fe=\"Mb\";\n\t\t\t\t\tif($f/1024 > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$f/=1024;\n\t\t\t\t\t\t$fe=\"GB\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$farray['Filename'] = $fn;\n\t\t\t$farray['Filesize'] = number_format($f,1);\n\t\t\t$farray['FilesizeDeterminant'] = $fe;\n\n\t\t\t$filenames[] = $farray;\n\t\t}\n\t\t$result['files']=$filenames;\n\n\t\theader('Content-Type: application/json');\n\t\techo(json_encode($result));\n\t}", "public function uploadPath()\n {\n return config('quikservice.user.upload.profile-picture.path');\n }", "public function getPaths()\n {\n return $this->paths;\n }", "public function basePathUpload() {\n\t\t\t\t\t\t$this->redirectToIndex();\n\t\t\t\t\t\t$pathupload = realpath ( APPLICATION_PATH . '/../public/data/uploads' );\n\t\t\t\t\t\treturn $pathupload;\n\t\t\t\t\t}", "protected function getUploadDir() {\n // when displaying uploaded doc/image in the view.\n return 'uploads/contact/contactlist/images';\n }", "public function fetch_upload_dirs($params = array())\n\t{\n\t\tif ( ! empty($this->_upload_dirs))\n\t\t{\n\t\t\treturn $this->_upload_dirs;\n\t\t}\n\n\t\treturn $this->_directories($params);\n\t}", "public function getUploadedFileList($property = '') {\n\t\t$parameters = GeneralUtility::_GPmerged('tx_mediaupload_pi1');\n\t\treturn empty($parameters['uploadedFiles'][$property]) ? '' : $parameters['uploadedFiles'][$property];\n\t}", "public function getPaths()\n {\n return $this->_paths;\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/user/images';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/users';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return '/uploads/users/'.$this->getId().'/';\n }", "protected function getUploadDir() {\n // when displaying uploaded doc/image in the view.\n return 'uploads/';\n }", "public function getPathParts()\n {\n if (empty($this->path)) {\n $this->path = $this->composeDefaultPath();\n }\n if (is_array($this->path)) {\n return $this->path;\n }\n return explode('.', $this->path);\n }", "protected function getUploadDir()\r\n {\r\n // when displaying uploaded doc/image in the view.\r\n return 'uploads/images';\r\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/photos';\n }", "public function getPaths();", "public function getMediaPath()\n {\n // should return an array\n $query = $this->query()\n ->join('media_handlers', 'media_handlers.model_id', '=', 'anggota.id')\n ->where('media_handlers.model_id', '=', $this->id)\n ->where('media_handlers.model_name', '=', $this->const_ModelName)\n ->where('media_handlers.deleted_at', '=', null)\n ->get();\n\n // return single object instead of an array\n if (count($query) != 0) {\n // Add new sub attribute about preview and\n $item = $query[0];\n $item->imageUrl = $this->getUrlPath($item->path);\n $item->thumbnail = $this->getThumbnailUrlPath($item->path);\n $item->preview = $this->getPreviewUrlPath($item->path);\n return $item;\n }\n\n return null;\n }", "public function fileInfo()\n {\n return R::findAll('uploaddetail');\n }", "public function listRecords( Upload $obj ){\r\n\r\n\t\t\t$response = $this->listRowsByTokenId( $obj->id_token );\r\n\t\t\treturn json_encode($response);\r\n\t\t\t\r\n\t\t}", "private function determineUploadLocation(FieldItemListInterface $field): string {\n return (new FileItem($field->getItemDefinition()))->getUploadLocation();\n }", "public function getUploadPath()\n\t{\n\t\t// return Yii::app()->params->upload.'/';\n\t\treturn Yii::app()->config->fixedValues['upload_path'];\n\t}", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/models';\n }", "function LoadUploadedFiles()\n {\n\t\t$upld_folder = $this->EnsureTmpUploadFolder();\n\t\t\n foreach($this->upload_fields as $filefield)\n {\n $tmp_filepath = $this->globaldata->files[$filefield]['tmp_name'];\n if(is_uploaded_file($tmp_filepath))\n {\n $filename = $this->globaldata->files[$filefield]['name'];\n\t\t\t\t$filename = $this->trim_file_name($filename,$this->globaldata->files[$filefield][\"type\"]);\n \n if(!$this->config->allow_nonsecure_file_attachments && \n $this->IsNonSecureFile($filename))\n {\n $this->error_handler->NotifyError(\n \"File Upload handler: skipping nonsecure file attachment: $filename\");\n continue;\n }\n\n $upld_path = $upld_folder.\"/\".$filename;\n \n $upld_path = \n $this->CopyFile_Prevent_Overwrite($tmp_filepath, $upld_path);\n\n $this->logger->LogInfo(\"File Upload handler: loaded file from $tmp_filepath to $upld_path.\");\n\n $mimetype = $this->globaldata->files[$filefield][\"type\"];\n\n //NOTE: LoadUploadedFiles is for native file uploads where the file is submitted along with the\n //form submission. In this case, more than one files is not supported per field.\n $existing_file = $this->find_file_uploaded($filefield);\n if($existing_file >= 0)\n {\n unlink($this->loaded_files[$existing_file]['loaded_file']);\n $this->loaded_files[$existing_file] = array(\"input_name\"=>$filefield,\n \"loaded_file\"=>$upld_path,\n \"mime_type\"=>$mimetype); \n }\n else\n {\n $this->loaded_files[] = array(\"input_name\"=>$filefield,\n \"loaded_file\"=>$upld_path,\n \"mime_type\"=>$mimetype);\n }\n }//if\n }//foreach\n \n \n \n return true;\n }", "protected function getUploadDir() {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }", "public function getUploadResponse(Request $request, array $uploadedFiles = array());", "public function list_of_fileuploads() {\n $request = $_GET;\n $result = $this->fileupload_model->load_list_of_fileuploads($request, array());\n $result = getUtfData($result);\n echo json_encode($result);\n exit;\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/ads/images';\n }", "public static function getUploadPath()\n {\n return '';\n }", "abstract protected function getUploadDir(): string;", "function getFilesFromPath($itemid, $fieldid, $exts=null, $pending = false)\n\t{\n\t\t// Set pending FLAG\n\t\t$this->_pending = $pending;\n\n\t\t// Retrieving files from a folder , do not use pagination\n\t\t$this->_total_pending = 0;\n\t\t$this->_total = 0;\n\n\t\t$app = JFactory::getApplication();\n\t\t$jinput = $app->input;\n\t\t$option = $jinput->get('option', '', 'cmd');\n\t\t$cparams = JComponentHelper::getParams('com_flexicontent');\n\n\t\t$exts = $exts ?: $cparams->get('upload_extensions', 'bmp,wbmp,csv,doc,docx,webp,gif,ico,jpg,jpeg,odg,odp,ods,odt,pdf,png,ppt,pptx,txt,xcf,xls,xlsx,zip,ics');\n\t\t$imageexts = array('png', 'gif', 'jpeg', 'jpg', 'webp', 'wbmp', 'bmp', 'ico'); // Common image extensions\n\t\t$options = array();\n\t\t$gallery_folder = $this->getFieldFolderPath($itemid, $fieldid, $options);\n\t\t//echo $gallery_folder .\"<br />\";\n\n\t\t// Create field's folder if it does not exist already\n\t\tif (!is_dir($gallery_folder))\n\t\t{\n\t\t\tmkdir($gallery_folder, $mode = 0755, $recursive=true);\n\t\t}\n\n\t\t// Get file list according to filtering\n\t\t$exts = preg_replace(\"/[\\s]*,[\\s]*/\", '|', $exts);\n\t\t$it = new RegexIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($gallery_folder)), '#(.*\\.)('.$exts.')#i');\n\t\t$it->rewind();\n\n\t\tif ($this->_pending)\n\t\t{\n\t\t\tif (!$itemid)\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t\t\t$upload_context = 'fc_upload_history.item_' . $itemid . '_field_' . $fieldid;\n\t\t\t$session_files = JFactory::getSession()->get($upload_context, array());\n\n\t\t\t$names_pending = isset($session_files['names_pending'])\n\t\t\t\t? $session_files['names_pending']\n\t\t\t\t: array();\n\t\t\t$names_pending = array_flip($names_pending);\n\t\t}\n\n\t\tif ( $options['image_source'] === 1 )\n\t\t{\n\t\t\t$this->cleanUpFolderModeFolders($options['base_path']);\n\t\t}\n\n\t\t// Get file information\n\t\tstatic $mime_icons = array();\n\t\t$rows = array();\n\t\t$i = 1;\n\t\twhile($it->valid())\n\t\t{\n\t\t\tif ($it->isDot())\n\t\t\t{\n\t\t\t\t$it->next();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$filesubpath = $it->getSubPathName(); // filename including the folder subpath\n\t\t\t$filepath = $it->key();\n\t\t\t$pinfo = pathinfo($filepath);\n\t\t\t$row = new stdClass();\n\t\t\t$row->ext = $pinfo['extension'];\n\n\t\t\t// Convert directory separators inside the subpath\n\t\t\t$row->filename = str_replace('\\\\', '/', $filesubpath); //$pinfo['filename'].\".\".$pinfo['extension'];\n\n\t\t\t// Lets load the files if it doesn't already exist\n\t\t\tif ($this->_pending)\n\t\t\t{\n\t\t\t\tif ( !isset($names_pending[$row->filename]))\n\t\t\t\t{\n\t\t\t\t\t$it->next();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Try to create a UTF8 filename\n\t\t\t$row->filename_original = iconv(mb_detect_encoding($row->filename, mb_detect_order(), true), \"UTF-8\", $row->filename);\n\t\t\t$row->filename_original = $row->filename_original ? $row->filename_original : $row->filename;\n\n\t\t\t$row->size = sprintf(\"%.0f KB\", (filesize($filepath) / 1024) );\n\t\t\t$row->altname = $pinfo['filename'];\n\n\t\t\t$row->uploader = '-';\n\t\t\t$row->uploaded = date(\"F d Y H:i:s.\", filectime($filepath) );\n\n\t\t\t$row->url = 0;\n\t\t\t$row->id = $i;\n\n\t\t\tif ( in_array(strtolower($row->ext), $imageexts))\n\t\t\t{\n\t\t\t\t$row->icon = JUri::root().\"components/com_flexicontent/assets/images/mime-icon-16/image.png\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$exists = $row->ext && isset($mime_icons[$row->ext])\n\t\t\t\t\t? $mime_icons[$row->ext]\n\t\t\t\t\t: null;\n\n\t\t\t\t// Check exists only once\n\t\t\t\tif ($row->ext && $exists === null)\n\t\t\t\t{\n\t\t\t\t\t$exists = $mime_icons[$row->ext] = file_exists(JPATH_SITE . '/components/com_flexicontent/assets/images/mime-icon-16/' . $row->ext . '.png');\n\t\t\t\t}\n\n\t\t\t\t$row->icon = $exists\n\t\t\t\t\t? JUri::root() . 'components/com_flexicontent/assets/images/mime-icon-16/' . $row->ext . '.png'\n\t\t\t\t\t: JUri::root() . 'components/com_flexicontent/assets/images/mime-icon-16/unknown.png';\n\t\t\t}\n\n\t\t\tif ($this->_pending)\n\t\t\t{\n\t\t\t\t$rows[$row->filename] = $row;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$rows[] = $row;\n\t\t\t}\n\n\t\t\t$i++;\n\t\t\t$it->next();\n\t\t}\n\n\t\t// Lets load the files if it doesn't already exist\n\t\tif ($this->_pending)\n\t\t{\n\t\t\t$_rows = array();\n\t\t\tforeach($names_pending as $filename => $file)\n\t\t\t{\n\t\t\t\t$_rows[] = $rows[$filename];\n\t\t\t}\n\t\t\t$rows = $_rows;\n\t\t}\n\n\t\treturn $rows;\n\t}", "public function get_paths() {\n return array(\n new convert_path('course_sections', '/MOODLE_BACKUP/COURSE/SECTIONS'),\n new convert_path(\n 'course_section', '/MOODLE_BACKUP/COURSE/SECTIONS/SECTION',\n array(\n 'newfields' => array(\n 'name' => null,\n 'summaryformat' => 1,\n 'sequence' => null,\n ),\n )\n ),\n new convert_path(\n 'course_module', '/MOODLE_BACKUP/COURSE/SECTIONS/SECTION/MODS/MOD',\n array(\n 'newfields' => array(\n 'completion' => 0,\n 'completiongradeitemnumber' => null,\n 'completionview' => 0,\n 'completionexpected' => 0,\n 'availablefrom' => 0,\n 'availableuntil' => 0,\n 'showavailability' => 0,\n 'availability_info' => array(),\n 'visibleold' => 1,\n ),\n 'dropfields' => array(\n 'instance',\n 'roles_overrides',\n 'roles_assignments',\n ),\n 'renamefields' => array(\n 'type' => 'modulename',\n ),\n )\n ),\n new convert_path('course_modules', '/MOODLE_BACKUP/COURSE/MODULES'),\n // todo new convert_path('course_module_roles_overrides', '/MOODLE_BACKUP/COURSE/SECTIONS/SECTION/MODS/MOD/ROLES_OVERRIDES'),\n // todo new convert_path('course_module_roles_assignments', '/MOODLE_BACKUP/COURSE/SECTIONS/SECTION/MODS/MOD/ROLES_ASSIGNMENTS'),\n );\n }", "public function getHandledPaths();", "abstract protected function paths();", "private function getFileUris(Request $request, array & $data)\n {\n $guzzle = new \\GuzzleHttp\\Client();\n try {\n $response = $guzzle->request(\n 'POST',\n env('CDN_SERVICE_SAVE_API'),\n [\n 'multipart' => $this->constructPayload($request),\n 'headers' => [\n 'Authorization' => $request->headers->get('authorization'),\n 'Origin' => $request->headers->get('origin')\n ]\n ]\n );\n $body = json_decode($response->getBody()->getContents());\n if ($body->status === 200) {\n $data['file'] = (array)$body;\n return (array)$body->data->fileUris;\n }\n } catch (\\GuzzleHttp\\Exception\\RequestException $e) {\n $data['file'] = [];\n if ($e->hasResponse()) {\n $body = $e->getResponse()->getBody();\n $data['file'] = (array)json_decode($body->getContents());\n } else {\n $data['file']['status'] = 500;\n $data['file']['message'] = $e->getMessage();\n $data['file']['data'] = null;\n }\n }\n\n return [];\n }", "public function iN_INSERTUploadedFiles($uid, $filePath, $tumbnailPath, $fileXPath, $ext) {\n\t\t$uid = mysqli_real_escape_string($this->db, $uid);\n\t\t$filePath = mysqli_real_escape_string($this->db, $filePath);\n\t\t$fileXPath = mysqli_real_escape_string($this->db, $fileXPath);\n\t\t$fileExtension = mysqli_real_escape_string($this->db, $ext);\n\t\t$uploadTime = time();\n\t\t$userIP = $_SERVER['REMOTE_ADDR'];\n\t\t$query = mysqli_query($this->db, \"INSERT INTO i_user_uploads (iuid_fk,uploaded_file_path,upload_tumbnail_file_path,uploaded_x_file_path, uploaded_file_ext,upload_time,ip)VALUES('$uid' ,'$filePath','$tumbnailPath','$fileXPath','$fileExtension','$uploadTime','$userIP')\") or die(mysqli_error($this->db));\n\t\t$ids = mysqli_insert_id($this->db);\n\t\treturn $ids;\n\t}", "public function getUploadDir()\n {\n return storage_path($this->getUploadUri());\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'results';\n }", "public function getUpload()\n {\n return $this->upload;\n }", "function _wp_relative_upload_path($path)\n {\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/user';\n }", "public function GetFiles() {\n\n if ($this->Files === null) {\n $this->Files= array();\n foreach($this->GetRequestContext()->FILES as $Key=>$Value) {\n if (is_array($Value['tmp_name'])) {\n $this->Error('Request/File: multiple values for files are not supported for key \"'.$Key.'\".');\n continue;\n }\n $this->Files[$Key]= $this->BuildComponent('Accent\\\\Request\\\\File', array('OrigInfo'=> $Value));\n }\n }\n return $this->Files;\n }", "public static function CHECK_FILE_UPLOAD_LIST(){\n\t $SQL_String = \"SELECT folder,_regist FROM task_upload WHERE hash=:hash AND _upload!='';\";\n\t return $SQL_String;\n\t}" ]
[ "0.606116", "0.60114723", "0.5939847", "0.58901644", "0.5739032", "0.5711511", "0.5705625", "0.56313145", "0.5467583", "0.54382384", "0.5411503", "0.53950095", "0.5389481", "0.53644305", "0.53644305", "0.5335713", "0.53040653", "0.5287242", "0.52597153", "0.5247577", "0.5208445", "0.517259", "0.5143094", "0.51334685", "0.51291585", "0.5113047", "0.50868505", "0.5074366", "0.50727195", "0.50554365", "0.50485253", "0.50459695", "0.5022273", "0.50174373", "0.5013456", "0.4995975", "0.4974591", "0.49731857", "0.49471495", "0.49408594", "0.49401522", "0.49353784", "0.49306673", "0.4928946", "0.49205342", "0.49110824", "0.49077454", "0.4885619", "0.488259", "0.4865823", "0.4855347", "0.48480704", "0.4847477", "0.48428804", "0.48427102", "0.48374113", "0.4836995", "0.48357937", "0.48301327", "0.48280668", "0.4822149", "0.48214066", "0.48073596", "0.48047075", "0.48039544", "0.47979656", "0.47967806", "0.47964916", "0.47960317", "0.47902334", "0.4784284", "0.4783621", "0.478019", "0.47798118", "0.47797453", "0.47765312", "0.47650322", "0.47638974", "0.47621098", "0.47581518", "0.47573093", "0.47568455", "0.47548372", "0.47453395", "0.47423145", "0.47417703", "0.47411224", "0.473926", "0.47373438", "0.47362566", "0.47348377", "0.47347963", "0.47327092", "0.47326747", "0.47316086", "0.47302404", "0.47279", "0.4727521", "0.47244802", "0.472113" ]
0.5677413
7
Handler for timelane setup storage into sessions.
public function handleStoreDate($yearFrom,$monthFrom,$yearTo,$monthTo) { $session = $this->session->getSection('map'); $session->dateFrom = array('Year'=>$yearFrom,'Month'=>$monthFrom); $session->dateTo = array('Year'=>$yearTo,'Month'=>$monthTo); $this->terminate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setup()\n {\n $_SESSION = array();\n $_SESSION['security'] = array(\n 'user-agent' => md5(empty($_SERVER['HTTP_USER_AGENT']) ? '' : $_SERVER['HTTP_USER_AGENT']),\n 'ip' => $_SERVER['REMOTE_ADDR'],\n 'start' => time()\n );\n $_SESSION['stores'] = array();\n }", "public function storeSessionData() {}", "public function storeSessionData() {}", "function __construct() {\n\t\tkataMakeTmpPath('sessions');\n\t}", "public function tracker_store(){\n\t\tif(!$this->env_get('tracker:event')) return;\n\n\t\t// get exact request time\n\t\t$request_time =\tround($_SERVER['REQUEST_TIME_FLOAT'], 4);\n\n\t\t// set a value (if not already set from a concurrent process) to block concurrent processes\n\t\t$unique = uniqid(rand(), true);\n\t\t$this->us_set('tracker:session_created', $unique, true);\n\n\n\t\t// check if unique key matched uncached session value\n\t\tif($this->us_is('tracker:session_created', $unique, true)){\n\n\t\t\t// if already session update data is found\n\t\t\t$session_data = $this->env_get('tracker:session_data') ?: [];\n\n\t\t\t// add redisjob to add session\n\t\t\t$res = traffic_session::delayed_create_session([\n\t\t\t\t// base param\n\t\t\t\t'persistID' \t\t\t\t=> $this->us_get('persistID'),\n\t\t\t\t'createTime'\t\t\t\t=> $_SERVER['REQUEST_TIME'],\n\t\t\t\t'domainID'\t\t\t\t\t=> $this->env_get('nexus:domainID'),\n\t\t\t\t'pageID'\t\t\t\t\t=> $this->env_get('nexus:pageID'),\n\t\t\t\t'publisherID'\t\t\t\t=> $this->env_get('nexus:publisherID'),\n\n\t\t\t\t// special param\n\t\t\t\t'publisher_uncover_key'\t\t=> $this->env_get('nexus:publisher_uncover_key'),\n\t\t\t\t'publisher_uncover_name'\t=> $this->env_get('nexus:publisher_uncover_name'),\n\t\t\t\t'publisher_affiliate_key'\t=> $this->env_get('nexus:publisher_affiliate_key'),\n\t\t\t\t'usID'\t\t\t\t\t\t=> $this->us->usID,\n\t\t\t\t'ipv4'\t\t\t\t\t\t=> (strpos($_SERVER['REMOTE_ADDR'], ':') === false) ? $_SERVER['REMOTE_ADDR'] : null,\n\t\t\t\t'ipv6'\t\t\t\t\t\t=> (strpos($_SERVER['REMOTE_ADDR'], ':') !== false) ? $_SERVER['REMOTE_ADDR'] : null,\n\t\t\t\t'useragent'\t\t\t\t\t=> !empty($_SERVER['HTTP_USER_AGENT']) ? substr($_SERVER['HTTP_USER_AGENT'], 0, 255) : null,\n\t\t\t\t'referer'\t\t\t\t\t=> $_SERVER['HTTP_REFERER'] ?? null,\n\n\t\t\t\t// options\n\t\t\t\t'ipv4_range_detection'\t\t=> $this->env_get('domain:ipv4range_detection') ? true : false,\n\t\t\t\t'delayed_parsing'\t\t\t=> true,\n\t\t\t\t] + $session_data);\n\n\t\t\t// on error\n\t\t\tif($res->status != 204){\n\n\t\t\t\t// log error\n\t\t\t\te::logtrigger('Failed to create RedisJob for create_session: '.$res->status);\n\n\t\t\t\t// and abort\n\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t// else if session update data is ready\n\t\telseif($this->env_get('tracker:session_data')){\n\n\t\t\t// add redisjob to update session\n\t\t\t$res = traffic_session::delayed_update_session([\n\t\t\t\t'persistID' \t=> $this->us_get('persistID'),\n\t\t\t\t] + $this->env_get('tracker:session_data')\n\t\t\t\t);\n\n\t\t\t// on error\n\t\t\tif($res->status != 204){\n\n\t\t\t\t// log error\n\t\t\t\te::logtrigger('Failed to create RedisJob for update_session: '.$res->status);\n\n\t\t\t\t// and abort\n\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t// if this is a new click\n\t\tif($this->env_is('nexus:new_click_request')){\n\n\t\t\t// get click request data\n\t\t\t$request_data = $this->env_get('nexus:new_click_request');\n\n\t\t\t// save in session\n\t\t\t$this->us_set('tracker:last_click_request', $request_data);\n\n\t\t\t// add redisjob to add click to session\n\t\t\t$res = traffic_session::delayed_create_click([\n\t\t\t\t// base param\n\t\t\t\t'persistID'\t\t=> $this->us_get('persistID'),\n\t\t\t\t'createTime'\t=> $_SERVER['REQUEST_TIME'],\n\n\t\t\t\t// special param\n\t\t\t\t'referer'\t\t=> $_SERVER['HTTP_REFERER'] ?? null,\n\t\t\t\t'request'\t\t=> $request_data,\n\t\t\t\t]);\n\n\t\t\t// on error\n\t\t\tif($res->status != 204){\n\n\t\t\t\t// log error\n\t\t\t\te::logtrigger('Failed to create RedisJob for create_click: '.$res->status);\n\n\t\t\t\t// and abort\n\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t// if we have a new blocked click\n if($this->env_is('nexus:blocked_click')){\n\n // get data\n $blocked_click = $this->env_get('nexus:blocked_click');\n\n // add redisjob to add click to session\n\t\t\t$res = traffic_session::delayed_create_blocked_click([\n\t\t\t\t// base param\n\t\t\t\t'persistID'\t\t=> $this->us_get('persistID'),\n\t\t\t\t'createTime'\t=> $_SERVER['REQUEST_TIME'],\n\t\t\t\t'pageID'\t\t=> $blocked_click->pageID,\n\t\t\t\t'publisherID'\t=> $blocked_click->publisherID,\n\t\t\t\t'status'\t\t=> $blocked_click->status,\n\n\t\t\t\t// special param\n\t\t\t\t'referer'\t\t=> $blocked_click->referer ?: null,\n\t\t\t\t'request'\t\t=> $blocked_click->pubdata ?: null,\n\t\t\t\t]);\n\n\t\t\t// on error\n\t\t\tif($res->status != 204){\n\n\t\t\t\t// log error\n\t\t\t\te::logtrigger('Failed to create RedisJob for create_blocked_click: '.$res->status);\n\n\t\t\t\t// and abort\n\t\t\t\treturn;\n\t\t\t\t}\n }\n\n\n\t\t// create pageview_data\n\t\t$pageview_data = $this->env_get('tracker:callinfo');\n\t\tif(!is_array($pageview_data)) $pageview_data = [];\n\t\t$pageview_data['url'] = $this->env_get('nexus:url');\n\n\t\t// add redisjob to add session_pageview\n\t\t$res = traffic_session::delayed_create_session_pageview([\n\t\t\t// base param\n\t\t\t'persistID'\t\t=> $this->us_get('persistID'),\n\t\t\t'createTime'\t=> $_SERVER['REQUEST_TIME'],\n\t\t\t'data'\t\t\t=> $pageview_data,\n\t\t\t]);\n\n\t\t// on error\n\t\tif($res->status != 204){\n\n\t\t\t// log error\n\t\t\te::logtrigger('Failed to create RedisJob for session_pageview: '.$res->status);\n\n\t\t\t// and abort\n\t\t\treturn;\n\t\t\t}\n\t\t}", "public function storeSession() {}", "protected function manageSession()\n {\n $this->session = new WebsiteSession();\n foreach ($this->eventRequest->getSession() as $key => $value) {\n\n if ($key == 'createdAt') {\n $value = time();\n }\n\n $method = 'set' . ucwords($key);\n if (method_exists($this->session, $method)) {\n $this->session->$method($value);\n }\n }\n }", "protected function setupSession()\n\t{\n\t\t$name = $this->appType . \"id\";\n\t\tsession_name($name);\n\n\t\t$path = getenv(\"P_SESSION_DIR\") ?: $GLOBALS[\"BASE_DIR\"] . \"/session\";\n\t\tif (! is_dir($path)) {\n\t\t\tif (! mkdir($path, 0777, true))\n\t\t\t\tjdRet(E_SERVER, \"fail to create session folder: $path\");\n\t\t}\n\t\tif (! is_writeable($path))\n\t\t\tjdRet(E_SERVER, \"session folder is NOT writeable: $path\");\n\t\tsession_save_path ($path);\n\n\t\tini_set(\"session.cookie_httponly\", 1);\n\n\t\t$path = getenv(\"P_URL_PATH\");\n\t\tif ($path)\n\t\t{\n\t\t\t// e.g. path=/cheguanjia\n\t\t\tini_set(\"session.cookie_path\", $path);\n\t\t}\n\t}", "public static function setAsSessionHandler()\n {\n session_set_save_handler(array('Eb_MemcacheSession', 'sessionOpen'),\n array('Eb_MemcacheSession', 'sessionClose'),\n array('Eb_MemcacheSession', 'sessionRead'),\n array('Eb_MemcacheSession', 'sessionWrite'),\n array('Eb_MemcacheSession', 'sessionDestroyer'),\n array('Eb_MemcacheSession', 'sessionGc'));\n }", "protected function _initialize_session()\n\t{\n\t\t$this->sdata = array(\n\t\t\t'session_id' \t\t=> 0,\n\t\t\t'fingerprint'\t\t=>\t0,\n\t\t\t'member_id' \t\t=> 0,\n\t\t\t'admin_sess' \t\t=> 0,\n\t\t\t'ip_address' \t\t=> ee()->input->ip_address(),\n\t\t\t'user_agent' \t\t=> substr(ee()->input->user_agent(), 0, 120),\n\t\t\t'last_activity'\t\t=> 0,\n\t\t\t'sess_start'\t\t=>\t0\n\t\t);\n\t}", "private function _sess_run() {\n\t\t// session\n\t\tini_set('session.save_handler', $this->sess_save_handler);\n\t\t$path = array();\n\t\tforeach ($this->sess_server as $server) {\n\t\t\tif (isset($server['host']) && isset($server['port'])) {\n\t\t\t\t$path[] = \"tcp://{$server['host']}:{$server['port']}?\" . http_build_query(isset($server['params']) ? $server['params'] : array());\n\t\t\t}\n\t\t}\n\t\tif (empty($path)) {\n\t\t\tshow_error('Session save_path is empty');\n\t\t}\n\t\tini_set('session.save_path', implode(',', $path));\n\n\t\tini_set('session.gc_maxlifetime', $this->sess_expiration);\t// 过期时间\n\t\t// cookie\n\t\tini_set('session.cookie_secure', 0);\t\t// 0 http:// 1 https://\n\t\tini_set('session.cookie_httponly', 1);\t\t// 不让JS读取session的cookie\n\t\tsession_name($this->sess_cookie_name);\n\n\t\tsession_start();\n\t\t// delete old flashdata (from last request)\n\t\t$this->_flashdata_sweep();\n\t\t// mark all new flashdata as old (data will be deleted before next request)\n\t\t$this->_flashdata_mark();\n\t}", "protected function _saveToSession()\n {\n $this->sessionData['_options'] = $this->_options;\n $this->sessionData['_selectedIndex'] = $this->_selectedIndex;\n $this->sessionData['safeMode'] = $this->safeMode;\n }", "protected function setupSessionVars()\n\t{\n\t\tif(!empty($_SESSION[SESSION_KEY]))\n\t\t{\n\t\t\tself::$session = $_SESSION[SESSION_KEY];\n\t\t}\n\t\telse \n\t\t{\n\t\t\tself::$session = $_SESSION[SESSION_KEY] = array();\n\t\t}\n\t\tif(!empty($_SESSION[SESSION_FLASH_KEY]))\n\t\t{\n\t\t\tself::$session_flash = $_SESSION[SESSION_FLASH_KEY];\n\t\t\t$_SESSION['session_flash_data'] = array();\n\t\t}\n\t\telse \n\t\t{\n\t\t\tself::$session_flash = $_SESSION[SESSION_FLASH_KEY] = array();\n\t\t}\n\t}", "function _setHellaspayIntoSession() {\r\n\t$session = JFactory::getSession();\r\n\t$sessionHellaspay = new stdClass();\r\n\t$sessionHellaspay->vivinstalments = $this->_vivinstalments;\r\n\t$sessionHellaspay->vivinstalmentsamount = $this->_vivinstalmentsamount;\r\n\t$session->set('hellaspay', json_encode($sessionHellaspay), 'vm');\r\n }", "function setSession() {\n $layout = $this->input->post('layout');\n $_SESSION['standingLayout'] = $layout;\n \n // gets value for order and stores in session variable\n $order = $this->input->post('order');\n $_SESSION['standingOrder'] = $order;\n \n // gets value for data source and stores in session variable\n $dataSource = $this->input->post('dataSource');\n $_SESSION['standingDataSource'] = $dataSource;\n \n redirect('/standing');\n }", "private function store()\n {\n $this->session->set('sergsxm_form_'.$this->formId, $this->parameters);\n }", "function initSession(){\n\n\t\t//load resource files\n\t\t$this->refreshDataSet();\n\n\t\tif($this->isFatal())return;\n\n\t\t//check the state\n\t\t$this->checkInput();\n\n\t\t\n\t\tif($this->isFatal())return;\n\n\t\t//construct the table from the data\n\t\t$this->buildTable($this->schedule, $this->users);\n\n\t\tif($this->isFatal())return;\t\n\n\t}", "function MySessionStart() {\n\tif (defined('SET_SESSION_NAME')) session_name(SET_SESSION_NAME);\n\t\n\tif (TRACKPOINT_ISSETUP) {\n\t\tif (!defined('TABLEPREFIX')) define('TABLEPREFIX', TRACKPOINT_TABLEPREFIX);\n\t\t$ses_class = new Session();\n\t\tsession_set_save_handler(\n\t\t\tarray(&$ses_class, '_open'),\n\t\t\tarray(&$ses_class, '_close'),\n\t\t\tarray(&$ses_class, '_read'),\n\t\t\tarray(&$ses_class, '_write'),\n\t\t\tarray(&$ses_class, '_destroy'),\n\t\t\tarray(&$ses_class, '_gc')\n\t\t);\n\t} else {\n\t\tini_set('session.save_handler', 'files');\n\t\tif (defined('TEMP_DIRECTORY') && is_writable(TEMP_DIRECTORY)) ini_set('session.save_path', TEMP_DIRECTORY);\n\t}\n\tsession_start();\n}", "public function store() {\n\t\t$_SESSION['puserauth'] = serialize($this);\n\t}", "private function storeSchedule()\n\t{\n\t\tfile_put_contents('schedule.json', json_encode(self::$schedule));\n\n\t\t// Sleeping 1/10s to avoid race conditions and reloading the file\n\t\tusleep(100000);\n\t\tself::loadSchedule();\n\t}", "protected function initialize()\n\t{\n\t\t$this->data =& $_SESSION;\n\t}", "private function _initSession()\n {\n Zend_Session::setOptions(array('remember_me_seconds' => intval(App::config()->remember_me_seconds) , 'save_path' => VAR_PATH . \"session\" , 'gc_probability' => 1 , 'gc_divisor' => 5000 , 'name' => \"zfsession\" , 'use_only_cookies' => 0));\n $handler = strtolower(App::config()->session_save_handler);\n if('db' === $handler){\n Zend_Session::setSaveHandler(new App_Session_SaveHandler_DbTable(array('name' => DB_TABLE_PREFIX . 'session' , 'primary' => 'id' , 'modifiedColumn' => 'modified' , 'dataColumn' => 'data' , 'lifetimeColumn' => 'lifetime')));\n }\n Zend_Session::start();\n }", "private function setSESSIONvariables() {\n $_SESSION['pqz_configuration'] = $this->configuration;\n $_SESSION['pqz_question'] = $this->question;\n }", "protected function _postConstruct()\n {\n parent::_postConstruct();\n\n $this->_manager = Solar::dependency(\n 'Solar_Session_Manager',\n $this->_config['manager']\n );\n \n // Add ourselves to the session manager's list to receive updates\n $this->_manager->addSession($this);\n \n // determine the storage segment; use trim() and strict-equals to \n // allow for string zero segment names.\n $segment = is_null($this->_config['class']) ? $this->_config['segment'] : $this->_config['class'];\n $segment = trim($segment);\n if ($segment === '') {\n $segment = 'Solar';\n }\n \n // set the class\n $this->setSegment($segment);\n \n // lazy-start any existing session\n $this->lazyStart();\n }", "public function initStorage() {}", "static public function begin(){ \n $_SESSION['session_time'] = time(); \n }", "function initialize()\n\t{\n\t\t$accountsfile = \"/tmp/accounts\";\n\n\t\t$size = filesize($accountsfile);\n\t\tif (FALSE == $size || 0 == $size)\n\t\t\t$_SESSION[\"accounts\"] = array();\n\n\t\t$_SESSION[\"accounts\"] = unserialize(file_get_contents($accountsfile));\n\t}", "private function set_storage() {\r\n if (!is_array($this->cache_handler) && !empty($this->cache_handler)) {\r\n $this->cache_handler = array($this->cache_handler);\r\n }\r\n\r\n foreach ($this->cache_handler as $handler) {\r\n if ((extension_loaded($handler) || $handler == 'File') && class_exists('TS3ViewerStorage' . $handler)) {\r\n $handler = 'TS3ViewerStorage' . $handler;\r\n $this->cache = new $handler;\r\n break;\r\n }\r\n }\r\n\r\n if ($this->cache === null && class_exists('TS3ViewerStorageFile')) {\r\n $this->cache = new TS3ViewerStorageFile;\r\n }\r\n elseif ($this->cache === null) {\r\n $this->errors[] = 'no cache handler found..';\r\n return;\r\n }\r\n $this->cache_handler = get_class($this->cache);\r\n if ($this->cache_handler == 'TS3ViewerStorageFile') {\r\n $this->cache->path = $this->cache_path;\r\n }\r\n\r\n $this->cache->timeout = $this->cache_timeout;\r\n }", "private function createSession()\n {\n session_regenerate_id(TRUE);\n $this->session = array();\n $this->session['legit'] = $this->sessionHash();\n $this->session['id'] = $this->userId;\n if (!$this->userId) {\n $this->voidCookie();\n }\n }", "function set_times_login ($times_login)\r\n {\r\n $_SESSION[\"times_login\"] = $times_login;\r\n }", "abstract public function prepareToStore();", "protected function load()\n {\n $_SESSION[$this->name] = $_SESSION[$this->name]?? [];\n $_SESSION[SessionBlockInterface::FLASH_KEY] = $_SESSION[SessionBlockInterface::FLASH_KEY] ?? [];\n }", "function set_session() {\n\t\t\t// Set cart and coupon session data\n\t\t\t$_SESSION['cart'] = $this->cart_contents;\n\t\t\t$_SESSION['coupons'] = $this->applied_coupons;\n\t\t\t\n\t\t\t// Cart contents change so reset shipping\n\t\t\tunset($_SESSION['_chosen_shipping_method']);\n\t\t\t\n\t\t\t// Calculate totals\n\t\t\t$this->calculate_totals();\n\t\t}", "public function setup()\n {\n $this->luser = $this->sessioncheck('user', FALSE); # see if there is a user variable in the session....\n foreach (getallheaders() as $k => $v)\n {\n if (self::TOKEN === strtoupper($k))\n {\n $tok = JWT::decode($v, self::KEY);\n $this->luser = $this->load('user', $tok->sub);\n $this->tokauth = TRUE;\n break;\n }\n }\n if (isset($_SERVER['REDIRECT_URL']) && !preg_match('/index.php/', $_SERVER['REDIRECT_URL']))\n {\n/**\n * Apache v 2.4.17 changed the the REDIRECT_URL value to be a full URL, so we need to strip this.\n * Older versions will not have this so the code will do nothing.\n */\n $uri = preg_replace('#^https?://[^/]+#', '', $_SERVER['REDIRECT_URL']);\n }\n else\n {\n $uri = $_SERVER['REQUEST_URI'];\n }\n if ($_SERVER['QUERY_STRING'] != '')\n { # there is a query string so get rid it of it from the URI\n list($uri) = explode('?', $uri);\n }\n $req = array_filter(explode('/', $uri)); # array_filter removes empty elements - trailing / or multiple /\n/*\n * If you know that the base directory is empty then you can delete the next test block.\n *\n * You can also optimise out the loop if you know how deep you are nested in sub-directories\n *\n * The code here is to make it easier to move your code around within the hierarchy. If you don't need\n * this then optimise the hell out of it.\n */\n if ($this->local()->base() != '')\n { # we are in at least one sub-directory\n $bsplit = array_filter(explode('/', $this->local()->base()));\n foreach (range(1, count($bsplit)) as $c)\n {\n array_shift($req); # pop off the directory name...\n }\n }\n if (!empty($req))\n { # there was something after the domain name so split it into action and rest...\n $this->reqaction = strtolower(array_shift($req));\n $this->reqrest = empty($req) ? [''] : array_values($req);\n }\n\n return $this;\n }", "public function run()\n {\n $sessions = [\n \t[\n \t\t'session_name' => 'registration',\n \t\t'session_start' => Carbon::now(),\n \t\t'session_end' => Carbon::now()\n \t],\n \t[\n \t\t'session_name' => 'kti_submit',\n \t\t'session_start' => Carbon::now(),\n \t\t'session_end' => Carbon::now()\n \t],\n \t[\n \t\t'session_name' => 'non_kti_submit',\n \t\t'session_start' => Carbon::now(),\n \t\t'session_end' => Carbon::now()\n \t]\n ];\n\n DB::table('sessions')->insert($sessions);\n }", "protected function afterActionInit(): void\n {\n $this->loader = Loader::addTo($this->vp, ['ui' => $this->loaderUi, 'shim' => $this->loaderShim]);\n $this->actionData = $this->loader->jsGetStoreData()['session'];\n }", "public static function setSessionHandler () {\n \n // use memcache if available\n $handler = conf::getMainIni('session_handler');\n if ($handler == 'memcache'){\n $host = conf::getMainIni('memcache_host');\n if (!$host) {\n $host = 'localhost';\n }\n $port = conf::getMainIni('memcache_port');\n if (!$port) {\n $port = '11211';\n }\n $query = conf::getMainIni('memcache_query');\n if (!$query) {\n $query = 'persistent=0&weight=2&timeout=2&retry_interval=10';\n }\n $session_save_path = \"tcp://$host:$port?$query, ,tcp://$host:$port \";\n ini_set('session.save_handler', 'memcache');\n ini_set('session.save_path', $session_save_path);\n }\n }", "public function session_init()\n {\n // session started (Installer?)\n if (session_id())\n return;\n\n $sess_name = $this->config->get('session_name');\n $sess_domain = $this->config->get('session_domain');\n $lifetime = $this->config->get('session_lifetime', 0) * 60;\n\n // set session domain\n if ($sess_domain) {\n ini_set('session.cookie_domain', $sess_domain);\n }\n // set session garbage collecting time according to session_lifetime\n if ($lifetime) {\n ini_set('session.gc_maxlifetime', $lifetime * 2);\n }\n\n ini_set('session.cookie_secure', rcube_ui::https_check());\n ini_set('session.name', $sess_name ? $sess_name : 'roundcube_sessid');\n ini_set('session.use_cookies', 1);\n ini_set('session.use_only_cookies', 1);\n ini_set('session.serialize_handler', 'php');\n\n // use database for storing session data\n $this->session = new rcube_session($this->get_dbh(), $this->config);\n\n $this->session->register_gc_handler(array($this, 'temp_gc'));\n $this->session->register_gc_handler(array($this, 'cache_gc'));\n\n // start PHP session (if not in CLI mode)\n if ($_SERVER['REMOTE_ADDR'])\n session_start();\n\n // set initial session vars\n if (!$_SESSION['user_id'])\n $_SESSION['temp'] = true;\n\n // restore skin selection after logout\n if ($_SESSION['temp'] && !empty($_SESSION['skin']))\n $this->config->set('skin', $_SESSION['skin']);\n }", "function saveSession() {}", "function saveToSession() {\n\t\t// Unset sessions since this info is elsewhere in the database\n\t\tunset($this->_questions);\n\t\ttx_wecassessment_sessiondata::storeSessionData($this, $this->getPID());\n\t}", "protected function startup()\n {\n $this->init(self::INIT_WITH_DB | self::INIT_WITH_PLUGINS);\n\n // start session\n $this->session_init();\n\n // create user object\n $this->set_user(new rcube_user($_SESSION['user_id']));\n\n // configure session (after user config merge!)\n $this->session_configure();\n\n // set task and action properties\n $this->set_task(rcube_ui::get_input_value('_task', rcube_ui::INPUT_GPC));\n $this->action = asciiwords(rcube_ui::get_input_value('_action', rcube_ui::INPUT_GPC));\n\n // reset some session parameters when changing task\n if ($this->task != 'utils') {\n if ($this->session && $_SESSION['task'] != $this->task)\n $this->session->remove('page');\n // set current task to session\n $_SESSION['task'] = $this->task;\n }\n\n // init output class\n if (!empty($_REQUEST['_remote']))\n $GLOBALS['OUTPUT'] = $this->json_init();\n else\n $GLOBALS['OUTPUT'] = $this->load_gui(!empty($_REQUEST['_framed']));\n\n // load plugins\n $this->plugins->init($this, $this->task);\n $this->plugins->load_plugins((array)$this->config->get('plugins', array()), array('filesystem_attachments', 'jqueryui'));\n }", "function __construct() {\n\t\t$this->time = time();\n\t\t$this->startSession();\n\t}", "private function getSessionSavePath() {}", "function bdd2session() {\n\tif (!empty($_SESSION['dims']['userid'])) {\n\t\tinclude_once DIMS_APP_PATH.'/modules/catalogue/include/class_panier.php';\n\t\t$panier = new cata_panier();\n\t\t$panier->open($_SESSION['dims']['userid']);\n\n\t\tforeach ($panier->articles as $art) {\n\t\t\t$_SESSION['catalogue']['panier']['articles'][$art['ref']]['qte'] = $art['qte'];\n\n\t\t\tif (isset($art['forced_price'])) {\n\t\t\t\t$_SESSION['catalogue']['panier']['articles'][$art['ref']]['forced_price'] = $art['forced_price'];\n\t\t\t}\n\t\t}\n\t\t// update_montant_panier();\n\t}\n}", "public function store(Request $request)\n {\n $setting = Setting::where('setting','Session')->first();\n $setting = Setting::find($setting->id);\n $setting->value = $request -> time;\n $setting->time = $request -> timeout;\n $setting->save();\n \n }", "protected function initStorageObjects() {\n\t\t$this->durationtiming = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n\t}", "public function __construct()\n {\n $this->storename = 'db.json';\n $this->expiration_time = 5;\n $this->set_storevalues();\n }", "public function run()\n {\n $objet = new Session();\n $objet->libelle_session = 'Normale';\n $objet->save();\n\n $objet = new Session();\n $objet->libelle_session = 'Rattrapage';\n $objet->save();\n\n $objet = new Session();\n $objet->libelle_session = 'Contrôle Continu';\n $objet->save();\n\n }", "public function load()\n {\n if ($this->isLoaded()) {\n return;\n }\n \n // can't be loaded if the session has started\n if (! $this->isStarted()) {\n // not possible for anything to be loaded, then\n $this->unload();\n return;\n }\n \n // set up the value store.\n if (empty($_SESSION[$this->_segment])) {\n $_SESSION[$this->_segment] = array();\n }\n $this->_store =& $_SESSION[$this->_segment];\n \n // set up the flash store\n if (empty($_SESSION['Solar_Session']['flash'][$this->_segment])) {\n $_SESSION['Solar_Session']['flash'][$this->_segment] = array();\n }\n $this->_flash =& $_SESSION['Solar_Session']['flash'][$this->_segment];\n \n // done!\n $this->_is_loaded = true;\n }", "public function setup_session(){\n if(!(isset($_SESSION))){\n session_start();\n }\n\n $_SESSION['user_id'] = $this->user_id;\n $_SESSION['name'] = $this->firstname;\n\n //Remove anon flag\n if(isset($_SESSION['anon'])){\n unset($_SESSION['anon']);\n }\n\n }", "function complentary_session_reset_data() {\n // Diff Wizard session data\n $url_path = $_SERVER['REQUEST_URI'];\n if (strpos($url_path, 'diff-wizard') !== false || strpos($url_path, 'product') !== false ) {\n if ( ! session_id() ) {\n session_start();\n }\n } else {\n if ( ! session_id() ) {\n session_start();\n }\n unset(\n $_SESSION['diffID'],\n $_SESSION['diffyear'],\n $_SESSION['make'],\n $_SESSION['model'],\n $_SESSION['drivetype']\n );\n }\n}", "public function setupSession() {\n global $userid, $langtag;\n $this->echecklistNamespace = new Zend_Session_Namespace('eChecklist');\n // logit(\"test: {$this->echecklistNamespace->lab['labnum']}\");\n if (isset($this->echecklistNamespace->user)) {\n $u = $this->echecklistNamespace->user;\n $user = $u;\n $this->usertype = $u['usertype'];\n $this->username = $u['userid'];\n $this->userfullname = $u['name'];\n $userid = $this->userid = $u['id'];\n // logit(\"{$this->username}, {$this->usertype}, {$this->userfullname}, {$this->userid}\");\n }\n // logit('TIME1: ' . isset($this->echecklistNamespace->lab));\n if (isset($this->echecklistNamespace->lab)) {\n\n $this->lab = $this->echecklistNamespace->lab;\n // logit('ECLAB: ' . print_r($this->lab, true));\n $this->labid = $this->lab['id'];\n $this->labname = $this->lab['labname'];\n $this->labnum = get_arrval($this->lab, 'labnum', 'No-NUM');\n $this->showlab = \"{$this->labnum}/{$this->labname}\";\n } else {\n $this->lab = null;\n $this->labid = 0;\n $this->labname = '';\n $this->labnum = '';\n $this->showlab = '';\n }\n if (! isset($this->echecklistNamespace->lang)) {\n $this->echecklistNamespace->lang = 'EN';\n }\n // clear selected audit if labid is not for this audit\n if (isset($this->echecklistNamespace->audit) || $this->echecklistNamespace->audit != null) {\n $au = new Application_Model_DbTable_Audit();\n $this->audit = $au->getAudit($this->echecklistNamespace->audit['audit_id']);\n if ($this->labid != $this->audit['lab_id'])\n $this->echecklistNamespace->audit = null;\n }\n\n if (isset($this->echecklistNamespace->audit) || $this->echecklistNamespace->audit != null) {\n // logit('AUEC: '. print_r($this->echecklistNamespace->audit, true));\n $au = new Application_Model_DbTable_Audit();\n $this->audit = $this->echecklistNamespace->audit = $au->getAudit($this->echecklistNamespace->audit['audit_id']);\n $this->showaudit = \"{$this->audit['tag']} - #{$this->audit['audit_id']}\" .\n \"- {$this->audit['labname']}\";\n // logit('ec audit: ' . print_r($this->audit, true));\n // / {$this->audit['updated_at']}\";\n } else {\n $this->audit = null;\n $this->showaudit = '';\n }\n $langtag = $this->view->langtag = $this->langtag = $this->echecklistNamespace->lang;\n // $this->langtag = $this->echecklistNamespace->lang;\n // logit('LT: '. $this->view->langtag);\n Zend_Session::start();\n }", "public function __construct() {\n session_start();\n $this->check_stored_login();\n }", "protected function _initSessionData()\n {\n $this->_flash = isset($_SESSION['_flash']) ? $_SESSION['_flash'] : null;\n unset($_SESSION['_flash']);\n $this->_session = $_SESSION;\n }", "function requestSessionInfo()\n {\n //para pasarselo al aside;\n\n $sessionLevel = $this->loginController->GetSessionAuthLevel();\n $this->view->setSessionLevel($sessionLevel);\n\n $sessionName = $this->loginController->GetSessionUsername();\n $this->view->setSessionName($sessionName);\n }", "public function run()\n {\n DB::table('portal_settings')->insert([\n ['expired_at' => null, 'last_renew' => null, 'status' => 'deactive']\n ]);\n }", "final protected function makeStorable()\n\t{\n\t\tassert( 'is_array( $this->usable )' );\n\n\t\tif ( data::autoType( config::get( 'session.encrypt', false ), 'boolean' ) )\n\t\t\t$this->storable = crypt::create()->encrypt( serialize( $this->usable ) );\n\t\telse\n\t\t\t$this->storable = serialize( $this->usable );\n\t}", "private function loadSesionVars() {\r\n\r\n $this->VARS = array(); \r\n\r\n $this->updateSessionExpireTime();\r\n\r\n $dati = $this->selectSessionVars();\r\n\r\n foreach($dati as $infos) { \r\n $this->VARS[$infos[\"name\"]]=unserialize($infos[\"value\"]);\r\n }\r\n\r\n }", "protected function _session()\n {\n if (class_exists('tracer_class')) {\n tracer_class::marker(array(\n 'set data on session markers',\n debug_backtrace(),\n '#006400'\n ));\n }\n\n if ($this->_session && $this->_session->returns('display')) {\n foreach ($this->_session->returns('display') as $key => $val) {\n $this->generate('session_display;' . $key, $val);\n }\n }\n }", "public function sess_create()\r\r\n\t{\r\r\n\t\tif(session_id() == '') {\r\r\n\t\t\tsession_start();\r\r\n\t\t}\r\r\n\r\r\n\t\t$_SESSION['session_id']\t\t= session_id();\r\r\n\t\t$_SESSION['ip_address']\t\t= $this->CI->input->ip_address();\r\r\n\t\t$_SESSION['user_agent']\t\t= substr($this->CI->input->user_agent(), 0, 120);\r\r\n\t\t$_SESSION['last_activity']\t= $this->parent->now;\r\r\n\r\r\n\t\t$this->parent->userdata = $_SESSION;\r\r\n\t}", "protected function setup() {\n $this->state[\"user\"] = $this->env->get_test_user();\n $this->env->log_user_in($this->state[\"user\"]->username);\n $this->state[\"fields\"] = array(\n \"token\" => str_repeat(\"0\", 64),\n \"uuid\" => str_repeat(\"0\", 36)\n );\n }", "protected function initStorageFile()\n {\n $storageFilePath = $this->getStoragePath();\n if(!file_exists($storageFilePath)) {\n touch($storageFilePath);\n fwrite(fopen($storageFilePath, \"w\"), static::HEADER . \"\\n\");\n }\n }", "private function setUp($config) {\r\n //print_r($config);\r\n //$this->_MYSESSION_CONF=$config;\r\n\r\n $this->db_type = $config[\"DATABASE_TYPE\"];\r\n $this->db_name = $config[\"DB_DATABASE\"];\r\n $this->db_pass = $config[\"DB_PASSWORD\"];\r\n $this->db_server = $config[\"DB_SERVER\"];\r\n $this->db_username = $config[\"DB_USERNAME\"];\r\n\r\n $this->table_name_session = $config[\"TB_NAME_SESSION\"];\r\n $this->table_name_variable = $config[\"TB_NAME_VALUE\"];\r\n $this->table_column_sid = $config[\"SID\"];\r\n $this->table_column_name = $config[\"NAME\"];\r\n $this->table_column_value = $config[\"VALUE\"];\r\n $this->table_column_fexp = $config[\"FEXP\"];\r\n $this->table_column_ua = $config[\"UA\"];\r\n $this->table_column_exp = $config[\"EXP\"];\r\n\r\n $this->sid_name = $config[\"SESSION_VAR_NAME\"];\r\n $this->overwrite = ($config[\"OVERWRITE_PHP_FUNCTION\"]=='1')?true:false;\r\n $this->sid_len = intval($config[\"SID_LEN\"]);\r\n $this->session_duration = intval($config[\"DURATION\"]);\r\n $this->session_max_duration = intval($config[\"MAX_DURATION\"]);\r\n $this->use_cookie = ($config[\"USE_COOKIE\"]=='1')?true:false;\r\n $this->encrypt_data = ($config[\"CRIPT\"]=='1')?true:false;\r\n $this->encrypt_key = $config[\"CRIPT_KEY\"];\r\n\r\n $this->hijackBlock = ($config[\"ENABLE_ANTI_HIJACKING\"]=='1')?true:false;\r\n $this->hijackSalt = $config[\"ANTI_HIJACKING_SALT\"];\r\n\r\n $this->dbConnection();\r\n $this->readSessionId();\r\n //check if i have to overwrite php\r\n if ($this->overwrite) {\r\n //yes.. i'm the best so i overwrite php function\r\n //Make sure session cookies expire when we want it to expires\r\n ini_set('session.cookie_lifetime', $this->session_duration); \r\n //set the value of the garbage collector\r\n ini_set('session.gc_maxlifetime', $this->session_max_duration);\r\n // set the session name to our fantastic name\r\n ini_set('session.name', $this->sid_name); \r\n\r\n // register the new handler\r\n session_set_save_handler(\r\n array(&$this, 'open'),\r\n array(&$this, 'close'),\r\n array(&$this, 'read'),\r\n array(&$this, 'write'),\r\n array(&$this, 'destroy'),\r\n array(&$this, 'gc')\r\n );\r\n\r\n\r\n // start the session and cross finger\r\n session_id($this->getSessionId());\r\n session_start();\r\n\r\n } \r\n\r\n \r\n //echo \"<hr>\".$this->sessionId.\"<hr>\";\r\n //if ($this->expireSession()) $this->destroy();\r\n //$_REQUEST[$this->_MYSESSION_CONF['SESSION_VAR_NAME']]=$this->sessionId;\r\n\r\n }", "function hook_session() {\n session_set_save_handler(array($this, '_open'),\n array($this, '_close'),\n array($this, '_read'),\n array($this, '_write'),\n array($this, '_destroy'),\n array($this, '_clean'));\n }", "public function store() {\n\t\t//\n\t}", "public function store() {\n\t\t//\n\t}", "public function store() {\n\t\t//\n\t}", "protected function setStorage($data)\n {\n Session::register(__NAMESPACE__, serialize($data));\n }", "public function store()\n\t{ \n $hour = new DateTime('now');\n return Redirect::to('/login'); \n\t}", "public function init() {\n $this->uri = ''; //En un futuro esto tomara pararemetros q vengan de GET\n session_start();\n //$this->generateFakeData();\n $this->validatePost();\n $this->requireView(); \n }", "private function storeGame()\n {\n $_SESSION['game'] = array(\n 'remaining_ships' => $this->remainingShips,\n 'player_turns' => $this->playerTurns,\n 'ships' => $this->ships,\n 'board' => $this->board\n );\n }", "function session_create()\n\t{\n\t\t$this->data = array();\n\t\treturn true;\n\t}", "public function getSessionLifetimeTask()\n\t{\n\t\t$this->send([Config::get('lifetime')]);\n\t}", "public function saveLoginData()\n {\n //Get user data (ip, time, browser)\n $request = \\Yii::$app->getRequest();\n $userData = [\n 'ip' => $request->getUserIP(),\n 'login_time' => time(),\n 'browser' => UserAgent::model()->browser,\n 'user_id' => \\Yii::$app->user->id\n ];\n\n //Save it to DB\n $loginStories = new LoginStories();\n $loginStories->attributes = $userData;\n $loginStories->save();\n }", "private function mkNew()\n\t{\n\t\tdo\n\t\t{\n\t\t\t$this->id = md5\n\t\t\t(\n\t\t\t\tuniqid(microtime()) . $_SERVER['REMOTE_ADDR']\n\t\t\t\t\t. $_SERVER['HTTP_USER_AGENT']\n\t\t\t);\n\n\t\t\t$this->filename = ini_get('session.save_path')\n\t\t\t\t. '/SuckLess_' . $this->name . '.' . $this->id;\n\t\t}\n\t\twhile(file_exists($this->filename));\n\n\t\t$this->data = array();\n\t}", "static function storeLocation() {\n if ($_SERVER['REQUEST_METHOD'] == 'GET') {\n $_SESSION['forwardingUrl'] = \"http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n }\n }", "public function setSaveHandler()\n {\n function open($savePath, $sessionName){ // open\n }\n function close(){ // close\n }\n function read($sessionId){ // read\n return $this->get($sessionId);\n }\n function write($sessionId, $data){ // write\n return $this->set($sessionId, $data);\n }\n function destroy($sessionId){ // destroy\n $this->delete($sessionId);\n }\n function gc($lifetime) { // gc\n }\n session_set_save_handler(\"open\", \"close\",\"read\",\"write\",\"destroy\",\"gc\");\n }", "public function __construct()\n {\n // Construct session place\n if(!array_key_exists(self::SESSION_KEY, $_SESSION)) {\n $_SESSION[self::SESSION_KEY] = array();\n }\n }", "private function _setSessionxxxx()\n {\n $this->_session = new Class_Session();\n\n if (!$this->_session instanceof Class_Session_Abstract) {\n require_once 'Class/User/SessionException.php';\n throw new Class_User_Exception('Invalid table data gateway provided');\n }\n }", "protected abstract function loadSessionData();", "public function __construct()\n {\n if (session_status() !== PHP_SESSION_ACTIVE) {\n session_start();\n }\n// $_SESSION['register_type'] = 'owner';\n $this->middleware('guest');\n }", "public function configureTransmission() {\n\n\t\t$this->transmissionLogger->info(\"[TRANSMISSION-CONFIGURE-SESSION] Setting up transmission session settings\");\n\n\t\t// This will prepare one script to execute a push notification from transmission when a download finishes\n\t\t$notificationScript = $this->processManager->prepareScriptToExecuteNotifyCall();\n\n\t\t$baseDownloadsPath = $this->settingsService->getDefaultTransmissionSettings()->getBaseDownloadsDir();\n\t\t//TODO: remove hardcoded /mediacenter -- use baseLibraryPath\n\t\t$requestPayload = array(\n\t\t\t\t\"method\" => \"session-set\",\n\t\t\t\t\"arguments\" => array(\"download-dir\" => $baseDownloadsPath,\n\t\t\t\t\t\t \"script-torrent-done-enabled\" => true,\n\t\t\t\t\t\t\t\t\t \"script-torrent-done-filename\" => \"/mediacenter/notify.sh\",\n\t\t\t\t\t\t\t\t\t \"start-added-torrents\" => true)\n\t\t);\n\n\t\t$jsonRequest = json_encode($requestPayload, JSON_UNESCAPED_SLASHES);\n\n\t\t$this->transmissionLogger->debug(\"[TRANSMISSION-CONFIGURE-SESSION] The payload to send to transmission API is $jsonRequest\");\n\n\t\t$result = $this->executeTransmissionApiCall($jsonRequest);\n\n\t\t$this->transmissionLogger->debug(\"[TRANSMISSION-CONFIGURE-SESSION] The result to set Session settings in Transmission is: \". json_encode($result));\n\t\t$this->transmissionLogger->debug(\"[TRANSMISSION-CONFIGURE-SESSION] Transmission Session properties are configured\");\n\t}", "public static function saveCommonData()\n {\n // Save needed data\n $_SESSION[self::LAST_PAGE_SESSION_NAME] = Server::getAbsoluteURL();\n }", "public function onSessiontypesAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "function startupHandler($param)\n {\n if (true) {\n $app = $param['source']->getApplication();\n $app->removeStyle('common/static/common.css');\n $app->addStyle('/static/tuit.css');\n\n $session_id = $_COOKIE['sessionid'];\n \n $ch = curl_init();\n $server_host = $_SERVER['SERVER_ADDR'];\n $browser_host = $_SERVER['HTTP_HOST'];\n $request_uri = $_SERVER['REQUEST_URI'];\n $server_port = $_SERVER['SERVER_PORT'];\n //\tmessage($_SERVER);\n $port_part = ($server_port != 80)?\":$server_port\":\"\";\n $port_part=\"\";\n\t \n\t \n\t //echo \"http://\" .$server_host . $port_part.\"/tuit/account/session/\";\n\t \t \n curl_setopt($ch, CURLOPT_URL, \"http://\" .$server_host . $port_part.\"/tuit/account/session/\");\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_COOKIE, \"sessionid=$session_id\");\n $res = curl_exec($ch);\n $info = curl_getinfo($ch);\n curl_close($ch);\n //message($_SERVER);\n\t //print_r($info);\n\t \n if ($res !== false) {\n\t \n $msg = json_decode($res);\n //message($msg);\n \n if ($msg != null && strlen($msg->username)) {\n $vg = property::get('loginTuit.viewGroup');\n $eg = property::get('loginTuit.editGroup');\n $ag = property::get('loginTuit.adminGroup');\n $can_view=$can_edit=$can_admin=0;\n if ($vg == '' || in_array($vg, $msg->groups)) {\n $can_view = 1;\n }\n if ($eg == '' || in_array($eg, $msg->groups)) {\n $can_edit = 1;\n }\n if ($ag == '' || in_array($ag, $msg->groups)) {\n $can_admin = 1;\n }\n \n //message(\"view: $can_view, edit: $can_edit, admin: $can_admin\");\n \n ciUser::setUser($msg->username,$msg->first_name . \" \" . $msg->last_name, $msg->email, $can_view, $can_edit, $can_admin);\n $param['source']->addContent('main_menu_pre',sprintf(\"<ul class='user_info'><li class='username'><a href='/tuit/account/%s'>%s - %s</a></li>\\n<li class='logout_button'><a href='/tuit/account/logout'>\"._(\"Log out\").\"</a></li></ul>\\n\",\n ciUser::$_me->username,\n ciUser::$_me->username,\n ciUser::$_me->fullname));\n \n return;\n }\n \n /* message(\"Status: \" . $info['http_code']);\n message(\"Got back \" . strlen($res) . \" characters of information\");\n message(\"Output from session query: \" . $res);\n */\n \n }\n util::redirect(\"http://\" .$browser_host .\"/tuit/account/login/?next=\" . urlencode($request_uri));\n\n }\n else {\n \n $username = $_SERVER['REMOTE_USER'];\t\n if($username) {\n ciUser::loginUser($username);\n }\n }\n \n \n }", "public function setupSession($userid, $data) {\n $_SESSION['userid'] = $userid;\n $_SESSION['nickname'] = $data['nickname'];\n $_SESSION['email'] = $data['email'];\n $_SESSION['firstname'] = $data['firstname'];\n $_SESSION['lastname'] = $data['lastname'];\n $_SESSION['access'] = $data['access'];\n\n // Next checking time\n $_SESSION['token_expiration'] = time() + self::TOKEN_EXPIRATION;\n }", "public function __construct(){\n session_set_save_handler(\n array($this, \"_open\"),\n array($this, \"_close\"),\n array($this, \"_read\"),\n array($this, \"_write\"),\n array($this, \"_destroy\"),\n array($this, \"_clean\")\n );\n \n // Start the session\n session_start();\n }", "function __construct(){\n session_start();\n //call this function automatically\n $this->check_the_login();\n $this->check_the_router();\n }", "public function init()\n {\n parent::init();\n $this->_steps = isset(LilyModule::instance()->session->data->userInitData->steps) ? LilyModule::instance()->session->data->userInitData->steps : null;\n $this->_stepId = isset(LilyModule::instance()->session->data->userInitData->stepId) ? LilyModule::instance()->session->data->userInitData->stepId : null;\n $this->_count = isset(LilyModule::instance()->session->data->userInitData->count) ? LilyModule::instance()->session->data->userInitData->count : null;\n }", "private function storeCacheSetting()\n {\n Cache::forever('setting', $this->setting->getKeyValueToStoreCache());\n }", "function view(){\n\t\t\t$this->hold_globals['globals']['domain_name'] = $GLOBALS['DOMAIN_PARTS'];\n\t\t\t$this->hold_session['session'] = $_SESSION; \n\t}", "public function persist()\n {\n if ($schedule = Auth::user()->schedule) {\n $modules = $schedule->modules;\n $sessions = $schedule->sessions;\n\n $total_session_count = count($sessions);\n $completed_session_count = count(\n $sessions->where(\n 'status', 'completed'\n )\n );\n \n $progress = round(\n (($completed_session_count/$total_session_count) * 100), 2\n );\n\n $no_modules = count($modules);\n $sessions_completed = $sessions->where('status', 'completed')->count();\n $sessions_missed = $sessions->where('status', 'failed')->count();\n $sessions_incomplete = $sessions->where('status', 'incomplete')->count();\n\n\n $schedule->reports()->create(\n [\n 'no_modules' => $no_modules,\n 'sessions_completed' => $sessions_completed,\n 'sessions_missed' => $sessions_missed,\n 'sessions_incomplete' => $sessions_incomplete,\n 'progress' => $progress,\n 'sessions' => request('sessions'),\n 'time_spent' => request('comparedtime'),\n 'study_times' => request('studytimes'),\n 'module_ratings' => request('moduleratings'),\n 'predictions' => request('predictions'),\n 'sessiondetails' => request('sessiondetails')\n ]\n );\n }\n }", "public function initializeWatchlistSession(): void\n {\n $_SESSION['WATCHLIST'] = \\is_array($_SESSION['WATCHLIST']) ? $_SESSION['WATCHLIST'] : array();\n\n if (Input::post('FORM_SUBMIT') !== 'watchlist' || !Input::post('REAL_ESTATE_ID') || static::$watchListInitialized)\n {\n return;\n }\n\n $realEstateId = Input::post('REAL_ESTATE_ID');\n\n if (($key = \\array_search($realEstateId, $_SESSION['WATCHLIST'])) !== false)\n {\n unset($_SESSION['WATCHLIST'][$key]);\n }\n else\n {\n $_SESSION['WATCHLIST'][] = $realEstateId;\n }\n\n if (FE_USER_LOGGED_IN)\n {\n $this->import('FrontendUser', 'User');\n $this->import('Database');\n\n $this->Database->prepare(\"UPDATE tl_member SET watchlist=? WHERE id=?\")\n ->execute(serialize($_SESSION['WATCHLIST']), $this->User->id);\n }\n\n static::$watchListInitialized = true;\n }", "public function fillInAddedSessionData();", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "private function persist() {\n $session = new Session();\n $items = $this->getItems();\n $session->set('inspiration_board', json_encode($items));\n }", "function _read_user_session()\n {\t\t\n\t\tif($this->sh_Options['keeping_logic'] == 'db'){\n\t\t\t$this->is_present = $this->_read_user_session_db();\n\t\t} else {\n\t\t\t$this->is_present = $this->_read_user_session_ss();\n\t\t}\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.6556193", "0.63545746", "0.6354262", "0.62131435", "0.61086285", "0.60772276", "0.6041215", "0.59287906", "0.588352", "0.5870326", "0.574875", "0.5666511", "0.56540185", "0.5650061", "0.56337", "0.5615553", "0.5569826", "0.556885", "0.5558049", "0.55578446", "0.55538243", "0.55332947", "0.55014044", "0.5495235", "0.548715", "0.54805076", "0.5478069", "0.54719704", "0.5453448", "0.5440148", "0.54278135", "0.54140514", "0.5406043", "0.5399244", "0.5398889", "0.53891313", "0.53875834", "0.53845304", "0.5383959", "0.5383546", "0.5378954", "0.5373029", "0.5361362", "0.53530174", "0.53438056", "0.5334159", "0.5333889", "0.5321625", "0.5319427", "0.5316482", "0.5313792", "0.53106856", "0.530577", "0.5280377", "0.52751666", "0.52739733", "0.52687246", "0.52652085", "0.5261718", "0.52515435", "0.52508056", "0.5246815", "0.52465856", "0.52407", "0.52320683", "0.52320683", "0.52320683", "0.5227311", "0.52228445", "0.5222235", "0.52196705", "0.52068263", "0.52022433", "0.5200965", "0.51982594", "0.51943535", "0.51880926", "0.5183308", "0.5168786", "0.516497", "0.5163191", "0.5158287", "0.5151292", "0.51432645", "0.51394516", "0.5126226", "0.51241547", "0.5110544", "0.5108631", "0.5103334", "0.5102399", "0.5100199", "0.5098955", "0.5096742", "0.5095706", "0.50944024", "0.50896025", "0.5086636", "0.5086636", "0.5086636", "0.5086636" ]
0.0
-1